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 Jan 4, 2022

  • new sinc, sinhc, tanc, tanhc generics + remaining trig functions #449:

    • All missing trigonometric functions have been filled in sicmutils.generic
      and aliased in sicmutils.env:

      • Inverse cotangent: acot
      • inverse secant: asec
      • inverse cosecant: acsc
      • hyperbolic (inverse hyperbolic) cotangent: coth and acoth
      • hyperbolic (and inverse hyperbolic) secant: sech and asech
      • hyperbolic (and inverse hyperbolic) cosecant: csch and acsch

      All of these have default implementations and derivatives defined. They'll
      work out of the box for all types with atan defined (and potentially
      exp, sqrt and log.)

      Thanks to John D Cook's 'Bootstrapping a minimal math
      library'

      for his inspiration on the defaults and implementation order of these new
      functions.

    • expt gains a new default implementation for non-native-integral powers,
      making expt work for any type with exp, log and mul defined.

    • sqrt gains a default implementation for all types implementing exp,
      mul and log.

    • All trig functions now have derivatives and docstrings.

    • New sinc, tanc, sinhc, tanhc functions live in sicmutils.generic
      and are aliased into sicmutils.env. These are generically defined as (/ (sin x) x), (/ (tan x) x) (and similar with sinh and tanh), with
      correct definitions for 0 and infinite-valued inputs.

      These functions all support derivatives as well.

    • New default acot implementation in sicmutils.series.

Base automatically changed from sritchie/infinite to main January 4, 2022 18:22
@codecov-commenter
Copy link

codecov-commenter commented Jan 4, 2022

Codecov Report

Merging #449 (d480b6b) into main (94e989a) will decrease coverage by 0.24%.
The diff coverage is 70.38%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #449      +/-   ##
==========================================
- Coverage   85.79%   85.55%   -0.25%     
==========================================
  Files          99       99              
  Lines       13357    13542     +185     
  Branches      719      716       -3     
==========================================
+ Hits        11460    11586     +126     
- Misses       1178     1240      +62     
+ Partials      719      716       -3     
Impacted Files Coverage Δ
src/sicmutils/env.cljc 93.33% <ø> (ø)
src/sicmutils/series.cljc 58.52% <33.33%> (-0.26%) ⬇️
src/sicmutils/generic.cljc 73.21% <66.99%> (-6.72%) ⬇️
src/sicmutils/differential.cljc 90.93% <100.00%> (+0.51%) ⬆️
src/sicmutils/numbers.cljc 82.47% <100.00%> (+0.75%) ⬆️
src/sicmutils/rational_function.cljc 80.33% <0.00%> (-1.13%) ⬇️
src/sicmutils/numsymb.cljc 91.72% <0.00%> (ø)
src/sicmutils/simplify/rules.cljc 70.14% <0.00%> (+0.97%) ⬆️

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 94e989a...d480b6b. Read the comment docs.

@sritchie sritchie added this to the 0.21.0 milestone Jan 4, 2022
(defgeneric sin 1 {:dfdx cos})

;; TODO add defaults for these too!
;; https://www.johndcook.com/blog/2021/01/05/bootstrapping-math-library/
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add notes about WHAT needs to exist at the base.

@sritchie sritchie changed the title new sinc, sinhc, tanc, tanhc generics [in progress] new sinc, sinhc, tanc, tanhc generics + remaining trig functions Jan 19, 2022
@sritchie sritchie added the kernel Remaining items from scmutils kernel. label Jan 19, 2022
@sritchie sritchie merged commit a1cf1c0 into main Jan 20, 2022
@sritchie sritchie deleted the sritchie/sinc branch January 20, 2022 02:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

kernel Remaining items from scmutils kernel.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants