Commit 3ec2beb9 authored by Luca Naterop's avatar Luca Naterop

global params to control accuracy

parent 2e8dc74b
......@@ -2,16 +2,22 @@
MODULE globals
implicit none
integer, parameter :: prec = selected_real_kind(15,32)
integer, parameter :: GPLInfinity = 30 ! the default outermost expansion order for MPLs
real, parameter :: epsilon = 1e-20 ! used for the small imaginary part
real, parameter :: zero = 1e-15 ! values smaller than this count as zero
real, parameter :: pi = 3.14159265358979323846
! The following parameters control the accuracy of the evaluation
integer :: MPLInfinity = 30 ! the default outermost expansion order for MPLs, formerly GPLInfinity
integer :: PolylogInfinity = 1000 ! expansion order for Polylogs
real(kind=prec) :: HoelderCircle = 1.1 ! when to apply Hoelder convolution?
integer :: verb = 0
CONTAINS
SUBROUTINE parse_cmd_args
integer :: i
character(len=32) :: arg
......
......@@ -331,15 +331,13 @@ CONTAINS
end if
! requires Hoelder convolution?
if( any(1.0 <= abs(z_flat/y) .and. abs(z_flat/y) <= 1.1) ) then
if( any(1.0 <= abs(z_flat/y) .and. abs(z_flat/y) <= HoelderCircle) ) then
res = improve_convergence(z_flat/y)
return
end if
! thus it is convergent, and has no trailing zeros
! -> evaluate in condensed notation -> which will give series representation
! -> evaluate in condensed notation which will give series representation
m_prime = get_condensed_m(z_flat)
if(find_first_zero(m_prime) == -1) then
condensed_size = size(m_prime)
......
......@@ -19,10 +19,9 @@ CONTAINS
! Computes the classical polylogarithm Li_m(x) using series representation up to order n
integer :: m
complex(kind=prec) :: x, res
integer :: i,n
n = 1000
integer :: i
res=0.
do i=1,n
do i=1,PolylogInfinity
if(i**m.lt.0) return ! roll over
if(abs(x**i).lt.1.e-250) return
res = res+x**i/i**m
......
......@@ -28,7 +28,7 @@ CONTAINS
integer, optional :: n_passed
integer :: i, n
n = merge(n_passed,GPLInfinity,present(n_passed))
n = merge(n_passed,MPLInfinity,present(n_passed))
if(size(m) /= size(x)) then
print*, 'Error: m and x must have the same length'
......
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