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




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.1 |
|---|---|
| Target | 3.2 |
| Herbie | 2.9 |
if y < -5.3509770605140432e-132 or 6.71735004807858134e-129 < y Initial program 12.8
rmApplied associate-/l*_binary64_201420.9
if -5.3509770605140432e-132 < y < 6.71735004807858134e-129Initial program 9.7
rmApplied add-cube-cbrt_binary64_2023210.8
Applied times-frac_binary64_2020310.0
Final simplification2.9
herbie shell --seed 2021027
(FPCore (x y z)
:name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
:precision binary64
:herbie-target
(if (< z -2.060202331921739e+104) (- x (/ (* z x) y)) (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y))))
(/ (* x (- y z)) y))