Skip to content

Instantly share code, notes, and snippets.

View bgeneto's full-sized avatar
🏠
Working from home

Bernhard Enders bgeneto

🏠
Working from home
View GitHub Profile
@bgeneto
bgeneto / fortran-vs-python-integration-loop.md
Last active February 17, 2025 13:19
Python vs Fortran performance on trapezoidal numerical integration

Python numerical integration performance

Out of the box performance of python numerical integration is poor. Here we present three python versions of the trapezoidal rule.

Python code (naive version)

import math
import time