JavaScript
Our web spider found the following code snippet at aoki2_si_gunma-u_ac_jp and contains information about abs and JavaScript.
abs(d) < FPMIN) d = FPMIN
c = b+an/c
if (Math.abs(c) < FPMIN) c = FPMIN
d = 1/d
del = d*c
h *= del
if (Math.abs(del-1) < EPS) {
return Math.exp(-x+a*Math.log(x)-gammln(a))*h
error(3)
return -99999
function gser(a, x)
var n, sum, del, ap
var ITMAX = 100
var EPS = 3e-7
if (x == 0) {
return 0
else if (x > 0) {
ap = a
del = sum = 1/a
for (n = 1; n <= ITMAX; n++) {
++ap
del *= x/ap
sum += del
if (Math.abs(del) < Math.abs(sum)*EPS) {
return sum*Math.exp(-x+a*Math.log(x)-gammln(a))
error(4)
return -99999
function gammp(a, x)
return (x < a+1) ? gser(a, x) : 1-gcf(a,x)
function erff(x)
Read the entire article....