We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86f6207 commit b0259dcCopy full SHA for b0259dc
src/methods.jl
@@ -157,10 +157,12 @@ end
157
158
# Compute coefficients for the method
159
function _coefs(grid::AbstractVector{<:Real}, p::Integer, q::Integer)
160
- C = [g^i for i in 0:(p - 1), g in grid]
161
- x = zeros(Int, p)
+ # For high precision on the \ we use Rational, and to prevent overfloats we use Int128
+ # At the end we go to Float64 for fast floating point math (rather than rational math)
162
+ C = [Rational{Int128}(g^i) for i in 0:(p - 1), g in grid]
163
+ x = zeros(Rational{Int128}, p)
164
x[q + 1] = factorial(q)
- return C \ x
165
+ return Float64.(C \ x)
166
end
167
168
# Estimate the bound on the function value and its derivatives at a point
0 commit comments