IrrationalConstants.jl icon indicating copy to clipboard operation
IrrationalConstants.jl copied to clipboard

Add "missing" irrationals

Open devmotion opened this issue 4 years ago • 2 comments

This PR adds some irrationals that seem to be "missing" and would be useful e.g. in SpecialFunctions. E.g., currently pi (in base), 2 * pi, 4 * pi, pi / 2, and pi / 4 are defined but even though the inverse of all of these numbers is defined as well only log(pi), log(2 * pi), and log(4 * pi) are implemented but neither log(pi / 2) nor log(pi / 4). Similarly, currently sqrt(pi / 4) is not defined (all other square roots are) and only 1 / sqrt(2 * pi) is defined but no other inverse square roots.

devmotion avatar Sep 20 '21 20:09 devmotion

Bump :slightly_smiling_face:

In particular invsqrtπ and invsqrtquartπ would be very helpful for the ChainRules definition since it would allow us eg to implement the derivative of erfcx(x) as 2 * (x * Ω - invsqrtπ) or 2 * x * Ω - invsqrtquartπ which in contrast to 2 * x * Ω - 2 / sqrtπ does not lead to any undesired promotions for e.g. Float32.

devmotion avatar Sep 23 '21 13:09 devmotion

Bump :slightly_smiling_face:

devmotion avatar Oct 02 '21 19:10 devmotion