question: returns the error function . erf x = 2 / & radic ; & pi ; 0 & int ; x e-t2dt this implementation computes erf x using the gamma #regularizedgammap double , double , double , int regularized gamma function , following erf , equation 3 the value returned is always between -1 and 1 inclusive . if abs x > 40 , then erf x is indistinguishable fromeither 1 or -1 as a double , so the appropriate extreme value is returned . concode_field_sep double X_CRIT concode_field_sep double erfc concode_elem_sep double erfInv concode_elem_sep double erfcInv
target: double function ( double arg0 ) { if ( FastMath . abs ( arg0 ) > 40 ) { return arg0 > 0 ? 1 : - 1 ; } final double loc0 = Gamma . regularizedGammaP ( 0.5 , arg0 * arg0 , 1.0e-15 , 10000 ) ; return arg0 < 0 ? - loc0 : loc0 ; }