diff --git a/gpl_module.f90 b/gpl_module.f90 index d979e539640804362081207358dd1ad0e7245c03..8eca5bbae630e5fb919fe768ac4902d9f0652bab 100644 --- a/gpl_module.f90 +++ b/gpl_module.f90 @@ -1,4 +1,4 @@ - + MODULE gpl_module use mpl_module @@ -6,12 +6,38 @@ MODULE gpl_module CONTAINS - FUNCTION GPL() - ! integer :: m(:) - ! complex(kind=prec) :: y(:) - complex(kind=prec) GPL + FUNCTION GPL(m,z,y,k) + ! computes the generalized polylogarithm G_{m1,..mk} (z1,...zk; y) + + integer :: m(:), k, i + complex(kind=prec) :: z(:), x(k), y, GPL + + ! print*, 'GPL called with arguments:' + ! print*, 'm=',m + ! print*, 'z=',z + ! print*, 'y=',y + + do i = 1,k + x(i) = merge(y/z(1), z(i-1)/z(i),i == 1) + end do + + GPL = (-1)**k * MPL(m,x) - print*, 'hello, GPL' END FUNCTION GPL END MODULE gpl_module + +! PROGRAM test +! ! used to test this module +! use gpl_module + +! integer :: m(2) = (/ 1,1 /) +! complex(kind=prec) :: z(2) = dcmplx((/ 1.3d0, 1.1d0 /)) +! complex(kind=prec) :: y = 0.4 +! complex(kind=prec) :: res + +! res = GPL(m,z,y,2) +! print*, 'res=',res + +! END PROGRAM test + diff --git a/test.f90 b/test.f90 index 6efe95e1130d15ec2e8901196bb4c0197036bd2e..860ac3df04c7058701085aac912a6effa7241988 100644 --- a/test.f90 +++ b/test.f90 @@ -12,8 +12,6 @@ PROGRAM TEST call do_MPL_tests() - res = GPL() - CONTAINS subroutine do_MPL_tests() @@ -25,18 +23,18 @@ CONTAINS print*, 'doing multiple polylog tests...' m2 = (/ 1,1 /) - x2 = cmplx((/ 0.3156498673740053, 0.3431255827785649 /)) - ref = cmplx(0.022696600480693277651633) + x2 = dcmplx((/ 0.3156498673740053, 0.3431255827785649 /)) + ref = dcmplx(0.022696600480693277651633) call check_MPL(m2,x2,ref) m2 = (/ 1,1 /) - x2 = cmplx((/ 0.03, 0.5012562893380046 /)) - ref = cmplx(0.00023134615630308335448329926098409) + x2 = dcmplx((/ 0.03, 0.5012562893380046 /)) + ref = dcmplx(0.00023134615630308335448329926098409) call check_MPL(m2,x2,ref) m3 = (/ 2,1,2 /) - x3 = cmplx((/ 0.03, 0.5012562893380046, 55.3832 /)) - ref = cmplx(0.000023446106415452030937059124671151) + x3 = dcmplx((/ 0.03, 0.5012562893380046, 55.3832 /)) + ref = dcmplx(0.000023446106415452030937059124671151) call check_MPL(m3,x3,ref) end subroutine do_MPL_tests