Skip to content

Commit a12822f

Browse files
committed
extend test to more orders
1 parent 36e3203 commit a12822f

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

test/Dual.jl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
if isdefined(Base, :get_extension)
22
import ForwardDiff
33

4-
function li_dual(n::Integer, z::Complex)
5-
z_dual = complex(ForwardDiff.Dual(real(z)), ForwardDiff.Dual(imag(z)))
6-
PolyLog.li(n, z_dual)
7-
end
8-
4+
to_dual(z::Complex) = Complex(ForwardDiff.Dual(real(z)), ForwardDiff.Dual(imag(z)))
95

106
@testset "Dual" begin
117
z = 0.5 + 0.8im
12-
@test li_dual(2, z) PolyLog.li(2, z) rtol=1e-15
8+
9+
for n in -10:10
10+
@test PolyLog.li(n, to_dual(z)) PolyLog.li(n, z) rtol=1e-14
11+
end
1312
end
1413
end

0 commit comments

Comments
 (0)