123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #include <openlibm_math.h>
- #include "math_private.h"
- static const long double
- one = 1.0,
- ln2 = 6.931471805599453094287e-01L;
- long double
- acoshl(long double x)
- {
- long double t;
- u_int32_t se,i0,i1;
- GET_LDOUBLE_WORDS(se,i0,i1,x);
- if(se<0x3fff || se & 0x8000) {
- return (x-x)/(x-x);
- } else if(se >=0x401d) {
- if(se >=0x7fff) {
- return x+x;
- } else
- return logl(x)+ln2;
- } else if(((se-0x3fff)|i0|i1)==0) {
- return 0.0;
- } else if (se > 0x4000) {
- t=x*x;
- return logl(2.0*x-one/(x+sqrtl(t-one)));
- } else {
- t = x-one;
- return log1pl(t+sqrtl(2.0*t+t*t));
- }
- }
|