From 7ce331c01ce6eb7b3f5c715a38a24359da9c6ee2 Mon Sep 17 00:00:00 2001 From: Eric Andersen 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/atanhf.c | 92 ----------------------------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 libm/float/atanhf.c (limited to 'libm/float/atanhf.c') diff --git a/libm/float/atanhf.c b/libm/float/atanhf.c deleted file mode 100644 index dfadad09e..000000000 --- a/libm/float/atanhf.c +++ /dev/null @@ -1,92 +0,0 @@ -/* 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 - * - */ - -/* atanh.c */ - - -/* -Cephes Math Library Release 2.2: June, 1992 -Copyright (C) 1987, 1992 by Stephen L. Moshier -Direct inquiries to 30 Frost Street, Cambridge, MA 02140 -*/ - -/* Single precision inverse hyperbolic tangent - * test interval: [-0.5, +0.5] - * trials: 10000 - * peak relative error: 8.2e-8 - * rms relative error: 3.0e-8 - */ -#include -extern float MAXNUMF; - -float logf( float ); - -float atanhf( float xx ) -{ -float x, z; - -x = xx; -if( x < 0 ) - z = -x; -else - z = x; -if( z >= 1.0 ) - { - if( x == 1.0 ) - return( MAXNUMF ); - if( x == -1.0 ) - return( -MAXNUMF ); - mtherr( "atanhl", DOMAIN ); - return( MAXNUMF ); - } - -if( z < 1.0e-4 ) - return(x); - -if( z < 0.5 ) - { - z = x * x; - z = - (((( 1.81740078349E-1 * z - + 8.24370301058E-2) * z - + 1.46691431730E-1) * z - + 1.99782164500E-1) * z - + 3.33337300303E-1) * z * x - + x; - } -else - { - z = 0.5 * logf( (1.0+x)/(1.0-x) ); - } -return( z ); -} -- cgit v1.2.3