Commit 5fd2633a by Luca Naterop

working pending integrals implementation

parent f7d1f54e
 ... @@ -60,48 +60,40 @@ CONTAINS ... @@ -60,48 +60,40 @@ CONTAINS print*, 'G(', abs(z_flat), abs(y), ')' print*, 'G(', abs(z_flat), abs(y), ')' END SUBROUTINE print_G END SUBROUTINE print_G RECURSIVE FUNCTION pending_integral(p,i,g) result(res) ! reduces a pending integral given by ! p = (y1, b1, ..., br) ! i = position of integration variable within g ! g = arguments of G-function, without the variable that is integrated over ! to a G function complex(kind=prec) :: p(:), g(:), res, y2 integer :: i res = 0 ! is what we have a G-function? if(size(g)+1 == i) then res = G_flat( [p(2:size(p)), g], p(1) ) return end if ! case where we use (64) RECURSIVE FUNCTION pending_integral(p,i,g) result(res) if(size(g) == 1 .and. i == 1) then ! evaluates a pending integral by reducing it to simpler ones and g functions y2 = g(1) complex(kind=prec) :: p(:), g(:), res res = pending_integral(p,2,[sub_ieps(y2)]) - pending_integral(p,2,[cmplx(0.0)]) & integer :: i + G_flat(p(2:size(p)),p(1)) * log(-sub_ieps(y2)) return res = 0 end if if(i == size(g)+1) then res = G_flat([p(2:size(p)),g], p(1)) return end if if(size(g) == 1) then res = pending_integral(p,2,[sub_ieps(g(1))]) - pending_integral(p,2,[cmplx(0.0)]) & + G_flat(p(2:size(p)), p(1)) * log(-sub_ieps(g(1))) end if END FUNCTION pending_integral END FUNCTION pending_integral FUNCTION reduce_to_convergent(a, y2) result(res) FUNCTION reduce_to_convergent(a,y2) result(res) complex(kind=prec) :: a(:), y2, res, s_r complex(kind=prec) :: a(:), y2, res, sr integer :: min_i integer :: i min_i = min_index(abs(a)) s_r = a(min_i) res = 0 res = 0 ! case that minimum is at first place i = min_index(abs(a)) if(min_i == 1) then sr = a(i) res = G_flat([cmplx(0.0), a(2:size(a))], y2) ! first term of (64) if(i == 1) then res = res + G_flat([y2], s_r) * G_flat(a(2:size(a)), y2) res = G_flat([cmplx(0), a(i+1:size(a))], y2) & res = res + pending_integral( [s_r, a(min_i+1)], min_i, [a(3:size(a)), y2] ) + G_flat([y2], sr) * G_flat(a(i+1:size(a)), y2) & res = res + G_flat([a(min_i+1)],s_r) * G_flat(a(2:size(a)), y2) + pending_integral([sr, a(i+1)], i, [a(i+2:size(a)), y2]) & - G_flat([a(i+1)], sr) * G_flat(a(i+1:size(a)), y2) return return end if end if END FUNCTION reduce_to_convergent END FUNCTION reduce_to_convergent RECURSIVE FUNCTION G_flat(z_flat,y) result(res) RECURSIVE FUNCTION G_flat(z_flat,y) result(res) ! Calls G function with flat arguments, that is, zeroes not passed through the m's. ! Calls G function with flat arguments, that is, zeroes not passed through the m's. ... @@ -154,7 +146,7 @@ CONTAINS ... @@ -154,7 +146,7 @@ CONTAINS res = G_condensed(m,z,y,size(m)) res = G_condensed(m,z,y,size(m)) deallocate(m) deallocate(m) deallocate(z) deallocate(z) END FUNCTION G_flat END FUNCTION G_flat RECURSIVE FUNCTION G_condensed(m,z,y,k) result(res) RECURSIVE FUNCTION G_condensed(m,z,y,k) result(res) ! computes the generalized polylogarithm G_{m1,..mk} (z1,...zk; y) ! computes the generalized polylogarithm G_{m1,..mk} (z1,...zk; y) ... ...
 ... @@ -18,7 +18,7 @@ PROGRAM TEST ... @@ -18,7 +18,7 @@ PROGRAM TEST ! call do_GPL_tests() ! call do_GPL_tests() ! call do_shuffle_tests() ! put this somewhere else ! call do_shuffle_tests() ! put this somewhere else res = G_flat(cmplx((/0.3,2.2/)),cmplx(2.0)) res = G_flat(cmplx((/1.0,10.0/)),cmplx(2.0)) print*, res print*, res ! if(tests_successful) then ! if(tests_successful) then ... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!