flintlib / arb

Arb has been merged into FLINT -- use https://github.com/flintlib/flint/ instead
http://arblib.org/
GNU Lesser General Public License v2.1
457 stars 137 forks source link

add lerch_phi to fpwrap #424

Closed vale981 closed 2 years ago

vale981 commented 2 years ago

This is only a proposal. I haven't tested this.

fredrik-johansson commented 2 years ago

It's an excellent proposal. However, the double version needs to call a C function that takes three arb_t arguments instead of acb_t arguments. You could add a wrapper based on the polygamma wrapper defined in the same file

static void
_arb_polygamma(arb_t res, const arb_t s, const arb_t z, slong prec)
{
    acb_t t, u, v;
    acb_init(t);
    acb_init(u);
    acb_init(v);
    acb_set_arb(t, s);
    acb_set_arb(u, z);
    acb_polygamma(v, t, u, prec);
    if (acb_is_real(v))
        arb_set(res, acb_realref(v));
    else
        arb_indeterminate(res);
    acb_clear(t);
    acb_clear(u);
    acb_clear(v);
}

just renaming polygamma -> lerch_phi.

Testing just requires adding two lines to fpwrap/test/t-fpwrap.c.

vale981 commented 2 years ago

done :). after the CI is through, i'll remove the accidental whitespace change

vale981 commented 2 years ago

The tests work in the CI, but I can't get it to compile locally. Some outdated dependency I think: bsplit_basecase_func_t is undeclared.

fredrik-johansson commented 2 years ago

Some outdated dependency I think: bsplit_basecase_func_t is undeclared.

What version of flint are you building against? It should be present in the current git version (wbhart's repo) and the 2.9 beta.

fredrik-johansson commented 2 years ago

I forgot about docs: could you just add the functions to doc/source/arb_fpwrap.rst as well? Should be ready to merge after that!

vale981 commented 2 years ago

done that :) you're the most responsive repo-owner i've encountered so far

fredrik-johansson commented 2 years ago

you're the most responsive repo-owner i've encountered so far

Thank you.

(I'm not always responsive 😬 You were lucky to submit this on a good day...)

vale981 commented 2 years ago

thank you for this nice project. it's hard to find a fast-ish lerch transcendent otherwise :)