legendre_p_ui_root: simplify failure test

as a micro-optimization, because the call to arb_contains could be
comparatively costly for small n
This commit is contained in:
Marc Mezzarobba 2018-01-13 20:13:55 +01:00
parent d59e3fc5ec
commit 0f0d3c8b39

View file

@ -203,7 +203,7 @@ arb_hypgeom_legendre_p_ui_root(arb_t res, arb_t weight, ulong n, ulong k, slong
arb_div(t, t, u, wp);
arb_sub(v, v, t, wp);
if (!arb_contains(v0, v))
if (mag_cmp(arb_radref(v), arb_radref(res)) >= 0)
{
/* flint_printf("unexpected Newton iteration failure...\n"); */
break;