Skip to content

Commit

Permalink
arb_hypgeom_dilog wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrik-johansson committed Aug 1, 2018
1 parent d30df8c commit 1968e54
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arb_hypgeom.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ void arb_hypgeom_legendre_p_ui_root(arb_t res, arb_t weight, ulong n, ulong k, s

void arb_hypgeom_central_bin_ui(arb_t res, ulong n, slong prec);

void arb_hypgeom_dilog(arb_t res, const arb_t z, slong prec);

#ifdef __cplusplus
}
#endif
Expand Down
4 changes: 4 additions & 0 deletions arb_hypgeom/test/t-wrappers.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ int main()
arb_set_str(v, "[-0.3763617490859 +/- 3.83e-14]", prec);
TEST(r, v, "legendre_q");

arb_hypgeom_dilog(r, a, prec);
arb_set_str(v, "[0.582240526465012 +/- 6.18e-16]", prec);
TEST(r, v, "dilog");

arb_clear(a);
arb_clear(b);
arb_clear(c);
Expand Down
13 changes: 13 additions & 0 deletions arb_hypgeom/wrappers.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,3 +629,16 @@ arb_hypgeom_legendre_q(arb_t res, const arb_t n, const arb_t m, const arb_t z, i
acb_clear(v);
}

void
arb_hypgeom_dilog(arb_t res, const arb_t z, slong prec)
{
acb_t t;
acb_init(t);
arb_set(acb_realref(t), z);
acb_hypgeom_dilog(t, t, prec);
if (acb_is_finite(t) && acb_is_real(t))
arb_swap(res, acb_realref(t));
else
arb_indeterminate(res);
acb_clear(t);
}
7 changes: 7 additions & 0 deletions doc/source/arb_hypgeom.rst
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,13 @@ Orthogonal polynomials and functions
subsequently refined using interval Newton steps with doubling working
precision.

Dilogarithm
-------------------------------------------------------------------------------

.. function:: void arb_hypgeom_dilog(arb_t res, const arb_t z slong prec)

Computes the dilogarithm `\operatorname{Li}_2(z)`.

Hypergeometric sequences
-------------------------------------------------------------------------------

Expand Down

0 comments on commit 1968e54

Please sign in to comment.