F1D integration using trapezium, Gauss, Richardson, Simpson methods
Code: "func_integration.py". Programming language: Python DMelt Version 1. Last modified: 12/11/2015. License: Pro
https://datamelt.org/code/cache/func_integration_7841.py
To run this script using the DMelt IDE, copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.



from jhplot import *
import time

f1=F1D('cos(x*x)+sin(1.0/x)*x^2')
methods=['trapezium','gauss4', 'gauss8',  'richardson', 'simpson'] 
for m in methods:
   start = time.clock()
   d=f1.integral(m,5000,10,100)
   t = time.clock()-start 
   print m,' =',d,' time (ms)=',t*1000

You see the box below because you did not login.