Skip to content

Fix Lagrange interpolation at zero-valued support points - #2998

Open
flodrick wants to merge 1 commit into
lballabio:masterfrom
flodrick:fix/lagrange-zero-knot
Open

flodrick wants to merge 1 commit into
lballabio:masterfrom
flodrick:fix/lagrange-zero-knot

Conversation

@flodrick

@flodrick flodrick commented Nov 1, 2026

Copy link
Copy Markdown

The Lagrange interpolation support-point check used a tolerance proportional to the absolute value of the evaluation point. At a zero-valued knot, that tolerance is zero, so evaluation falls through to the barycentric formula and can return NaN.

This change uses an explicit tolerance for the support-point check and adds regression coverage for interpolation at the zero-valued knot, including evaluation with updated y-values.

Tests: full QuantLib test suite passed (1,680 test cases, 618,976 assertions).

Issue #2987

@boring-cyborg

boring-cyborg Bot commented Nov 1, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! It might take a while before we look at it, so don't worry if there seems to be no feedback. We'll get to it.

@CLAassistant

CLAassistant commented Nov 1, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants