diff options
Diffstat (limited to 'newlib/libm/math/wf_j1.c')
-rw-r--r-- | newlib/libm/math/wf_j1.c | 52 |
1 files changed, 7 insertions, 45 deletions
diff --git a/newlib/libm/math/wf_j1.c b/newlib/libm/math/wf_j1.c index b91962881..01c9999c6 100644 --- a/newlib/libm/math/wf_j1.c +++ b/newlib/libm/math/wf_j1.c @@ -32,24 +32,12 @@ return __ieee754_j1f(x); #else float z; - struct exception exc; z = __ieee754_j1f(x); if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z; if(fabsf(x)>(float)X_TLOSS) { /* j1f(|x|>X_TLOSS) */ - exc.type = TLOSS; - exc.name = "j1f"; - exc.err = 0; - exc.arg1 = exc.arg2 = (double)x; - exc.retval = 0.0; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - errno = ERANGE; - } - if (exc.err != 0) - errno = exc.err; - return exc.retval; + errno = ERANGE; + return 0.0f; } else return z; #endif @@ -66,10 +54,9 @@ return __ieee754_y1f(x); #else float z; - struct exception exc; z = __ieee754_y1f(x); if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z; - if(x <= (float)0.0){ + if(x <= 0.0f){ /* y1f(0) = -inf or y1f(x<0) = NaN */ #ifndef HUGE_VAL #define HUGE_VAL inf @@ -77,38 +64,13 @@ SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */ #endif - exc.type = DOMAIN; /* should be SING for IEEE */ - exc.name = "y1f"; - exc.err = 0; - exc.arg1 = exc.arg2 = (double)x; - if (_LIB_VERSION == _SVID_) - exc.retval = -HUGE; - else - exc.retval = -HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - errno = EDOM; - } - if (exc.err != 0) - errno = exc.err; - return (float)exc.retval; + errno = EDOM; + return (float)-HUGE_VAL; } if(x>(float)X_TLOSS) { /* y1f(x>X_TLOSS) */ - exc.type = TLOSS; - exc.name = "y1f"; - exc.err = 0; - exc.arg1 = exc.arg2 = (double)x; - exc.retval = 0.0; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - errno = ERANGE; - } - if (exc.err != 0) - errno = exc.err; - return (float)exc.retval; + errno = ERANGE; + return 0.0f; } else return z; #endif |