if not (tableau.c_sol[-1] == 0 and (tableau.c_sol[:-1] == tableau.beta[-1]).all()):
// This property (true for Dormand-Prince) lets us save a few FLOPs.
yi = y0 + k.matmul(dt * tableau.c_sol).view_as(f0)
y1 = yi
f1 = k[..., -1]
y1_error = k.matmul(dt * tableau.c_error)
After Change
if not (tableau.c_sol[-1] == 0 and (tableau.c_sol[:-1] == tableau.beta[-1]).all()):
// This property (true for Dormand-Prince) lets us save a few FLOPs.
yi = y0 + k.matmul(dt * tableau.c_sol).view_as(f0).type_as(y0) // tableau is float 64 so cast back
y1 = yi
f1 = k[..., -1]