* sysdeps/generic/s_ctanhf.c (__ctanhf): Likewise.
* sysdeps/generic/s_ctanhl.c (__ctanhl): Likewise.
+2005-07-07 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/generic/s_ctanh.c (__ctanh): Handle case of zero den better.
+ * sysdeps/generic/s_ctanhf.c (__ctanhf): Likewise.
+ * sysdeps/generic/s_ctanhl.c (__ctanhl): Likewise.
+
2005-04-13 H.J. Lu <hongjiu.lu@intel.com>
[BZ #974]
/* Complex hyperbole tangent for double.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
den = (__ieee754_cosh (2.0 * __real__ x) + cos2ix);
- __real__ res = __ieee754_sinh (2.0 * __real__ x) / den;
- __imag__ res = sin2ix / den;
+ if (den == 0.0)
+ {
+ __complex__ double ez = __cexp (x);
+ __complex__ double emz = __cexp (-x);
+
+ res = (ez - emz) / (ez + emz);
+ }
+ else
+ {
+ __real__ res = __ieee754_sinh (2.0 * __real__ x) / den;
+ __imag__ res = sin2ix / den;
+ }
}
return res;
/* Complex hyperbole tangent for float.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
den = (__ieee754_coshf (2.0 * __real__ x) + cos2ix);
- __real__ res = __ieee754_sinhf (2.0 * __real__ x) / den;
- __imag__ res = sin2ix / den;
+ if (den == 0.0f)
+ {
+ __complex__ float ez = __cexpf (x);
+ __complex__ float emz = __cexpf (-x);
+
+ res = (ez - emz) / (ez + emz);
+ }
+ else
+ {
+ __real__ res = __ieee754_sinhf (2.0 * __real__ x) / den;
+ __imag__ res = sin2ix / den;
+ }
}
return res;