PVInt := proc(f::algebraic, r::(name = range), p::realcons) options `Maple Advisor Database 1.01 for Maple 6`, `Copyright (c) 2000 by Robert B. Israel. All rights reserved`; local g, v, n, o, J1, eps, fg; v := op(1, r); o := 0; n := -Order; if 0 <= n then n := -6 end if; while n < 2 do o := o + 2 - n; if 100 < o then ERROR("Order too large") end if; g := numapprox[laurent](f, v = p, o); if not has(g, O) then break end if; n := op(-1, g) end do; userinfo(1, PVInt, "Laurent series ", g); g := convert(g, polynom); J1 := int(g, r, CauchyPrincipalValue); if has(J1, infinity) then RETURN(J1) end if; J1 := evalf(J1); fg := subs(_F = f, _G = g, _V = v, proc(x) local fx, gx, d; fx := traperror(evalf(eval(_F, _V = x))); if fx = lasterror then RETURN(0) end if; d := max(5, ilog10(abs(fx))); if 2*Digits < d then RETURN(0) end if; evalf(eval(_F - _G, _V = x), Digits + d) end proc); J1 + evalf(Int(fg, op(2, r))) end proc;