\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot y}{z} \leq -\infty:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;\frac{x \cdot y}{z} \leq -1.1315654655892 \cdot 10^{-317}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* x y) z))
(FPCore (x y z)
:precision binary64
(if (<= (/ (* x y) z) (- INFINITY))
(/ x (/ z y))
(if (<= (/ (* x y) z) -1.1315654655892e-317)
(/ (* x y) z)
(*
(* x (/ (* (cbrt y) (cbrt y)) (* (cbrt z) (cbrt z))))
(/ (cbrt y) (cbrt z))))))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) / z) <= -((double) INFINITY)) {
tmp = x / (z / y);
} else if (((x * y) / z) <= -1.1315654655892e-317) {
tmp = (x * y) / z;
} else {
tmp = (x * ((cbrt(y) * cbrt(y)) / (cbrt(z) * cbrt(z)))) * (cbrt(y) / cbrt(z));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.3 |
|---|---|
| Target | 6.3 |
| Herbie | 1.2 |
if (/.f64 (*.f64 x y) z) < -inf.0Initial program 64.0
rmApplied associate-/l*_binary64_180960.2
if -inf.0 < (/.f64 (*.f64 x y) z) < -1.13156547e-317Initial program 0.5
if -1.13156547e-317 < (/.f64 (*.f64 x y) z) Initial program 7.4
rmApplied *-un-lft-identity_binary64_181517.4
Applied times-frac_binary64_181574.9
Simplified4.9
rmApplied add-cube-cbrt_binary64_181865.6
Applied add-cube-cbrt_binary64_181865.7
Applied times-frac_binary64_181575.7
Applied associate-*r*_binary64_180911.6
Final simplification1.2
herbie shell --seed 2021013
(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))