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

Faddeeva/Faddeeva.cc needs an update (my_copysign function is wrong) #49

Closed
fp4code opened this issue Apr 6, 2018 · 3 comments
Closed

Comments

@fp4code
Copy link
Contributor

fp4code commented Apr 6, 2018

Comparing Faddeeva/Faddeeva.cc with http://ab-initio.mit.edu/Faddeeva.cc we obtain

142a143
>           12 May 2015: Bugfix for systems lacking copysign function.
202c203
< static inline double my_copysign(double x, double y) { return y<0 ? -x : x; }
---
> static inline double my_copysign(double x, double y) { return x<0 != y<0 ? -x : x; }
223,226d223
< 
< #ifdef USE_OPENLIBM
< #  include <openlibm.h>
< #else
228d224
< #endif
248,254d243
< #  endif
< 
< #  ifdef USE_OPENLIBM
< #  ifndef CMPLX
< #    include "openlibm.h"
< #    define CMPLX(a,b) cpack(a,b)
< #  endif

The function my_copysign is clearly wrong.

@ViralBShah
Copy link
Member

cc @stevengj

@stevengj
Copy link
Member

stevengj commented Apr 6, 2018

Yes, this patch should be applied to openspecfun too. In practice, probably all of the platforms supported by openspecfun have a copysign function, so my_copysign is never invoked, but still would be good to patch.

ViralBShah added a commit that referenced this issue Dec 29, 2021
@ViralBShah
Copy link
Member

Closed by #55. I don't think a new release is necessary immediately for reasons mentioned above, but if I do end up excising rem_pio2, the new binaries will include this fix too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants