Here you can find the source of gaussianIntegral(double x)
public static double gaussianIntegral(double x)
//package com.java2s; //License from project: LGPL public class Main { public static double gaussianIntegral(double x) { if (x < -8.) return -.5; if (x > 8.) return .5; double xx = x * x; double sum = 0.0, term = x; for (int i = 3;; i += 2) { double next = sum + term; if (next == sum) break; sum = next;//from ww w .jav a 2 s. c o m term = term * xx / i; } return sum * gaussian(x); } public static double gaussian(double x) { return Math.exp(-x * x / 2) / Math.sqrt(2 * Math.PI); } }