mirror of
https://github.com/vale981/arb
synced 2025-03-05 09:21:38 -05:00
mag_tail_kexpk2_arb: fix rounding and comment on possible overflow
This commit is contained in:
parent
121292a276
commit
41efd43a92
1 changed files with 4 additions and 4 deletions
|
@ -50,11 +50,11 @@ mag_tail_kexpk2_arb(mag_t res, const arb_t a, ulong n)
|
||||||
{
|
{
|
||||||
mag_t c;
|
mag_t c;
|
||||||
mag_init(c);
|
mag_init(c);
|
||||||
mag_mul_ui_lower(res, m, n*n-n+1);
|
mag_mul_ui_lower(res, m, n*n-n+1); /* todo: possible overflow */
|
||||||
mag_expinv(res, res);
|
mag_expinv(res, res);
|
||||||
/* c = 2a(1+2a) */
|
/* c = 2a(1+2a) */
|
||||||
mag_mul_ui(m, m, 2);
|
mag_mul_2exp_si(m, m, 1);
|
||||||
mag_set_ui(c, 1);
|
mag_one(c);
|
||||||
mag_add_lower(c, m, c);
|
mag_add_lower(c, m, c);
|
||||||
mag_mul_lower(c, m, c);
|
mag_mul_lower(c, m, c);
|
||||||
mag_div(res, res, c);
|
mag_div(res, res, c);
|
||||||
|
@ -62,7 +62,7 @@ mag_tail_kexpk2_arb(mag_t res, const arb_t a, ulong n)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mag_mul_ui_lower(res, m, n*n-n-1);
|
mag_mul_ui_lower(res, m, n*n-n-1); /* todo: possible overflow */
|
||||||
mag_expinv(res, res);
|
mag_expinv(res, res);
|
||||||
mag_mul_ui(res, res, 2);
|
mag_mul_ui(res, res, 2);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue