woheller69
woheller69
No. For high-precision stuff use another calculator.
next version will have a better check for pi multiples, so sin(11PI) and sin(2000PI) should be 0 But that is all I can do.
I am using my own fork https://github.com/woheller69/ArityEngine Will apply the fix there :-) Maybe we should add a test case also
if 0.5 * log1p((x + x) / (1 - x)) should be used: Why are you proposing 0.5 * Math.log1p(twox + twox * x / (1 - x)); Shouldn't it...
Are there similar tweaks for things like sin(11Pi) or sin(2000Pi) ? (See above) For exact multiples of PI I fixed it already in my fork. But maybe there are better...
Maybe this library is an option? https://github.com/eobermuhlner/big-math
But probably that does not help either, as the input value does not come as BigDecimal. The whole Arity Engine would have to be changed...
@supsm I added your modifications and some test cases to my fork of Arity engine: https://github.com/woheller69/ArityEngine Here is an updated version of Arity. tanh and atanh (2%^9) now yield 5.12E-16...
This should fix some more issues with sin and cos calculations for multiples of PI or PI/2 https://github.com/woheller69/ArityEngine/commit/fab02d62e38fe5af723891b6c7d273cc1b7efca7 [app-release.apk.zip](https://github.com/woheller69/Arity/files/12907636/app-release.apk.zip)
If you want to divide the whole formula by 1000 you should put it in brackets (4÷3×π×(((6371+0.1)×1000)^3−(6371×1000)^3×2÷1000)÷1000