3 * Inverse of complemented imcomplete gamma integral
9 * float a, x, y, igamif();
17 * Given y, the function finds x such that
21 * Starting with the approximate value
28 * t = 1 - d - ndtri(y) sqrt(d)
34 * the routine performs up to 10 Newton iterations to find the
35 * root of igamc(a,x) - y = 0.
40 * Tested for a ranging from 0 to 100 and x from 0 to 1.
43 * arithmetic domain # trials peak rms
44 * IEEE 0,100 5000 1.0e-5 1.5e-6
49 Cephes Math Library Release 2.2: July, 1992
50 Copyright 1984, 1987, 1992 by Stephen L. Moshier
51 Direct inquiries to 30 Frost Street, Cambridge, MA 02140
56 extern float MACHEPF, MAXLOGF;
58 #define fabsf(x) ( (x) < 0 ? -(x) : (x) )
61 float igamcf(float, float);
62 float ndtrif(float), expf(float), logf(float), sqrtf(float), lgamf(float);
65 float ndtrif(), expf(), logf(), sqrtf(), lgamf();
70 float igamif( float aa, float yy0 )
72 float igamif( aa, yy0 )
76 float a, y0, d, y, x0, lgm;
81 /* approximation to inverse function */
83 y = ( 1.0 - d - ndtrif(y0) * sqrtf(d) );
92 mtherr( "igamif", UNDERFLOW );
96 /* compute the derivative of the function at this point */
97 d = (a - 1.0) * logf(x0) - x0 - lgm;
100 mtherr( "igamif", UNDERFLOW );
104 /* compute the step to the next approximation of x */
111 if( fabsf(d/x0) < (2.0 * MACHEPF) )