A javascript code for Romberg integration

Autar Kaw
As I am writing backend JavaScript for simulations in teaching Numerical Methods, I have also started developing some functions for some numerical techniques. Here is a function for Romberg integration. function auto_integrator_trap_romb_hnm(func,a,b,nmax,tol_ae,tol_rae) // INPUTS // func=integrand // a= lower limit of integration // b= upper limit of integration // nmax = number of partitions, n=2^nmax // tol_ae= maximum absolute approximate error acceptable (should be >=0) // tol_rae=maximum..