|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from libc.math cimport ( |
|
|
NAN, |
|
|
INFINITY, |
|
|
|
|
|
isinf, |
|
|
isfinite, |
|
|
isnan, |
|
|
signbit, |
|
|
|
|
|
M_E as E, |
|
|
M_LOG2E as LOG2E, |
|
|
M_LOG10E as LOG10E, |
|
|
M_PI as PI, |
|
|
M_PI_2 as PI_2, |
|
|
M_PI_4 as PI_4, |
|
|
M_1_PI as NPY_1_PI, |
|
|
M_2_PI as NPY_2_PI, |
|
|
M_LN2 as LOGE2, |
|
|
M_LN10 as LOGE10, |
|
|
|
|
|
copysignf, |
|
|
nextafterf, |
|
|
copysign, |
|
|
nextafter, |
|
|
copysignl, |
|
|
nextafterl, |
|
|
|
|
|
sinf, |
|
|
cosf, |
|
|
tanf, |
|
|
sinhf, |
|
|
coshf, |
|
|
tanhf, |
|
|
fabsf, |
|
|
floorf, |
|
|
ceilf, |
|
|
rintf, |
|
|
sqrtf, |
|
|
log10f, |
|
|
logf, |
|
|
expf, |
|
|
expm1f, |
|
|
asinf, |
|
|
acosf, |
|
|
atanf, |
|
|
asinhf, |
|
|
acoshf, |
|
|
atanhf, |
|
|
log1pf, |
|
|
exp2f, |
|
|
log2f, |
|
|
atan2f, |
|
|
hypotf, |
|
|
powf, |
|
|
fmodf, |
|
|
modff, |
|
|
|
|
|
sinl, |
|
|
cosl, |
|
|
tanl, |
|
|
sinhl, |
|
|
coshl, |
|
|
tanhl, |
|
|
fabsl, |
|
|
floorl, |
|
|
ceill, |
|
|
rintl, |
|
|
sqrtl, |
|
|
log10l, |
|
|
logl, |
|
|
expl, |
|
|
expm1l, |
|
|
asinl, |
|
|
acosl, |
|
|
atanl, |
|
|
asinhl, |
|
|
acoshl, |
|
|
atanhl, |
|
|
log1pl, |
|
|
exp2l, |
|
|
log2l, |
|
|
atan2l, |
|
|
hypotl, |
|
|
powl, |
|
|
fmodl, |
|
|
modfl, |
|
|
) |
|
|
|
|
|
|
|
|
cdef extern from "numpy/npy_math.h" nogil: |
|
|
""" |
|
|
#ifdef _MSC_VER |
|
|
#pragma message ("The 'numpy.math' import is outdated and deprecated. Use the standard 'libc.math' instead.") |
|
|
#else |
|
|
#warning The 'numpy.math' import is outdated and deprecated. Use the standard 'libc.math' instead. |
|
|
#endif |
|
|
""" |
|
|
|
|
|
|
|
|
long double PZERO "NPY_PZERO" |
|
|
long double NZERO "NPY_NZERO" |
|
|
|
|
|
|
|
|
long double EULER "NPY_EULER" |
|
|
|
|
|
|
|
|
float spacingf "npy_spacingf"(float x) |
|
|
double spacing "npy_spacing"(double x) |
|
|
long double spacingl "npy_spacingl"(long double x) |
|
|
|
|
|
|
|
|
float deg2radf "npy_deg2radf"(float x) |
|
|
float rad2degf "npy_rad2degf"(float x) |
|
|
float logaddexpf "npy_logaddexpf"(float x, float y) |
|
|
float logaddexp2f "npy_logaddexp2f"(float x, float y) |
|
|
|
|
|
double deg2rad "npy_deg2rad"(double x) |
|
|
double rad2deg "npy_rad2deg"(double x) |
|
|
double logaddexp "npy_logaddexp"(double x, double y) |
|
|
double logaddexp2 "npy_logaddexp2"(double x, double y) |
|
|
|
|
|
long double deg2radl "npy_deg2radl"(long double x) |
|
|
long double rad2degl "npy_rad2degl"(long double x) |
|
|
long double logaddexpl "npy_logaddexpl"(long double x, long double y) |
|
|
long double logaddexp2l "npy_logaddexp2l"(long double x, long double y) |
|
|
|