Skip to content

Commit 84d1add

Browse files
authored
Use rational representation if possible (#182)
1 parent a054ab9 commit 84d1add

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/time_integration_methods.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,10 @@ Reference: Section 315 of
119119
function residual_order_condition(t::RootedTree, rk::RungeKuttaMethod)
120120
ew = elementary_weight(t, rk)
121121
T = typeof(ew)
122+
invγ = 1//γ(t)
123+
invσ = 1//σ(t)
122124

123-
(ew - one(T) / γ(t)) / σ(t)
125+
(ew - invγ) * invσ
124126
end
125127

126128
# TODO: Deprecations introduced in v2

0 commit comments

Comments
 (0)