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 1
1
name = " FiniteDifferences"
2
2
uuid = " 26cc04aa-876d-5657-8c51-4c34ba976000"
3
- version = " 0.9.2 "
3
+ version = " 0.9.3 "
4
4
5
5
[deps ]
6
6
LinearAlgebra = " 37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Original file line number Diff line number Diff line change @@ -157,10 +157,12 @@ end
157
157
158
158
# Compute coefficients for the method
159
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)
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)
162
164
x[q + 1 ] = factorial (q)
163
- return C \ x
165
+ return Float64 .( C \ x)
164
166
end
165
167
166
168
# 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