From 7ce331c01ce6eb7b3f5c715a38a24359da9c6ee2 Mon Sep 17 00:00:00 2001
From: Eric Andersen <andersen@codepoet.org>
Date: Thu, 22 Nov 2001 14:04:29 +0000
Subject: Totally rework the math library, this time based on the MacOs X math
 library (which is itself based on the math lib from FreeBSD).  -Erik

---
 libm/float/Makefile   |   59 -
 libm/float/README.txt | 4721 -------------------------------------------------
 libm/float/acoshf.c   |   97 -
 libm/float/airyf.c    |  377 ----
 libm/float/asinf.c    |  186 --
 libm/float/asinhf.c   |   88 -
 libm/float/atanf.c    |  190 --
 libm/float/atanhf.c   |   92 -
 libm/float/bdtrf.c    |  247 ---
 libm/float/betaf.c    |  122 --
 libm/float/cbrtf.c    |  119 --
 libm/float/chbevlf.c  |   86 -
 libm/float/chdtrf.c   |  210 ---
 libm/float/clogf.c    |  669 -------
 libm/float/cmplxf.c   |  407 -----
 libm/float/constf.c   |   20 -
 libm/float/coshf.c    |   67 -
 libm/float/dawsnf.c   |  168 --
 libm/float/ellief.c   |  115 --
 libm/float/ellikf.c   |  113 --
 libm/float/ellpef.c   |  105 --
 libm/float/ellpjf.c   |  161 --
 libm/float/ellpkf.c   |  128 --
 libm/float/exp10f.c   |  115 --
 libm/float/exp2f.c    |  116 --
 libm/float/expf.c     |  122 --
 libm/float/expnf.c    |  207 ---
 libm/float/facf.c     |  106 --
 libm/float/fdtrf.c    |  214 ---
 libm/float/floorf.c   |  526 ------
 libm/float/fresnlf.c  |  173 --
 libm/float/gammaf.c   |  423 -----
 libm/float/gdtrf.c    |  144 --
 libm/float/hyp2f1f.c  |  442 -----
 libm/float/hypergf.c  |  384 ----
 libm/float/i0f.c      |  160 --
 libm/float/i1f.c      |  177 --
 libm/float/igamf.c    |  223 ---
 libm/float/igamif.c   |  112 --
 libm/float/incbetf.c  |  424 -----
 libm/float/incbif.c   |  197 ---
 libm/float/ivf.c      |  114 --
 libm/float/j0f.c      |  228 ---
 libm/float/j0tst.c    |   43 -
 libm/float/j1f.c      |  211 ---
 libm/float/jnf.c      |  124 --
 libm/float/jvf.c      |  848 ---------
 libm/float/k0f.c      |  175 --
 libm/float/k1f.c      |  174 --
 libm/float/knf.c      |  252 ---
 libm/float/log10f.c   |  129 --
 libm/float/log2f.c    |  129 --
 libm/float/logf.c     |  128 --
 libm/float/mtherr.c   |   99 --
 libm/float/nantst.c   |   54 -
 libm/float/nbdtrf.c   |  141 --
 libm/float/ndtrf.c    |  281 ---
 libm/float/ndtrif.c   |  186 --
 libm/float/pdtrf.c    |  188 --
 libm/float/polevlf.c  |   99 --
 libm/float/polynf.c   |  520 ------
 libm/float/powf.c     |  338 ----
 libm/float/powif.c    |  156 --
 libm/float/powtst.c   |   41 -
 libm/float/psif.c     |  153 --
 libm/float/rgammaf.c  |  130 --
 libm/float/setprec.c  |   10 -
 libm/float/shichif.c  |  212 ---
 libm/float/sicif.c    |  279 ---
 libm/float/sindgf.c   |  232 ---
 libm/float/sinf.c     |  283 ---
 libm/float/sinhf.c    |   87 -
 libm/float/spencef.c  |  135 --
 libm/float/sqrtf.c    |  140 --
 libm/float/stdtrf.c   |  154 --
 libm/float/struvef.c  |  315 ----
 libm/float/tandgf.c   |  206 ---
 libm/float/tanf.c     |  192 --
 libm/float/tanhf.c    |   88 -
 libm/float/ynf.c      |  120 --
 libm/float/zetacf.c   |  266 ---
 libm/float/zetaf.c    |  175 --
 82 files changed, 20647 deletions(-)
 delete mode 100644 libm/float/Makefile
 delete mode 100644 libm/float/README.txt
 delete mode 100644 libm/float/acoshf.c
 delete mode 100644 libm/float/airyf.c
 delete mode 100644 libm/float/asinf.c
 delete mode 100644 libm/float/asinhf.c
 delete mode 100644 libm/float/atanf.c
 delete mode 100644 libm/float/atanhf.c
 delete mode 100644 libm/float/bdtrf.c
 delete mode 100644 libm/float/betaf.c
 delete mode 100644 libm/float/cbrtf.c
 delete mode 100644 libm/float/chbevlf.c
 delete mode 100644 libm/float/chdtrf.c
 delete mode 100644 libm/float/clogf.c
 delete mode 100644 libm/float/cmplxf.c
 delete mode 100644 libm/float/constf.c
 delete mode 100644 libm/float/coshf.c
 delete mode 100644 libm/float/dawsnf.c
 delete mode 100644 libm/float/ellief.c
 delete mode 100644 libm/float/ellikf.c
 delete mode 100644 libm/float/ellpef.c
 delete mode 100644 libm/float/ellpjf.c
 delete mode 100644 libm/float/ellpkf.c
 delete mode 100644 libm/float/exp10f.c
 delete mode 100644 libm/float/exp2f.c
 delete mode 100644 libm/float/expf.c
 delete mode 100644 libm/float/expnf.c
 delete mode 100644 libm/float/facf.c
 delete mode 100644 libm/float/fdtrf.c
 delete mode 100644 libm/float/floorf.c
 delete mode 100644 libm/float/fresnlf.c
 delete mode 100644 libm/float/gammaf.c
 delete mode 100644 libm/float/gdtrf.c
 delete mode 100644 libm/float/hyp2f1f.c
 delete mode 100644 libm/float/hypergf.c
 delete mode 100644 libm/float/i0f.c
 delete mode 100644 libm/float/i1f.c
 delete mode 100644 libm/float/igamf.c
 delete mode 100644 libm/float/igamif.c
 delete mode 100644 libm/float/incbetf.c
 delete mode 100644 libm/float/incbif.c
 delete mode 100644 libm/float/ivf.c
 delete mode 100644 libm/float/j0f.c
 delete mode 100644 libm/float/j0tst.c
 delete mode 100644 libm/float/j1f.c
 delete mode 100644 libm/float/jnf.c
 delete mode 100644 libm/float/jvf.c
 delete mode 100644 libm/float/k0f.c
 delete mode 100644 libm/float/k1f.c
 delete mode 100644 libm/float/knf.c
 delete mode 100644 libm/float/log10f.c
 delete mode 100644 libm/float/log2f.c
 delete mode 100644 libm/float/logf.c
 delete mode 100644 libm/float/mtherr.c
 delete mode 100644 libm/float/nantst.c
 delete mode 100644 libm/float/nbdtrf.c
 delete mode 100644 libm/float/ndtrf.c
 delete mode 100644 libm/float/ndtrif.c
 delete mode 100644 libm/float/pdtrf.c
 delete mode 100644 libm/float/polevlf.c
 delete mode 100644 libm/float/polynf.c
 delete mode 100644 libm/float/powf.c
 delete mode 100644 libm/float/powif.c
 delete mode 100644 libm/float/powtst.c
 delete mode 100644 libm/float/psif.c
 delete mode 100644 libm/float/rgammaf.c
 delete mode 100644 libm/float/setprec.c
 delete mode 100644 libm/float/shichif.c
 delete mode 100644 libm/float/sicif.c
 delete mode 100644 libm/float/sindgf.c
 delete mode 100644 libm/float/sinf.c
 delete mode 100644 libm/float/sinhf.c
 delete mode 100644 libm/float/spencef.c
 delete mode 100644 libm/float/sqrtf.c
 delete mode 100644 libm/float/stdtrf.c
 delete mode 100644 libm/float/struvef.c
 delete mode 100644 libm/float/tandgf.c
 delete mode 100644 libm/float/tanf.c
 delete mode 100644 libm/float/tanhf.c
 delete mode 100644 libm/float/ynf.c
 delete mode 100644 libm/float/zetacf.c
 delete mode 100644 libm/float/zetaf.c

(limited to 'libm/float')

diff --git a/libm/float/Makefile b/libm/float/Makefile
deleted file mode 100644
index 80f7aa1ff..000000000
--- a/libm/float/Makefile
+++ /dev/null
@@ -1,59 +0,0 @@
-# Makefile for uClibc's math library
-# Copyright (C) 2001 by Lineo, inc.
-#
-# This math library is derived primarily from the Cephes Math Library,
-# copyright by Stephen L. Moshier <moshier@world.std.com>
-#
-# This program is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Library General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option) any
-# later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
-# details.
-#
-# You should have received a copy of the GNU Library General Public License
-# along with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-
-TOPDIR=../../
-include $(TOPDIR)Rules.mak
-
-LIBM=../libm.a
-TARGET_CC= $(TOPDIR)/extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc
-
-CSRC= acoshf.c airyf.c asinf.c asinhf.c atanf.c \
-	atanhf.c bdtrf.c betaf.c cbrtf.c chbevlf.c chdtrf.c \
-	clogf.c cmplxf.c constf.c coshf.c dawsnf.c ellief.c \
-	ellikf.c ellpef.c ellpkf.c ellpjf.c expf.c exp2f.c \
-	exp10f.c expnf.c facf.c fdtrf.c floorf.c fresnlf.c \
-	gammaf.c gdtrf.c hypergf.c hyp2f1f.c igamf.c igamif.c \
-	incbetf.c incbif.c i0f.c i1f.c ivf.c j0f.c j1f.c \
-	jnf.c jvf.c k0f.c k1f.c knf.c logf.c log2f.c \
-	log10f.c nbdtrf.c ndtrf.c ndtrif.c pdtrf.c polynf.c \
-	powif.c powf.c psif.c rgammaf.c shichif.c sicif.c \
-	sindgf.c sinf.c sinhf.c spencef.c sqrtf.c stdtrf.c \
-	struvef.c tandgf.c tanf.c tanhf.c ynf.c zetaf.c \
-	zetacf.c polevlf.c setprec.c mtherr.c
-COBJS=$(patsubst %.c,%.o, $(CSRC))
-OBJS=$(COBJS)
-
-all: $(OBJS) $(LIBM)
-
-$(LIBM): ar-target
-
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBM) $(OBJS)
-
-$(COBJS): %.o : %.c
-	$(TARGET_CC) $(TARGET_CFLAGS) -c $< -o $@
-	$(STRIPTOOL) -x -R .note -R .comment $*.o
-
-$(OBJ): Makefile
-
-clean:
-	rm -f *.[oa] *~ core
-
diff --git a/libm/float/README.txt b/libm/float/README.txt
deleted file mode 100644
index 30a10b083..000000000
--- a/libm/float/README.txt
+++ /dev/null
@@ -1,4721 +0,0 @@
-/*							acoshf.c
- *
- *	Inverse hyperbolic cosine
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, acoshf();
- *
- * y = acoshf( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns inverse hyperbolic cosine of argument.
- *
- * If 1 <= x < 1.5, a polynomial approximation
- *
- *	sqrt(z) * P(z)
- *
- * where z = x-1, is used.  Otherwise,
- *
- * acosh(x)  =  log( x + sqrt( (x-1)(x+1) ).
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      1,3         100000      1.8e-7       3.9e-8
- *    IEEE      1,2000      100000                   3.0e-8
- *
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * acoshf domain      |x| < 1            0.0
- *
- */
-
-/*							airy.c
- *
- *	Airy function
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, ai, aip, bi, bip;
- * int airyf();
- *
- * airyf( x, _&ai, _&aip, _&bi, _&bip );
- *
- *
- *
- * DESCRIPTION:
- *
- * Solution of the differential equation
- *
- *	y"(x) = xy.
- *
- * The function returns the two independent solutions Ai, Bi
- * and their first derivatives Ai'(x), Bi'(x).
- *
- * Evaluation is by power series summation for small x,
- * by rational minimax approximations for large x.
- *
- *
- *
- * ACCURACY:
- * Error criterion is absolute when function <= 1, relative
- * when function > 1, except * denotes relative error criterion.
- * For large negative x, the absolute error increases as x^1.5.
- * For large positive x, the relative error increases as x^1.5.
- *
- * Arithmetic  domain   function  # trials      peak         rms
- * IEEE        -10, 0     Ai        50000       7.0e-7      1.2e-7
- * IEEE          0, 10    Ai        50000       9.9e-6*     6.8e-7*
- * IEEE        -10, 0     Ai'       50000       2.4e-6      3.5e-7
- * IEEE          0, 10    Ai'       50000       8.7e-6*     6.2e-7*
- * IEEE        -10, 10    Bi       100000       2.2e-6      2.6e-7
- * IEEE        -10, 10    Bi'       50000       2.2e-6      3.5e-7
- *
- */
-
-/*							asinf.c
- *
- *	Inverse circular sine
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, asinf();
- *
- * y = asinf( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns radian angle between -pi/2 and +pi/2 whose sine is x.
- *
- * A polynomial of the form x + x**3 P(x**2)
- * is used for |x| in the interval [0, 0.5].  If |x| > 0.5 it is
- * transformed by the identity
- *
- *    asin(x) = pi/2 - 2 asin( sqrt( (1-x)/2 ) ).
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE     -1, 1       100000       2.5e-7       5.0e-8
- *
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * asinf domain        |x| > 1           0.0
- *
- */
-/*							acosf()
- *
- *	Inverse circular cosine
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, acosf();
- *
- * y = acosf( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns radian angle between -pi/2 and +pi/2 whose cosine
- * is x.
- *
- * Analytically, acos(x) = pi/2 - asin(x).  However if |x| is
- * near 1, there is cancellation error in subtracting asin(x)
- * from pi/2.  Hence if x < -0.5,
- *
- *    acos(x) =	 pi - 2.0 * asin( sqrt((1+x)/2) );
- *
- * or if x > +0.5,
- *
- *    acos(x) =	 2.0 * asin(  sqrt((1-x)/2) ).
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      -1, 1      100000       1.4e-7      4.2e-8
- *
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * acosf domain        |x| > 1           0.0
- */
-
-/*							asinhf.c
- *
- *	Inverse hyperbolic sine
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, asinhf();
- *
- * y = asinhf( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns inverse hyperbolic sine of argument.
- *
- * If |x| < 0.5, the function is approximated by a rational
- * form  x + x**3 P(x)/Q(x).  Otherwise,
- *
- *     asinh(x) = log( x + sqrt(1 + x*x) ).
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE     -3,3        100000       2.4e-7      4.1e-8
- *
- */
-
-/*							atanf.c
- *
- *	Inverse circular tangent
- *      (arctangent)
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, atanf();
- *
- * y = atanf( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns radian angle between -pi/2 and +pi/2 whose tangent
- * is x.
- *
- * Range reduction is from four intervals into the interval
- * from zero to  tan( pi/8 ).  A polynomial approximates
- * the function in this basic interval.
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      -10, 10     100000      1.9e-7      4.1e-8
- *
- */
-/*							atan2f()
- *
- *	Quadrant correct inverse circular tangent
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, z, atan2f();
- *
- * z = atan2f( y, x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns radian angle whose tangent is y/x.
- * Define compile time symbol ANSIC = 1 for ANSI standard,
- * range -PI < z <= +PI, args (y,x); else ANSIC = 0 for range
- * 0 to 2PI, args (x,y).
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      -10, 10     100000      1.9e-7      4.1e-8
- * See atan.c.
- *
- */
-
-/*							atanhf.c
- *
- *	Inverse hyperbolic tangent
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, atanhf();
- *
- * y = atanhf( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns inverse hyperbolic tangent of argument in the range
- * MINLOGF to MAXLOGF.
- *
- * If |x| < 0.5, a polynomial approximation is used.
- * Otherwise,
- *        atanh(x) = 0.5 * log( (1+x)/(1-x) ).
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      -1,1        100000      1.4e-7      3.1e-8
- *
- */
-
-/*							bdtrf.c
- *
- *	Binomial distribution
- *
- *
- *
- * SYNOPSIS:
- *
- * int k, n;
- * float p, y, bdtrf();
- *
- * y = bdtrf( k, n, p );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns the sum of the terms 0 through k of the Binomial
- * probability density:
- *
- *   k
- *   --  ( n )   j      n-j
- *   >   (   )  p  (1-p)
- *   --  ( j )
- *  j=0
- *
- * The terms are not summed directly; instead the incomplete
- * beta integral is employed, according to the formula
- *
- * y = bdtr( k, n, p ) = incbet( n-k, k+1, 1-p ).
- *
- * The arguments must be positive, with p ranging from 0 to 1.
- *
- *
- *
- * ACCURACY:
- *
- *        Relative error (p varies from 0 to 1):
- * arithmetic   domain     # trials      peak         rms
- *    IEEE       0,100       2000       6.9e-5      1.1e-5
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * bdtrf domain        k < 0            0.0
- *                     n < k
- *                     x < 0, x > 1
- *
- */
-/*							bdtrcf()
- *
- *	Complemented binomial distribution
- *
- *
- *
- * SYNOPSIS:
- *
- * int k, n;
- * float p, y, bdtrcf();
- *
- * y = bdtrcf( k, n, p );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns the sum of the terms k+1 through n of the Binomial
- * probability density:
- *
- *   n
- *   --  ( n )   j      n-j
- *   >   (   )  p  (1-p)
- *   --  ( j )
- *  j=k+1
- *
- * The terms are not summed directly; instead the incomplete
- * beta integral is employed, according to the formula
- *
- * y = bdtrc( k, n, p ) = incbet( k+1, n-k, p ).
- *
- * The arguments must be positive, with p ranging from 0 to 1.
- *
- *
- *
- * ACCURACY:
- *
- *        Relative error (p varies from 0 to 1):
- * arithmetic   domain     # trials      peak         rms
- *    IEEE       0,100       2000       6.0e-5      1.2e-5
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * bdtrcf domain     x<0, x>1, n<k       0.0
- */
-/*							bdtrif()
- *
- *	Inverse binomial distribution
- *
- *
- *
- * SYNOPSIS:
- *
- * int k, n;
- * float p, y, bdtrif();
- *
- * p = bdtrf( k, n, y );
- *
- *
- *
- * DESCRIPTION:
- *
- * Finds the event probability p such that the sum of the
- * terms 0 through k of the Binomial probability density
- * is equal to the given cumulative probability y.
- *
- * This is accomplished using the inverse beta integral
- * function and the relation
- *
- * 1 - p = incbi( n-k, k+1, y ).
- *
- *
- *
- *
- * ACCURACY:
- *
- *        Relative error (p varies from 0 to 1):
- * arithmetic   domain     # trials      peak         rms
- *    IEEE       0,100       2000       3.5e-5      3.3e-6
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * bdtrif domain    k < 0, n <= k         0.0
- *                  x < 0, x > 1
- *
- */
-
-/*							betaf.c
- *
- *	Beta function
- *
- *
- *
- * SYNOPSIS:
- *
- * float a, b, y, betaf();
- *
- * y = betaf( a, b );
- *
- *
- *
- * DESCRIPTION:
- *
- *                   -     -
- *                  | (a) | (b)
- * beta( a, b )  =  -----------.
- *                     -
- *                    | (a+b)
- *
- * For large arguments the logarithm of the function is
- * evaluated using lgam(), then exponentiated.
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE       0,30       10000       4.0e-5      6.0e-6
- *    IEEE       -20,0      10000       4.9e-3      5.4e-5
- *
- * ERROR MESSAGES:
- *
- *   message         condition          value returned
- * betaf overflow   log(beta) > MAXLOG       0.0
- *                  a or b <0 integer        0.0
- *
- */
-
-/*							cbrtf.c
- *
- *	Cube root
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, cbrtf();
- *
- * y = cbrtf( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns the cube root of the argument, which may be negative.
- *
- * Range reduction involves determining the power of 2 of
- * the argument.  A polynomial of degree 2 applied to the
- * mantissa, and multiplication by the cube root of 1, 2, or 4
- * approximates the root to within about 0.1%.  Then Newton's
- * iteration is used to converge to an accurate result.
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      0,1e38      100000      7.6e-8      2.7e-8
- *
- */
-
-/*							chbevlf.c
- *
- *	Evaluate Chebyshev series
- *
- *
- *
- * SYNOPSIS:
- *
- * int N;
- * float x, y, coef[N], chebevlf();
- *
- * y = chbevlf( x, coef, N );
- *
- *
- *
- * DESCRIPTION:
- *
- * Evaluates the series
- *
- *        N-1
- *         - '
- *  y  =   >   coef[i] T (x/2)
- *         -            i
- *        i=0
- *
- * of Chebyshev polynomials Ti at argument x/2.
- *
- * Coefficients are stored in reverse order, i.e. the zero
- * order term is last in the array.  Note N is the number of
- * coefficients, not the order.
- *
- * If coefficients are for the interval a to b, x must
- * have been transformed to x -> 2(2x - b - a)/(b-a) before
- * entering the routine.  This maps x from (a, b) to (-1, 1),
- * over which the Chebyshev polynomials are defined.
- *
- * If the coefficients are for the inverted interval, in
- * which (a, b) is mapped to (1/b, 1/a), the transformation
- * required is x -> 2(2ab/x - b - a)/(b-a).  If b is infinity,
- * this becomes x -> 4a/x - 1.
- *
- *
- *
- * SPEED:
- *
- * Taking advantage of the recurrence properties of the
- * Chebyshev polynomials, the routine requires one more
- * addition per loop than evaluating a nested polynomial of
- * the same degree.
- *
- */
-
-/*							chdtrf.c
- *
- *	Chi-square distribution
- *
- *
- *
- * SYNOPSIS:
- *
- * float df, x, y, chdtrf();
- *
- * y = chdtrf( df, x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns the area under the left hand tail (from 0 to x)
- * of the Chi square probability density function with
- * v degrees of freedom.
- *
- *
- *                                  inf.
- *                                    -
- *                        1          | |  v/2-1  -t/2
- *  P( x | v )   =   -----------     |   t      e     dt
- *                    v/2  -       | |
- *                   2    | (v/2)   -
- *                                   x
- *
- * where x is the Chi-square variable.
- *
- * The incomplete gamma integral is used, according to the
- * formula
- *
- *	y = chdtr( v, x ) = igam( v/2.0, x/2.0 ).
- *
- *
- * The arguments must both be positive.
- *
- *
- *
- * ACCURACY:
- *
- *        Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE       0,100       5000       3.2e-5      5.0e-6
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * chdtrf domain  x < 0 or v < 1        0.0
- */
-/*							chdtrcf()
- *
- *	Complemented Chi-square distribution
- *
- *
- *
- * SYNOPSIS:
- *
- * float v, x, y, chdtrcf();
- *
- * y = chdtrcf( v, x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns the area under the right hand tail (from x to
- * infinity) of the Chi square probability density function
- * with v degrees of freedom:
- *
- *
- *                                  inf.
- *                                    -
- *                        1          | |  v/2-1  -t/2
- *  P( x | v )   =   -----------     |   t      e     dt
- *                    v/2  -       | |
- *                   2    | (v/2)   -
- *                                   x
- *
- * where x is the Chi-square variable.
- *
- * The incomplete gamma integral is used, according to the
- * formula
- *
- *	y = chdtr( v, x ) = igamc( v/2.0, x/2.0 ).
- *
- *
- * The arguments must both be positive.
- *
- *
- *
- * ACCURACY:
- *
- *        Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE       0,100       5000       2.7e-5      3.2e-6
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * chdtrc domain  x < 0 or v < 1        0.0
- */
-/*							chdtrif()
- *
- *	Inverse of complemented Chi-square distribution
- *
- *
- *
- * SYNOPSIS:
- *
- * float df, x, y, chdtrif();
- *
- * x = chdtrif( df, y );
- *
- *
- *
- *
- * DESCRIPTION:
- *
- * Finds the Chi-square argument x such that the integral
- * from x to infinity of the Chi-square density is equal
- * to the given cumulative probability y.
- *
- * This is accomplished using the inverse gamma integral
- * function and the relation
- *
- *    x/2 = igami( df/2, y );
- *
- *
- *
- *
- * ACCURACY:
- *
- *        Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE       0,100       10000      2.2e-5      8.5e-7
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * chdtri domain   y < 0 or y > 1        0.0
- *                     v < 1
- *
- */
-
-/*							clogf.c
- *
- *	Complex natural logarithm
- *
- *
- *
- * SYNOPSIS:
- *
- * void clogf();
- * cmplxf z, w;
- *
- * clogf( &z, &w );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns complex logarithm to the base e (2.718...) of
- * the complex argument x.
- *
- * If z = x + iy, r = sqrt( x**2 + y**2 ),
- * then
- *       w = log(r) + i arctan(y/x).
- * 
- * The arctangent ranges from -PI to +PI.
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      -10,+10     30000       1.9e-6       6.2e-8
- *
- * Larger relative error can be observed for z near 1 +i0.
- * In IEEE arithmetic the peak absolute error is 3.1e-7.
- *
- */
-/*							cexpf()
- *
- *	Complex exponential function
- *
- *
- *
- * SYNOPSIS:
- *
- * void cexpf();
- * cmplxf z, w;
- *
- * cexpf( &z, &w );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns the exponential of the complex argument z
- * into the complex result w.
- *
- * If
- *     z = x + iy,
- *     r = exp(x),
- *
- * then
- *
- *     w = r cos y + i r sin y.
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      -10,+10     30000       1.4e-7      4.5e-8
- *
- */
-/*							csinf()
- *
- *	Complex circular sine
- *
- *
- *
- * SYNOPSIS:
- *
- * void csinf();
- * cmplxf z, w;
- *
- * csinf( &z, &w );
- *
- *
- *
- * DESCRIPTION:
- *
- * If
- *     z = x + iy,
- *
- * then
- *
- *     w = sin x  cosh y  +  i cos x sinh y.
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      -10,+10     30000       1.9e-7      5.5e-8
- *
- */
-/*							ccosf()
- *
- *	Complex circular cosine
- *
- *
- *
- * SYNOPSIS:
- *
- * void ccosf();
- * cmplxf z, w;
- *
- * ccosf( &z, &w );
- *
- *
- *
- * DESCRIPTION:
- *
- * If
- *     z = x + iy,
- *
- * then
- *
- *     w = cos x  cosh y  -  i sin x sinh y.
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      -10,+10     30000       1.8e-7       5.5e-8
- */
-/*							ctanf()
- *
- *	Complex circular tangent
- *
- *
- *
- * SYNOPSIS:
- *
- * void ctanf();
- * cmplxf z, w;
- *
- * ctanf( &z, &w );
- *
- *
- *
- * DESCRIPTION:
- *
- * If
- *     z = x + iy,
- *
- * then
- *
- *           sin 2x  +  i sinh 2y
- *     w  =  --------------------.
- *            cos 2x  +  cosh 2y
- *
- * On the real axis the denominator is zero at odd multiples
- * of PI/2.  The denominator is evaluated by its Taylor
- * series near these points.
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      -10,+10     30000       3.3e-7       5.1e-8
- */
-/*							ccotf()
- *
- *	Complex circular cotangent
- *
- *
- *
- * SYNOPSIS:
- *
- * void ccotf();
- * cmplxf z, w;
- *
- * ccotf( &z, &w );
- *
- *
- *
- * DESCRIPTION:
- *
- * If
- *     z = x + iy,
- *
- * then
- *
- *           sin 2x  -  i sinh 2y
- *     w  =  --------------------.
- *            cosh 2y  -  cos 2x
- *
- * On the real axis, the denominator has zeros at even
- * multiples of PI/2.  Near these points it is evaluated
- * by a Taylor series.
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      -10,+10     30000       3.6e-7       5.7e-8
- * Also tested by ctan * ccot = 1 + i0.
- */
-/*							casinf()
- *
- *	Complex circular arc sine
- *
- *
- *
- * SYNOPSIS:
- *
- * void casinf();
- * cmplxf z, w;
- *
- * casinf( &z, &w );
- *
- *
- *
- * DESCRIPTION:
- *
- * Inverse complex sine:
- *
- *                               2
- * w = -i clog( iz + csqrt( 1 - z ) ).
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      -10,+10     30000       1.1e-5      1.5e-6
- * Larger relative error can be observed for z near zero.
- *
- */
-/*							cacosf()
- *
- *	Complex circular arc cosine
- *
- *
- *
- * SYNOPSIS:
- *
- * void cacosf();
- * cmplxf z, w;
- *
- * cacosf( &z, &w );
- *
- *
- *
- * DESCRIPTION:
- *
- *
- * w = arccos z  =  PI/2 - arcsin z.
- *
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      -10,+10     30000       9.2e-6       1.2e-6
- *
- */
-/*							catan()
- *
- *	Complex circular arc tangent
- *
- *
- *
- * SYNOPSIS:
- *
- * void catan();
- * cmplxf z, w;
- *
- * catan( &z, &w );
- *
- *
- *
- * DESCRIPTION:
- *
- * If
- *     z = x + iy,
- *
- * then
- *          1       (    2x     )
- * Re w  =  - arctan(-----------)  +  k PI
- *          2       (     2    2)
- *                  (1 - x  - y )
- *
- *               ( 2         2)
- *          1    (x  +  (y+1) )
- * Im w  =  - log(------------)
- *          4    ( 2         2)
- *               (x  +  (y-1) )
- *
- * Where k is an arbitrary integer.
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      -10,+10     30000        2.3e-6      5.2e-8
- *
- */
-
-/*							cmplxf.c
- *
- *	Complex number arithmetic
- *
- *
- *
- * SYNOPSIS:
- *
- * typedef struct {
- *      float r;     real part
- *      float i;     imaginary part
- *     }cmplxf;
- *
- * cmplxf *a, *b, *c;
- *
- * caddf( a, b, c );     c = b + a
- * csubf( a, b, c );     c = b - a
- * cmulf( a, b, c );     c = b * a
- * cdivf( a, b, c );     c = b / a
- * cnegf( c );           c = -c
- * cmovf( b, c );        c = b
- *
- *
- *
- * DESCRIPTION:
- *
- * Addition:
- *    c.r  =  b.r + a.r
- *    c.i  =  b.i + a.i
- *
- * Subtraction:
- *    c.r  =  b.r - a.r
- *    c.i  =  b.i - a.i
- *
- * Multiplication:
- *    c.r  =  b.r * a.r  -  b.i * a.i
- *    c.i  =  b.r * a.i  +  b.i * a.r
- *
- * Division:
- *    d    =  a.r * a.r  +  a.i * a.i
- *    c.r  = (b.r * a.r  + b.i * a.i)/d
- *    c.i  = (b.i * a.r  -  b.r * a.i)/d
- * ACCURACY:
- *
- * In DEC arithmetic, the test (1/z) * z = 1 had peak relative
- * error 3.1e-17, rms 1.2e-17.  The test (y/z) * (z/y) = 1 had
- * peak relative error 8.3e-17, rms 2.1e-17.
- *
- * Tests in the rectangle {-10,+10}:
- *                      Relative error:
- * arithmetic   function  # trials      peak         rms
- *    IEEE       cadd       30000       5.9e-8      2.6e-8
- *    IEEE       csub       30000       6.0e-8      2.6e-8
- *    IEEE       cmul       30000       1.1e-7      3.7e-8
- *    IEEE       cdiv       30000       2.1e-7      5.7e-8
- */
-
-/*							cabsf()
- *
- *	Complex absolute value
- *
- *
- *
- * SYNOPSIS:
- *
- * float cabsf();
- * cmplxf z;
- * float a;
- *
- * a = cabsf( &z );
- *
- *
- *
- * DESCRIPTION:
- *
- *
- * If z = x + iy
- *
- * then
- *
- *       a = sqrt( x**2 + y**2 ).
- * 
- * Overflow and underflow are avoided by testing the magnitudes
- * of x and y before squaring.  If either is outside half of
- * the floating point full scale range, both are rescaled.
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      -10,+10     30000       1.2e-7      3.4e-8
- */
-/*							csqrtf()
- *
- *	Complex square root
- *
- *
- *
- * SYNOPSIS:
- *
- * void csqrtf();
- * cmplxf z, w;
- *
- * csqrtf( &z, &w );
- *
- *
- *
- * DESCRIPTION:
- *
- *
- * If z = x + iy,  r = |z|, then
- *
- *                       1/2
- * Im w  =  [ (r - x)/2 ]   ,
- *
- * Re w  =  y / 2 Im w.
- *
- *
- * Note that -w is also a square root of z.  The solution
- * reported is always in the upper half plane.
- *
- * Because of the potential for cancellation error in r - x,
- * the result is sharpened by doing a Heron iteration
- * (see sqrt.c) in complex arithmetic.
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      -10,+10    100000       1.8e-7       4.2e-8
- *
- */
-
-/*							coshf.c
- *
- *	Hyperbolic cosine
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, coshf();
- *
- * y = coshf( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns hyperbolic cosine of argument in the range MINLOGF to
- * MAXLOGF.
- *
- * cosh(x)  =  ( exp(x) + exp(-x) )/2.
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE     +-MAXLOGF    100000      1.2e-7      2.8e-8
- *
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * coshf overflow  |x| > MAXLOGF       MAXNUMF
- *
- *
- */
-
-/*							dawsnf.c
- *
- *	Dawson's Integral
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, dawsnf();
- *
- * y = dawsnf( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Approximates the integral
- *
- *                             x
- *                             -
- *                      2     | |        2
- *  dawsn(x)  =  exp( -x  )   |    exp( t  ) dt
- *                          | |
- *                           -
- *                           0
- *
- * Three different rational approximations are employed, for
- * the intervals 0 to 3.25; 3.25 to 6.25; and 6.25 up.
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      0,10        50000       4.4e-7      6.3e-8
- *
- *
- */
-
-/*							ellief.c
- *
- *	Incomplete elliptic integral of the second kind
- *
- *
- *
- * SYNOPSIS:
- *
- * float phi, m, y, ellief();
- *
- * y = ellief( phi, m );
- *
- *
- *
- * DESCRIPTION:
- *
- * Approximates the integral
- *
- *
- *                phi
- *                 -
- *                | |
- *                |                   2
- * E(phi\m)  =    |    sqrt( 1 - m sin t ) dt
- *                |
- *              | |    
- *               -
- *                0
- *
- * of amplitude phi and modulus m, using the arithmetic -
- * geometric mean algorithm.
- *
- *
- *
- * ACCURACY:
- *
- * Tested at random arguments with phi in [0, 2] and m in
- * [0, 1].
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE       0,2        10000       4.5e-7      7.4e-8
- *
- *
- */
-
-/*							ellikf.c
- *
- *	Incomplete elliptic integral of the first kind
- *
- *
- *
- * SYNOPSIS:
- *
- * float phi, m, y, ellikf();
- *
- * y = ellikf( phi, m );
- *
- *
- *
- * DESCRIPTION:
- *
- * Approximates the integral
- *
- *
- *
- *                phi
- *                 -
- *                | |
- *                |           dt
- * F(phi\m)  =    |    ------------------
- *                |                   2
- *              | |    sqrt( 1 - m sin t )
- *               -
- *                0
- *
- * of amplitude phi and modulus m, using the arithmetic -
- * geometric mean algorithm.
- *
- *
- *
- *
- * ACCURACY:
- *
- * Tested at random points with phi in [0, 2] and m in
- * [0, 1].
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      0,2         10000       2.9e-7      5.8e-8
- *
- *
- */
-
-/*							ellpef.c
- *
- *	Complete elliptic integral of the second kind
- *
- *
- *
- * SYNOPSIS:
- *
- * float m1, y, ellpef();
- *
- * y = ellpef( m1 );
- *
- *
- *
- * DESCRIPTION:
- *
- * Approximates the integral
- *
- *
- *            pi/2
- *             -
- *            | |                 2
- * E(m)  =    |    sqrt( 1 - m sin t ) dt
- *          | |    
- *           -
- *            0
- *
- * Where m = 1 - m1, using the approximation
- *
- *      P(x)  -  x log x Q(x).
- *
- * Though there are no singularities, the argument m1 is used
- * rather than m for compatibility with ellpk().
- *
- * E(1) = 1; E(0) = pi/2.
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE       0, 1       30000       1.1e-7      3.9e-8
- *
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * ellpef domain     x<0, x>1            0.0
- *
- */
-
-/*							ellpjf.c
- *
- *	Jacobian Elliptic Functions
- *
- *
- *
- * SYNOPSIS:
- *
- * float u, m, sn, cn, dn, phi;
- * int ellpj();
- *
- * ellpj( u, m, _&sn, _&cn, _&dn, _&phi );
- *
- *
- *
- * DESCRIPTION:
- *
- *
- * Evaluates the Jacobian elliptic functions sn(u|m), cn(u|m),
- * and dn(u|m) of parameter m between 0 and 1, and real
- * argument u.
- *
- * These functions are periodic, with quarter-period on the
- * real axis equal to the complete elliptic integral
- * ellpk(1.0-m).
- *
- * Relation to incomplete elliptic integral:
- * If u = ellik(phi,m), then sn(u|m) = sin(phi),
- * and cn(u|m) = cos(phi).  Phi is called the amplitude of u.
- *
- * Computation is by means of the arithmetic-geometric mean
- * algorithm, except when m is within 1e-9 of 0 or 1.  In the
- * latter case with m close to 1, the approximation applies
- * only for phi < pi/2.
- *
- * ACCURACY:
- *
- * Tested at random points with u between 0 and 10, m between
- * 0 and 1.
- *
- *            Absolute error (* = relative error):
- * arithmetic   function   # trials      peak         rms
- *    IEEE      sn          10000       1.7e-6      2.2e-7
- *    IEEE      cn          10000       1.6e-6      2.2e-7
- *    IEEE      dn          10000       1.4e-3      1.9e-5
- *    IEEE      phi         10000       3.9e-7*     6.7e-8*
- *
- *  Peak error observed in consistency check using addition
- * theorem for sn(u+v) was 4e-16 (absolute).  Also tested by
- * the above relation to the incomplete elliptic integral.
- * Accuracy deteriorates when u is large.
- *
- */
-
-/*							ellpkf.c
- *
- *	Complete elliptic integral of the first kind
- *
- *
- *
- * SYNOPSIS:
- *
- * float m1, y, ellpkf();
- *
- * y = ellpkf( m1 );
- *
- *
- *
- * DESCRIPTION:
- *
- * Approximates the integral
- *
- *
- *
- *            pi/2
- *             -
- *            | |
- *            |           dt
- * K(m)  =    |    ------------------
- *            |                   2
- *          | |    sqrt( 1 - m sin t )
- *           -
- *            0
- *
- * where m = 1 - m1, using the approximation
- *
- *     P(x)  -  log x Q(x).
- *
- * The argument m1 is used rather than m so that the logarithmic
- * singularity at m = 1 will be shifted to the origin; this
- * preserves maximum accuracy.
- *
- * K(0) = pi/2.
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE       0,1        30000       1.3e-7      3.4e-8
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * ellpkf domain      x<0, x>1           0.0
- *
- */
-
-/*							exp10f.c
- *
- *	Base 10 exponential function
- *      (Common antilogarithm)
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, exp10f();
- *
- * y = exp10f( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns 10 raised to the x power.
- *
- * Range reduction is accomplished by expressing the argument
- * as 10**x = 2**n 10**f, with |f| < 0.5 log10(2).
- * A polynomial approximates 10**f.
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      -38,+38     100000      9.8e-8      2.8e-8
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * exp10 underflow    x < -MAXL10        0.0
- * exp10 overflow     x > MAXL10       MAXNUM
- *
- * IEEE single arithmetic: MAXL10 = 38.230809449325611792.
- *
- */
-
-/*							exp2f.c
- *
- *	Base 2 exponential function
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, exp2f();
- *
- * y = exp2f( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns 2 raised to the x power.
- *
- * Range reduction is accomplished by separating the argument
- * into an integer k and fraction f such that
- *     x    k  f
- *    2  = 2  2.
- *
- * A polynomial approximates 2**x in the basic range [-0.5, 0.5].
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE     -127,+127    100000      1.7e-7      2.8e-8
- *
- *
- * See exp.c for comments on error amplification.
- *
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * exp underflow    x < -MAXL2        0.0
- * exp overflow     x > MAXL2         MAXNUMF
- *
- * For IEEE arithmetic, MAXL2 = 127.
- */
-
-/*							expf.c
- *
- *	Exponential function
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, expf();
- *
- * y = expf( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns e (2.71828...) raised to the x power.
- *
- * Range reduction is accomplished by separating the argument
- * into an integer k and fraction f such that
- *
- *     x    k  f
- *    e  = 2  e.
- *
- * A polynomial is used to approximate exp(f)
- * in the basic range [-0.5, 0.5].
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      +- MAXLOG   100000      1.7e-7      2.8e-8
- *
- *
- * Error amplification in the exponential function can be
- * a serious matter.  The error propagation involves
- * exp( X(1+delta) ) = exp(X) ( 1 + X*delta + ... ),
- * which shows that a 1 lsb error in representing X produces
- * a relative error of X times 1 lsb in the function.
- * While the routine gives an accurate result for arguments
- * that are exactly represented by a double precision
- * computer number, the result contains amplified roundoff
- * error for large arguments not exactly represented.
- *
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * expf underflow    x < MINLOGF         0.0
- * expf overflow     x > MAXLOGF         MAXNUMF
- *
- */
-
-/*							expnf.c
- *
- *		Exponential integral En
- *
- *
- *
- * SYNOPSIS:
- *
- * int n;
- * float x, y, expnf();
- *
- * y = expnf( n, x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Evaluates the exponential integral
- *
- *                 inf.
- *                   -
- *                  | |   -xt
- *                  |    e
- *      E (x)  =    |    ----  dt.
- *       n          |      n
- *                | |     t
- *                 -
- *                  1
- *
- *
- * Both n and x must be nonnegative.
- *
- * The routine employs either a power series, a continued
- * fraction, or an asymptotic formula depending on the
- * relative values of n and x.
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      0, 30       10000       5.6e-7      1.2e-7
- *
- */
-
-/*							facf.c
- *
- *	Factorial function
- *
- *
- *
- * SYNOPSIS:
- *
- * float y, facf();
- * int i;
- *
- * y = facf( i );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns factorial of i  =  1 * 2 * 3 * ... * i.
- * fac(0) = 1.0.
- *
- * Due to machine arithmetic bounds the largest value of
- * i accepted is 33 in single precision arithmetic.
- * Greater values, or negative ones,
- * produce an error message and return MAXNUM.
- *
- *
- *
- * ACCURACY:
- *
- * For i < 34 the values are simply tabulated, and have
- * full machine accuracy.
- *
- */
-
-/*							fdtrf.c
- *
- *	F distribution
- *
- *
- *
- * SYNOPSIS:
- *
- * int df1, df2;
- * float x, y, fdtrf();
- *
- * y = fdtrf( df1, df2, x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns the area from zero to x under the F density
- * function (also known as Snedcor's density or the
- * variance ratio density).  This is the density
- * of x = (u1/df1)/(u2/df2), where u1 and u2 are random
- * variables having Chi square distributions with df1
- * and df2 degrees of freedom, respectively.
- *
- * The incomplete beta integral is used, according to the
- * formula
- *
- *	P(x) = incbet( df1/2, df2/2, (df1*x/(df2 + df1*x) ).
- *
- *
- * The arguments a and b are greater than zero, and x
- * x is nonnegative.
- * ACCURACY:
- *
- *        Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE       0,100       5000       2.2e-5      1.1e-6
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * fdtrf domain    a<0, b<0, x<0         0.0
- *
- */
-/*							fdtrcf()
- *
- *	Complemented F distribution
- *
- *
- *
- * SYNOPSIS:
- *
- * int df1, df2;
- * float x, y, fdtrcf();
- *
- * y = fdtrcf( df1, df2, x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns the area from x to infinity under the F density
- * function (also known as Snedcor's density or the
- * variance ratio density).
- *
- *
- *                      inf.
- *                       -
- *              1       | |  a-1      b-1
- * 1-P(x)  =  ------    |   t    (1-t)    dt
- *            B(a,b)  | |
- *                     -
- *                      x
- *
- * (See fdtr.c.)
- *
- * The incomplete beta integral is used, according to the
- * formula
- *
- *	P(x) = incbet( df2/2, df1/2, (df2/(df2 + df1*x) ).
- *
- *
- * ACCURACY:
- *
- *        Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE       0,100       5000       7.3e-5      1.2e-5
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * fdtrcf domain   a<0, b<0, x<0         0.0
- *
- */
-/*							fdtrif()
- *
- *	Inverse of complemented F distribution
- *
- *
- *
- * SYNOPSIS:
- *
- * float df1, df2, x, y, fdtrif();
- *
- * x = fdtrif( df1, df2, y );
- *
- *
- *
- *
- * DESCRIPTION:
- *
- * Finds the F density argument x such that the integral
- * from x to infinity of the F density is equal to the
- * given probability y.
- *
- * This is accomplished using the inverse beta integral
- * function and the relations
- *
- *      z = incbi( df2/2, df1/2, y )
- *      x = df2 (1-z) / (df1 z).
- *
- * Note: the following relations hold for the inverse of
- * the uncomplemented F distribution:
- *
- *      z = incbi( df1/2, df2/2, y )
- *      x = df2 z / (df1 (1-z)).
- *
- *
- *
- * ACCURACY:
- *
- * arithmetic   domain     # trials      peak         rms
- *        Absolute error:
- *    IEEE       0,100       5000       4.0e-5      3.2e-6
- *        Relative error:
- *    IEEE       0,100       5000       1.2e-3      1.8e-5
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * fdtrif domain  y <= 0 or y > 1       0.0
- *                     v < 1
- *
- */
-
-/*							ceilf()
- *							floorf()
- *							frexpf()
- *							ldexpf()
- *
- *	Single precision floating point numeric utilities
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y;
- * float ceilf(), floorf(), frexpf(), ldexpf();
- * int expnt, n;
- *
- * y = floorf(x);
- * y = ceilf(x);
- * y = frexpf( x, &expnt );
- * y = ldexpf( x, n );
- *
- *
- *
- * DESCRIPTION:
- *
- * All four routines return a single precision floating point
- * result.
- *
- * sfloor() returns the largest integer less than or equal to x.
- * It truncates toward minus infinity.
- *
- * sceil() returns the smallest integer greater than or equal
- * to x.  It truncates toward plus infinity.
- *
- * sfrexp() extracts the exponent from x.  It returns an integer
- * power of two to expnt and the significand between 0.5 and 1
- * to y.  Thus  x = y * 2**expn.
- *
- * sldexp() multiplies x by 2**n.
- *
- * These functions are part of the standard C run time library
- * for many but not all C compilers.  The ones supplied are
- * written in C for either DEC or IEEE arithmetic.  They should
- * be used only if your compiler library does not already have
- * them.
- *
- * The IEEE versions assume that denormal numbers are implemented
- * in the arithmetic.  Some modifications will be required if
- * the arithmetic has abrupt rather than gradual underflow.
- */
-
-/*							fresnlf.c
- *
- *	Fresnel integral
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, S, C;
- * void fresnlf();
- *
- * fresnlf( x, _&S, _&C );
- *
- *
- * DESCRIPTION:
- *
- * Evaluates the Fresnel integrals
- *
- *           x
- *           -
- *          | |
- * C(x) =   |   cos(pi/2 t**2) dt,
- *        | |
- *         -
- *          0
- *
- *           x
- *           -
- *          | |
- * S(x) =   |   sin(pi/2 t**2) dt.
- *        | |
- *         -
- *          0
- *
- *
- * The integrals are evaluated by power series for small x.
- * For x >= 1 auxiliary functions f(x) and g(x) are employed
- * such that
- *
- * C(x) = 0.5 + f(x) sin( pi/2 x**2 ) - g(x) cos( pi/2 x**2 )
- * S(x) = 0.5 - f(x) cos( pi/2 x**2 ) - g(x) sin( pi/2 x**2 )
- *
- *
- *
- * ACCURACY:
- *
- *  Relative error.
- *
- * Arithmetic  function   domain     # trials      peak         rms
- *   IEEE       S(x)      0, 10       30000       1.1e-6      1.9e-7
- *   IEEE       C(x)      0, 10       30000       1.1e-6      2.0e-7
- */
-
-/*							gammaf.c
- *
- *	Gamma function
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, gammaf();
- * extern int sgngamf;
- *
- * y = gammaf( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns gamma function of the argument.  The result is
- * correctly signed, and the sign (+1 or -1) is also
- * returned in a global (extern) variable named sgngamf.
- * This same variable is also filled in by the logarithmic
- * gamma function lgam().
- *
- * Arguments between 0 and 10 are reduced by recurrence and the
- * function is approximated by a polynomial function covering
- * the interval (2,3).  Large arguments are handled by Stirling's
- * formula. Negative arguments are made positive using
- * a reflection formula.  
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE       0,-33      100,000     5.7e-7      1.0e-7
- *    IEEE       -33,0      100,000     6.1e-7      1.2e-7
- *
- *
- */
-/*							lgamf()
- *
- *	Natural logarithm of gamma function
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, lgamf();
- * extern int sgngamf;
- *
- * y = lgamf( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns the base e (2.718...) logarithm of the absolute
- * value of the gamma function of the argument.
- * The sign (+1 or -1) of the gamma function is returned in a
- * global (extern) variable named sgngamf.
- *
- * For arguments greater than 6.5, the logarithm of the gamma
- * function is approximated by the logarithmic version of
- * Stirling's formula.  Arguments between 0 and +6.5 are reduced by
- * by recurrence to the interval [.75,1.25] or [1.5,2.5] of a rational
- * approximation.  The cosecant reflection formula is employed for
- * arguments less than zero.
- *
- * Arguments greater than MAXLGM = 2.035093e36 return MAXNUM and an
- * error message.
- *
- *
- *
- * ACCURACY:
- *
- *
- *
- * arithmetic      domain        # trials     peak         rms
- *    IEEE        -100,+100       500,000    7.4e-7       6.8e-8
- * The error criterion was relative when the function magnitude
- * was greater than one but absolute when it was less than one.
- * The routine has low relative error for positive arguments.
- *
- * The following test used the relative error criterion.
- *    IEEE    -2, +3              100000     4.0e-7      5.6e-8
- *
- */
-
-/*							gdtrf.c
- *
- *	Gamma distribution function
- *
- *
- *
- * SYNOPSIS:
- *
- * float a, b, x, y, gdtrf();
- *
- * y = gdtrf( a, b, x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns the integral from zero to x of the gamma probability
- * density function:
- *
- *
- *                x
- *        b       -
- *       a       | |   b-1  -at
- * y =  -----    |    t    e    dt
- *       -     | |
- *      | (b)   -
- *               0
- *
- *  The incomplete gamma integral is used, according to the
- * relation
- *
- * y = igam( b, ax ).
- *
- *
- * ACCURACY:
- *
- *        Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE       0,100       5000       5.8e-5      3.0e-6
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * gdtrf domain        x < 0            0.0
- *
- */
-/*							gdtrcf.c
- *
- *	Complemented gamma distribution function
- *
- *
- *
- * SYNOPSIS:
- *
- * float a, b, x, y, gdtrcf();
- *
- * y = gdtrcf( a, b, x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns the integral from x to infinity of the gamma
- * probability density function:
- *
- *
- *               inf.
- *        b       -
- *       a       | |   b-1  -at
- * y =  -----    |    t    e    dt
- *       -     | |
- *      | (b)   -
- *               x
- *
- *  The incomplete gamma integral is used, according to the
- * relation
- *
- * y = igamc( b, ax ).
- *
- *
- * ACCURACY:
- *
- *        Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE       0,100       5000       9.1e-5      1.5e-5
- *
- * ERROR MESSAGES:
- *
- *   message         condition      value returned
- * gdtrcf domain        x < 0            0.0
- *
- */
-
-/*							hyp2f1f.c
- *
- *	Gauss hypergeometric function   F
- *	                               2 1
- *
- *
- * SYNOPSIS:
- *
- * float a, b, c, x, y, hyp2f1f();
- *
- * y = hyp2f1f( a, b, c, x );
- *
- *
- * DESCRIPTION:
- *
- *
- *  hyp2f1( a, b, c, x )  =   F ( a, b; c; x )
- *                           2 1
- *
- *           inf.
- *            -   a(a+1)...(a+k) b(b+1)...(b+k)   k+1
- *   =  1 +   >   -----------------------------  x   .
- *            -         c(c+1)...(c+k) (k+1)!
- *          k = 0
- *
- *  Cases addressed are
- *	Tests and escapes for negative integer a, b, or c
- *	Linear transformation if c - a or c - b negative integer
- *	Special case c = a or c = b
- *	Linear transformation for  x near +1
- *	Transformation for x < -0.5
- *	Psi function expansion if x > 0.5 and c - a - b integer
- *      Conditionally, a recurrence on c to make c-a-b > 0
- *
- * |x| > 1 is rejected.
- *
- * The parameters a, b, c are considered to be integer
- * valued if they are within 1.0e-6 of the nearest integer.
- *
- * ACCURACY:
- *
- *                      Relative error (-1 < x < 1):
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      0,3         30000       5.8e-4      4.3e-6
- */
-
-/*							hypergf.c
- *
- *	Confluent hypergeometric function
- *
- *
- *
- * SYNOPSIS:
- *
- * float a, b, x, y, hypergf();
- *
- * y = hypergf( a, b, x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Computes the confluent hypergeometric function
- *
- *                          1           2
- *                       a x    a(a+1) x
- *   F ( a,b;x )  =  1 + ---- + --------- + ...
- *  1 1                  b 1!   b(b+1) 2!
- *
- * Many higher transcendental functions are special cases of
- * this power series.
- *
- * As is evident from the formula, b must not be a negative
- * integer or zero unless a is an integer with 0 >= a > b.
- *
- * The routine attempts both a direct summation of the series
- * and an asymptotic expansion.  In each case error due to
- * roundoff, cancellation, and nonconvergence is estimated.
- * The result with smaller estimated error is returned.
- *
- *
- *
- * ACCURACY:
- *
- * Tested at random points (a, b, x), all three variables
- * ranging from 0 to 30.
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      0,5         10000       6.6e-7      1.3e-7
- *    IEEE      0,30        30000       1.1e-5      6.5e-7
- *
- * Larger errors can be observed when b is near a negative
- * integer or zero.  Certain combinations of arguments yield
- * serious cancellation error in the power series summation
- * and also are not in the region of near convergence of the
- * asymptotic series.  An error message is printed if the
- * self-estimated relative error is greater than 1.0e-3.
- *
- */
-
-/*							i0f.c
- *
- *	Modified Bessel function of order zero
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, i0();
- *
- * y = i0f( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns modified Bessel function of order zero of the
- * argument.
- *
- * The function is defined as i0(x) = j0( ix ).
- *
- * The range is partitioned into the two intervals [0,8] and
- * (8, infinity).  Chebyshev polynomial expansions are employed
- * in each interval.
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      0,30        100000      4.0e-7      7.9e-8
- *
- */
-/*							i0ef.c
- *
- *	Modified Bessel function of order zero,
- *	exponentially scaled
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, i0ef();
- *
- * y = i0ef( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns exponentially scaled modified Bessel function
- * of order zero of the argument.
- *
- * The function is defined as i0e(x) = exp(-|x|) j0( ix ).
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      0,30        100000      3.7e-7      7.0e-8
- * See i0f().
- *
- */
-
-/*							i1f.c
- *
- *	Modified Bessel function of order one
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, i1f();
- *
- * y = i1f( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns modified Bessel function of order one of the
- * argument.
- *
- * The function is defined as i1(x) = -i j1( ix ).
- *
- * The range is partitioned into the two intervals [0,8] and
- * (8, infinity).  Chebyshev polynomial expansions are employed
- * in each interval.
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      0, 30       100000      1.5e-6      1.6e-7
- *
- *
- */
-/*							i1ef.c
- *
- *	Modified Bessel function of order one,
- *	exponentially scaled
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, i1ef();
- *
- * y = i1ef( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns exponentially scaled modified Bessel function
- * of order one of the argument.
- *
- * The function is defined as i1(x) = -i exp(-|x|) j1( ix ).
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      0, 30       30000       1.5e-6      1.5e-7
- * See i1().
- *
- */
-
-/*							igamf.c
- *
- *	Incomplete gamma integral
- *
- *
- *
- * SYNOPSIS:
- *
- * float a, x, y, igamf();
- *
- * y = igamf( a, x );
- *
- *
- *
- * DESCRIPTION:
- *
- * The function is defined by
- *
- *                           x
- *                            -
- *                   1       | |  -t  a-1
- *  igam(a,x)  =   -----     |   e   t   dt.
- *                  -      | |
- *                 | (a)    -
- *                           0
- *
- *
- * In this implementation both arguments must be positive.
- * The integral is evaluated by either a power series or
- * continued fraction expansion, depending on the relative
- * values of a and x.
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      0,30        20000       7.8e-6      5.9e-7
- *
- */
-/*							igamcf()
- *
- *	Complemented incomplete gamma integral
- *
- *
- *
- * SYNOPSIS:
- *
- * float a, x, y, igamcf();
- *
- * y = igamcf( a, x );
- *
- *
- *
- * DESCRIPTION:
- *
- * The function is defined by
- *
- *
- *  igamc(a,x)   =   1 - igam(a,x)
- *
- *                            inf.
- *                              -
- *                     1       | |  -t  a-1
- *               =   -----     |   e   t   dt.
- *                    -      | |
- *                   | (a)    -
- *                             x
- *
- *
- * In this implementation both arguments must be positive.
- * The integral is evaluated by either a power series or
- * continued fraction expansion, depending on the relative
- * values of a and x.
- *
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      0,30        30000       7.8e-6      5.9e-7
- *
- */
-
-/*							igamif()
- *
- *      Inverse of complemented imcomplete gamma integral
- *
- *
- *
- * SYNOPSIS:
- *
- * float a, x, y, igamif();
- *
- * x = igamif( a, y );
- *
- *
- *
- * DESCRIPTION:
- *
- * Given y, the function finds x such that
- *
- *  igamc( a, x ) = y.
- *
- * Starting with the approximate value
- *
- *         3
- *  x = a t
- *
- *  where
- *
- *  t = 1 - d - ndtri(y) sqrt(d)
- * 
- * and
- *
- *  d = 1/9a,
- *
- * the routine performs up to 10 Newton iterations to find the
- * root of igamc(a,x) - y = 0.
- *
- *
- * ACCURACY:
- *
- * Tested for a ranging from 0 to 100 and x from 0 to 1.
- *
- *                      Relative error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      0,100         5000       1.0e-5      1.5e-6
- *
- */
-
-/*							incbetf.c
- *
- *	Incomplete beta integral
- *
- *
- * SYNOPSIS:
- *
- * float a, b, x, y, incbetf();
- *
- * y = incbetf( a, b, x );
- *
- *
- * DESCRIPTION:
- *
- * Returns incomplete beta integral of the arguments, evaluated
- * from zero to x.  The function is defined as
- *
- *                  x
- *     -            -
- *    | (a+b)      | |  a-1     b-1
- *  -----------    |   t   (1-t)   dt.
- *   -     -     | |
- *  | (a) | (b)   -
- *                 0
- *
- * The domain of definition is 0 <= x <= 1.  In this
- * implementation a and b are restricted to positive values.
- * The integral from x to 1 may be obtained by the symmetry
- * relation
- *
- *    1 - incbet( a, b, x )  =  incbet( b, a, 1-x ).
- *
- * The integral is evaluated by a continued fraction expansion.
- * If a < 1, the function calls itself recursively after a
- * transformation to increase a to a+1.
- *
- * ACCURACY:
- *
- * Tested at random points (a,b,x) with a and b in the indicated
- * interval and x between 0 and 1.
- *
- * arithmetic   domain     # trials      peak         rms
- * Relative error:
- *    IEEE       0,30       10000       3.7e-5      5.1e-6
- *    IEEE       0,100      10000       1.7e-4      2.5e-5
- * The useful domain for relative error is limited by underflow
- * of the single precision exponential function.
- * Absolute error:
- *    IEEE       0,30      100000       2.2e-5      9.6e-7
- *    IEEE       0,100      10000       6.5e-5      3.7e-6
- *
- * Larger errors may occur for extreme ratios of a and b.
- *
- * ERROR MESSAGES:
- *   message         condition      value returned
- * incbetf domain     x<0, x>1          0.0
- */
-
-/*							incbif()
- *
- *      Inverse of imcomplete beta integral
- *
- *
- *
- * SYNOPSIS:
- *
- * float a, b, x, y, incbif();
- *
- * x = incbif( a, b, y );
- *
- *
- *
- * DESCRIPTION:
- *
- * Given y, the function finds x such that
- *
- *  incbet( a, b, x ) = y.
- *
- * the routine performs up to 10 Newton iterations to find the
- * root of incbet(a,b,x) - y = 0.
- *
- *
- * ACCURACY:
- *
- *                      Relative error:
- *                x     a,b
- * arithmetic   domain  domain  # trials    peak       rms
- *    IEEE      0,1     0,100     5000     2.8e-4    8.3e-6
- *
- * Overflow and larger errors may occur for one of a or b near zero
- *  and the other large.
- */
-
-/*							ivf.c
- *
- *	Modified Bessel function of noninteger order
- *
- *
- *
- * SYNOPSIS:
- *
- * float v, x, y, ivf();
- *
- * y = ivf( v, x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns modified Bessel function of order v of the
- * argument.  If x is negative, v must be integer valued.
- *
- * The function is defined as Iv(x) = Jv( ix ).  It is
- * here computed in terms of the confluent hypergeometric
- * function, according to the formula
- *
- *              v  -x
- * Iv(x) = (x/2)  e   hyperg( v+0.5, 2v+1, 2x ) / gamma(v+1)
- *
- * If v is a negative integer, then v is replaced by -v.
- *
- *
- * ACCURACY:
- *
- * Tested at random points (v, x), with v between 0 and
- * 30, x between 0 and 28.
- * arithmetic   domain     # trials      peak         rms
- *                      Relative error:
- *    IEEE      0,15          3000      4.7e-6      5.4e-7
- *          Absolute error (relative when function > 1)
- *    IEEE      0,30          5000      8.5e-6      1.3e-6
- *
- * Accuracy is diminished if v is near a negative integer.
- * The useful domain for relative error is limited by overflow
- * of the single precision exponential function.
- *
- * See also hyperg.c.
- *
- */
-
-/*							j0f.c
- *
- *	Bessel function of order zero
- *
- *
- *
- * SYNOPSIS:
- *
- * float x, y, j0f();
- *
- * y = j0f( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns Bessel function of order zero of the argument.
- *
- * The domain is divided into the intervals [0, 2] and
- * (2, infinity). In the first interval the following polynomial
- * approximation is used:
- *
- *
- *        2         2         2
- * (w - r  ) (w - r  ) (w - r  ) P(w)
- *       1         2         3   
- *
- *            2
- * where w = x  and the three r's are zeros of the function.
- *
- * In the second interval, the modulus and phase are approximated
- * by polynomials of the form Modulus(x) = sqrt(1/x) Q(1/x)
- * and Phase(x) = x + 1/x R(1/x^2) - pi/4.  The function is
- *
- *   j0(x) = Modulus(x) cos( Phase(x) ).
- *
- *
- *
- * ACCURACY:
- *
- *                      Absolute error:
- * arithmetic   domain     # trials      peak         rms
- *    IEEE      0, 2        100000      1.3e-7      3.6e-8
- *    IEEE      2, 32       100000      1.9e-7      5.4e-8
- *
-