|
Boost : |
From: this_one_was_not_taken (mkoerner_at_[hidden])
Date: 2002-02-12 13:54:49
--- In boost_at_y..., Peter Schmitteckert (boost) <boost_at_s...> wrote:
> I would like to request comments on a first step towards a
> "Differential Arithmetic Library".
> ...
> The main idea of this templated library is to provide the
calculation of
> a function including the derivative of the function at a given
value.
> ...
Dear Peter,
I like the idea of having such a library. It is probably
to some extent the same as programming a polynom class,
that has polynoms up to a fixed order??! E.g.:
( f(0) + f'(0) * x ) * ( g(0) + g'(0) x )
= ( f(0) + g(0) ) + ( f'(0) * g(0) + g'(0) * f(0) ) * x + O(x^2)
Ok, there are some constant prefactors for higher derivatives,
but otherwise, it looks very much the same. Perhaps it would make
sense to base the library on a polynom class. I once used something
like:
typedef polynom<int,'x',4> polynom_type;
typedef polynom_type::symbol_type symbol_type;
polynom_type p, q, r;
symbol_type x;
std::cin >> p >> q;
r = x * p * q;
std::cout << r;
It would also be nice to have multivariable derivatives/polynoms
or if one could write q = cos(p). On the other hand it will be very
difficult to provide a correct/consistent answer for a function
such as sqrt as it has a branch cut.
So, I'd be very interested in such a library, but I would also very
much like to know, if other users also think of it as general purpose
or not.
--Mathias Koerner
mkoerner at itp dot phys dot ethz dot ch
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk