Skip to content

Commit ba49ec0

Browse files
committed
Calculate the initial condition using only real numbers
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.
1 parent 4882061 commit ba49ec0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017–2021: Justin Willmert
3+
Copyright (c) 2017–2022: Justin Willmert
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "AssociatedLegendrePolynomials"
22
uuid = "2119f1ac-fb78-50f5-8cc0-dda848ebdb19"
33
authors = ["Justin Willmert <justin@willmert.me>"]
4-
version = "1.0.0"
4+
version = "1.0.1"
55

66
[compat]
77
julia = "1.2"

src/calculation.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ _fma(x, y, z) = Base.fma(x, y, z)
137137
y¹[ii] = sqrt(y²[ii])
138138
end
139139

140-
fill!(pm, initcond(norm, T))
140+
fill!(pm, initcond(norm, real(T)))
141141
for m in 0:mmax
142142
@simd for ii in I
143143
if N == 2

0 commit comments

Comments
 (0)