Exemple #1
0
void
_acb_poly_compose(acb_ptr res,
    acb_srcptr poly1, slong len1,
    acb_srcptr poly2, slong len2, slong prec)
{
    if (len1 == 1)
    {
        acb_set_round(res, poly1, prec);
    }
    else if (len2 == 1)
    {
        _acb_poly_evaluate(res, poly1, len1, poly2, prec);
    }
    else if (_acb_vec_is_zero(poly2 + 1, len2 - 2))
    {
        _acb_poly_compose_axnc(res, poly1, len1, poly2, poly2 + len2 - 1, len2 - 1, prec);
    }
    else if (len1 <= 7)
    {
        _acb_poly_compose_horner(res, poly1, len1, poly2, len2, prec);
    }
    else
    {
        _acb_poly_compose_divconquer(res, poly1, len1, poly2, len2, prec);
    }
}
Exemple #2
0
void
_acb_poly_taylor_shift_divconquer(acb_ptr poly, const acb_t c, slong len, slong prec)
{
    acb_struct d[2];

    if (len <= 1 || acb_is_zero(c))
        return;

    if (len == 2)
    {
        acb_addmul(poly, poly + 1, c, prec);
        return;
    }

    d[0] = *c;

    acb_init(d + 1);
    acb_one(d + 1); /* no need to free */

    _acb_poly_compose_divconquer(poly, poly, len, d, 2, prec);
}