Re: precision in cubicsplineinterpolation (and in general)

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/precision-in-cubicsplineinterpolation-and-in-general-tp12216p12221.html

Hi Sylvain,
        apologies for the long silence.

On Mon, 2008-08-04 at 11:55 -0400, Sylvain Bertrand wrote:

> As the implementation relies heavily on matrix operations, I would
> need to use only long double matrices, which work if I set QL_REAL to
> long double for the whole library, since matrices are forced to the
> QL_REAL type.
>  
> "QL_REAL = long double" would then have to be the default for QL
> releases, otherwise the user would run the risk of using the cubic
> splines with very poor results (in that case there should also be a
> warning to prevent the user from changing the setting back to double
> and use the splines).
>  
> Is that something that would be acceptable? I personally don't think
> of it as the best option.

You're right, this is not a good option.

> Another option would be to transform the current Matrix class into a
> template to support different types, which would give each piece of
> code the freedom to use the default QL_REAL or use more precision when
> needed.

Possibly. It would make the Matrix code quite a bit more complicated,
though.  Do you think it would be possible to improve the accuracy of
matrix calculations while keeping the double type? Maybe by using some
smarter algorithms instead of the naive ones we used?

Later,
        Luigi


--

The rule on staying alive as a forecaster is to give 'em a number or
give 'em a date, but never give 'em both at once.
-- Jane Bryant Quinn



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev