mirror of
https://github.com/vale981/arb
synced 2025-03-04 17:01:40 -05:00
elliptic_roots, modular_eisenstein: detect real output
This commit is contained in:
parent
01472aed72
commit
7711297f62
2 changed files with 42 additions and 0 deletions
|
@ -16,12 +16,28 @@ void
|
|||
acb_elliptic_roots(acb_t e1, acb_t e2, acb_t e3, const acb_t tau, slong prec)
|
||||
{
|
||||
acb_t t1, t2, t3, t4;
|
||||
int e1r, e23r;
|
||||
|
||||
if (!arb_is_positive(acb_imagref(tau)) || !arb_is_finite(acb_realref(tau)))
|
||||
{
|
||||
acb_indeterminate(e1);
|
||||
acb_indeterminate(e2);
|
||||
acb_indeterminate(e3);
|
||||
return;
|
||||
}
|
||||
|
||||
acb_init(t1);
|
||||
acb_init(t2);
|
||||
acb_init(t3);
|
||||
acb_init(t4);
|
||||
|
||||
e1r = e23r = 0;
|
||||
|
||||
if (arb_is_int(acb_realref(tau)))
|
||||
e1r = e23r = 1;
|
||||
else if (arb_is_int_2exp_si(acb_realref(tau), -1))
|
||||
e1r = 1;
|
||||
|
||||
acb_modular_theta(t1, t2, t3, t4, t1, tau, prec);
|
||||
|
||||
acb_pow_ui(t2, t2, 4, prec);
|
||||
|
@ -42,6 +58,15 @@ acb_elliptic_roots(acb_t e1, acb_t e2, acb_t e3, const acb_t tau, slong prec)
|
|||
acb_mul(e3, e3, t3, prec);
|
||||
acb_neg(e3, e3);
|
||||
|
||||
if (e1r)
|
||||
arb_zero(acb_imagref(e1));
|
||||
|
||||
if (e23r)
|
||||
{
|
||||
arb_zero(acb_imagref(e2));
|
||||
arb_zero(acb_imagref(e3));
|
||||
}
|
||||
|
||||
acb_clear(t1);
|
||||
acb_clear(t2);
|
||||
acb_clear(t3);
|
||||
|
|
|
@ -18,10 +18,20 @@ acb_modular_eisenstein(acb_ptr r, const acb_t tau, slong len, slong prec)
|
|||
arf_t one_minus_eps;
|
||||
acb_t tau_prime, t1, t2, t3, t4, q;
|
||||
slong m, n;
|
||||
int real;
|
||||
|
||||
if (len < 1)
|
||||
return;
|
||||
|
||||
if (!arb_is_positive(acb_imagref(tau)) || !arb_is_finite(acb_realref(tau)))
|
||||
{
|
||||
_acb_vec_indeterminate(r, len);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
real = arb_is_int_2exp_si(acb_realref(tau), -1);
|
||||
|
||||
psl2z_init(g);
|
||||
arf_init(one_minus_eps);
|
||||
acb_init(tau_prime);
|
||||
|
@ -110,6 +120,13 @@ acb_modular_eisenstein(acb_ptr r, const acb_t tau, slong len, slong prec)
|
|||
}
|
||||
}
|
||||
|
||||
if (real)
|
||||
{
|
||||
arb_zero(acb_imagref(r));
|
||||
if (len > 1)
|
||||
arb_zero(acb_imagref(r + 1));
|
||||
}
|
||||
|
||||
/* compute more coefficients using recurrence */
|
||||
for (n = 4; n < len + 2; n++)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue