mirror of
https://github.com/vale981/arb
synced 2025-03-04 17:01:40 -05:00
more fixes
This commit is contained in:
parent
3ff973a37f
commit
89cb885c07
5 changed files with 431 additions and 11 deletions
|
@ -810,49 +810,49 @@ int arb_fpwrap_cdouble_4_int(complex_double * res, acb_func_4_int func, complex_
|
|||
} \
|
||||
|
||||
#define DEF_DOUBLE_FUN_1_INT(name, arb_fun) \
|
||||
int arb_fpwrap_double_ ## name ## _int(double * res, double x, int intx, int flags) \
|
||||
int arb_fpwrap_double_ ## name(double * res, double x, int intx, int flags) \
|
||||
{ \
|
||||
return arb_fpwrap_double_1_int(res, arb_fun, x, intx, flags); \
|
||||
} \
|
||||
|
||||
#define DEF_DOUBLE_FUN_2_INT(name, arb_fun) \
|
||||
int arb_fpwrap_double_ ## name ## _int(double * res, double x1, double x2, int intx, int flags) \
|
||||
int arb_fpwrap_double_ ## name(double * res, double x1, double x2, int intx, int flags) \
|
||||
{ \
|
||||
return arb_fpwrap_double_2_int(res, arb_fun, x1, x2, intx, flags); \
|
||||
} \
|
||||
|
||||
#define DEF_DOUBLE_FUN_3_INT(name, arb_fun) \
|
||||
int arb_fpwrap_double_ ## name ## _int(double * res, double x1, double x2, double x3, int intx, int flags) \
|
||||
int arb_fpwrap_double_ ## name(double * res, double x1, double x2, double x3, int intx, int flags) \
|
||||
{ \
|
||||
return arb_fpwrap_double_3_int(res, arb_fun, x1, x2, x3, intx, flags); \
|
||||
} \
|
||||
|
||||
#define DEF_DOUBLE_FUN_4_INT(name, arb_fun) \
|
||||
int arb_fpwrap_double_ ## name ## _int(double * res, double x1, double x2, double x3, double x4, int intx, int flags) \
|
||||
int arb_fpwrap_double_ ## name(double * res, double x1, double x2, double x3, double x4, int intx, int flags) \
|
||||
{ \
|
||||
return arb_fpwrap_double_4_int(res, arb_fun, x1, x2, x3, x4, intx, flags); \
|
||||
} \
|
||||
|
||||
#define DEF_CDOUBLE_FUN_1_INT(name, acb_fun) \
|
||||
int arb_fpwrap_cdouble_ ## name ## _int(complex_double * res, complex_double x, int intx, int flags) \
|
||||
int arb_fpwrap_cdouble_ ## name(complex_double * res, complex_double x, int intx, int flags) \
|
||||
{ \
|
||||
return arb_fpwrap_cdouble_1_int(res, acb_fun, x, intx, flags); \
|
||||
} \
|
||||
|
||||
#define DEF_CDOUBLE_FUN_2_INT(name, acb_fun) \
|
||||
int arb_fpwrap_cdouble_ ## name ## _int(complex_double * res, complex_double x1, complex_double x2, int intx, int flags) \
|
||||
int arb_fpwrap_cdouble_ ## name(complex_double * res, complex_double x1, complex_double x2, int intx, int flags) \
|
||||
{ \
|
||||
return arb_fpwrap_cdouble_2_int(res, acb_fun, x1, x2, intx, flags); \
|
||||
} \
|
||||
|
||||
#define DEF_CDOUBLE_FUN_3_INT(name, acb_fun) \
|
||||
int arb_fpwrap_cdouble_ ## name ## _int(complex_double * res, complex_double x1, complex_double x2, complex_double x3, int intx, int flags) \
|
||||
int arb_fpwrap_cdouble_ ## name(complex_double * res, complex_double x1, complex_double x2, complex_double x3, int intx, int flags) \
|
||||
{ \
|
||||
return arb_fpwrap_cdouble_3_int(res, acb_fun, x1, x2, x3, intx, flags); \
|
||||
} \
|
||||
|
||||
#define DEF_CDOUBLE_FUN_4_INT(name, acb_fun) \
|
||||
int arb_fpwrap_cdouble_ ## name ## _int(complex_double * res, complex_double x1, complex_double x2, complex_double x3, complex_double x4, int intx, int flags) \
|
||||
int arb_fpwrap_cdouble_ ## name(complex_double * res, complex_double x1, complex_double x2, complex_double x3, complex_double x4, int intx, int flags) \
|
||||
{ \
|
||||
return arb_fpwrap_cdouble_4_int(res, acb_fun, x1, x2, x3, x4, intx, flags); \
|
||||
} \
|
||||
|
@ -1062,9 +1062,15 @@ DEF_DOUBLE_FUN_1(exp_integral_ei, arb_hypgeom_ei)
|
|||
DEF_CDOUBLE_FUN_1(exp_integral_ei, acb_hypgeom_ei)
|
||||
|
||||
DEF_DOUBLE_FUN_1(sin_integral, arb_hypgeom_si)
|
||||
DEF_CDOUBLE_FUN_1(sin_integral, acb_hypgeom_si)
|
||||
|
||||
DEF_DOUBLE_FUN_1(cos_integral, arb_hypgeom_ci)
|
||||
DEF_CDOUBLE_FUN_1(cos_integral, acb_hypgeom_ci)
|
||||
|
||||
DEF_DOUBLE_FUN_1(sinh_integral, arb_hypgeom_shi)
|
||||
DEF_CDOUBLE_FUN_1(sinh_integral, acb_hypgeom_shi)
|
||||
|
||||
DEF_DOUBLE_FUN_1(cosh_integral, arb_hypgeom_chi)
|
||||
DEF_CDOUBLE_FUN_1(cosh_integral, acb_hypgeom_chi)
|
||||
|
||||
DEF_DOUBLE_FUN_1_INT(log_integral, arb_hypgeom_li)
|
||||
|
@ -1270,6 +1276,9 @@ int arb_fpwrap_cdouble_hypgeom_pfq(complex_double * res, const complex_double *
|
|||
return status;
|
||||
}
|
||||
|
||||
DEF_DOUBLE_FUN_2(agm, arb_agm)
|
||||
DEF_CDOUBLE_FUN_2(agm, acb_agm)
|
||||
|
||||
DEF_CDOUBLE_FUN_1(elliptic_k, acb_elliptic_k)
|
||||
DEF_CDOUBLE_FUN_1(elliptic_e, acb_elliptic_e)
|
||||
DEF_CDOUBLE_FUN_2(elliptic_pi, acb_elliptic_pi)
|
||||
|
|
|
@ -12,6 +12,29 @@
|
|||
#include "flint/double_extras.h"
|
||||
#include "arb_fpwrap.h"
|
||||
|
||||
#define CHECK_DOUBLE(fcall) \
|
||||
do { \
|
||||
int fail = fcall; \
|
||||
if (fail || res != res) \
|
||||
{ \
|
||||
flint_printf("FAIL\n"); \
|
||||
flint_printf("%d\n", __LINE__); \
|
||||
flint_abort(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define CHECK_CDOUBLE(fcall) \
|
||||
do { \
|
||||
int fail = fcall; \
|
||||
if (fail || cres.real != cres.real || cres.imag != cres.imag) \
|
||||
{ \
|
||||
flint_printf("FAIL\n"); \
|
||||
flint_printf("%d\n", __LINE__); \
|
||||
flint_abort(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
slong iter;
|
||||
|
@ -125,6 +148,310 @@ int main()
|
|||
}
|
||||
}
|
||||
|
||||
{
|
||||
double x, y, z;
|
||||
complex_double cx, cy, cz, ctau;
|
||||
double res, res2;
|
||||
complex_double cres;
|
||||
int flags;
|
||||
|
||||
x = 0.25;
|
||||
y = 0.625;
|
||||
z = 0.75;
|
||||
|
||||
cx.real = 0.25;
|
||||
cx.imag = 0.125;
|
||||
cy.real = 0.5;
|
||||
cy.imag = 0.625;
|
||||
cz.real = 0.75;
|
||||
cz.imag = 0.125;
|
||||
ctau.real = 0.25;
|
||||
ctau.imag = 1.0;
|
||||
|
||||
flags = 0;
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_exp(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_exp(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_expm1(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_expm1(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_log(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_log(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_log1p(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_log1p(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_sqrt(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_sqrt(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_rsqrt(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_rsqrt(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_cbrt(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_cbrt(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_sin(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_sin(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_cos(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_cos(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_tan(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_tan(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_cot(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_cot(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_sec(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_sec(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_csc(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_csc(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_sinc(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_sinc(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_sin_pi(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_sin_pi(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_cos_pi(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_cos_pi(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_tan_pi(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_tan_pi(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_cot_pi(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_cot_pi(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_sinc_pi(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_sinc_pi(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_asin(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_asin(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_acos(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_acos(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_atan(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_atan(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_atan2(&res, x, y, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_asinh(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_asinh(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_acosh(&res, 1.0 + x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_acosh(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_atanh(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_atanh(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_lambertw(&res, x, 0, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_lambertw(&cres, cx, 0, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_lambertw(&res, -0.2, -1, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_lambertw(&cres, cx, -1, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_rising(&res, x, y, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_rising(&cres, cx, cy, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_gamma(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_gamma(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_rgamma(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_rgamma(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_lgamma(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_lgamma(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_digamma(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_digamma(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_zeta(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_zeta(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_hurwitz_zeta(&res, x, z, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_hurwitz_zeta(&cres, cx, cz, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_barnes_g(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_barnes_g(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_log_barnes_g(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_log_barnes_g(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_polygamma(&res, x, z, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_polygamma(&cres, cx, cz, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_polylog(&res, x, z, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_polylog(&cres, cx, cz, flags));
|
||||
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_dirichlet_eta(&cres, cz, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_riemann_xi(&cres, cz, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_hardy_theta(&cres, cz, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_hardy_z(&cres, cz, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_zeta_zero(&cres, 2, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_erf(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_erf(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_erfc(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_erfc(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_erfi(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_erfi(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_fresnel_s(&res, x, 0, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_fresnel_s(&cres, cx, 0, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_fresnel_c(&res, x, 0, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_fresnel_c(&cres, cx, 0, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_gamma_upper(&res, x, z, 0, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_gamma_upper(&cres, cx, cz, 0, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_gamma_lower(&res, x, z, 0, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_gamma_lower(&cres, cx, cz, 0, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_beta_lower(&res, x, y, z, 0, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_beta_lower(&cres, cx, cy, cz, 0, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_exp_integral_e(&res, x, z, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_exp_integral_e(&cres, cx, cz, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_exp_integral_ei(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_exp_integral_ei(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_sin_integral(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_sin_integral(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_cos_integral(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_cos_integral(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_sinh_integral(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_sinh_integral(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_cosh_integral(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_cosh_integral(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_log_integral(&res, x, 0, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_log_integral(&cres, cx, 0, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_bessel_j(&res, y, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_bessel_j(&cres, cy, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_bessel_y(&res, y, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_bessel_y(&cres, cy, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_bessel_i(&res, y, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_bessel_i(&cres, cy, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_bessel_k(&res, y, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_bessel_k(&cres, cy, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_bessel_k_scaled(&res, y, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_bessel_k_scaled(&cres, cy, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_airy_ai(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_airy_ai(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_airy_ai_prime(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_airy_ai_prime(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_airy_bi(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_airy_bi(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_airy_bi_prime(&res, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_airy_bi_prime(&cres, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_airy_ai_zero(&res, 1, flags));
|
||||
CHECK_DOUBLE(arb_fpwrap_double_airy_ai_prime_zero(&res, 1, flags));
|
||||
CHECK_DOUBLE(arb_fpwrap_double_airy_bi_zero(&res, 1, flags));
|
||||
CHECK_DOUBLE(arb_fpwrap_double_airy_bi_prime_zero(&res, 1, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_coulomb_f(&res, y, z, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_coulomb_f(&cres, cy, cz, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_coulomb_g(&res, y, z, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_coulomb_g(&cres, cy, cz, cx, flags));
|
||||
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_coulomb_hpos(&cres, cy, cz, cx, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_coulomb_hneg(&cres, cy, cz, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_chebyshev_t(&res, y, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_chebyshev_t(&cres, cy, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_chebyshev_u(&res, y, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_chebyshev_u(&cres, cy, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_jacobi_p(&res, y, x, y, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_jacobi_p(&cres, cy, cx, cy, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_gegenbauer_c(&res, y, z, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_gegenbauer_c(&cres, cy, cz, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_laguerre_l(&res, y, z, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_laguerre_l(&cres, cy, cz, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_hermite_h(&res, y, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_hermite_h(&cres, cy, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_legendre_p(&res, y, z, x, 0, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_legendre_p(&cres, cy, cz, cx, 0, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_legendre_q(&res, y, z, x, 0, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_legendre_q(&cres, cy, cz, cx, 0, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_legendre_root(&res, &res2, 2, 1, flags));
|
||||
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_spherical_y(&cres, 2, 1, cx, cy, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_hypgeom_0f1(&res, y, x, 0, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_hypgeom_0f1(&cres, cy, cx, 0, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_hypgeom_1f1(&res, x, y, x, 0, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_hypgeom_1f1(&cres, cx, cy, cx, 0, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_hypgeom_u(&res, x, y, x, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_hypgeom_u(&cres, cx, cy, cx, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_hypgeom_2f1(&res, x, y, z, x, 0, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_hypgeom_2f1(&cres, cx, cy, cz, cx, 0, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_hypgeom_pfq(&res, &x, 1, &y, 1, z, 0, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_hypgeom_pfq(&cres, &cx, 1, &cy, 1, cz, 0, flags));
|
||||
|
||||
CHECK_DOUBLE(arb_fpwrap_double_agm(&res, x, y, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_agm(&cres, cx, cy, flags));
|
||||
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_elliptic_k(&cres, cz, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_elliptic_e(&cres, cz, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_elliptic_pi(&cres, cy, cz, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_elliptic_f(&cres, cx, cz, 0, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_elliptic_e_inc(&cres, cx, cz, 0, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_elliptic_pi_inc(&cres, cx, cy, cz, 0, flags));
|
||||
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_elliptic_rf(&cres, cx, cy, cz, 0, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_elliptic_rg(&cres, cx, cy, cz, 0, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_elliptic_rj(&cres, cx, cy, cz, cx, 0, flags));
|
||||
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_elliptic_p(&cres, cz, ctau, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_elliptic_p_prime(&cres, cz, ctau, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_elliptic_inv_p(&cres, cz, ctau, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_elliptic_zeta(&cres, cz, ctau, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_elliptic_sigma(&cres, cz, ctau, flags));
|
||||
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_jacobi_theta_1(&cres, cz, ctau, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_jacobi_theta_2(&cres, cz, ctau, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_jacobi_theta_3(&cres, cz, ctau, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_jacobi_theta_4(&cres, cz, ctau, flags));
|
||||
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_dedekind_eta(&cres, ctau, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_modular_j(&cres, ctau, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_modular_lambda(&cres, ctau, flags));
|
||||
CHECK_CDOUBLE(arb_fpwrap_cdouble_modular_delta(&cres, ctau, flags));
|
||||
}
|
||||
|
||||
flint_randclear(state);
|
||||
flint_cleanup();
|
||||
flint_printf("PASS\n");
|
||||
|
|
|
@ -414,7 +414,7 @@ Hypergeometric functions
|
|||
.. function:: int arb_fpwrap_double_hypgeom_2f1(double * res, double a, double b, double c, double x, int regularized, int flags)
|
||||
int arb_fpwrap_cdouble_hypgeom_2f1(complex_double * res, complex_double a, complex_double b, complex_double c, complex_double x, int regularized, int flags)
|
||||
|
||||
.. function:: int arb_fpwrap_double_hypgeom_pfq(double * res, const double * a, slong p, const double * b, slong q, double z, int regularized, int flags);
|
||||
.. function:: int arb_fpwrap_double_hypgeom_pfq(double * res, const double * a, slong p, const double * b, slong q, double z, int regularized, int flags)
|
||||
int arb_fpwrap_cdouble_hypgeom_pfq(complex_double * res, const complex_double * a, slong p, const complex_double * b, slong q, complex_double z, int regularized, int flags)
|
||||
|
||||
|
||||
|
@ -478,9 +478,50 @@ Elliptic integrals, elliptic functions and modular forms
|
|||
|
||||
.. function:: int arb_fpwrap_cdouble_modular_delta(complex_double * res, complex_double tau, int flags)
|
||||
|
||||
Calling from C
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
The program ``examples/fpwrap.c`` provides a usage example::
|
||||
|
||||
#include "arb_fpwrap.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
double x, y;
|
||||
complex_double cx, cy;
|
||||
int flags = 0; /* default options */
|
||||
|
||||
x = 2.0;
|
||||
cx.real = 0.5;
|
||||
cx.imag = 123.0;
|
||||
|
||||
arb_fpwrap_double_zeta(&y, x, flags);
|
||||
arb_fpwrap_cdouble_zeta(&cy, cx, flags);
|
||||
|
||||
printf("zeta(%g) = %.16g\n", x, y);
|
||||
printf("zeta(%g + %gi) = %.16g + %.16gi\n", cx.real, cx.imag, cy.real, cy.imag);
|
||||
|
||||
flint_cleanup();
|
||||
return 0;
|
||||
}
|
||||
|
||||
.. highlight:: text
|
||||
|
||||
This should print::
|
||||
|
||||
> build/examples/fpwrap
|
||||
zeta(2) = 1.644934066848226
|
||||
zeta(0.5 + 123i) = 0.006252861175594465 + 0.08206030514520983i
|
||||
|
||||
Note that this program does not check the return flag
|
||||
to perform error handling.
|
||||
|
||||
|
||||
Interfacing from Python
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
.. highlight:: python
|
||||
|
||||
This illustrates how to call functions from Python using ``ctypes``::
|
||||
|
||||
import ctypes
|
||||
|
@ -520,6 +561,8 @@ This illustrates how to call functions from Python using ``ctypes``::
|
|||
print(czeta(0.5+1e9j))
|
||||
print(zeta(1.0)) # pole, where wrapper throws exception
|
||||
|
||||
.. highlight:: text
|
||||
|
||||
This should print::
|
||||
|
||||
1.6449340668482264
|
||||
|
@ -531,6 +574,8 @@ This should print::
|
|||
Interfacing from Julia
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
.. highlight:: julia
|
||||
|
||||
This illustrates how to call functions from Julia using ``ccall``::
|
||||
|
||||
using Libdl
|
||||
|
@ -539,7 +584,7 @@ This illustrates how to call functions from Julia using ``ccall``::
|
|||
|
||||
function zeta(x::Float64)
|
||||
cy = Ref{Float64}()
|
||||
if Bool(ccall((:arb_fpwrap_double_zeta, :libarb), Cint, (Ptr{Float64}, Float64), cy, x))
|
||||
if Bool(ccall((:arb_fpwrap_double_zeta, :libarb), Cint, (Ptr{Float64}, Float64, Cint), cy, x, 0))
|
||||
error("unable to evaluate accurately at ", x)
|
||||
end
|
||||
return cy[]
|
||||
|
@ -547,7 +592,7 @@ This illustrates how to call functions from Julia using ``ccall``::
|
|||
|
||||
function zeta(x::Complex{Float64})
|
||||
cy = Ref{Complex{Float64}}()
|
||||
if Bool(ccall((:arb_fpwrap_cdouble_zeta, :libarb), Cint, (Ptr{Complex{Float64}}, Complex{Float64}), cy, x))
|
||||
if Bool(ccall((:arb_fpwrap_cdouble_zeta, :libarb), Cint, (Ptr{Complex{Float64}}, Complex{Float64}, Cint), cy, x, 0))
|
||||
error("unable to evaluate accurately at ", x)
|
||||
end
|
||||
return cy[]
|
||||
|
@ -557,6 +602,8 @@ This illustrates how to call functions from Julia using ``ccall``::
|
|||
println(zeta(0.5 + 1e9im))
|
||||
println(zeta(1.0)) # pole, where wrapper throws exception
|
||||
|
||||
.. highlight:: text
|
||||
|
||||
This should print::
|
||||
|
||||
1.6449340668482264
|
||||
|
@ -565,3 +612,6 @@ This should print::
|
|||
Stacktrace:
|
||||
...
|
||||
|
||||
|
||||
.. highlight:: c
|
||||
|
||||
|
|
|
@ -707,5 +707,15 @@ A few examples::
|
|||
cpu/wall(s): 0.019 0.018
|
||||
I9 = [0.3785300 +/- 3.17e-8]
|
||||
|
||||
fpwrap.c
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
This program demonstrates calling the floating-point wrapper::
|
||||
|
||||
> build/examples/fpwrap
|
||||
zeta(2) = 1.644934066848226
|
||||
zeta(0.5 + 123i) = 0.006252861175594465 + 0.08206030514520983i
|
||||
|
||||
|
||||
.. highlight:: c
|
||||
|
||||
|
|
24
examples/fpwrap.c
Normal file
24
examples/fpwrap.c
Normal file
|
@ -0,0 +1,24 @@
|
|||
/* This file is public domain. Author: Fredrik Johansson. */
|
||||
|
||||
#include "arb_fpwrap.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
double x, y;
|
||||
complex_double cx, cy;
|
||||
int flags = 0; /* default options */
|
||||
|
||||
x = 2.0;
|
||||
cx.real = 0.5;
|
||||
cx.imag = 123.0;
|
||||
|
||||
arb_fpwrap_double_zeta(&y, x, flags);
|
||||
arb_fpwrap_cdouble_zeta(&cy, cx, flags);
|
||||
|
||||
printf("zeta(%g) = %.16g\n", x, y);
|
||||
printf("zeta(%g + %gi) = %.16g + %.16gi\n", cx.real, cx.imag, cy.real, cy.imag);
|
||||
|
||||
flint_cleanup();
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Add table
Reference in a new issue