-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement the 6 missing inverse trig and inverse hyperbolic functions #411
Comments
Of course we don't need the series near 0 because none of those functions are continuous there. And I see that arb_acos is implemented by just computing pi/2 minus the expression for arb_asin, so we can do a similar thing for all of these. That would make it relatively little work: just a straightforward implementation of the formulas here. |
And of course for the second and third formula, it's better to use acos(1/x) and asin(1/x), respectively. |
+1 I believe all cases of these functions can be implemented in numerically stable ways in terms of the existing functions. Of course for the complex versions one has to be careful with branch cuts. |
Ugh. I looked into this a little bit more and found something ugly. The DLMF defines acot, asec, and acsc in https://dlmf.nist.gov/4.23:
It defined acoth, asech, and acsch in https://dlmf.nist.gov/4.37:
This is the same as what I (eventually) wrote above except for the arccotangent... and that's where the rub is. I realize now that there are two common definitions of the arccotangent, and they differ even on the (negative) real numbers. The DLMF definition is also used by Mathematica, gsl, julia, and your own mpmath in Python. The other definition is used on the wikipedia page and the ISO 80000 standard (which discusses the function only in terms of real numbers). So it seems that it might be most appropriate to use the DLMF definitions here. |
One correction: acoth(x) is continuous at x=0, at least within the half planes Im(x) >= 0 and Im(x) < 0. For Im(x) >= 0, it behaves like |
It would be nice to have:
for both
arb_t
andacb_t
. We might want to use asymptotic series nearx=0
for all except the arccotangent, and a series near the zeroes of the arctrigs, and otherwise use the definition above, or something like that.The text was updated successfully, but these errors were encountered: