Skip to content

Commit

Permalink
only test derivatives on 1.9 onwards
Browse files Browse the repository at this point in the history
  • Loading branch information
longemen3000 committed Jun 3, 2024
1 parent e455404 commit fd6c684
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
6 changes: 4 additions & 2 deletions test/Li.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ end
@test PolyLog.li(n, BigFloat("1.0") + 0im) == PolyLog.zeta(n, BigFloat)

#ForwardDiff Test
@test ForwardDiff.derivative(Base.Fix1(PolyLog.reli,n),float(pi)) == PolyLog.reli(n-1,float(pi))/float(pi)
@test ForwardDiff.derivative(Base.Fix1(PolyLog.reli,n),0.0) == 1.0
if isdefined(Base,:get_extension)
@test ForwardDiff.derivative(Base.Fix1(PolyLog.reli,n),float(pi)) == PolyLog.reli(n-1,float(pi))/float(pi)
@test ForwardDiff.derivative(Base.Fix1(PolyLog.reli,n),0.0) == 1.0
end
end

# value close to boundary between series 1 and 2 in arXiv:2010.09860
Expand Down
6 changes: 4 additions & 2 deletions test/Li1.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
@test PolyLog.li1(1.0 + 1e300im) -690.77552789821371 + 1.5707963267948966im rtol=eps(Float64)

#ForwardDiff Test
@test ForwardDiff.derivative(PolyLog.reli1,float(pi)) == 1/(1 - pi)
@test ForwardDiff.derivative(PolyLog.reli1,0.0) == 1.0
if isdefined(Base,:get_extension)
@test ForwardDiff.derivative(PolyLog.reli1,float(pi)) == 1/(1 - pi)
@test ForwardDiff.derivative(PolyLog.reli1,0.0) == 1.0
end
end
6 changes: 4 additions & 2 deletions test/Li2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
@test PolyLog.li2(1.0 + 1e300im) -238585.82620504462 + 1085.06766186232im rtol=eps(Float64)

#ForwardDiff Test
@test ForwardDiff.derivative(PolyLog.reli2,float(pi)) == PolyLog.reli1(float(pi))/float(pi)
@test ForwardDiff.derivative(PolyLog.reli2,0.0) == 1.0
if isdefined(Base,:get_extension)
@test ForwardDiff.derivative(PolyLog.reli2,float(pi)) == PolyLog.reli1(float(pi))/float(pi)
@test ForwardDiff.derivative(PolyLog.reli2,0.0) == 1.0
end
end
6 changes: 4 additions & 2 deletions test/Li3.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
@test PolyLog.li3(1.0 + 1e300im) -5.4936606061973454e7 + 374771.031356405im rtol=eps(Float64)

#ForwardDiff Test
@test ForwardDiff.derivative(PolyLog.reli3,float(pi)) == PolyLog.reli2(float(pi))/float(pi)
@test ForwardDiff.derivative(PolyLog.reli3,0.0) == 1.0
if isdefined(Base, :ForwardDiff)
@test ForwardDiff.derivative(PolyLog.reli3,float(pi)) == PolyLog.reli2(float(pi))/float(pi)
@test ForwardDiff.derivative(PolyLog.reli3,0.0) == 1.0
end
end
6 changes: 4 additions & 2 deletions test/Li4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
@test PolyLog.li4(1.0 + 1e300im) -9.4872648206269765e9 + 8.62951114411071e7im rtol=eps(Float64)

#ForwardDiff Test
@test ForwardDiff.derivative(PolyLog.reli4,float(pi)) == PolyLog.reli3(float(pi))/float(pi)
@test ForwardDiff.derivative(PolyLog.reli4,0.0) == 1.0
if isdefined(Base,:get_extension)
@test ForwardDiff.derivative(PolyLog.reli4,float(pi)) == PolyLog.reli3(float(pi))/float(pi)
@test ForwardDiff.derivative(PolyLog.reli4,0.0) == 1.0
end
end
4 changes: 3 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using Test
import PolyLog
import ForwardDiff
if isdefined(Base,:get_extension)
import ForwardDiff
end

include("TestPrecision.jl")
include("DataReader.jl")
Expand Down

0 comments on commit fd6c684

Please sign in to comment.