summaryrefslogtreecommitdiffstats
path: root/lib/libm/common_source/erf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libm/common_source/erf.c')
-rw-r--r--lib/libm/common_source/erf.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/libm/common_source/erf.c b/lib/libm/common_source/erf.c
index 308f1a9..ba0c006 100644
--- a/lib/libm/common_source/erf.c
+++ b/lib/libm/common_source/erf.c
@@ -68,13 +68,13 @@ static char sccsid[] = "@(#)erf.c 8.1 (Berkeley) 6/4/93";
* erfc(x) = 1 - erf(x) if x<=0.25
* = 0.5 + ((0.5-x)-x*P) if x in [0.25,0.84375]
* where
- * 2 2 4 20
+ * 2 2 4 20
* P = P(x ) = (p0 + p1 * x + p2 * x + ... + p10 * x )
* is an approximation to (erf(x)-x)/x with precision
*
* -56.45
* | P - (erf(x)-x)/x | <= 2
- *
+ *
*
* Remark. The formula is derived by noting
* erf(x) = (2/sqrt(pi))*(x - x^3/3 + x^5/10 - x^7/42 + ....)
@@ -96,7 +96,7 @@ static char sccsid[] = "@(#)erf.c 8.1 (Berkeley) 6/4/93";
* That is, we use rational approximation to approximate
* erf(1+s) - (c = (single)0.84506291151)
* Note that |P1/Q1|< 0.078 for x in [0.84375,1.25]
- * where
+ * where
* P1(s) = degree 6 poly in s
* Q1(s) = degree 6 poly in s
*
@@ -105,7 +105,7 @@ static char sccsid[] = "@(#)erf.c 8.1 (Berkeley) 6/4/93";
* erfc(x) = (1/x)exp(-x*x-(.5*log(pi) -.5z + R(z)/S(z))
*
* Where z = 1/(x*x), R is degree 9, and S is degree 3;
- *
+ *
* 5. For x in [4,28]
* erf(x) = 1.0 - tiny
* erfc(x) = (1/x)exp(-x*x-(.5*log(pi)+eps + zP(z))
@@ -139,7 +139,7 @@ static char sccsid[] = "@(#)erf.c 8.1 (Berkeley) 6/4/93";
*
* 7. Special cases:
* erf(0) = 0, erf(inf) = 1, erf(-inf) = -1,
- * erfc(0) = 1, erfc(inf) = 0, erfc(-inf) = 2,
+ * erfc(0) = 1, erfc(inf) = 0, erfc(-inf) = 2,
* erfc/erf(NaN) is NaN
*/
@@ -181,7 +181,7 @@ p8 = 1.640186161764254363152286358441771740838e-0006,
p9 = -1.571599331700515057841960987689515895479e-0007,
p10= 1.073087585213621540635426191486561494058e-0008;
/*
- * Coefficients for approximation to erf in [0.84375,1.25]
+ * Coefficients for approximation to erf in [0.84375,1.25]
*/
static double
pa0 = -2.362118560752659485957248365514511540287e-0003,
@@ -319,7 +319,7 @@ double erf(x)
return (z-one);
}
-double erfc(x)
+double erfc(x)
double x;
{
double R,S,P,Q,s,ax,y,z,r,fabs(),__exp__D();
@@ -352,7 +352,7 @@ double erfc(x)
P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));
Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));
if (x>=0) {
- z = one-c; return z - P/Q;
+ z = one-c; return z - P/Q;
} else {
z = c+P/Q; return one+z;
}
OpenPOWER on IntegriCloud