Skip to content

Commit d5ff1e4

Browse files
committed
iteratively compute sinpi
1 parent f72c9ce commit d5ff1e4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/fillalgebra.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,12 @@ function _eigvecs_toeplitz(T; sortby = nothing)
562562
prefactors = _eigvec_prefactors(T, cm1, c1)
563563
for q in axes(M,2)
564564
qrev = n+1-q # match the default eigenvalue sorting
565+
x = qrev/(n+1)
566+
cs = cispi(x)
567+
cs1 = copy(cs)
565568
for j in 1:cld(n,2)
566-
M[j, q] = prefactors[j] * sinpi(j*qrev/(n+1))
569+
M[j, q] = prefactors[j] * imag(cs)
570+
cs *= cs1
567571
end
568572
phase = iseven(n+q) ? 1 : -1
569573
for j in cld(n,2)+1:n

0 commit comments

Comments
 (0)