2016-04-26 17:20:05 +02:00
|
|
|
/*
|
2015-04-10 13:10:25 +02:00
|
|
|
Copyright (C) 2015 Fredrik Johansson
|
|
|
|
|
2016-04-26 17:20:05 +02:00
|
|
|
This file is part of Arb.
|
|
|
|
|
|
|
|
Arb is free software: you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU Lesser General Public License (LGPL) as published
|
|
|
|
by the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
(at your option) any later version. See <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2015-04-10 13:10:25 +02:00
|
|
|
|
|
|
|
#include "acb_hypgeom.h"
|
|
|
|
|
|
|
|
static void
|
2015-11-05 17:46:43 +00:00
|
|
|
_acb_hypgeom_li(acb_t res, const acb_t z, slong prec)
|
2015-04-10 13:10:25 +02:00
|
|
|
{
|
|
|
|
if (acb_is_zero(z))
|
|
|
|
{
|
|
|
|
acb_zero(res);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
acb_log(res, z, prec);
|
|
|
|
acb_hypgeom_ei(res, res, prec);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2015-11-05 17:46:43 +00:00
|
|
|
_acb_hypgeom_const_li2_eval(arb_t s, slong prec)
|
2015-04-10 13:10:25 +02:00
|
|
|
{
|
|
|
|
acb_t t;
|
|
|
|
acb_init(t);
|
|
|
|
acb_set_ui(t, 2);
|
|
|
|
_acb_hypgeom_li(t, t, prec);
|
|
|
|
arb_set(s, acb_realref(t));
|
|
|
|
acb_clear(t);
|
|
|
|
}
|
|
|
|
|
|
|
|
ARB_DEF_CACHED_CONSTANT(_acb_hypgeom_const_li2, _acb_hypgeom_const_li2_eval)
|
|
|
|
|
|
|
|
static void
|
2015-11-05 17:46:43 +00:00
|
|
|
_acb_hypgeom_li_offset(acb_t res, const acb_t z, slong prec)
|
2015-04-10 13:10:25 +02:00
|
|
|
{
|
|
|
|
if (acb_is_int(z) && arf_cmp_2exp_si(arb_midref(acb_realref(z)), 1) == 0)
|
|
|
|
{
|
|
|
|
acb_zero(res);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
arb_t t;
|
|
|
|
arb_init(t);
|
|
|
|
_acb_hypgeom_const_li2(t, prec);
|
|
|
|
_acb_hypgeom_li(res, z, prec);
|
|
|
|
arb_sub(acb_realref(res), acb_realref(res), t, prec);
|
|
|
|
arb_clear(t);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2015-11-05 17:46:43 +00:00
|
|
|
acb_hypgeom_li(acb_t res, const acb_t z, int offset, slong prec)
|
2015-04-10 13:10:25 +02:00
|
|
|
{
|
|
|
|
if (offset)
|
|
|
|
_acb_hypgeom_li_offset(res, z, prec);
|
|
|
|
else
|
|
|
|
_acb_hypgeom_li(res, z, prec);
|
|
|
|
}
|
|
|
|
|