We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 36e3203 commit a12822fCopy full SHA for a12822f
1 file changed
test/Dual.jl
@@ -1,14 +1,13 @@
1
if isdefined(Base, :get_extension)
2
import ForwardDiff
3
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
-
+ to_dual(z::Complex) = Complex(ForwardDiff.Dual(real(z)), ForwardDiff.Dual(imag(z)))
9
10
@testset "Dual" begin
11
z = 0.5 + 0.8im
12
- @test li_dual(2, z) ≈ PolyLog.li(2, z) rtol=1e-15
+
+ for n in -10:10
+ @test PolyLog.li(n, to_dual(z)) ≈ PolyLog.li(n, z) rtol=1e-14
+ end
13
end
14
0 commit comments