Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jun 18, 2025. It is now read-only.

Conversation

sritchie
Copy link
Member

@sritchie sritchie commented Mar 27, 2022

  • Taylor series upgrades + extra tidying #514:

    • Modifies sicmutils.calculus.derivative/taylor-series to return a proper
      PowerSeries instance, which the user can call with some dx to get back
      the old behavior.

      The new version can take any number of arguments in addition to f.
      Supplying no arguments returns the expansion at 0; if you supply many
      arguments (totally fine!), you'll need to wrap your dx components in a
      vector before supplying them to the returned PowerSeries.

    • sicmutils.series/function-> works the same way now, and functions
      identically, but with a different implementation. (previously it took a
      single expansion point under a keyword argument :x0.)

    • The new sicmutils.calculus.derivative/symbolic-taylor-series is a port of
      Taylor-series-coefficients from scmutils. It has the same contract as
      taylor-series, except that the full expansion is performed symbolically,
      and the original arguments are substituted in after expansion and
      simplification.

    • Other changes:

      • Installs 1 as the one-like and identity-like return values for
        structures and vectors. A true identity element would be an identity
        element compatible with all entries of the structure; but as defined now,
        1 is a fine choice and matches the scmutils implementation.

      • new sicmutils.differential/map-coefficients, which makes simplify
        slightly more efficient by filtering terms .

      • more efficient sicmutils.expression/variables-in, maybe 30% faster for
        big expressions; this makes a difference in the simplifier!

      • sicmutils.expression/substitute now works for proper Literal
        instances. Before it only worked for unwrapped literals.

      • matrix walks made slightly faster by caching a row or column before
        traversal

@codecov-commenter
Copy link

codecov-commenter commented Mar 27, 2022

Codecov Report

Merging #514 (69954d4) into main (9834abb) will increase coverage by 0.04%.
The diff coverage is 96.96%.

@@            Coverage Diff             @@
##             main     #514      +/-   ##
==========================================
+ Coverage   86.49%   86.54%   +0.04%     
==========================================
  Files         105      105              
  Lines       15320    15345      +25     
  Branches      781      776       -5     
==========================================
+ Hits        13251    13280      +29     
- Misses       1288     1289       +1     
+ Partials      781      776       -5     
Impacted Files Coverage Δ
src/sicmutils/collection.cljc 94.28% <ø> (+1.76%) ⬆️
src/sicmutils/calculus/derivative.cljc 79.83% <90.90%> (+1.61%) ⬆️
src/sicmutils/differential.cljc 93.20% <100.00%> (+0.13%) ⬆️
src/sicmutils/env/sci.cljc 96.90% <100.00%> (-0.07%) ⬇️
src/sicmutils/expression.cljc 71.96% <100.00%> (-0.13%) ⬇️
src/sicmutils/matrix.cljc 87.55% <100.00%> (+0.01%) ⬆️
src/sicmutils/numerical/derivative.cljc 90.35% <100.00%> (ø)
src/sicmutils/series.cljc 61.78% <100.00%> (+0.63%) ⬆️
src/sicmutils/structure.cljc 88.01% <100.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9834abb...69954d4. Read the comment docs.

@sritchie sritchie changed the title Port symbolic taylor series coefficients Taylor series upgrades + extra tidying Apr 1, 2022
@sritchie sritchie merged commit cf24023 into main Apr 1, 2022
@sritchie sritchie deleted the sritchie/deriv_sym branch April 1, 2022 19:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants