1 16 package org.apache.commons.math.special; 17 18 import java.io.Serializable ; 19 20 import org.apache.commons.math.MathException; 21 22 28 public class Erf implements Serializable { 29 30 33 private Erf() { 34 super(); 35 } 36 37 51 public static double erf(double x) throws MathException { 52 double ret = Gamma.regularizedGammaP(0.5, x * x, 1.0e-15, 10000); 53 if (x < 0) { 54 ret = -ret; 55 } 56 return ret; 57 } 58 } 59 | Popular Tags |