Commit ee4a63a3 authored by ulrich_y's avatar ulrich_y

Added new tests for polylog

parent d303027f
......@@ -28,6 +28,9 @@ PROGRAM TEST
#else
call iprint("Argument -verb is not available, compile with --debug", 2)
#endif
case('-polylog-test')
tol = zero
call do_poly_tests
case('-mpl-test')
tol = zero * 1.e5_prec
call do_MPL_tests
......@@ -110,6 +113,7 @@ CONTAINS
print*,"Runs a set of tests for handyG"
print*,""
print*,"Possible tests are:"
print*," -polylog-test compares a few complex polylogs"
print*," -mpl-test performs tests on the series expansion of"
print*," convergent MPLs"
print*," -gpl-test tests GPLs and their reduction. This includes"
......@@ -135,6 +139,50 @@ CONTAINS
end subroutine
subroutine do_poly_tests()
implicit none
complex(kind=prec) :: ref, z
tol = 1e-9 ! TODO way too loose
z = 0.9999_prec * exp((0.,1._prec))
ref = ( 0.324133535392567026495406418480254855764_prec,1.013852051950427381643871737213288702950_prec)
call check( polylog( 2, z), ref)
ref = ( 0.522770725155376044565670599443640187194_prec,0.869361155897677036715122800524769654185_prec)
call check( polylog( 5, z), ref)
ref = ( 0.539824626930596495579386730660957051319_prec,0.842276214103123630233317308533693430239_prec)
call check( polylog(10, z), ref)
z = 0.99999_prec * exp((0.,1._prec))
ref = ( 0.324137319831170505532582434237087014236_prec,1.013948424389723032721958295757400129230_prec)
call check( polylog( 2, z), ref)
ref = ( 0.522815799416934255669781473407124697155_prec,0.869441778136187554517193738781550493266_prec)
call check( polylog( 5, z), ref)
z = 1.00001_prec * exp((0.,1._prec))
ref = ( 0.324138160221287178367712545364630311917_prec,1.013969840316258729274699928974034201521_prec)
call check( polylog( 2, z), ref)
ref = ( 0.522825815862029305845720413414469502401_prec,0.869459694240961134437078365904557794494_prec)
call check( polylog( 5, z), ref)
z = 0.999999_prec * exp((0.,1._prec))
ref = ( 0.324137698033552982036491149170744105494_prec,1.013958061564363933265675662561552413453_prec)
call check( polylog( 2, z), ref)
ref = ( 0.522820306819813365669890959221612196007_prec,0.869449840381005997194835712531309011624_prec)
call check( polylog( 5, z), ref)
z = 0.9999999_prec * exp((0.,1._prec))
ref = ( 0.324137735851376524606585447637048722447_prec,1.013959025281135047042683412228827082409_prec)
call check( polylog( 2, z), ref)
ref = ( 0.522820757559868506601039369765883468501_prec,0.869450646605697511953904345069485267937_prec)
call check( polylog( 5, z), ref)
z = 0.9999999_prec * exp((0.,2._prec))
ref = (-0.496658534687223270187711312384211419797_prec,0.727145993783645319190052450531069102550_prec)
call check( polylog( 2, z), ref)
ref = (-0.432933763639004718041881713834580186629_prec,0.885265176678646954693047624423223092246_prec)
call check( polylog( 5, z), ref)
end subroutine
subroutine do_MPL_tests()
complex(kind=prec) :: ref
print*, 'doing MPL tests...'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment