Loosen the root value test a little #535
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.