newlib: libm: skip "long double" complex functions if long double != double
The rest of "long double" functions aren't compiled with long double and double are not the same. Do the same for all complex functions. Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
This commit is contained in:
parent
10b9216811
commit
1ed1516136
|
@ -7,12 +7,11 @@
|
||||||
#include <complex.h>
|
#include <complex.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
/* On platforms where long double is as wide as double. */
|
||||||
|
#ifdef _LDBL_EQ_DBL
|
||||||
long double
|
long double
|
||||||
cargl(long double complex z)
|
cargl(long double complex z)
|
||||||
{
|
{
|
||||||
#ifdef _LDBL_EQ_DBL
|
|
||||||
return carg (z);
|
return carg (z);
|
||||||
#else
|
|
||||||
return atan2l (cimagl (z), creall (z));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "cephes_subrl.h"
|
#include "cephes_subrl.h"
|
||||||
|
|
||||||
|
/* On platforms where long double is as wide as double. */
|
||||||
|
#ifdef _LDBL_EQ_DBL
|
||||||
#ifdef __weak_alias
|
#ifdef __weak_alias
|
||||||
__weak_alias(catanl, _catanl)
|
__weak_alias(catanl, _catanl)
|
||||||
#endif
|
#endif
|
||||||
|
@ -72,4 +74,4 @@ ovrf:
|
||||||
w = HUGE_VALL + HUGE_VALL * I;
|
w = HUGE_VALL + HUGE_VALL * I;
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
#include <complex.h>
|
#include <complex.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
/* On platforms where long double is as wide as double. */
|
||||||
|
#ifdef _LDBL_EQ_DBL
|
||||||
long double complex
|
long double complex
|
||||||
ccoshl(long double complex z)
|
ccoshl(long double complex z)
|
||||||
{
|
{
|
||||||
|
@ -43,3 +45,4 @@ ccoshl(long double complex z)
|
||||||
w = coshl(x) * cosl(y) + (sinhl(x) * sinl(y)) * I;
|
w = coshl(x) * cosl(y) + (sinhl(x) * sinl(y)) * I;
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "cephes_subrl.h"
|
#include "cephes_subrl.h"
|
||||||
|
|
||||||
|
/* On platforms where long double is as wide as double. */
|
||||||
|
#ifdef _LDBL_EQ_DBL
|
||||||
long double complex
|
long double complex
|
||||||
ccosl(long double complex z)
|
ccosl(long double complex z)
|
||||||
{
|
{
|
||||||
|
@ -43,3 +45,4 @@ ccosl(long double complex z)
|
||||||
w = cosl(creall(z)) * ch - (sinl(creall(z)) * sh) * I;
|
w = cosl(creall(z)) * ch - (sinl(creall(z)) * sh) * I;
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
|
|
||||||
/* calculate cosh and sinh */
|
/* calculate cosh and sinh */
|
||||||
|
|
||||||
|
/* On platforms where long double is as wide as double. */
|
||||||
|
#ifdef _LDBL_EQ_DBL
|
||||||
void
|
void
|
||||||
_cchshl(long double x, long double *c, long double *s)
|
_cchshl(long double x, long double *c, long double *s)
|
||||||
{
|
{
|
||||||
|
@ -51,6 +53,7 @@ _cchshl(long double x, long double *c, long double *s)
|
||||||
*c = e + ei;
|
*c = e + ei;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Program to subtract nearest integer multiple of PI */
|
/* Program to subtract nearest integer multiple of PI */
|
||||||
|
|
||||||
|
@ -85,6 +88,8 @@ _redupil(long double x)
|
||||||
|
|
||||||
/* Taylor series expansion for cosh(2y) - cos(2x) */
|
/* Taylor series expansion for cosh(2y) - cos(2x) */
|
||||||
|
|
||||||
|
/* On platforms where long double is as wide as double. */
|
||||||
|
#ifdef _LDBL_EQ_DBL
|
||||||
long double
|
long double
|
||||||
_ctansl(long double complex z)
|
_ctansl(long double complex z)
|
||||||
{
|
{
|
||||||
|
@ -126,3 +131,4 @@ _ctansl(long double complex z)
|
||||||
} while (fabsl(t/d) > MACHEPL);
|
} while (fabsl(t/d) > MACHEPL);
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
#include <complex.h>
|
#include <complex.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
/* On platforms where long double is as wide as double. */
|
||||||
|
#ifdef _LDBL_EQ_DBL
|
||||||
long double complex
|
long double complex
|
||||||
cexpl(long double complex z)
|
cexpl(long double complex z)
|
||||||
{
|
{
|
||||||
|
@ -44,3 +46,4 @@ cexpl(long double complex z)
|
||||||
w = r * cosl(y) + r * sinl(y) * I;
|
w = r * cosl(y) + r * sinl(y) * I;
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
#include <complex.h>
|
#include <complex.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
/* On platforms where long double is as wide as double. */
|
||||||
|
#ifdef _LDBL_EQ_DBL
|
||||||
long double complex
|
long double complex
|
||||||
clogl(long double complex z)
|
clogl(long double complex z)
|
||||||
{
|
{
|
||||||
|
@ -44,3 +46,4 @@ clogl(long double complex z)
|
||||||
w = p + rr * I;
|
w = p + rr * I;
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
#include <complex.h>
|
#include <complex.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
/* On platforms where long double is as wide as double. */
|
||||||
|
#ifdef _LDBL_EQ_DBL
|
||||||
long double complex
|
long double complex
|
||||||
cpowl(long double complex a, long double complex z)
|
cpowl(long double complex a, long double complex z)
|
||||||
{
|
{
|
||||||
|
@ -54,3 +56,4 @@ cpowl(long double complex a, long double complex z)
|
||||||
w = r * cosl(theta) + (r * sinl(theta)) * I;
|
w = r * cosl(theta) + (r * sinl(theta)) * I;
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -45,6 +45,9 @@ __RCSID("$NetBSD: cprojl.c,v 1.7 2014/10/10 00:48:18 christos Exp $");
|
||||||
*
|
*
|
||||||
* INFINITY + I * copysign(0.0, cimag(z))
|
* INFINITY + I * copysign(0.0, cimag(z))
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* On platforms where long double is as wide as double. */
|
||||||
|
#ifdef _LDBL_EQ_DBL
|
||||||
long double complex
|
long double complex
|
||||||
cprojl(long double complex z)
|
cprojl(long double complex z)
|
||||||
{
|
{
|
||||||
|
@ -62,3 +65,4 @@ cprojl(long double complex z)
|
||||||
|
|
||||||
return (w.z);
|
return (w.z);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
#include <complex.h>
|
#include <complex.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
/* On platforms where long double is as wide as double. */
|
||||||
|
#ifdef _LDBL_EQ_DBL
|
||||||
long double complex
|
long double complex
|
||||||
csinhl(long double complex z)
|
csinhl(long double complex z)
|
||||||
{
|
{
|
||||||
|
@ -43,3 +45,4 @@ csinhl(long double complex z)
|
||||||
w = sinhl(x) * cosl(y) + (coshl(x) * sinl(y)) * I;
|
w = sinhl(x) * cosl(y) + (coshl(x) * sinl(y)) * I;
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "cephes_subrl.h"
|
#include "cephes_subrl.h"
|
||||||
|
|
||||||
|
/* On platforms where long double is as wide as double. */
|
||||||
|
#ifdef _LDBL_EQ_DBL
|
||||||
long double complex
|
long double complex
|
||||||
csinl(long double complex z)
|
csinl(long double complex z)
|
||||||
{
|
{
|
||||||
|
@ -43,3 +45,4 @@ csinl(long double complex z)
|
||||||
w = sinl(creall(z)) * ch + (cosl(creall(z)) * sh) * I;
|
w = sinl(creall(z)) * ch + (cosl(creall(z)) * sh) * I;
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -49,6 +49,8 @@ __RCSID("$NetBSD: csqrtl.c,v 1.2 2014/10/11 00:43:51 christos Exp $");
|
||||||
|
|
||||||
#define cpackl(r, i) ((r) + (i) * I)
|
#define cpackl(r, i) ((r) + (i) * I)
|
||||||
|
|
||||||
|
/* On platforms where long double is as wide as double. */
|
||||||
|
#ifdef _LDBL_EQ_DBL
|
||||||
long double complex
|
long double complex
|
||||||
csqrtl(long double complex z)
|
csqrtl(long double complex z)
|
||||||
{
|
{
|
||||||
|
@ -110,3 +112,4 @@ csqrtl(long double complex z)
|
||||||
else
|
else
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
#include <complex.h>
|
#include <complex.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
/* On platforms where long double is as wide as double. */
|
||||||
|
#ifdef _LDBL_EQ_DBL
|
||||||
long double complex
|
long double complex
|
||||||
ctanhl(long double complex z)
|
ctanhl(long double complex z)
|
||||||
{
|
{
|
||||||
|
@ -45,3 +47,4 @@ ctanhl(long double complex z)
|
||||||
|
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -34,6 +34,8 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "cephes_subrl.h"
|
#include "cephes_subrl.h"
|
||||||
|
|
||||||
|
/* On platforms where long double is as wide as double. */
|
||||||
|
#ifdef _LDBL_EQ_DBL
|
||||||
long double complex
|
long double complex
|
||||||
ctanl(long double complex z)
|
ctanl(long double complex z)
|
||||||
{
|
{
|
||||||
|
@ -54,3 +56,4 @@ ctanl(long double complex z)
|
||||||
w = sinl(2.0L * creall(z)) / d + (sinhl(2.0L * cimagl(z)) / d) * I;
|
w = sinl(2.0L * creall(z)) / d + (sinhl(2.0L * cimagl(z)) / d) * I;
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue