Fix EllipticE divergence and unrecognized Temporary/Stub attributes - #696
Merged
Conversation
Found while checking Woxi Studio against a random Wolfram Demonstration
notebook ("Ellipse Rolling around Another Ellipse"):
- EllipticE[m]'s power series only converges for |m| < 1, so any m <= -1
blew up to nonsense values (e.g. ~1.6*10^48 instead of ~1.9). Negative m
now delegates to the already-correct incomplete-integral quadrature at
phi = Pi/2.
- Attributes[] rejected the real Wolfram attributes Temporary and Stub as
unknown, which is what Mathematica stores on the auto-generated unique
symbols used internally by Manipulate.
The 2.3069156143590688 literal round-trips through f64 with fewer digits than written; clippy -D warnings flagged it.
Addresses review feedback on PR #696: the Stub row had no description/effect_level at all, and Temporary's description read like it described an Option rather than an Attribute. implementation_status is left blank for both (rather than marked done): Woxi now recognizes the two names so they no longer trigger Attributes::attnf, but no functional behavior is implemented for either (no autoload for Stub, no auto-removal for Temporary), so marking them implemented would overclaim relative to how this column is used for the other attributes.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Found while checking Woxi Studio's compatibility against a random Wolfram Demonstration notebook ("Ellipse Rolling around Another Ellipse", downloaded from the Wolfram Demonstrations Project) via
cargo run -p woxi-studio --example dump_manipulate. Notebook parsing, evaluation, and Manipulate widget/graphics rendering all already worked — but two real bugs surfaced along the way:EllipticE[m]'s one-argument complete integral used a power series in powers ofm, which only converges for|m| < 1. Anym <= -1(a value that occurs naturally in the demonstration's formula) blew up to nonsense values — e.g.EllipticE[-1.2857142857142856]returned~1.6*10^48instead of the correct~1.99. Negativemnow delegates to the already-correct incomplete-integral numeric quadrature atphi = Pi/2, verified againstmpmath.ellipeto ~13 significant digits.Attributes[...] = {Temporary}(andStub) wrongly warnedAttributes::attnf: ... is not a known attribute.— these are real Wolfram attributes, andTemporaryin particular is what Mathematica stores on the auto-generated unique symbols used internally byManipulate.Test plan
EllipticEatm = -1, a value below-1, and a larger negativem, checked against independently computedmpmathreference values (tests/interpreter_tests/math/special_functions.rs)Temporary/Stubno longer trigger theattnfwarning (tests/interpreter_tests/attributes.rs)make test(27792 tests viacargo nextest) passesmake formatGenerated by Claude Code