Skip to content

Conversation

@jneem
Copy link
Member

@jneem jneem commented Dec 31, 2025

This addresses a recent test failure in polycool, found by property testing in CI. It changes only the tests.

For context, for arbitrary polynomials we test root-finding by checking that the polynomial evaluates to approximately zero at the putative root. This is easier than testing that the putative root is close to an actual root, because in order to do that we'd need to know what the actual root is. The issue is that if the polynomial has a very large derivative near the root, the value at the putative root could be far from zero even if the root is very close.

In the failing example, the derivative was more than 1e172 and the approximate root (at about 0.93) evaluated to less than 2e159. That's comfortably consistent with our target relative error of 1e-12 once the derivative is taken into account.

Copy link
Member

@tomcur tomcur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

@jneem jneem added this pull request to the merge queue Jan 5, 2026
Merged via the queue into linebender:main with commit 887700c Jan 5, 2026
15 checks passed
@jneem jneem deleted the polycool-failure branch January 5, 2026 15:43
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