Commit f91f198f authored by Luca Naterop's avatar Luca Naterop
Browse files

relate GPL to MPL

parent 84f14c42
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
......@@ -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
......
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