Skip to content

Calculate the initial condition using only real numbers #33

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

Merged
merged 1 commit into from
Nov 19, 2022

Conversation

jmert
Copy link
Owner

@jmert jmert commented Nov 19, 2022

The other recursion coefficients were already all using only real number types, but the initial condition was forgotten. This has worked thus far, but a change in the upcoming Julia v1.9 (presumably JuliaLang/julia#47255) broke the exact correspondance between real inputs and real-axis complex inputs for the spherical normalization.

Specifically, on Julia 1.8:

julia> r = inv(sqrt(4convert(Float64, π)))
0.28209479177387814

julia> r - real(inv(sqrt(4convert(ComplexF64, π))))
0.0

while with Julia 1.9:

julia> r = inv(sqrt(4convert(Float64, π)))
0.28209479177387814

julia> r - real(inv(sqrt(4convert(ComplexF64, π))))
-5.551115123125783e-17

The simple change that allows the tests to pass again is to just ask for the initial condition to be calculated in the appropriate real number type.

The other recursion coefficients were already all using only real
number types, but the initial condition was forgotten. This has worked
thus far, but a change in the upcoming Julia v1.9 (presumably
JuliaLang/julia#47255) broke the exact correspondance between real
inputs and real-axis complex inputs for the spherical normalization.

Specifically, on Julia 1.8:
```julia
julia> r = inv(sqrt(4convert(Float64, π)))
0.28209479177387814

julia> r - real(inv(sqrt(4convert(ComplexF64, π))))
0.0
```
while with Julia 1.9:
```julia
julia> r = inv(sqrt(4convert(Float64, π)))
0.28209479177387814

julia> r - real(inv(sqrt(4convert(ComplexF64, π))))
-5.551115123125783e-17
```

The simple change that allows the tests to pass again is to just ask
for the initial condition to be calculated in the appropriate real
number type.
@codecov
Copy link

codecov bot commented Nov 19, 2022

Codecov Report

Merging #33 (5603444) into master (b0df887) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master      #33   +/-   ##
=======================================
  Coverage   96.57%   96.57%           
=======================================
  Files           9        9           
  Lines         350      350           
=======================================
  Hits          338      338           
  Misses         12       12           
Impacted Files Coverage Δ
src/calculation.jl 94.40% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jmert jmert merged commit ba49ec0 into master Nov 19, 2022
@jmert jmert deleted the jw/complex_initcond branch November 19, 2022 16:13
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

Successfully merging this pull request may close these issues.

1 participant