diff options
Diffstat (limited to 'newlib/libm/math/wf_atanh.c')
-rw-r--r-- | newlib/libm/math/wf_atanh.c | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/newlib/libm/math/wf_atanh.c b/newlib/libm/math/wf_atanh.c index 565630411..31e049006 100644 --- a/newlib/libm/math/wf_atanh.c +++ b/newlib/libm/math/wf_atanh.c @@ -30,39 +30,19 @@ return __ieee754_atanhf(x); #else float z,y; - struct exception exc; z = __ieee754_atanhf(x); if(_LIB_VERSION == _IEEE_ || isnan(x)) return z; y = fabsf(x); - if(y>=(float)1.0) { - if(y>(float)1.0) { - /* atanhf(|x|>1) */ - exc.type = DOMAIN; - exc.name = "atanhf"; - exc.err = 0; - exc.arg1 = exc.arg2 = (double)x; - exc.retval = 0.0/0.0; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - errno = EDOM; - } + if(y>=1.0f) { + if(y>1.0f) { + /* atanhf(|x|>1) */ + errno = EDOM; + return 0.0f/0.0f; } else { - /* atanhf(|x|=1) */ - exc.type = SING; - exc.name = "atanhf"; - exc.err = 0; - exc.arg1 = exc.arg2 = (double)x; - exc.retval = x/0.0; /* sign(x)*inf */ - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - errno = EDOM; - } - } - if (exc.err != 0) - errno = exc.err; - return (float)exc.retval; + /* atanhf(|x|=1) */ + errno = EDOM; + return x/0.0f; /* sign(x)*inf */ + } } else return z; #endif |