mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-10 05:03:06 +03:00
Convert _Complex cosine functions to generated code
This is fairly straight fowards. m68k overrides are updated to use the framework, and thus are simplified a bit.
This commit is contained in:
41
ChangeLog
41
ChangeLog
@@ -1,3 +1,44 @@
|
|||||||
|
2016-08-19 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
|
||||||
|
|
||||||
|
* math/Makefile (libm-gen-calls): Move
|
||||||
|
s_cacos, s_cacosh, s_ccos, s_ccosh from ...
|
||||||
|
(libm-calls): Remove above.
|
||||||
|
|
||||||
|
* math/s_cacos_template.c: Update using type-generic macros.
|
||||||
|
* math/s_cacosh_template.c: Likewise.
|
||||||
|
* math/s_ccos_template.c: Likewise.
|
||||||
|
* math/s_ccosh_template.c: Likwise.
|
||||||
|
|
||||||
|
* math/s_cacosf.c: Removed.
|
||||||
|
* math/s_cacos.c: Removed.
|
||||||
|
* math/s_cacosl.c: Removed.
|
||||||
|
* math/s_cacoshf.c: Removed.
|
||||||
|
* math/s_cacosh.c: Removed.
|
||||||
|
* math/s_cacoshl.c: Removed.
|
||||||
|
* math/s_ccosf.c: Removed.
|
||||||
|
* math/s_ccos.c: Removed.
|
||||||
|
* math/s_ccosl.c: Removed.
|
||||||
|
* math/s_ccoshf.c: Removed.
|
||||||
|
* math/s_ccosh.c: Removed.
|
||||||
|
* math/s_ccoshl.c: Removed.
|
||||||
|
|
||||||
|
* sysdeps/ieee754/ldbl-opt/s_cacoshl.c: Removed.
|
||||||
|
* sysdeps/ieee754/ldbl-opt/s_cacosl.c: Removed.
|
||||||
|
* sysdeps/ieee754/ldbl-opt/s_ccos.c: Removed.
|
||||||
|
* sysdeps/ieee754/ldbl-opt/s_ccosh.c: Removed.
|
||||||
|
* sysdeps/ieee754/ldbl-opt/s_ccoshl.c: Removed.
|
||||||
|
* sysdeps/ieee754/ldbl-opt/s_ccosl.c: Removed.
|
||||||
|
|
||||||
|
* sysdeps/m68k/m680x0/fpu/s_ccosh.c: Refactor into.
|
||||||
|
* sysdeps/m68k/m680x0/fpu/s_ccosh_template.c: New file.
|
||||||
|
* sysdeps/m68k/m680x0/fpu/s_ccoshf.c: Removed.
|
||||||
|
* sysdeps/m68k/m680x0/fpu/s_ccoshl.c: Removed.
|
||||||
|
|
||||||
|
* sysdeps/alpha/fpu/s_cacosf.c: Update to use template file.
|
||||||
|
* sysdeps/alpha/fpu/s_cacoshf.c: Likewise.
|
||||||
|
* sysdeps/alpha/fpu/s_ccosf.c: Likewise.
|
||||||
|
* sysdeps/alpha/fpu/s_ccoshf.c: Likewise.
|
||||||
|
|
||||||
2016-08-19 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
|
2016-08-19 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
|
||||||
|
|
||||||
* s_cacos_template.c: Copy of s_cacos.c.
|
* s_cacos_template.c: Copy of s_cacos.c.
|
||||||
|
@@ -45,7 +45,8 @@ libm-support = s_lib_version s_matherr s_signgam \
|
|||||||
|
|
||||||
# Wrappers for these functions generated per type using a file named
|
# Wrappers for these functions generated per type using a file named
|
||||||
# <func>_template.c and the appropriate math-type-macros-<TYPE>.h.
|
# <func>_template.c and the appropriate math-type-macros-<TYPE>.h.
|
||||||
gen-libm-calls = cargF conjF cimagF crealF cabsF
|
gen-libm-calls = cargF conjF cimagF crealF cabsF s_cacosF \
|
||||||
|
s_cacoshF s_ccosF s_ccoshF
|
||||||
|
|
||||||
libm-calls = \
|
libm-calls = \
|
||||||
e_acosF e_acoshF e_asinF e_atan2F e_atanhF e_coshF e_expF e_fmodF \
|
e_acosF e_acoshF e_asinF e_atan2F e_atanhF e_coshF e_expF e_fmodF \
|
||||||
@@ -63,9 +64,9 @@ libm-calls = \
|
|||||||
w_ilogbF \
|
w_ilogbF \
|
||||||
s_fpclassifyF s_fmaxF s_fminF s_fdimF s_nanF s_truncF \
|
s_fpclassifyF s_fmaxF s_fminF s_fdimF s_nanF s_truncF \
|
||||||
s_remquoF e_log2F e_exp2F s_roundF s_nearbyintF s_sincosF \
|
s_remquoF e_log2F e_exp2F s_roundF s_nearbyintF s_sincosF \
|
||||||
s_cexpF s_csinhF s_ccoshF s_clogF \
|
s_cexpF s_csinhF s_clogF \
|
||||||
s_catanF s_casinF s_ccosF s_csinF s_ctanF s_ctanhF s_cacosF \
|
s_catanF s_casinF s_csinF s_ctanF s_ctanhF \
|
||||||
s_casinhF s_cacoshF s_catanhF s_csqrtF s_cpowF s_cprojF s_clog10F \
|
s_casinhF s_catanhF s_csqrtF s_cpowF s_cprojF s_clog10F \
|
||||||
s_fmaF s_lrintF s_llrintF s_lroundF s_llroundF e_exp10F w_log2F \
|
s_fmaF s_lrintF s_llrintF s_lroundF s_llroundF e_exp10F w_log2F \
|
||||||
s_issignalingF $(calls:s_%=m_%) x2y2m1F k_casinhF \
|
s_issignalingF $(calls:s_%=m_%) x2y2m1F k_casinhF \
|
||||||
gamma_productF lgamma_negF lgamma_productF \
|
gamma_productF lgamma_negF lgamma_productF \
|
||||||
|
@@ -1,58 +0,0 @@
|
|||||||
/* Return cosine of complex double value.
|
|
||||||
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with the GNU C Library; if not, see
|
|
||||||
<http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#include <complex.h>
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
__complex__ double
|
|
||||||
__cacos (__complex__ double x)
|
|
||||||
{
|
|
||||||
__complex__ double y;
|
|
||||||
__complex__ double res;
|
|
||||||
int rcls = fpclassify (__real__ x);
|
|
||||||
int icls = fpclassify (__imag__ x);
|
|
||||||
|
|
||||||
if (rcls <= FP_INFINITE || icls <= FP_INFINITE
|
|
||||||
|| (rcls == FP_ZERO && icls == FP_ZERO))
|
|
||||||
{
|
|
||||||
y = __casin (x);
|
|
||||||
|
|
||||||
__real__ res = (double) M_PI_2 - __real__ y;
|
|
||||||
if (__real__ res == 0.0)
|
|
||||||
__real__ res = 0.0;
|
|
||||||
__imag__ res = -__imag__ y;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__real__ y = -__imag__ x;
|
|
||||||
__imag__ y = __real__ x;
|
|
||||||
|
|
||||||
y = __kernel_casinh (y, 1);
|
|
||||||
|
|
||||||
__real__ res = __imag__ y;
|
|
||||||
__imag__ res = __real__ y;
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
weak_alias (__cacos, cacos)
|
|
||||||
#ifdef NO_LONG_DOUBLE
|
|
||||||
strong_alias (__cacos, __cacosl)
|
|
||||||
weak_alias (__cacos, cacosl)
|
|
||||||
#endif
|
|
@@ -1,4 +1,4 @@
|
|||||||
/* Return cosine of complex double value.
|
/* Return cosine of a complex type.
|
||||||
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||||
@@ -20,22 +20,22 @@
|
|||||||
#include <complex.h>
|
#include <complex.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
__complex__ double
|
CFLOAT
|
||||||
__cacos (__complex__ double x)
|
M_DECL_FUNC (__cacos) (CFLOAT x)
|
||||||
{
|
{
|
||||||
__complex__ double y;
|
CFLOAT y;
|
||||||
__complex__ double res;
|
CFLOAT res;
|
||||||
int rcls = fpclassify (__real__ x);
|
int rcls = fpclassify (__real__ x);
|
||||||
int icls = fpclassify (__imag__ x);
|
int icls = fpclassify (__imag__ x);
|
||||||
|
|
||||||
if (rcls <= FP_INFINITE || icls <= FP_INFINITE
|
if (rcls <= FP_INFINITE || icls <= FP_INFINITE
|
||||||
|| (rcls == FP_ZERO && icls == FP_ZERO))
|
|| (rcls == FP_ZERO && icls == FP_ZERO))
|
||||||
{
|
{
|
||||||
y = __casin (x);
|
y = M_SUF (__casin) (x);
|
||||||
|
|
||||||
__real__ res = (double) M_PI_2 - __real__ y;
|
__real__ res = (FLOAT) M_MLIT (M_PI_2) - __real__ y;
|
||||||
if (__real__ res == 0.0)
|
if (__real__ res == 0)
|
||||||
__real__ res = 0.0;
|
__real__ res = 0;
|
||||||
__imag__ res = -__imag__ y;
|
__imag__ res = -__imag__ y;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -43,7 +43,7 @@ __cacos (__complex__ double x)
|
|||||||
__real__ y = -__imag__ x;
|
__real__ y = -__imag__ x;
|
||||||
__imag__ y = __real__ x;
|
__imag__ y = __real__ x;
|
||||||
|
|
||||||
y = __kernel_casinh (y, 1);
|
y = M_SUF (__kernel_casinh) (y, 1);
|
||||||
|
|
||||||
__real__ res = __imag__ y;
|
__real__ res = __imag__ y;
|
||||||
__imag__ res = __real__ y;
|
__imag__ res = __real__ y;
|
||||||
@@ -51,8 +51,9 @@ __cacos (__complex__ double x)
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
weak_alias (__cacos, cacos)
|
|
||||||
#ifdef NO_LONG_DOUBLE
|
declare_mgen_alias (__cacos, cacos);
|
||||||
strong_alias (__cacos, __cacosl)
|
|
||||||
weak_alias (__cacos, cacosl)
|
#if M_LIBM_NEED_COMPAT (carg)
|
||||||
|
declare_mgen_libm_compat (__cacos, cacos)
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,56 +0,0 @@
|
|||||||
/* Return cosine of complex float value.
|
|
||||||
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with the GNU C Library; if not, see
|
|
||||||
<http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#include <complex.h>
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
__complex__ float
|
|
||||||
__cacosf (__complex__ float x)
|
|
||||||
{
|
|
||||||
__complex__ float y;
|
|
||||||
__complex__ float res;
|
|
||||||
int rcls = fpclassify (__real__ x);
|
|
||||||
int icls = fpclassify (__imag__ x);
|
|
||||||
|
|
||||||
if (rcls <= FP_INFINITE || icls <= FP_INFINITE
|
|
||||||
|| (rcls == FP_ZERO && icls == FP_ZERO))
|
|
||||||
{
|
|
||||||
y = __casinf (x);
|
|
||||||
|
|
||||||
__real__ res = (float) M_PI_2 - __real__ y;
|
|
||||||
if (__real__ res == 0.0f)
|
|
||||||
__real__ res = 0.0f;
|
|
||||||
__imag__ res = -__imag__ y;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__real__ y = -__imag__ x;
|
|
||||||
__imag__ y = __real__ x;
|
|
||||||
|
|
||||||
y = __kernel_casinhf (y, 1);
|
|
||||||
|
|
||||||
__real__ res = __imag__ y;
|
|
||||||
__imag__ res = __real__ y;
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
#ifndef __cacosf
|
|
||||||
weak_alias (__cacosf, cacosf)
|
|
||||||
#endif
|
|
@@ -1,94 +0,0 @@
|
|||||||
/* Return arc hyperbole cosine for double value.
|
|
||||||
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with the GNU C Library; if not, see
|
|
||||||
<http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#include <complex.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <math_private.h>
|
|
||||||
|
|
||||||
|
|
||||||
__complex__ double
|
|
||||||
__cacosh (__complex__ double x)
|
|
||||||
{
|
|
||||||
__complex__ double res;
|
|
||||||
int rcls = fpclassify (__real__ x);
|
|
||||||
int icls = fpclassify (__imag__ x);
|
|
||||||
|
|
||||||
if (rcls <= FP_INFINITE || icls <= FP_INFINITE)
|
|
||||||
{
|
|
||||||
if (icls == FP_INFINITE)
|
|
||||||
{
|
|
||||||
__real__ res = HUGE_VAL;
|
|
||||||
|
|
||||||
if (rcls == FP_NAN)
|
|
||||||
__imag__ res = __nan ("");
|
|
||||||
else
|
|
||||||
__imag__ res = __copysign ((rcls == FP_INFINITE
|
|
||||||
? (__real__ x < 0.0
|
|
||||||
? M_PI - M_PI_4 : M_PI_4)
|
|
||||||
: M_PI_2), __imag__ x);
|
|
||||||
}
|
|
||||||
else if (rcls == FP_INFINITE)
|
|
||||||
{
|
|
||||||
__real__ res = HUGE_VAL;
|
|
||||||
|
|
||||||
if (icls >= FP_ZERO)
|
|
||||||
__imag__ res = __copysign (signbit (__real__ x) ? M_PI : 0.0,
|
|
||||||
__imag__ x);
|
|
||||||
else
|
|
||||||
__imag__ res = __nan ("");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__real__ res = __nan ("");
|
|
||||||
__imag__ res = __nan ("");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (rcls == FP_ZERO && icls == FP_ZERO)
|
|
||||||
{
|
|
||||||
__real__ res = 0.0;
|
|
||||||
__imag__ res = __copysign (M_PI_2, __imag__ x);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__complex__ double y;
|
|
||||||
|
|
||||||
__real__ y = -__imag__ x;
|
|
||||||
__imag__ y = __real__ x;
|
|
||||||
|
|
||||||
y = __kernel_casinh (y, 1);
|
|
||||||
|
|
||||||
if (signbit (__imag__ x))
|
|
||||||
{
|
|
||||||
__real__ res = __real__ y;
|
|
||||||
__imag__ res = -__imag__ y;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__real__ res = -__real__ y;
|
|
||||||
__imag__ res = __imag__ y;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
weak_alias (__cacosh, cacosh)
|
|
||||||
#ifdef NO_LONG_DOUBLE
|
|
||||||
strong_alias (__cacosh, __cacoshl)
|
|
||||||
weak_alias (__cacosh, cacoshl)
|
|
||||||
#endif
|
|
@@ -1,4 +1,4 @@
|
|||||||
/* Return arc hyperbole cosine for double value.
|
/* Return arc hyperbolic cosine for a complex type.
|
||||||
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||||
@@ -22,10 +22,10 @@
|
|||||||
#include <math_private.h>
|
#include <math_private.h>
|
||||||
|
|
||||||
|
|
||||||
__complex__ double
|
CFLOAT
|
||||||
__cacosh (__complex__ double x)
|
M_DECL_FUNC (__cacosh) (CFLOAT x)
|
||||||
{
|
{
|
||||||
__complex__ double res;
|
CFLOAT res;
|
||||||
int rcls = fpclassify (__real__ x);
|
int rcls = fpclassify (__real__ x);
|
||||||
int icls = fpclassify (__imag__ x);
|
int icls = fpclassify (__imag__ x);
|
||||||
|
|
||||||
@@ -33,45 +33,46 @@ __cacosh (__complex__ double x)
|
|||||||
{
|
{
|
||||||
if (icls == FP_INFINITE)
|
if (icls == FP_INFINITE)
|
||||||
{
|
{
|
||||||
__real__ res = HUGE_VAL;
|
__real__ res = M_HUGE_VAL;
|
||||||
|
|
||||||
if (rcls == FP_NAN)
|
if (rcls == FP_NAN)
|
||||||
__imag__ res = __nan ("");
|
__imag__ res = M_NAN;
|
||||||
else
|
else
|
||||||
__imag__ res = __copysign ((rcls == FP_INFINITE
|
__imag__ res = M_COPYSIGN ((rcls == FP_INFINITE
|
||||||
? (__real__ x < 0.0
|
? (__real__ x < 0
|
||||||
? M_PI - M_PI_4 : M_PI_4)
|
? M_MLIT (M_PI) - M_MLIT (M_PI_4)
|
||||||
: M_PI_2), __imag__ x);
|
: M_MLIT (M_PI_4))
|
||||||
|
: M_MLIT (M_PI_2)), __imag__ x);
|
||||||
}
|
}
|
||||||
else if (rcls == FP_INFINITE)
|
else if (rcls == FP_INFINITE)
|
||||||
{
|
{
|
||||||
__real__ res = HUGE_VAL;
|
__real__ res = M_HUGE_VAL;
|
||||||
|
|
||||||
if (icls >= FP_ZERO)
|
if (icls >= FP_ZERO)
|
||||||
__imag__ res = __copysign (signbit (__real__ x) ? M_PI : 0.0,
|
__imag__ res = M_COPYSIGN (signbit (__real__ x)
|
||||||
__imag__ x);
|
? M_MLIT (M_PI) : 0, __imag__ x);
|
||||||
else
|
else
|
||||||
__imag__ res = __nan ("");
|
__imag__ res = M_NAN;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
__real__ res = __nan ("");
|
__real__ res = M_NAN;
|
||||||
__imag__ res = __nan ("");
|
__imag__ res = M_NAN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (rcls == FP_ZERO && icls == FP_ZERO)
|
else if (rcls == FP_ZERO && icls == FP_ZERO)
|
||||||
{
|
{
|
||||||
__real__ res = 0.0;
|
__real__ res = 0;
|
||||||
__imag__ res = __copysign (M_PI_2, __imag__ x);
|
__imag__ res = M_COPYSIGN (M_MLIT (M_PI_2), __imag__ x);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
__complex__ double y;
|
CFLOAT y;
|
||||||
|
|
||||||
__real__ y = -__imag__ x;
|
__real__ y = -__imag__ x;
|
||||||
__imag__ y = __real__ x;
|
__imag__ y = __real__ x;
|
||||||
|
|
||||||
y = __kernel_casinh (y, 1);
|
y = M_SUF (__kernel_casinh) (y, 1);
|
||||||
|
|
||||||
if (signbit (__imag__ x))
|
if (signbit (__imag__ x))
|
||||||
{
|
{
|
||||||
@@ -87,8 +88,9 @@ __cacosh (__complex__ double x)
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
weak_alias (__cacosh, cacosh)
|
|
||||||
#ifdef NO_LONG_DOUBLE
|
declare_mgen_alias (__cacosh, cacosh)
|
||||||
strong_alias (__cacosh, __cacoshl)
|
|
||||||
weak_alias (__cacosh, cacoshl)
|
#if M_LIBM_NEED_COMPAT (cacosh)
|
||||||
|
declare_mgen_libm_compat (__cacosh, cacosh)
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,92 +0,0 @@
|
|||||||
/* Return arc hyperbole cosine for float value.
|
|
||||||
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with the GNU C Library; if not, see
|
|
||||||
<http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#include <complex.h>
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#include <math_private.h>
|
|
||||||
|
|
||||||
__complex__ float
|
|
||||||
__cacoshf (__complex__ float x)
|
|
||||||
{
|
|
||||||
__complex__ float res;
|
|
||||||
int rcls = fpclassify (__real__ x);
|
|
||||||
int icls = fpclassify (__imag__ x);
|
|
||||||
|
|
||||||
if (rcls <= FP_INFINITE || icls <= FP_INFINITE)
|
|
||||||
{
|
|
||||||
if (icls == FP_INFINITE)
|
|
||||||
{
|
|
||||||
__real__ res = HUGE_VALF;
|
|
||||||
|
|
||||||
if (rcls == FP_NAN)
|
|
||||||
__imag__ res = __nanf ("");
|
|
||||||
else
|
|
||||||
__imag__ res = __copysignf ((rcls == FP_INFINITE
|
|
||||||
? (__real__ x < 0.0
|
|
||||||
? M_PI - M_PI_4 : M_PI_4)
|
|
||||||
: M_PI_2), __imag__ x);
|
|
||||||
}
|
|
||||||
else if (rcls == FP_INFINITE)
|
|
||||||
{
|
|
||||||
__real__ res = HUGE_VALF;
|
|
||||||
|
|
||||||
if (icls >= FP_ZERO)
|
|
||||||
__imag__ res = __copysignf (signbit (__real__ x) ? M_PI : 0.0,
|
|
||||||
__imag__ x);
|
|
||||||
else
|
|
||||||
__imag__ res = __nanf ("");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__real__ res = __nanf ("");
|
|
||||||
__imag__ res = __nanf ("");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (rcls == FP_ZERO && icls == FP_ZERO)
|
|
||||||
{
|
|
||||||
__real__ res = 0.0;
|
|
||||||
__imag__ res = __copysignf (M_PI_2, __imag__ x);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__complex__ float y;
|
|
||||||
|
|
||||||
__real__ y = -__imag__ x;
|
|
||||||
__imag__ y = __real__ x;
|
|
||||||
|
|
||||||
y = __kernel_casinhf (y, 1);
|
|
||||||
|
|
||||||
if (signbit (__imag__ x))
|
|
||||||
{
|
|
||||||
__real__ res = __real__ y;
|
|
||||||
__imag__ res = -__imag__ y;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__real__ res = -__real__ y;
|
|
||||||
__imag__ res = __imag__ y;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
#ifndef __cacoshf
|
|
||||||
weak_alias (__cacoshf, cacoshf)
|
|
||||||
#endif
|
|
@@ -1,90 +0,0 @@
|
|||||||
/* Return arc hyperbole cosine for long double value.
|
|
||||||
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with the GNU C Library; if not, see
|
|
||||||
<http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#include <complex.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <math_private.h>
|
|
||||||
|
|
||||||
|
|
||||||
__complex__ long double
|
|
||||||
__cacoshl (__complex__ long double x)
|
|
||||||
{
|
|
||||||
__complex__ long double res;
|
|
||||||
int rcls = fpclassify (__real__ x);
|
|
||||||
int icls = fpclassify (__imag__ x);
|
|
||||||
|
|
||||||
if (rcls <= FP_INFINITE || icls <= FP_INFINITE)
|
|
||||||
{
|
|
||||||
if (icls == FP_INFINITE)
|
|
||||||
{
|
|
||||||
__real__ res = HUGE_VALL;
|
|
||||||
|
|
||||||
if (rcls == FP_NAN)
|
|
||||||
__imag__ res = __nanl ("");
|
|
||||||
else
|
|
||||||
__imag__ res = __copysignl ((rcls == FP_INFINITE
|
|
||||||
? (__real__ x < 0.0
|
|
||||||
? M_PIl - M_PI_4l : M_PI_4l)
|
|
||||||
: M_PI_2l), __imag__ x);
|
|
||||||
}
|
|
||||||
else if (rcls == FP_INFINITE)
|
|
||||||
{
|
|
||||||
__real__ res = HUGE_VALL;
|
|
||||||
|
|
||||||
if (icls >= FP_ZERO)
|
|
||||||
__imag__ res = __copysignl (signbit (__real__ x) ? M_PIl : 0.0,
|
|
||||||
__imag__ x);
|
|
||||||
else
|
|
||||||
__imag__ res = __nanl ("");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__real__ res = __nanl ("");
|
|
||||||
__imag__ res = __nanl ("");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (rcls == FP_ZERO && icls == FP_ZERO)
|
|
||||||
{
|
|
||||||
__real__ res = 0.0;
|
|
||||||
__imag__ res = __copysignl (M_PI_2l, __imag__ x);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__complex__ long double y;
|
|
||||||
|
|
||||||
__real__ y = -__imag__ x;
|
|
||||||
__imag__ y = __real__ x;
|
|
||||||
|
|
||||||
y = __kernel_casinhl (y, 1);
|
|
||||||
|
|
||||||
if (signbit (__imag__ x))
|
|
||||||
{
|
|
||||||
__real__ res = __real__ y;
|
|
||||||
__imag__ res = -__imag__ y;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__real__ res = -__real__ y;
|
|
||||||
__imag__ res = __imag__ y;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
weak_alias (__cacoshl, cacoshl)
|
|
@@ -1,54 +0,0 @@
|
|||||||
/* Return cosine of complex long double value.
|
|
||||||
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with the GNU C Library; if not, see
|
|
||||||
<http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#include <complex.h>
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
__complex__ long double
|
|
||||||
__cacosl (__complex__ long double x)
|
|
||||||
{
|
|
||||||
__complex__ long double y;
|
|
||||||
__complex__ long double res;
|
|
||||||
int rcls = fpclassify (__real__ x);
|
|
||||||
int icls = fpclassify (__imag__ x);
|
|
||||||
|
|
||||||
if (rcls <= FP_INFINITE || icls <= FP_INFINITE
|
|
||||||
|| (rcls == FP_ZERO && icls == FP_ZERO))
|
|
||||||
{
|
|
||||||
y = __casinl (x);
|
|
||||||
|
|
||||||
__real__ res = M_PI_2l - __real__ y;
|
|
||||||
if (__real__ res == 0.0L)
|
|
||||||
__real__ res = 0.0L;
|
|
||||||
__imag__ res = -__imag__ y;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__real__ y = -__imag__ x;
|
|
||||||
__imag__ y = __real__ x;
|
|
||||||
|
|
||||||
y = __kernel_casinhl (y, 1);
|
|
||||||
|
|
||||||
__real__ res = __imag__ y;
|
|
||||||
__imag__ res = __real__ y;
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
weak_alias (__cacosl, cacosl)
|
|
@@ -1,40 +0,0 @@
|
|||||||
/* Return cosine of complex double value.
|
|
||||||
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with the GNU C Library; if not, see
|
|
||||||
<http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#include <complex.h>
|
|
||||||
#include <fenv.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <math_private.h>
|
|
||||||
|
|
||||||
|
|
||||||
__complex__ double
|
|
||||||
__ccos (__complex__ double x)
|
|
||||||
{
|
|
||||||
__complex__ double y;
|
|
||||||
|
|
||||||
__real__ y = -__imag__ x;
|
|
||||||
__imag__ y = __real__ x;
|
|
||||||
|
|
||||||
return __ccosh (y);
|
|
||||||
}
|
|
||||||
weak_alias (__ccos, ccos)
|
|
||||||
#ifdef NO_LONG_DOUBLE
|
|
||||||
strong_alias (__ccos, __ccosl)
|
|
||||||
weak_alias (__ccos, ccosl)
|
|
||||||
#endif
|
|
@@ -1,4 +1,4 @@
|
|||||||
/* Return cosine of complex double value.
|
/* Return cosine of complex float type.
|
||||||
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||||
@@ -22,19 +22,19 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <math_private.h>
|
#include <math_private.h>
|
||||||
|
|
||||||
|
CFLOAT
|
||||||
__complex__ double
|
M_DECL_FUNC (__ccos) (CFLOAT x)
|
||||||
__ccos (__complex__ double x)
|
|
||||||
{
|
{
|
||||||
__complex__ double y;
|
CFLOAT y;
|
||||||
|
|
||||||
__real__ y = -__imag__ x;
|
__real__ y = -__imag__ x;
|
||||||
__imag__ y = __real__ x;
|
__imag__ y = __real__ x;
|
||||||
|
|
||||||
return __ccosh (y);
|
return M_SUF (__ccosh) (y);
|
||||||
}
|
}
|
||||||
weak_alias (__ccos, ccos)
|
|
||||||
#ifdef NO_LONG_DOUBLE
|
declare_mgen_alias (__ccos, ccos);
|
||||||
strong_alias (__ccos, __ccosl)
|
|
||||||
weak_alias (__ccos, ccosl)
|
#if M_LIBM_NEED_COMPAT (carg)
|
||||||
|
declare_mgen_libm_compat (__ccos, ccos)
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,38 +0,0 @@
|
|||||||
/* Return cosine of complex float value.
|
|
||||||
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with the GNU C Library; if not, see
|
|
||||||
<http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#include <complex.h>
|
|
||||||
#include <fenv.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <math_private.h>
|
|
||||||
|
|
||||||
|
|
||||||
__complex__ float
|
|
||||||
__ccosf (__complex__ float x)
|
|
||||||
{
|
|
||||||
__complex__ float y;
|
|
||||||
|
|
||||||
__real__ y = -__imag__ x;
|
|
||||||
__imag__ y = __real__ x;
|
|
||||||
|
|
||||||
return __ccoshf (y);
|
|
||||||
}
|
|
||||||
#ifndef __ccosf
|
|
||||||
weak_alias (__ccosf, ccosf)
|
|
||||||
#endif
|
|
147
math/s_ccosh.c
147
math/s_ccosh.c
@@ -1,147 +0,0 @@
|
|||||||
/* Complex cosine hyperbole function for double.
|
|
||||||
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with the GNU C Library; if not, see
|
|
||||||
<http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#include <complex.h>
|
|
||||||
#include <fenv.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <math_private.h>
|
|
||||||
#include <float.h>
|
|
||||||
|
|
||||||
__complex__ double
|
|
||||||
__ccosh (__complex__ double x)
|
|
||||||
{
|
|
||||||
__complex__ double retval;
|
|
||||||
int rcls = fpclassify (__real__ x);
|
|
||||||
int icls = fpclassify (__imag__ x);
|
|
||||||
|
|
||||||
if (__glibc_likely (rcls >= FP_ZERO))
|
|
||||||
{
|
|
||||||
/* Real part is finite. */
|
|
||||||
if (__glibc_likely (icls >= FP_ZERO))
|
|
||||||
{
|
|
||||||
/* Imaginary part is finite. */
|
|
||||||
const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2);
|
|
||||||
double sinix, cosix;
|
|
||||||
|
|
||||||
if (__glibc_likely (fabs (__imag__ x) > DBL_MIN))
|
|
||||||
{
|
|
||||||
__sincos (__imag__ x, &sinix, &cosix);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sinix = __imag__ x;
|
|
||||||
cosix = 1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fabs (__real__ x) > t)
|
|
||||||
{
|
|
||||||
double exp_t = __ieee754_exp (t);
|
|
||||||
double rx = fabs (__real__ x);
|
|
||||||
if (signbit (__real__ x))
|
|
||||||
sinix = -sinix;
|
|
||||||
rx -= t;
|
|
||||||
sinix *= exp_t / 2.0;
|
|
||||||
cosix *= exp_t / 2.0;
|
|
||||||
if (rx > t)
|
|
||||||
{
|
|
||||||
rx -= t;
|
|
||||||
sinix *= exp_t;
|
|
||||||
cosix *= exp_t;
|
|
||||||
}
|
|
||||||
if (rx > t)
|
|
||||||
{
|
|
||||||
/* Overflow (original real part of x > 3t). */
|
|
||||||
__real__ retval = DBL_MAX * cosix;
|
|
||||||
__imag__ retval = DBL_MAX * sinix;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
double exp_val = __ieee754_exp (rx);
|
|
||||||
__real__ retval = exp_val * cosix;
|
|
||||||
__imag__ retval = exp_val * sinix;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__real__ retval = __ieee754_cosh (__real__ x) * cosix;
|
|
||||||
__imag__ retval = __ieee754_sinh (__real__ x) * sinix;
|
|
||||||
}
|
|
||||||
|
|
||||||
math_check_force_underflow_complex (retval);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__imag__ retval = __real__ x == 0.0 ? 0.0 : __nan ("");
|
|
||||||
__real__ retval = __nan ("") + __nan ("");
|
|
||||||
|
|
||||||
if (icls == FP_INFINITE)
|
|
||||||
feraiseexcept (FE_INVALID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (rcls == FP_INFINITE)
|
|
||||||
{
|
|
||||||
/* Real part is infinite. */
|
|
||||||
if (__glibc_likely (icls > FP_ZERO))
|
|
||||||
{
|
|
||||||
/* Imaginary part is finite. */
|
|
||||||
double sinix, cosix;
|
|
||||||
|
|
||||||
if (__glibc_likely (fabs (__imag__ x) > DBL_MIN))
|
|
||||||
{
|
|
||||||
__sincos (__imag__ x, &sinix, &cosix);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sinix = __imag__ x;
|
|
||||||
cosix = 1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
__real__ retval = __copysign (HUGE_VAL, cosix);
|
|
||||||
__imag__ retval = (__copysign (HUGE_VAL, sinix)
|
|
||||||
* __copysign (1.0, __real__ x));
|
|
||||||
}
|
|
||||||
else if (icls == FP_ZERO)
|
|
||||||
{
|
|
||||||
/* Imaginary part is 0.0. */
|
|
||||||
__real__ retval = HUGE_VAL;
|
|
||||||
__imag__ retval = __imag__ x * __copysign (1.0, __real__ x);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* The addition raises the invalid exception. */
|
|
||||||
__real__ retval = HUGE_VAL;
|
|
||||||
__imag__ retval = __nan ("") + __nan ("");
|
|
||||||
|
|
||||||
if (icls == FP_INFINITE)
|
|
||||||
feraiseexcept (FE_INVALID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__real__ retval = __nan ("");
|
|
||||||
__imag__ retval = __imag__ x == 0.0 ? __imag__ x : __nan ("");
|
|
||||||
}
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
weak_alias (__ccosh, ccosh)
|
|
||||||
#ifdef NO_LONG_DOUBLE
|
|
||||||
strong_alias (__ccosh, __ccoshl)
|
|
||||||
weak_alias (__ccosh, ccoshl)
|
|
||||||
#endif
|
|
@@ -1,4 +1,4 @@
|
|||||||
/* Complex cosine hyperbole function for double.
|
/* Complex cosine hyperbolic function for float types.
|
||||||
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||||
@@ -23,10 +23,10 @@
|
|||||||
#include <math_private.h>
|
#include <math_private.h>
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
|
|
||||||
__complex__ double
|
CFLOAT
|
||||||
__ccosh (__complex__ double x)
|
M_DECL_FUNC (__ccosh) (CFLOAT x)
|
||||||
{
|
{
|
||||||
__complex__ double retval;
|
CFLOAT retval;
|
||||||
int rcls = fpclassify (__real__ x);
|
int rcls = fpclassify (__real__ x);
|
||||||
int icls = fpclassify (__imag__ x);
|
int icls = fpclassify (__imag__ x);
|
||||||
|
|
||||||
@@ -36,28 +36,28 @@ __ccosh (__complex__ double x)
|
|||||||
if (__glibc_likely (icls >= FP_ZERO))
|
if (__glibc_likely (icls >= FP_ZERO))
|
||||||
{
|
{
|
||||||
/* Imaginary part is finite. */
|
/* Imaginary part is finite. */
|
||||||
const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2);
|
const int t = (int) ((M_MAX_EXP - 1) * M_MLIT (M_LN2));
|
||||||
double sinix, cosix;
|
FLOAT sinix, cosix;
|
||||||
|
|
||||||
if (__glibc_likely (fabs (__imag__ x) > DBL_MIN))
|
if (__glibc_likely (M_FABS (__imag__ x) > M_MIN))
|
||||||
{
|
{
|
||||||
__sincos (__imag__ x, &sinix, &cosix);
|
M_SINCOS (__imag__ x, &sinix, &cosix);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sinix = __imag__ x;
|
sinix = __imag__ x;
|
||||||
cosix = 1.0;
|
cosix = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fabs (__real__ x) > t)
|
if (M_FABS (__real__ x) > t)
|
||||||
{
|
{
|
||||||
double exp_t = __ieee754_exp (t);
|
FLOAT exp_t = M_EXP (t);
|
||||||
double rx = fabs (__real__ x);
|
FLOAT rx = M_FABS (__real__ x);
|
||||||
if (signbit (__real__ x))
|
if (signbit (__real__ x))
|
||||||
sinix = -sinix;
|
sinix = -sinix;
|
||||||
rx -= t;
|
rx -= t;
|
||||||
sinix *= exp_t / 2.0;
|
sinix *= exp_t / 2;
|
||||||
cosix *= exp_t / 2.0;
|
cosix *= exp_t / 2;
|
||||||
if (rx > t)
|
if (rx > t)
|
||||||
{
|
{
|
||||||
rx -= t;
|
rx -= t;
|
||||||
@@ -67,28 +67,28 @@ __ccosh (__complex__ double x)
|
|||||||
if (rx > t)
|
if (rx > t)
|
||||||
{
|
{
|
||||||
/* Overflow (original real part of x > 3t). */
|
/* Overflow (original real part of x > 3t). */
|
||||||
__real__ retval = DBL_MAX * cosix;
|
__real__ retval = M_MAX * cosix;
|
||||||
__imag__ retval = DBL_MAX * sinix;
|
__imag__ retval = M_MAX * sinix;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double exp_val = __ieee754_exp (rx);
|
FLOAT exp_val = M_EXP (rx);
|
||||||
__real__ retval = exp_val * cosix;
|
__real__ retval = exp_val * cosix;
|
||||||
__imag__ retval = exp_val * sinix;
|
__imag__ retval = exp_val * sinix;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
__real__ retval = __ieee754_cosh (__real__ x) * cosix;
|
__real__ retval = M_COSH (__real__ x) * cosix;
|
||||||
__imag__ retval = __ieee754_sinh (__real__ x) * sinix;
|
__imag__ retval = M_SINH (__real__ x) * sinix;
|
||||||
}
|
}
|
||||||
|
|
||||||
math_check_force_underflow_complex (retval);
|
math_check_force_underflow_complex (retval);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
__imag__ retval = __real__ x == 0.0 ? 0.0 : __nan ("");
|
__imag__ retval = __real__ x == 0 ? 0 : M_NAN;
|
||||||
__real__ retval = __nan ("") + __nan ("");
|
__real__ retval = M_NAN + M_NAN;
|
||||||
|
|
||||||
if (icls == FP_INFINITE)
|
if (icls == FP_INFINITE)
|
||||||
feraiseexcept (FE_INVALID);
|
feraiseexcept (FE_INVALID);
|
||||||
@@ -100,33 +100,33 @@ __ccosh (__complex__ double x)
|
|||||||
if (__glibc_likely (icls > FP_ZERO))
|
if (__glibc_likely (icls > FP_ZERO))
|
||||||
{
|
{
|
||||||
/* Imaginary part is finite. */
|
/* Imaginary part is finite. */
|
||||||
double sinix, cosix;
|
FLOAT sinix, cosix;
|
||||||
|
|
||||||
if (__glibc_likely (fabs (__imag__ x) > DBL_MIN))
|
if (__glibc_likely (M_FABS (__imag__ x) > M_MIN))
|
||||||
{
|
{
|
||||||
__sincos (__imag__ x, &sinix, &cosix);
|
M_SINCOS (__imag__ x, &sinix, &cosix);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sinix = __imag__ x;
|
sinix = __imag__ x;
|
||||||
cosix = 1.0;
|
cosix = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__real__ retval = __copysign (HUGE_VAL, cosix);
|
__real__ retval = M_COPYSIGN (M_HUGE_VAL, cosix);
|
||||||
__imag__ retval = (__copysign (HUGE_VAL, sinix)
|
__imag__ retval = (M_COPYSIGN (M_HUGE_VAL, sinix)
|
||||||
* __copysign (1.0, __real__ x));
|
* M_COPYSIGN (1, __real__ x));
|
||||||
}
|
}
|
||||||
else if (icls == FP_ZERO)
|
else if (icls == FP_ZERO)
|
||||||
{
|
{
|
||||||
/* Imaginary part is 0.0. */
|
/* Imaginary part is 0.0. */
|
||||||
__real__ retval = HUGE_VAL;
|
__real__ retval = M_HUGE_VAL;
|
||||||
__imag__ retval = __imag__ x * __copysign (1.0, __real__ x);
|
__imag__ retval = __imag__ x * M_COPYSIGN (1, __real__ x);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* The addition raises the invalid exception. */
|
/* The addition raises the invalid exception. */
|
||||||
__real__ retval = HUGE_VAL;
|
__real__ retval = M_HUGE_VAL;
|
||||||
__imag__ retval = __nan ("") + __nan ("");
|
__imag__ retval = M_NAN + M_NAN;
|
||||||
|
|
||||||
if (icls == FP_INFINITE)
|
if (icls == FP_INFINITE)
|
||||||
feraiseexcept (FE_INVALID);
|
feraiseexcept (FE_INVALID);
|
||||||
@@ -134,14 +134,15 @@ __ccosh (__complex__ double x)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
__real__ retval = __nan ("");
|
__real__ retval = M_NAN;
|
||||||
__imag__ retval = __imag__ x == 0.0 ? __imag__ x : __nan ("");
|
__imag__ retval = __imag__ x == 0 ? __imag__ x : M_NAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
weak_alias (__ccosh, ccosh)
|
|
||||||
#ifdef NO_LONG_DOUBLE
|
declare_mgen_alias (__ccosh, ccosh);
|
||||||
strong_alias (__ccosh, __ccoshl)
|
|
||||||
weak_alias (__ccosh, ccoshl)
|
#if M_LIBM_NEED_COMPAT (carg)
|
||||||
|
declare_mgen_libm_compat (__ccosh, ccosh)
|
||||||
#endif
|
#endif
|
||||||
|
145
math/s_ccoshf.c
145
math/s_ccoshf.c
@@ -1,145 +0,0 @@
|
|||||||
/* Complex cosine hyperbole function for float.
|
|
||||||
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with the GNU C Library; if not, see
|
|
||||||
<http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#include <complex.h>
|
|
||||||
#include <fenv.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <math_private.h>
|
|
||||||
#include <float.h>
|
|
||||||
|
|
||||||
__complex__ float
|
|
||||||
__ccoshf (__complex__ float x)
|
|
||||||
{
|
|
||||||
__complex__ float retval;
|
|
||||||
int rcls = fpclassify (__real__ x);
|
|
||||||
int icls = fpclassify (__imag__ x);
|
|
||||||
|
|
||||||
if (__glibc_likely (rcls >= FP_ZERO))
|
|
||||||
{
|
|
||||||
/* Real part is finite. */
|
|
||||||
if (__glibc_likely (icls >= FP_ZERO))
|
|
||||||
{
|
|
||||||
/* Imaginary part is finite. */
|
|
||||||
const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2);
|
|
||||||
float sinix, cosix;
|
|
||||||
|
|
||||||
if (__glibc_likely (fabsf (__imag__ x) > FLT_MIN))
|
|
||||||
{
|
|
||||||
__sincosf (__imag__ x, &sinix, &cosix);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sinix = __imag__ x;
|
|
||||||
cosix = 1.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fabsf (__real__ x) > t)
|
|
||||||
{
|
|
||||||
float exp_t = __ieee754_expf (t);
|
|
||||||
float rx = fabsf (__real__ x);
|
|
||||||
if (signbit (__real__ x))
|
|
||||||
sinix = -sinix;
|
|
||||||
rx -= t;
|
|
||||||
sinix *= exp_t / 2.0f;
|
|
||||||
cosix *= exp_t / 2.0f;
|
|
||||||
if (rx > t)
|
|
||||||
{
|
|
||||||
rx -= t;
|
|
||||||
sinix *= exp_t;
|
|
||||||
cosix *= exp_t;
|
|
||||||
}
|
|
||||||
if (rx > t)
|
|
||||||
{
|
|
||||||
/* Overflow (original real part of x > 3t). */
|
|
||||||
__real__ retval = FLT_MAX * cosix;
|
|
||||||
__imag__ retval = FLT_MAX * sinix;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
float exp_val = __ieee754_expf (rx);
|
|
||||||
__real__ retval = exp_val * cosix;
|
|
||||||
__imag__ retval = exp_val * sinix;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__real__ retval = __ieee754_coshf (__real__ x) * cosix;
|
|
||||||
__imag__ retval = __ieee754_sinhf (__real__ x) * sinix;
|
|
||||||
}
|
|
||||||
|
|
||||||
math_check_force_underflow_complex (retval);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__imag__ retval = __real__ x == 0.0 ? 0.0 : __nanf ("");
|
|
||||||
__real__ retval = __nanf ("");
|
|
||||||
|
|
||||||
if (icls == FP_INFINITE)
|
|
||||||
feraiseexcept (FE_INVALID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (rcls == FP_INFINITE)
|
|
||||||
{
|
|
||||||
/* Real part is infinite. */
|
|
||||||
if (__glibc_likely (icls > FP_ZERO))
|
|
||||||
{
|
|
||||||
/* Imaginary part is finite. */
|
|
||||||
float sinix, cosix;
|
|
||||||
|
|
||||||
if (__glibc_likely (fabsf (__imag__ x) > FLT_MIN))
|
|
||||||
{
|
|
||||||
__sincosf (__imag__ x, &sinix, &cosix);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sinix = __imag__ x;
|
|
||||||
cosix = 1.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
__real__ retval = __copysignf (HUGE_VALF, cosix);
|
|
||||||
__imag__ retval = (__copysignf (HUGE_VALF, sinix)
|
|
||||||
* __copysignf (1.0, __real__ x));
|
|
||||||
}
|
|
||||||
else if (icls == FP_ZERO)
|
|
||||||
{
|
|
||||||
/* Imaginary part is 0.0. */
|
|
||||||
__real__ retval = HUGE_VALF;
|
|
||||||
__imag__ retval = __imag__ x * __copysignf (1.0, __real__ x);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* The addition raises the invalid exception. */
|
|
||||||
__real__ retval = HUGE_VALF;
|
|
||||||
__imag__ retval = __nanf ("") + __nanf ("");
|
|
||||||
|
|
||||||
if (icls == FP_INFINITE)
|
|
||||||
feraiseexcept (FE_INVALID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__real__ retval = __nanf ("");
|
|
||||||
__imag__ retval = __imag__ x == 0.0 ? __imag__ x : __nanf ("");
|
|
||||||
}
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
#ifndef __ccoshf
|
|
||||||
weak_alias (__ccoshf, ccoshf)
|
|
||||||
#endif
|
|
143
math/s_ccoshl.c
143
math/s_ccoshl.c
@@ -1,143 +0,0 @@
|
|||||||
/* Complex cosine hyperbole function for long double.
|
|
||||||
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with the GNU C Library; if not, see
|
|
||||||
<http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#include <complex.h>
|
|
||||||
#include <fenv.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <math_private.h>
|
|
||||||
#include <float.h>
|
|
||||||
|
|
||||||
__complex__ long double
|
|
||||||
__ccoshl (__complex__ long double x)
|
|
||||||
{
|
|
||||||
__complex__ long double retval;
|
|
||||||
int rcls = fpclassify (__real__ x);
|
|
||||||
int icls = fpclassify (__imag__ x);
|
|
||||||
|
|
||||||
if (__glibc_likely (rcls >= FP_ZERO))
|
|
||||||
{
|
|
||||||
/* Real part is finite. */
|
|
||||||
if (__glibc_likely (icls >= FP_ZERO))
|
|
||||||
{
|
|
||||||
/* Imaginary part is finite. */
|
|
||||||
const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l);
|
|
||||||
long double sinix, cosix;
|
|
||||||
|
|
||||||
if (__glibc_likely (fabsl (__imag__ x) > LDBL_MIN))
|
|
||||||
{
|
|
||||||
__sincosl (__imag__ x, &sinix, &cosix);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sinix = __imag__ x;
|
|
||||||
cosix = 1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fabsl (__real__ x) > t)
|
|
||||||
{
|
|
||||||
long double exp_t = __ieee754_expl (t);
|
|
||||||
long double rx = fabsl (__real__ x);
|
|
||||||
if (signbit (__real__ x))
|
|
||||||
sinix = -sinix;
|
|
||||||
rx -= t;
|
|
||||||
sinix *= exp_t / 2.0L;
|
|
||||||
cosix *= exp_t / 2.0L;
|
|
||||||
if (rx > t)
|
|
||||||
{
|
|
||||||
rx -= t;
|
|
||||||
sinix *= exp_t;
|
|
||||||
cosix *= exp_t;
|
|
||||||
}
|
|
||||||
if (rx > t)
|
|
||||||
{
|
|
||||||
/* Overflow (original real part of x > 3t). */
|
|
||||||
__real__ retval = LDBL_MAX * cosix;
|
|
||||||
__imag__ retval = LDBL_MAX * sinix;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
long double exp_val = __ieee754_expl (rx);
|
|
||||||
__real__ retval = exp_val * cosix;
|
|
||||||
__imag__ retval = exp_val * sinix;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__real__ retval = __ieee754_coshl (__real__ x) * cosix;
|
|
||||||
__imag__ retval = __ieee754_sinhl (__real__ x) * sinix;
|
|
||||||
}
|
|
||||||
|
|
||||||
math_check_force_underflow_complex (retval);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__imag__ retval = __real__ x == 0.0 ? 0.0 : __nanl ("");
|
|
||||||
__real__ retval = __nanl ("") + __nanl ("");
|
|
||||||
|
|
||||||
if (icls == FP_INFINITE)
|
|
||||||
feraiseexcept (FE_INVALID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (rcls == FP_INFINITE)
|
|
||||||
{
|
|
||||||
/* Real part is infinite. */
|
|
||||||
if (__glibc_likely (icls > FP_ZERO))
|
|
||||||
{
|
|
||||||
/* Imaginary part is finite. */
|
|
||||||
long double sinix, cosix;
|
|
||||||
|
|
||||||
if (__glibc_likely (fabsl (__imag__ x) > LDBL_MIN))
|
|
||||||
{
|
|
||||||
__sincosl (__imag__ x, &sinix, &cosix);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sinix = __imag__ x;
|
|
||||||
cosix = 1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
__real__ retval = __copysignl (HUGE_VALL, cosix);
|
|
||||||
__imag__ retval = (__copysignl (HUGE_VALL, sinix)
|
|
||||||
* __copysignl (1.0, __real__ x));
|
|
||||||
}
|
|
||||||
else if (icls == FP_ZERO)
|
|
||||||
{
|
|
||||||
/* Imaginary part is 0.0. */
|
|
||||||
__real__ retval = HUGE_VALL;
|
|
||||||
__imag__ retval = __imag__ x * __copysignl (1.0, __real__ x);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* The addition raises the invalid exception. */
|
|
||||||
__real__ retval = HUGE_VALL;
|
|
||||||
__imag__ retval = __nanl ("") + __nanl ("");
|
|
||||||
|
|
||||||
if (icls == FP_INFINITE)
|
|
||||||
feraiseexcept (FE_INVALID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
__real__ retval = __nanl ("");
|
|
||||||
__imag__ retval = __imag__ x == 0.0 ? __imag__ x : __nanl ("");
|
|
||||||
}
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
weak_alias (__ccoshl, ccoshl)
|
|
@@ -1,36 +0,0 @@
|
|||||||
/* Return cosine of complex long double value.
|
|
||||||
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with the GNU C Library; if not, see
|
|
||||||
<http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#include <complex.h>
|
|
||||||
#include <fenv.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <math_private.h>
|
|
||||||
|
|
||||||
|
|
||||||
__complex__ long double
|
|
||||||
__ccosl (__complex__ long double x)
|
|
||||||
{
|
|
||||||
__complex__ long double y;
|
|
||||||
|
|
||||||
__real__ y = -__imag__ x;
|
|
||||||
__imag__ y = __real__ x;
|
|
||||||
|
|
||||||
return __ccoshl (y);
|
|
||||||
}
|
|
||||||
weak_alias (__ccosl, ccosl)
|
|
@@ -24,11 +24,18 @@
|
|||||||
|
|
||||||
#undef __cacosf
|
#undef __cacosf
|
||||||
#undef cacosf
|
#undef cacosf
|
||||||
#define __cacosf internal_cacosf
|
|
||||||
|
|
||||||
static _Complex float internal_cacosf (_Complex float x);
|
static _Complex float internal_cacosf (_Complex float x);
|
||||||
|
|
||||||
#include <math/s_cacosf.c>
|
#define M_DECL_FUNC(f) internal_cacosf
|
||||||
|
#include <math-type-macros-float.h>
|
||||||
|
|
||||||
|
/* Disable any aliasing from base template. */
|
||||||
|
#undef declare_mgen_alias
|
||||||
|
#define declare_mgen_alias(__to, __from)
|
||||||
|
|
||||||
|
#include <math/s_cacos_template.c>
|
||||||
|
|
||||||
#include "cfloat-compat.h"
|
#include "cfloat-compat.h"
|
||||||
|
|
||||||
#undef __cacosf
|
#undef __cacosf
|
||||||
|
@@ -24,11 +24,17 @@
|
|||||||
|
|
||||||
#undef __cacoshf
|
#undef __cacoshf
|
||||||
#undef cacoshf
|
#undef cacoshf
|
||||||
#define __cacoshf internal_cacoshf
|
|
||||||
|
|
||||||
static _Complex float internal_cacoshf (_Complex float x);
|
static _Complex float internal_cacoshf (_Complex float x);
|
||||||
|
|
||||||
#include <math/s_cacoshf.c>
|
#define M_DECL_FUNC(f) internal_cacoshf
|
||||||
|
#include <math-type-macros-float.h>
|
||||||
|
|
||||||
|
/* Disable any aliasing from base template. */
|
||||||
|
#undef declare_mgen_alias
|
||||||
|
#define declare_mgen_alias(__to, __from)
|
||||||
|
|
||||||
|
#include <math/s_cacosh_template.c>
|
||||||
#include "cfloat-compat.h"
|
#include "cfloat-compat.h"
|
||||||
|
|
||||||
#undef __cacoshf
|
#undef __cacoshf
|
||||||
|
@@ -24,14 +24,18 @@
|
|||||||
|
|
||||||
#undef __ccosf
|
#undef __ccosf
|
||||||
#undef ccosf
|
#undef ccosf
|
||||||
#define __ccosf internal_ccosf
|
|
||||||
|
|
||||||
static _Complex float internal_ccosf (_Complex float x);
|
static _Complex float internal_ccosf (_Complex float x);
|
||||||
|
|
||||||
#include <math/s_ccosf.c>
|
#define M_DECL_FUNC(f) internal_ccosf
|
||||||
#include "cfloat-compat.h"
|
#include <math-type-macros-float.h>
|
||||||
|
|
||||||
#undef __ccosf
|
/* Disable any aliasing from base template. */
|
||||||
|
#undef declare_mgen_alias
|
||||||
|
#define declare_mgen_alias(__to, __from)
|
||||||
|
|
||||||
|
#include <math/s_ccos_template.c>
|
||||||
|
#include "cfloat-compat.h"
|
||||||
|
|
||||||
c1_cfloat_rettype
|
c1_cfloat_rettype
|
||||||
__c1_ccosf (c1_cfloat_decl (x))
|
__c1_ccosf (c1_cfloat_decl (x))
|
||||||
|
@@ -24,14 +24,18 @@
|
|||||||
|
|
||||||
#undef __ccoshf
|
#undef __ccoshf
|
||||||
#undef ccoshf
|
#undef ccoshf
|
||||||
#define __ccoshf internal_ccoshf
|
|
||||||
|
|
||||||
static _Complex float internal_ccoshf (_Complex float x);
|
static _Complex float internal_ccoshf (_Complex float x);
|
||||||
|
|
||||||
#include <math/s_ccoshf.c>
|
#define M_DECL_FUNC(f) internal_ccoshf
|
||||||
#include "cfloat-compat.h"
|
#include <math-type-macros-float.h>
|
||||||
|
|
||||||
#undef __ccoshf
|
/* Disable any aliasing from base template. */
|
||||||
|
#undef declare_mgen_alias
|
||||||
|
#define declare_mgen_alias(__to, __from)
|
||||||
|
|
||||||
|
#include <math/s_ccosh_template.c>
|
||||||
|
#include "cfloat-compat.h"
|
||||||
|
|
||||||
c1_cfloat_rettype
|
c1_cfloat_rettype
|
||||||
__c1_ccoshf (c1_cfloat_decl (x))
|
__c1_ccoshf (c1_cfloat_decl (x))
|
||||||
|
@@ -1,6 +0,0 @@
|
|||||||
#include <complex.h>
|
|
||||||
#include <math_ldbl_opt.h>
|
|
||||||
#include <math/s_cacos.c>
|
|
||||||
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
|
|
||||||
compat_symbol (libm, __cacos, cacosl, GLIBC_2_1);
|
|
||||||
#endif
|
|
@@ -1,6 +0,0 @@
|
|||||||
#include <complex.h>
|
|
||||||
#include <math_ldbl_opt.h>
|
|
||||||
#include <math/s_cacosh.c>
|
|
||||||
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
|
|
||||||
compat_symbol (libm, __cacosh, cacoshl, GLIBC_2_1);
|
|
||||||
#endif
|
|
@@ -1,6 +0,0 @@
|
|||||||
#include <complex.h>
|
|
||||||
#include <math_ldbl_opt.h>
|
|
||||||
#undef weak_alias
|
|
||||||
#define weak_alias(n,a)
|
|
||||||
#include <math/s_cacoshl.c>
|
|
||||||
long_double_symbol (libm, __cacoshl, cacoshl);
|
|
@@ -1,6 +0,0 @@
|
|||||||
#include <complex.h>
|
|
||||||
#include <math_ldbl_opt.h>
|
|
||||||
#undef weak_alias
|
|
||||||
#define weak_alias(n,a)
|
|
||||||
#include <math/s_cacosl.c>
|
|
||||||
long_double_symbol (libm, __cacosl, cacosl);
|
|
@@ -1,6 +0,0 @@
|
|||||||
#include <complex.h>
|
|
||||||
#include <math_ldbl_opt.h>
|
|
||||||
#include <math/s_ccos.c>
|
|
||||||
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
|
|
||||||
compat_symbol (libm, __ccos, ccosl, GLIBC_2_1);
|
|
||||||
#endif
|
|
@@ -1,6 +0,0 @@
|
|||||||
#include <complex.h>
|
|
||||||
#include <math_ldbl_opt.h>
|
|
||||||
#include <math/s_ccosh.c>
|
|
||||||
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
|
|
||||||
compat_symbol (libm, __ccosh, ccoshl, GLIBC_2_1);
|
|
||||||
#endif
|
|
@@ -1,6 +0,0 @@
|
|||||||
#include <complex.h>
|
|
||||||
#include <math_ldbl_opt.h>
|
|
||||||
#undef weak_alias
|
|
||||||
#define weak_alias(n,a)
|
|
||||||
#include <math/s_ccoshl.c>
|
|
||||||
long_double_symbol (libm, __ccoshl, ccoshl);
|
|
@@ -1,6 +0,0 @@
|
|||||||
#include <complex.h>
|
|
||||||
#include <math_ldbl_opt.h>
|
|
||||||
#undef weak_alias
|
|
||||||
#define weak_alias(n,a)
|
|
||||||
#include <math/s_ccosl.c>
|
|
||||||
long_double_symbol (libm, __ccosl, ccosl);
|
|
@@ -21,27 +21,19 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "mathimpl.h"
|
#include "mathimpl.h"
|
||||||
|
|
||||||
#ifndef SUFF
|
#define s(name) M_SUF (name)
|
||||||
#define SUFF
|
|
||||||
#endif
|
|
||||||
#ifndef float_type
|
|
||||||
#define float_type double
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CONCATX(a,b) __CONCAT(a,b)
|
|
||||||
#define s(name) CONCATX(name,SUFF)
|
|
||||||
#define m81(func) __m81_u(s(func))
|
#define m81(func) __m81_u(s(func))
|
||||||
|
|
||||||
__complex__ float_type
|
CFLOAT
|
||||||
s(__ccosh) (__complex__ float_type x)
|
s(__ccosh) (CFLOAT x)
|
||||||
{
|
{
|
||||||
__complex__ float_type retval;
|
CFLOAT retval;
|
||||||
unsigned long ix_cond = __m81_test (__imag__ x);
|
unsigned long ix_cond = __m81_test (__imag__ x);
|
||||||
|
|
||||||
if ((ix_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0)
|
if ((ix_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0)
|
||||||
{
|
{
|
||||||
/* Imaginary part is finite. */
|
/* Imaginary part is finite. */
|
||||||
float_type sin_ix, cos_ix;
|
FLOAT sin_ix, cos_ix;
|
||||||
|
|
||||||
__asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix)
|
__asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix)
|
||||||
: "f" (__imag__ x));
|
: "f" (__imag__ x));
|
@@ -1,3 +0,0 @@
|
|||||||
#define SUFF f
|
|
||||||
#define float_type float
|
|
||||||
#include <s_ccosh.c>
|
|
@@ -1,3 +0,0 @@
|
|||||||
#define SUFF l
|
|
||||||
#define float_type long double
|
|
||||||
#include <s_ccosh.c>
|
|
Reference in New Issue
Block a user