2015-04-10 13:10:25 +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 General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
ARB is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with ARB; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
|
|
|
=============================================================================*/
|
|
|
|
/******************************************************************************
|
|
|
|
|
|
|
|
Copyright (C) 2015 Fredrik Johansson
|
|
|
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
#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);
|
|
|
|
}
|
|
|
|
|