Closed Jean1995 closed 1 year ago
When MoliereInterpol creates the interpolation tables, it evaluates the function at negative x.
Why? Would that be avoidable?
Wouldn't a better fix be avoiding calling the function with improper input instead of coercing all negative values to 0?
When MoliereInterpol creates the interpolation tables, it evaluates the function at negative x.
Why? Would that be avoidable?
Wouldn't a better fix be avoiding calling the function with improper input instead of coercing all negative values to 0?
I believe this is the interpolation routine evaluating the function around x=0, probably to calculate the differential. But I can investigate this a bit more.
When MoliereInterpol creates the interpolation tables, it evaluates the function at negative x.
Why? Would that be avoidable? Wouldn't a better fix be avoiding calling the function with improper input instead of coercing all negative values to 0?
I believe this is the interpolation routine evaluating the function around x=0, probably to calculate the differential. But I can investigate this a bit more.
I've looked at this, and indeed this comes from the fact that the cubic interpolation calculates the derivative at the edges of the definition regime. I am not sure whether this is intrinsic to the cubic interpolation algorithm. But if it is a bug, this is a bug of the cubic interpolation package.
When
MoliereInterpol
creates the interpolation tables, it evaluates the function at negative x. This becomes a problem if floating point exceptions are caught. This simple patch protects the function from evaluation of the square root at negative x.