diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2018-01-03 17:39:24 -0700 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2018-01-03 17:39:24 -0700 |
commit | a6c1ed4716cf02626ea035beb6dd4a921642ba80 (patch) | |
tree | ef582c1b52819e27bdd16097ec03b69799d04ede /newlib/libm/mathfp/sf_tan.c | |
parent | f6c9a624fa8a6878a7fb2b02f55e4990a20feb59 (diff) |
Use libc from agbcc instead of standalone newlib\nYou must have AGBCC commit 80d029caec189587f8b9294b6c8a5a489b8f5f88 in order to compile pmd_red.gbalibc
Diffstat (limited to 'newlib/libm/mathfp/sf_tan.c')
-rw-r--r-- | newlib/libm/mathfp/sf_tan.c | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/newlib/libm/mathfp/sf_tan.c b/newlib/libm/mathfp/sf_tan.c deleted file mode 100644 index fcde19a..0000000 --- a/newlib/libm/mathfp/sf_tan.c +++ /dev/null @@ -1,104 +0,0 @@ - -/* @(#)z_tanf.c 1.0 98/08/13 */ -/****************************************************************** - * The following routines are coded directly from the algorithms - * and coefficients given in "Software Manual for the Elementary - * Functions" by William J. Cody, Jr. and William Waite, Prentice - * Hall, 1980. - ******************************************************************/ -/****************************************************************** - * Tangent - * - * Input: - * x - floating point value - * - * Output: - * tangent of x - * - * Description: - * This routine calculates the tangent of x. - * - *****************************************************************/ - -#include "fdlibm.h" -#include "zmath.h" - -static const float TWO_OVER_PI = 0.6366197723; -static const float p[] = { -0.958017723e-1 }; -static const float q[] = { -0.429135777, - 0.971685835e-2 }; - -float -_DEFUN (tanf, (float), - float x) -{ - float y, f, g, XN, xnum, xden, res; - int N; - - /* Check for special values. */ - switch (numtestf (x)) - { - case NAN: - errno = EDOM; - return (x); - case INF: - errno = EDOM; - return (z_notanum_f.f); - } - - y = fabsf (x); - - /* Check for values that are out of our range. */ - if (y > 105414357.0) - { - errno = ERANGE; - return (y); - } - - if (x < 0.0) - N = (int) (x * TWO_OVER_PI - 0.5); - else - N = (int) (x * TWO_OVER_PI + 0.5); - - XN = (float) N; - - f = x - N * __PI_OVER_TWO; - - /* Check for values that are too small. */ - if (-z_rooteps_f < f && f < z_rooteps_f) - { - xnum = f; - xden = 1.0; - } - - /* Calculate the polynomial. */ - else - { - g = f * f; - - xnum = f * (p[0] * g) + f; - xden = (q[1] * g + q[0]) * g + 1.0; - } - - /* Check for odd or even values. */ - if (N & 1) - { - xnum = -xnum; - res = xden / xnum; - } - else - { - res = xnum / xden; - } - - return (res); -} - -#ifdef _DOUBLE_IS_32BITS - -double tan (double x) -{ - return (double) tanf ((float) x); -} - -#endif /* _DOUBLE_IS_32BITS */ |