Monte-Carlo integration

Basic javascript one-dimensional Monte-Carlo integrator. Javascript is very slow, and the computation is hundreds of times faster using Fortran. You can use the following function names in the definition of the function: sin, cos, exp, sqrt, log, abs, tan, pow, asin, acos, atan, atan2, sinh, cosh, tanh, asinh, acosh, atanh, random, ceil, floor, round, max, min, PI, E, log10, log2, cbrt, sign, clz32, imul, fround, hypot, trunc.

Function to Integrate