mirror of
https://github.com/vale981/arb
synced 2025-03-05 09:21:38 -05:00
fix a branch cut issue with pi_inc
This commit is contained in:
parent
778c71b5a7
commit
626d71218d
4 changed files with 24 additions and 2 deletions
|
@ -126,6 +126,22 @@ acb_elliptic_pi_inc(acb_t res, const acb_t n, const acb_t phi, const acb_t m, in
|
|||
return;
|
||||
}
|
||||
|
||||
/* Fixme: the exact argument reduction sometimes
|
||||
does not work when re(phi) = k/2 and we end up exactly on a branch cut,
|
||||
presumably due to getting the wrong sign in R_J? Should
|
||||
investigate and find a better solution. */
|
||||
if (times_pi && !acb_is_real(phi))
|
||||
{
|
||||
acb_init(z);
|
||||
arb_init(pi);
|
||||
arb_const_pi(pi, prec);
|
||||
acb_mul_arb(z, phi, pi, prec);
|
||||
acb_elliptic_pi_inc(res, n, z, m, 0, prec);
|
||||
acb_clear(z);
|
||||
arb_clear(pi);
|
||||
return;
|
||||
}
|
||||
|
||||
arb_init(x);
|
||||
arb_init(d);
|
||||
arb_init(pi);
|
||||
|
|
|
@ -50,7 +50,8 @@ int main()
|
|||
fmpz_randtest(k, state, 1 + n_randint(state, 100));
|
||||
arb_const_pi(pi, FLINT_MAX(prec1, prec2));
|
||||
|
||||
fmpz_set_ui(k, 3);
|
||||
if (n_randint(state, 2))
|
||||
arb_set_d(acb_realref(z1), -4.5 + n_randint(state, 10));
|
||||
|
||||
if (times_pi)
|
||||
{
|
||||
|
|
|
@ -50,6 +50,9 @@ int main()
|
|||
fmpz_randtest(k, state, 1 + n_randint(state, 100));
|
||||
arb_const_pi(pi, FLINT_MAX(prec1, prec2));
|
||||
|
||||
if (n_randint(state, 2))
|
||||
arb_set_d(acb_realref(z1), -4.5 + n_randint(state, 10));
|
||||
|
||||
if (times_pi)
|
||||
{
|
||||
if (n_randint(state, 2))
|
||||
|
|
|
@ -51,8 +51,10 @@ int main()
|
|||
fmpz_randtest(k, state, 1 + n_randint(state, 100));
|
||||
arb_const_pi(pi, FLINT_MAX(prec1, prec2));
|
||||
|
||||
if (n_randint(state, 2))
|
||||
arb_set_d(acb_realref(z1), -4.5 + n_randint(state, 10));
|
||||
|
||||
/* test Pi(n,z,m) = Pi(n, z+pi k, m) - 2 k Pi(n, m) */
|
||||
fmpz_set_ui(k, 3);
|
||||
|
||||
if (times_pi)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue