Follow-up Comment #1, bug #66862 (group gsl):

The findings were due to rounding errors and both implementations ultimately
rely on the identities:
\sin(x+iy)=\frac{1}{2}\left(\sin(x)\left(e^y+e^{-y}\right)+i\cos(x)\left(e^y-e^{-y}\right)\right)
\\
\cos(x+iy)=\frac{1}{2}\left(\cos(x)\left(e^y+e^{-y}\right)-i\sin(x)\left(e^y-e^{-y}\right)\right)

Specifically finding 3 can be ignored.

Still, it would make sense to rationalise the functions, for example have
complex/gsl_complex_sin() point to specfunc/gsl_sf_complex_sin_e(). The former
relies on the native implementations sinh() / cosh(h), while the latter on
sinh_series() / cosh_series(), which are under our control and allow for
arbitrary precision.

Some additional test cases have been added. Where they fail, it is down to
accuracy at 10^-14 or smaller. Results have been checked against Julia and
Mathematica.

Further areas for improvement for specfunc/trig.c and can be added to
specfunc/TODO file:
1- naming conventions of variables could be made more consistent, for example
a_r instead of R for the real part of the argument.
2- there are gsl_sf_complex_sin_e() and gsl_sf_complex_cos_e(), but no
gsl_sf_complex_sin() or gsl_sf_complex_cos().
3- there is a gsl_sf_complex_logsin_e(), but no gsl_sf_complex_logcos_e().
4- these functions should be called gsl_sf_complex_lnsin_e() etc, to match
with naming convention of similar logarithm functions.


(file #56988)

    _______________________________________________________

Additional Item Attachment:

File name: specfunc_test_sf.diff          Size: 6KiB
    <https://file.savannah.gnu.org/file/specfunc_test_sf.diff?file_id=56988>


    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-0b36f6c0238c4c45bfdaf6150748d50ab48e7ef4.tar.gz


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66862>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to