0

I'm attempting a port of GeographicLib into F#. Ideally, I'd like it to be available as a PCL library, so that it can be accessed from Xamarin. Unfortunately, the MathNet.Numerics and MathNet.Numerics.FSharp packages are not compatible with PCL.

My first stumbling block are the absence of the hyperbolic trig function Trig.Atanh, and of a representation of Precision.MachineEpsilon, from the standard numerical libraries. I have searched online, but drawn a blank for the most efficient way to implement these.

Is there a straightforward way to find the optimal implementation of these functions?

Rob Lyndon
  • 12,089
  • 5
  • 49
  • 74
  • 4
    This is actually 2 questions... The atanh question has already been answered here: http://stackoverflow.com/questions/21154596/wheres-the-inverse-of-math-tanh-in-the-math-libraries – dana Sep 24 '15 at 21:55
  • 1
    The machine epsilon question has been answered here: http://stackoverflow.com/questions/9392869/where-do-i-find-the-machine-epsilon-in-c – dana Sep 24 '15 at 21:57
  • You can also use MathNet.Numerics without the F# extensions from F#. MathNet.Numerics supports more PCL profiles than MathNet.Numerics.FSharp. See http://numerics.mathdotnet.com/Compatibility.html for details. – Christoph Rüegg Sep 25 '15 at 15:38
  • 1
    Thanks Dana. Both answers are helpful. – Rob Lyndon Sep 25 '15 at 16:14
  • Christoph -- unfortunately, although the table says it should work, my compiler says otherwise. However, so far I've only needed it for the two cases stated in the question, so I'll try again only when I absolutely need to load the whole of MathNet,Numerics. – Rob Lyndon Sep 25 '15 at 16:16
  • That's bad news, seems like I need to request a new Xamarin license to verify. In the meantime I'd be interested in the exact compiler error. – Christoph Rüegg Sep 25 '15 at 18:51
  • I'm working just in Visual Studio at the moment. It seems like it's a warning in the fsx script file rather than an outright error. The warning reads "The type 'Complex' is required here and is unavailable"; however, I have defined only a real implementation of atanh, so I should be OK. – Rob Lyndon Sep 25 '15 at 21:49
  • For reference, the branch that shows this warning is at https://github.com/SpiegelSoft/GeographicLib/tree/MathNetNumericsError/GeographicLib. Let me know if it helps. – Rob Lyndon Sep 25 '15 at 21:50

0 Answers0