Numbers icon indicating copy to clipboard operation
Numbers copied to clipboard

Trigonometric functions for EDecimal

Open Happypig375 opened this issue 3 years ago • 2 comments

Includes sin, cos, tan, asin, acos, atan, atan2.

Also including sinh, cosh, tanh should be easy.

Here is a starting point: https://github.com/raminrahimzada/CSharp-Helper-Classes/blob/master/Math/DecimalMath/DecimalMath.cs

Also doing them for EFloat is okay but we only use EDecimal so it is more important to us.

Happypig375 avatar Jul 08 '20 12:07 Happypig375

There are also a couple of tests that can be ported directly: https://github.com/raminrahimzada/CSharp-Helper-Classes/blob/master/Math/DecimalMath/DecimalMathUnitTests.cs

Happypig375 avatar Jul 14 '20 09:07 Happypig375

The reason why it is not implemented might be because it is hard to implement trigonometric functions with correct rounding and because there are very few resources and implementations on correctly rounded trigonometric algorithms.

The only publicly-available implementation with correct rounding that I have found is MPFR. Here is a document of their proofs: https://www.mpfr.org/algorithms.pdf

luming-zhou avatar Sep 20 '22 23:09 luming-zhou