Skip to content
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

Inverse trigonometric functions #12

Open
monadius opened this issue Jul 11, 2016 · 11 comments
Open

Inverse trigonometric functions #12

monadius opened this issue Jul 11, 2016 · 11 comments
Assignees

Comments

@monadius
Copy link
Member

I would like to be able to use inverse trigonometric functions in .dop files. The following functions are requested:
arcsin
arccos
arctan
Alternative names for these functions should also be available: asin, acos, atan

@keram88
Copy link
Member

keram88 commented Jul 11, 2016

These functions are now present in gelpia (FPTaylorCompat) both the a* and arc* versions. What are your preferred ranges for arcsin and arccos? Gaol prefers [-pi/2,pi/2] for the former and [0,pi] for the latter.

@keram88
Copy link
Member

keram88 commented Jul 11, 2016

I updated my previous comment.

@monadius
Copy link
Member Author

Ranges [-pi/2,pi/2] for arcsin and [0,pi] for arccos are most common so I agree with Gaol choices.

@keram88
Copy link
Member

keram88 commented Jul 11, 2016

I'll leave this open in case you find any problems.

@keram88 keram88 self-assigned this Jul 11, 2016
@ganeshutah
Copy link

Wei-Fan once ran into the need for inverse trig functions in one of the
benchmarks we were contemplating (forgot which). Since FPTaylor does not
have support for these (afaik), we did not pursue them.

Ganesh

On Mon, Jul 11, 2016 at 3:11 PM, monadius notifications@github.com wrote:

I would like to be able to use inverse trigonometric functions in .dop
files. The following functions are requested:
arcsin
arccos
arctan
Alternative names for these functions should also be available: asin,
acos, atan


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#12, or mute the thread
https://github.com/notifications/unsubscribe/AEyiCu_wTd30uLb_epLCVS3iS2gB9UDyks5qUrGXgaJpZM4JJyUw
.

@monadius
Copy link
Member Author

I implemented asin, acos, sinh, cosh, and tanh in FPTaylor (atan was already there). You can open an issue directly in the FPTaylor project when you need a new feature.

@keram88
Copy link
Member

keram88 commented Jul 22, 2016

Should we include hyperbolic functions? We use CRlibm which GAOL suggests cosh, sinh and tanh are not rounded correctly; oddly their inverses are rounded correctly. I've never been able to obtain a working version of libultim required by APLibMath, so we can't use the correctly rounding APLibMath.

Should I expose these functions and warn users that they may not be correct?

@monadius
Copy link
Member Author

It is better to be safe. You may include sinh, cosh, tanh in the frontend and then convert them to the corresponding math expressions: sinh(x) = (exp(x) - exp(-x)) / 2, cosh(x) = (exp(x) + exp(-x)) / 2, tanh(x) = (exp(2_x) - 1)/(exp(2_x) + 1).

@keram88
Copy link
Member

keram88 commented Jul 23, 2016

I'll have to carefully examine the proofs of the hyperbolic functions in crlibm; in short they don't seem to guarantee 1ULP for all cases. For now I'll implement these functions in terms of exp.

@keram88
Copy link
Member

keram88 commented Jul 23, 2016

Hyperbolic functions are now implemented. Inverses can be used with the prefix "arc" or simply "a". A test directory has been added to ensure that the implementations return correct answers.

@monadius
Copy link
Member Author

Please also add the prefix "ar" for inverse hyperbolic functions: arsinh, arcosh, and artanh. (Wikipedia)

There should be 3 names for one function: asinh, arsinh, arcsinh, etc.

keram88 added a commit that referenced this issue Jul 24, 2016
keram88 added a commit that referenced this issue Jul 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants