diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-11-22 14:04:29 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-11-22 14:04:29 +0000 |
commit | 7ce331c01ce6eb7b3f5c715a38a24359da9c6ee2 (patch) | |
tree | 3a7e8476e868ae15f4da1b7ce26b2db6f434468c /libm/float/sinhf.c | |
parent | c117dd5fb183afb1a4790a6f6110d88704be6bf8 (diff) |
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
Diffstat (limited to 'libm/float/sinhf.c')
-rw-r--r-- | libm/float/sinhf.c | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/libm/float/sinhf.c b/libm/float/sinhf.c deleted file mode 100644 index e8baaf4fa..000000000 --- a/libm/float/sinhf.c +++ /dev/null @@ -1,87 +0,0 @@ -/* sinhf.c - * - * Hyperbolic sine - * - * - * - * SYNOPSIS: - * - * float x, y, sinhf(); - * - * y = sinhf( x ); - * - * - * - * DESCRIPTION: - * - * Returns hyperbolic sine of argument in the range MINLOGF to - * MAXLOGF. - * - * The range is partitioned into two segments. If |x| <= 1, a - * polynomial approximation is used. - * Otherwise the calculation is sinh(x) = ( exp(x) - exp(-x) )/2. - * - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE +-MAXLOG 100000 1.1e-7 2.9e-8 - * - */ - -/* -Cephes Math Library Release 2.2: June, 1992 -Copyright 1984, 1987, 1989, 1992 by Stephen L. Moshier -Direct inquiries to 30 Frost Street, Cambridge, MA 02140 -*/ - -/* Single precision hyperbolic sine - * test interval: [-1, +1] - * trials: 10000 - * peak relative error: 9.0e-8 - * rms relative error: 3.0e-8 - */ -#include <math.h> -extern float MAXLOGF, MAXNUMF; - -float expf( float ); - -float sinhf( float xx ) -{ -register float z; -float x; - -x = xx; -if( xx < 0 ) - z = -x; -else - z = x; - -if( z > MAXLOGF ) - { - mtherr( "sinhf", DOMAIN ); - if( x > 0 ) - return( MAXNUMF ); - else - return( -MAXNUMF ); - } -if( z > 1.0 ) - { - z = expf(z); - z = 0.5*z - (0.5/z); - if( x < 0 ) - z = -z; - } -else - { - z = x * x; - z = - (( 2.03721912945E-4 * z - + 8.33028376239E-3) * z - + 1.66667160211E-1) * z * x - + x; - } -return( z ); -} |