dilog_bernoulli: real output

This commit is contained in:
Fredrik Johansson 2017-02-25 16:46:04 +01:00
parent 536ec0faaf
commit 663b4c58e4

View file

@ -22,6 +22,7 @@ acb_hypgeom_dilog_bernoulli(acb_t res, const acb_t z, slong prec)
fmpz_t c, d;
mag_t m, err;
double lm;
int real;
acb_init(s);
acb_init(w);
@ -31,6 +32,13 @@ acb_hypgeom_dilog_bernoulli(acb_t res, const acb_t z, slong prec)
mag_init(m);
mag_init(err);
real = 0;
if (acb_is_real(z))
{
arb_sub_ui(acb_realref(w), acb_realref(z), 1, 30);
real = arb_is_nonpositive(acb_realref(w));
}
acb_log(w, z, prec);
acb_get_mag(m, w);
@ -75,6 +83,8 @@ acb_hypgeom_dilog_bernoulli(acb_t res, const acb_t z, slong prec)
acb_add(res, s, w, prec);
acb_add_error_mag(res, err);
if (real)
arb_zero(acb_imagref(res));
}
else
{