Repository navigation
am_series keeps the power it is asked for - #2303
Merged
Merged
Conversation
Catalogue.Series and the MCP tool am_series document their degree as the highest power kept, and passed it to MathS.Series.Maclaurin and Taylor, whose second argument is the number of terms. So the highest power kept was one less than asked: sin(x) to degree 7 stopped at x ^ 5, and degree 1, which am_series offers for linearising a model, gave the constant term alone, 0 for sin(x) and 1 for e^x. The catalogue now passes one term more than the degree. 2.6.0's am_series called MathS.Series directly and answered the same. MathS.Series is unchanged. Its documentation called the argument the degree of the polynomial, and its own examples show it counts terms, Maclaurin(Sin(x), 4, x) stopping at x ^ 3, so the documentation now says that. CatalogueTest asks for the highest power at degrees 0, 1, 2 and 7, and the pin beside it takes one term more. ToolsTest.Series, which pinned degree 7 at x ^ 5, takes x ^ 7 and degree 1. The suite, the trio, F#, AOT and the eight harnesses pass. Fixes #2299. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2303 +/- ##
==========================================
+ Coverage 86.74% 86.76% +0.02%
==========================================
Files 310 310
Lines 67973 67974 +1
Branches 19744 19736 -8
==========================================
+ Hits 58961 58976 +15
+ Misses 4880 4874 -6
+ Partials 4132 4124 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
Catalogue.Seriesandam_seriesdocument their degree as the highest power kept, but they passed it toMathS.Series, whose argument counts terms. The catalogue now passes one term more.am_seriessin(x), degree 7x ^ 5 / 120 - x ^ 3 / 6 + xx ^ 5 / 120 - x ^ 7 / 5040 - x ^ 3 / 6 + xsin(x), degree 10xe^x, degree 111 + xMathS.Seriesis unchanged. Its documentation called the argument the polynomial's degree, while its own examples count terms, so the documentation now says so.CatalogueTestchecks that the highest power kept is the one asked for, at degrees 0, 1, 2 and 7.ToolsTest.Seriesused to pin x⁵ at degree 7, and now checks x⁷ and degree 1.Fixes #2299.
🤖 Generated with Claude Code