[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gsl] [bug #45746] Incorrect results of trigonometric functions gsl_
From: |
Peter Barfuss |
Subject: |
[Bug-gsl] [bug #45746] Incorrect results of trigonometric functions gsl_sf_sin and gsl_sf_cos |
Date: |
Tue, 11 Oct 2016 16:35:38 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.22+ (KHTML, like Gecko) Chromium/17.0.963.56 Chrome/17.0.963.56 Safari/535.22+ jumanji/0.0 |
Follow-up Comment #1, bug #45746 (project gsl):
So gsl_sf_angle_restrict_symm_err_e is basically equivalent to e_rem_pio2. As
you can see in that file, this technique only works until about x ~ 2^18 *
M_PI (~823549.6645, so smaller than you think). Past that, you need to
implement Payne-Hanek reduction (which is the entirety of k_rem_pio2), which
is somewhat of a royal payne.
http://stackoverflow.com/questions/30463616/payne-hanek-algorithm-implementation-in-c
is a pretty comprehensive reference. I might throw something together myself
later if I have time.
There's really no other alternative other than that or the current
implementation, which is "return very invalid results for large values of
fabs(x)", sadly.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?45746>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-gsl] [bug #45746] Incorrect results of trigonometric functions gsl_sf_sin and gsl_sf_cos,
Peter Barfuss <=