Area under the curve
Completion requirements
Opened: Tuesday, 22 April 2025, 12:00 AM
Due: Tuesday, 29 April 2025, 11:59 PM
Consider the Python code `auc_serial.py` for computing the area under the curve \(y=\frac7{10}x^3-2x^2+4\) from \(x=0\) to \(x=3\).
This code can be run with `python auc_serial 100000000` (100,000,000 is the number of points it will use).
1 Profile the auc_serial.py code
- Add @profile to the main function.
- Run this through the line profiler and see what line(s) cause the most cpu usage.
- Submit the (text) output of the line profiler.
2 Speed up the python code
- Use either numpy, numexpr, or numba.
- Submit the improved python code.
The deadline is Tue April 29, 2025 at midnight.
- 22 April 2025, 7:29 PM