\frac{x - y \cdot z}{t - a \cdot z}\begin{array}{l}
\mathbf{if}\;z \leq -1.1630780186435354 \cdot 10^{-34} \lor \neg \left(z \leq 1.4508809270850323 \cdot 10^{-194}\right):\\
\;\;\;\;\frac{x}{t - z \cdot a} - \frac{y}{\frac{t}{z} - a}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{\frac{x - z \cdot y}{t - z \cdot a}} \cdot \left(\sqrt[3]{\frac{x - z \cdot y}{t - z \cdot a}} \cdot \sqrt[3]{\frac{x - z \cdot y}{t - z \cdot a}}\right)\\
\end{array}(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
(FPCore (x y z t a)
:precision binary64
(if (or (<= z -1.1630780186435354e-34) (not (<= z 1.4508809270850323e-194)))
(- (/ x (- t (* z a))) (/ y (- (/ t z) a)))
(*
(cbrt (/ (- x (* z y)) (- t (* z a))))
(*
(cbrt (/ (- x (* z y)) (- t (* z a))))
(cbrt (/ (- x (* 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) {
double tmp;
if ((z <= -1.1630780186435354e-34) || !(z <= 1.4508809270850323e-194)) {
tmp = (x / (t - (z * a))) - (y / ((t / z) - a));
} else {
tmp = cbrt((x - (z * y)) / (t - (z * a))) * (cbrt((x - (z * y)) / (t - (z * a))) * cbrt((x - (z * y)) / (t - (z * a))));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 10.9 |
|---|---|
| Target | 1.6 |
| Herbie | 2.2 |
if z < -1.1630780186435354e-34 or 1.4508809270850323e-194 < z Initial program 15.8
rmApplied div-sub_binary6415.8
Simplified15.8
Simplified15.8
rmApplied associate-/l*_binary6410.5
rmApplied div-sub_binary6410.5
Simplified2.6
if -1.1630780186435354e-34 < z < 1.4508809270850323e-194Initial program 0.1
rmApplied add-cube-cbrt_binary641.2
Simplified1.2
Simplified1.2
Final simplification2.2
herbie shell --seed 2020231
(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))))