(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
(FPCore (x y z t a) :precision binary64 (- (/ x (- t (* a z))) (/ y (- (/ t z) a))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
double code(double x, double y, double z, double t, double a) {
return (x / (t - (a * z))) - (y / ((t / z) - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x - (y * z)) / (t - (a * z))
end function
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x / (t - (a * z))) - (y / ((t / z) - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
public static double code(double x, double y, double z, double t, double a) {
return (x / (t - (a * z))) - (y / ((t / z) - a));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
def code(x, y, z, t, a): return (x / (t - (a * z))) - (y / ((t / z) - a))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function code(x, y, z, t, a) return Float64(Float64(x / Float64(t - Float64(a * z))) - Float64(y / Float64(Float64(t / z) - a))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
function tmp = code(x, y, z, t, a) tmp = (x / (t - (a * z))) - (y / ((t / z) - a)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := N[(N[(x / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x - y \cdot z}{t - a \cdot z}
\frac{x}{t - a \cdot z} - \frac{y}{\frac{t}{z} - a}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 10.4 |
|---|---|
| Target | 1.9 |
| Herbie | 3.2 |
Initial program 10.4
Taylor expanded in x around 0 10.4
Applied *-un-lft-identity_binary6410.4
Applied times-frac_binary648.2
Simplified8.2
Simplified8.2
Taylor expanded in y around 0 10.4
Simplified3.2
Final simplification3.2
herbie shell --seed 2022131
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< z -32113435955957344.0) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a)))))
(/ (- x (* y z)) (- t (* a z))))