mirror of
https://github.com/vale981/arb
synced 2025-03-04 17:01:40 -05:00
add arb_is_int_2exp_si and acb_is_int_2exp_si
This commit is contained in:
parent
9005956dba
commit
8f9f343127
8 changed files with 25 additions and 8 deletions
6
acb.h
6
acb.h
|
@ -110,6 +110,12 @@ acb_is_int(const acb_t z)
|
|||
return arb_is_zero(acb_imagref(z)) && arb_is_int(acb_realref(z));
|
||||
}
|
||||
|
||||
ACB_INLINE int
|
||||
acb_is_int_2exp_si(const acb_t z, slong e)
|
||||
{
|
||||
return arb_is_zero(acb_imagref(z)) && arb_is_int_2exp_si(acb_realref(z), e);
|
||||
}
|
||||
|
||||
ACB_INLINE void
|
||||
acb_zero(acb_t z)
|
||||
{
|
||||
|
|
|
@ -30,7 +30,7 @@ acb_polygamma(acb_t res, const acb_t s, const acb_t z, slong prec)
|
|||
acb_gamma(u, t, prec);
|
||||
acb_hurwitz_zeta(t, t, z, prec);
|
||||
|
||||
if (arf_is_int_2exp_si(arb_midref(acb_realref(s)), 1))
|
||||
if (acb_is_int_2exp_si(s, 1))
|
||||
acb_neg(t, t);
|
||||
|
||||
acb_mul(res, t, u, prec);
|
||||
|
|
|
@ -92,8 +92,7 @@ acb_elliptic_e_inc(acb_t res, const acb_t phi, const acb_t m, int times_pi, slon
|
|||
return;
|
||||
}
|
||||
|
||||
if (times_pi && acb_is_real(phi) && arb_is_exact(acb_realref(phi)) &&
|
||||
arf_is_int_2exp_si(arb_midref(acb_realref(phi)), -1))
|
||||
if (times_pi && acb_is_int_2exp_si(phi, -1))
|
||||
{
|
||||
acb_t t;
|
||||
acb_init(t);
|
||||
|
|
|
@ -77,8 +77,7 @@ acb_elliptic_f(acb_t res, const acb_t phi, const acb_t m, int times_pi, slong pr
|
|||
return;
|
||||
}
|
||||
|
||||
if (times_pi && acb_is_real(phi) && arb_is_exact(acb_realref(phi)) &&
|
||||
arf_is_int_2exp_si(arb_midref(acb_realref(phi)), -1))
|
||||
if (times_pi && acb_is_int_2exp_si(phi, -1))
|
||||
{
|
||||
acb_t t;
|
||||
acb_init(t);
|
||||
|
|
|
@ -113,9 +113,7 @@ acb_elliptic_pi_inc(acb_t res, const acb_t n, const acb_t phi, const acb_t m, in
|
|||
return;
|
||||
}
|
||||
|
||||
if (acb_is_zero(phi) || (times_pi && acb_is_real(phi)
|
||||
&& arb_is_exact(acb_realref(phi)) &&
|
||||
arf_is_int_2exp_si(arb_midref(acb_realref(phi)), -1)))
|
||||
if (acb_is_zero(phi) || (times_pi && acb_is_int_2exp_si(phi, -1)))
|
||||
{
|
||||
acb_t t;
|
||||
acb_init(t);
|
||||
|
|
7
arb.h
7
arb.h
|
@ -290,6 +290,13 @@ arb_is_int(const arb_t x)
|
|||
arf_is_int(arb_midref(x));
|
||||
}
|
||||
|
||||
ARB_INLINE int
|
||||
arb_is_int_2exp_si(const arb_t x, slong e)
|
||||
{
|
||||
return mag_is_zero(arb_radref(x)) &&
|
||||
arf_is_int_2exp_si(arb_midref(x), e);
|
||||
}
|
||||
|
||||
ARB_INLINE int
|
||||
arb_contains_zero(const arb_t x)
|
||||
{
|
||||
|
|
|
@ -225,6 +225,10 @@ Precision and comparisons
|
|||
|
||||
Returns nonzero iff *z* is an exact integer.
|
||||
|
||||
.. function:: int acb_is_int_2exp_si(const acb_t x, slong e)
|
||||
|
||||
Returns nonzero iff *z* exactly equals `n 2^e` for some integer *n*.
|
||||
|
||||
.. function:: int acb_equal(const acb_t x, const acb_t y)
|
||||
|
||||
Returns nonzero iff *x* and *y* are identical as sets, i.e.
|
||||
|
|
|
@ -523,6 +523,10 @@ Comparisons
|
|||
|
||||
Returns nonzero iff *x* is an exact integer.
|
||||
|
||||
.. function:: int arb_is_int_2exp_si(const arb_t x, slong e)
|
||||
|
||||
Returns nonzero iff *x* exactly equals `n 2^e` for some integer *n*.
|
||||
|
||||
.. function:: int arb_equal(const arb_t x, const arb_t y)
|
||||
|
||||
Returns nonzero iff *x* and *y* are equal as balls, i.e. have both the
|
||||
|
|
Loading…
Add table
Reference in a new issue