We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
NaN
digamma
_cotpi
The definition of _digamma(z::ComplexOrReal{Float64}) contains the formula
_digamma(z::ComplexOrReal{Float64})
SpecialFunctions.jl/src/gamma.jl
Line 29 in cf35c58
Line 63 in cf35c58
cospi
sinpi
Inf
julia> cospi(500 * exp(im * 3pi/4)) Inf - Inf*im julia> sinpi(500 * exp(im * 3pi/4)) Inf + Inf*im julia> cospi(500 * exp(im * 3pi/4)) / sinpi(500 * exp(im * 3pi/4)) NaN + NaN*im
Nevertheless, the ordinary cot gives the correct answer
cot
julia> cot(pi * 500 * exp(im * 3pi/4)) 0.0 - 1.0im
A way to avoid NaN is to define cotpi as in mpmath https://github.com/mpmath/mpmath/blob/b600dbcabf4b7406a61e82b9e607f754a9f12ff9/mpmath/libfp.py#L153-L161
cotpi
mpmath
The text was updated successfully, but these errors were encountered:
Wouldn't it be better to fix tanpi in base?
tanpi
Sorry, something went wrong.
tan
I have added a comment under a tanpi issue in the Julia repo.
No branches or pull requests
The definition of
_digamma(z::ComplexOrReal{Float64})
contains the formulaSpecialFunctions.jl/src/gamma.jl
Line 29 in cf35c58
in which
_cotpi
is defined asSpecialFunctions.jl/src/gamma.jl
Line 63 in cf35c58
For large complex arguments,
_cotpi
producesNaN
sincecospi
andsinpi
produceInf
. For example,Nevertheless, the ordinary
cot
gives the correct answerA way to avoid
NaN
is to definecotpi
as inmpmath
https://github.com/mpmath/mpmath/blob/b600dbcabf4b7406a61e82b9e607f754a9f12ff9/mpmath/libfp.py#L153-L161
The text was updated successfully, but these errors were encountered: