File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 11name = " FiniteDifferences"
22uuid = " 26cc04aa-876d-5657-8c51-4c34ba976000"
3- version = " 0.9.2 "
3+ version = " 0.9.3 "
44
55[deps ]
66LinearAlgebra = " 37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Original file line number Diff line number Diff line change @@ -157,10 +157,12 @@ end
157157
158158# Compute coefficients for the method
159159function _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)
160+ # For high precision on the \ we use Rational, and to prevent overfloats we use Int128
161+ # 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)
162164 x[q + 1 ] = factorial (q)
163- return C \ x
165+ return Float64 .( C \ x)
164166end
165167
166168# Estimate the bound on the function value and its derivatives at a point
You can’t perform that action at this time.
0 commit comments