Repository navigation
The forward difference - #2201
Merged
Merged
Conversation
forwarddifference(f, k) was reserved by name in #2184. It is now f(k + 1) - f(k), the forward difference with a step of 1, as Mathematica's DifferenceDelta[f, k] is. It is written that way when parsed, as laplacian is, and needs no node: forwarddifference(k^2, k) simplifies to 1 + 2 k, and sum(forwarddifference(k^3, k), k, 1, 5) is 215, which is 6^3 - 1. A derivative in f is taken at k + 1, as #2189 lets it be, so the difference of derivative(k^3, k) is 6 k + 3. It is taken in a variable, and a number or a constant in that place is refused. Part of #2182. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2201 +/- ##
==========================================
- Coverage 86.56% 86.55% -0.01%
==========================================
Files 298 298
Lines 66592 66596 +4
Branches 19319 19320 +1
==========================================
- Hits 57646 57645 -1
- Misses 4868 4875 +7
+ Partials 4078 4076 -2
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.
forwarddifference(f, k)was reserved in #2184. It is nowf(k + 1) − f(k), the forward difference with a step of 1, as in Mathematica'sDifferenceDelta[f, k]. Likelaplacian, it is written out when parsed and needs no node. Part of #2182.forwarddifference(k^2, k)simplifies to1 + 2 * k.sum(forwarddifference(k^3, k), k, 1, 5)is215, which is6^3 − 1.fis evaluated atk + 1, now that Substituting for a derivative's variable is dropped: derivative(x^3, x) at x = 1 evaluates to 3 x^2 #2189 handles that substitution: the difference ofderivative(k^3, k)is6 k + 3."forwarddifference(k^2, k)".ToEntity().Simplify()UnhandledParseException1 + 2 * k"forwarddifference(2^k, k)".ToEntity()UnhandledParseException2 ^ (k + 1) - 2 ^ k🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura