From Bugzilla Helper: User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.2-2 i586) Description of problem: The result of coshl(x) (defined as (e^x - e^-x)/2) should be representable for all x where |x| <= 11357, but it overflows to infinity when |X| >= 711. How reproducible: Always Steps to Reproduce: Compile and run the following program: #include <stdio.h> #include <math.h> main () { long double a, b; const long double test_cases[] = { 711.0L, 11356.0L }; int i, r = 0; for (i = 0; i < sizeof (test_cases) / sizeof (test_cases[0]); i++) { a = coshl (test_cases[i]); b = (expl (test_cases[i]) - expl (-test_cases[i])) / 2.0L; if (a == b) { printf ("cosh(%Lg) = %Lg\n", a); } else { printf ("coshl(%Lg) returned %Lg; expected %Lg\n", test_cases[i], a, b); r = 1; } } return r; } Actual Results: coshl(711) returned inf; expected 3.03631e+308 coshl(11356) returned inf; expected 3.52457e+4931 Expected Results: cosh(711) = 3.03631e+308 cosh(11356) = 3.52457e+4931 Additional info: The source of this bug can be found in glibc-2.2.3/sysdeps/generic/w_coshl.c. When it checks for a range error, it is using the domain limit of the double function (710.475860073943863426) rather than the long double version (11357.2165534747038948012940999836L).
Then there should be special sysdeps/ieee754/ldbl-{96,128}/w_coshl.c, I'll compute the constants tomorrow.
See http://sources.redhat.com/ml/libc-hacker/2001-06/msg00005.html and http://sources.redhat.com/ml/libc-hacker/2001-06/msg00006.html.
Included in glibc-2.2.3-11.