\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -6.188455075910293 \cdot 10^{-153} \lor \neg \left(x \cdot y \leq 3.775274464953522 \cdot 10^{-137}\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{y}{\frac{z}{x}}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* x y) z))
(FPCore (x y z)
:precision binary64
(if (or (<= (* x y) -6.188455075910293e-153)
(not (<= (* x y) 3.775274464953522e-137)))
(/
(* (* y (/ (* (cbrt x) (cbrt x)) (cbrt z))) (/ (cbrt x) (cbrt z)))
(cbrt z))
(/ y (/ z x))))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) <= -6.188455075910293e-153) || !((x * y) <= 3.775274464953522e-137)) {
tmp = ((y * ((cbrt(x) * cbrt(x)) / cbrt(z))) * (cbrt(x) / cbrt(z))) / cbrt(z);
} else {
tmp = y / (z / x);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.5 |
|---|---|
| Target | 6.2 |
| Herbie | 2.1 |
if (*.f64 x y) < -6.1884550759102927e-153 or 3.7752744649535218e-137 < (*.f64 x y) Initial program 5.1
rmApplied add-cube-cbrt_binary646.1
Applied associate-/r*_binary646.1
Simplified6.9
rmApplied add-cube-cbrt_binary647.1
Applied times-frac_binary647.1
Applied associate-*r*_binary642.5
if -6.1884550759102927e-153 < (*.f64 x y) < 3.7752744649535218e-137Initial program 9.0
rmApplied add-cube-cbrt_binary649.5
Applied associate-/r*_binary649.5
Simplified3.1
rmApplied associate-/l*_binary641.9
Simplified1.3
Final simplification2.1
herbie shell --seed 2021174
(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))