symbolic icon indicating copy to clipboard operation
symbolic copied to clipboard

list of functions that need @double implementations

Open mtmiller opened this issue 6 years ago • 6 comments

According to Matlab docs, the pochhammer function should accept numeric arguments as well, so we should provide a @double implementation.

mtmiller avatar Mar 13 '18 17:03 mtmiller

+1 probably many other functions like this too.

cbm755 avatar Mar 19 '18 21:03 cbm755

Here's a partial list I came up with some web scraping

Functions already in octsympy that should be overloaded to allow numeric args:

  • [x] chebyshevT
  • [x] chebyshevU
  • [ ] ei
  • [ ] ellipticCE
  • [ ] ellipticCK
  • [ ] ellipticCPi
  • [ ] ellipticE
  • [ ] ellipticF
  • [ ] ellipticK
  • [ ] ellipticPi
  • [x] pochhammer

Functions not yet added in octsympy, but should also accept numeric args for future reference:

  • [ ] ellipticNome
  • [ ] hermiteH
  • [ ] jacobiAM
  • [ ] jacobiCD
  • [ ] jacobiCN
  • [ ] jacobiCS
  • [ ] jacobiDC
  • [ ] jacobiDN
  • [ ] jacobiDS
  • [ ] jacobiNC
  • [ ] jacobiND
  • [ ] jacobiNS
  • [ ] jacobiP
  • [ ] jacobiSC
  • [ ] jacobiSD
  • [ ] jacobiSN
  • [ ] kummerU
  • [ ] meijerG
  • [ ] wrightOmega

mtmiller avatar Mar 19 '18 21:03 mtmiller

thanks! xref with https://github.com/cbm755/octsympy/issues/215

cbm755 avatar Mar 19 '18 21:03 cbm755

Sorry, do you want me to merge this list into #215 or just a reminder for future visitors?

Do you want to add tags on not-yet-implemented functions already mentioned in #215 that should support numeric as well as symbolic args (hermiteH, kummerU, wrightOmega) for contributors that might want to work on those?

Happy to do any more scraping or organizing that you think may help.

Is there a rule for whether functions should be in inst (e.g. inst/dirac.m) vs inst/@double (e.g. inst/@double/zeta.m)?

mtmiller avatar Mar 20 '18 00:03 mtmiller

I meant as a reminder for the future, sorry for brevity.

I think inst/foo.m needs to work for both single and double )and maybe int?). I have few relevant commits in a WIP branch that I should push, more to follow...

cbm755 avatar Mar 20 '18 06:03 cbm755

Here are my notes on related issues... TODO: clean up this based on @mtmiller's notes above.

Roundtrip improvements

  • [x] chebyshevT.m
  • [x] chebyshevU.m
  • [ ] norm.m?
  • [x] pochhammer.m: ~~~rewrite as gamma?~~~ no, needs @double/ as above.
  • [ ] igamma.m would need @double/?
  • [x] lgamma.m
  • [ ] symprod.m
  • [ ] symsum.m
  • [ ] round.m?
  • [ ] fix.m?
  • [ ] frac.m what should this be?
  • [ ] hypergeom.m needs @double?
  • [ ] dawson: put some future testing in case it gets added to sympy (right now we use erf for it)

Round trip with changes in sympy and/or tests added

Check mark here means done in #875.

  • [x] kroneckerDelta.m
  • [x] real
  • [x] imag
  • [x] arg
  • [x] angle -> to angle (matlab has angle, octave has both)
  • [x] beta
  • [x] conj
  • [x] atan2

Other notes

ei.m: should we have SymPy codegen make coshint + sinhint? generally, using an identity can lead to numerical stability problems.

why don't we have ellipj(sym)? b/c not in SymPy (JacobiSN etc, SMT got them in 2017b).

ellipke and ellipticK/ellipticE: ellipke in core Octave for doubles. SymPy codegen for ellipticE could do @(x) nthargout(2, @ellipke, x) but that isn't matlab compatible. Better

cbm755 avatar Mar 20 '18 07:03 cbm755