Boost logo

Boost :

Subject: Re: [boost] RFC: Multiprecision arithmetic library
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-12-22 10:43:54

On 12/22/2011 02:41 PM, John Maddock wrote:

> * A generic front-end that's capable of wrapping almost any type that's
> a "number". The front end is expression template enabled and handles all
> the expression optimization and code reduction. For example it's
> possible to evaluate a polynomial using Horner's rule without a single
> temporary variable being created.

Does it mean you're translating the expression

result = a0 + x * (a1 + x * (a2 + x * a3));

to the expression

result = x,
result *= a3,
result += a2,
result *= x,
result += a1,
result *= x,
result += a0;


This is something we wanted to do as well for MPFR support in the NT2
library, but we never had the time to think about it properly.

It would be nice if the logic that did this transformation was
single-contained and re-usable (unless it's trivial).
It could probably be generalized to any node that has an in-place
equivalent, and I can think of some uses beyond integration with
libraries such as MPFR. It could work with anything where operations are
pure and commutative.

Boost list run by bdawes at, gregod at, cpdaniel at, john at