@@ -75,9 +75,15 @@ function extrapolate(f, h_::Number; contract::Number=oftype(float(real(h_)), 0.1
75
75
atol:: Real = 0 , rtol:: Real = atol > zero (atol) ? zero (one (float (real (x0+ h_)))) : sqrt (eps (typeof (one (float (real (x0+ h_)))))),
76
76
maxeval:: Integer = typemax (Int), breaktol:: Real = 2 )
77
77
if isinf (x0)
78
- # use a change of variables x = 1/u
79
- return extrapolate (u -> f (inv (u)), inv (h_); rtol= rtol, atol= atol, maxeval= maxeval, contract = abs (contract) > 1 ? inv (contract) : contract, x0= inv (x0), power= power)
78
+ # use a change of variables x = 1/u
79
+ contract = abs (contract) > 1 ? inv (contract) : contract
80
+ _extrapolate (u -> f (inv (u)), inv (h_), contract, inv (x0), power, atol, rtol, maxeval, breaktol)
81
+ else
82
+ _extrapolate (f, h_, contract, x0, power, atol, rtol, maxeval, breaktol)
80
83
end
84
+ end
85
+
86
+ function _extrapolate (f, h_:: Number , contract, x0, power, atol, rtol, maxeval, breaktol)
81
87
(rtol ≥ 0 && atol ≥ zero (atol)) || throw (ArgumentError (" rtol and atol must be nonnegative" ))
82
88
breaktol > 0 || throw (ArgumentError (" breaktol must be positive" ))
83
89
0 < abs (contract) < 1 || throw (ArgumentError (" contract must be in (0,1)" ))
0 commit comments