3

Does the MathNet.Symbolics.Infix parser have a way of identifying more complicated trig functions such as tanh? I have tried the following in F# but it is not recognised (I get an undefined expression). When I replace 'tanh' with 'cos' it works just fine.

open MathNet.Symbolics

let exp = Infix.parseOrUndefined "tanh(x)" //undefined

printfn "%s" (LaTeX.format exp) 

Any other libraries for parsing mathematics expressions in F# would also be of interest to me if they can handle functions such as tanh. Thanks!

FoggyFinder
  • 2,230
  • 2
  • 20
  • 34
mwpb
  • 83
  • 7

1 Answers1

2

Math.NET Symbolics can work with hyperbolic functions. You got the wrong result, because there was a small error in the library. Now it is fixed. You can wait for the next version or build DLL from source.

FoggyFinder
  • 2,230
  • 2
  • 20
  • 34
  • Can confirm that this now works by cloning https://github.com/mathnet/mathnet-symbolics, running build.cmd and creating a reference to /out/lib/NET40/MathNet.Symbolics.dll. Thanks! – mwpb Sep 22 '16 at 09:11
  • @mwpb,btw, if you have any questions on using the library, you can just do ping me in the [chat F#](http://chat.stackoverflow.com/rooms/51909/f) – FoggyFinder Sep 23 '16 at 07:27