\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.5670411781114046 \cdot 10^{-141} \lor \neg \left(x \cdot y \leq 9.134236070867421 \cdot 10^{-110}\right):\\
\;\;\;\;\frac{\left(y \cdot \frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{z}}}{\sqrt[3]{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* x y) z))
(FPCore (x y z)
:precision binary64
(if (or (<= (* x y) -3.5670411781114046e-141)
(not (<= (* x y) 9.134236070867421e-110)))
(/
(* (* y (/ (* (cbrt x) (cbrt x)) (cbrt z))) (/ (cbrt x) (cbrt z)))
(cbrt z))
(/ x (/ z y))))double code(double x, double y, double z) {
return (x * y) / z;
}
double code(double x, double y, double z) {
double tmp;
if (((x * y) <= -3.5670411781114046e-141) || !((x * y) <= 9.134236070867421e-110)) {
tmp = ((y * ((cbrt(x) * cbrt(x)) / cbrt(z))) * (cbrt(x) / cbrt(z))) / cbrt(z);
} else {
tmp = x / (z / y);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 5.9 |
|---|---|
| Target | 6.3 |
| Herbie | 2.4 |
if (*.f64 x y) < -3.5670411781114046e-141 or 9.134236070867421e-110 < (*.f64 x y) Initial program 4.8
rmApplied add-cube-cbrt_binary64_212555.8
Applied associate-/r*_binary64_211645.9
Simplified7.1
rmApplied add-cube-cbrt_binary64_212557.3
Applied times-frac_binary64_212267.3
Applied associate-*r*_binary64_211602.9
if -3.5670411781114046e-141 < (*.f64 x y) < 9.134236070867421e-110Initial program 7.6
rmApplied associate-/l*_binary64_211651.5
Final simplification2.4
herbie shell --seed 2021098
(FPCore (x y z)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< z -4.262230790519429e-138) (/ (* x y) z) (if (< z 1.7042130660650472e-164) (/ x (/ z y)) (* (/ x z) y)))
(/ (* x y) z))