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

Add methods taking machine floats for Sinh, Cosh, Tanh, Asinh, Acosh, Atanh, CubeRoot, Erf, Gamma #3986

Merged
merged 1 commit into from
Apr 27, 2020

Conversation

fingolfin
Copy link
Member

  • A bunch of operations for floating point numbers had no implementation for
    machine floats, even though C99 provides suitable functions.

  • Most of the math functions we checked for in configure are actually
    guaranteed to be there by C99. The sole exception is exp10, which is a
    non-standard extension.

  • Add a bunch of super-trivial tests to ensure those new functions are
    actually callable. These are not good tests, just a bare minimum.

Resolves #3983

- A bunch of operations for floating point numbers had no implementation for
  machine floats, even though C99 provides suitable functions.

- Most of the math functions we checked for in configure are actually
  guaranteed to be there by C99. The sole exception is exp10, which is a
  non-standard extension.

- Add a bunch of super-trivial tests to ensure those new functions are
  actually callable. These are not good tests, just a bare minimum.
@fingolfin fingolfin added kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements topic: kernel release notes: to be added PRs introducing changes that should be (but have not yet been) mentioned in the release notes labels Apr 26, 2020
[ 0., 1. ]
gap> Erf(0.);
0.
gap> #Zeta(0.); # TODO: not implemented for machine floats
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually as far as I can tell, not even the float package implements this, for any float type -- correct, @laurentbartholdi ?

So perhaps we should just remove this, there seems little value in keeping an operation with no methods around?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I just followed the standard (I don't remember where I read it, though); so in my opinion it's best to leave it there, so as to reserve the word "Zeta".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laurentbartholdi could you please clarify which "standard" you are referring to here?

Copy link
Member

@mohamed-barakat mohamed-barakat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fingolfin.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 84.371% when pulling 853fa92 on fingolfin:mh/floats into 7941f3d on gap-system:master.

@laurentbartholdi
Copy link
Contributor

laurentbartholdi commented Apr 27, 2020 via email

@fingolfin
Copy link
Member Author

Well, C99 implements most of the functions you added to GAP, except for zeta. And also gamma was renamed to tgamma and with a companion lgamma that apparently often is more useful. See https://en.cppreference.com/w/c/numeric/math

I looked a bit around and found no standard the includes zeta, other than indeed C++17 which seems to include everything and the kitchen sink, but that's not something we can reasonably aim for :-)

@fingolfin fingolfin changed the title kernel: add some 'missing' methods for machine floats Add some missing methods for machine floats (Sinh, Cosh, Tanh, Asinh, Acosh, Atanh, CubeRoot, Erf, Gamma) Apr 27, 2020
@fingolfin fingolfin merged commit 3ad5da9 into gap-system:master Apr 27, 2020
@fingolfin fingolfin deleted the mh/floats branch April 27, 2020 17:03
@ThomasBreuer ThomasBreuer added release notes: added PRs introducing changes that have since been mentioned in the release notes and removed release notes: to be added PRs introducing changes that should be (but have not yet been) mentioned in the release notes labels Feb 17, 2021
@fingolfin fingolfin changed the title Add some missing methods for machine floats (Sinh, Cosh, Tanh, Asinh, Acosh, Atanh, CubeRoot, Erf, Gamma) Add some missing methods for machine floats (Sinh, Cosh, Tanh, Asinh, Acosh, Atanh, CubeRoot, Erf, Gamma) Aug 17, 2022
@fingolfin fingolfin changed the title Add some missing methods for machine floats (Sinh, Cosh, Tanh, Asinh, Acosh, Atanh, CubeRoot, Erf, Gamma) Add methods taking machine floats for Sinh, Cosh, Tanh, Asinh, Acosh, Atanh, CubeRoot, Erf, Gamma Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements release notes: added PRs introducing changes that have since been mentioned in the release notes topic: kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Asinh/Acosh/Atanh have no methods for machine floats
5 participants