\frac{x \cdot \left(y - z\right)}{y}
\begin{array}{l}
\mathbf{if}\;z \leq -1.715631163475474 \cdot 10^{+50} \lor \neg \left(z \leq 2.1939773630248555 \cdot 10^{+116}\right):\\
\;\;\;\;\begin{array}{l}
t_0 := \sqrt[3]{y - z}\\
\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{t_0 \cdot t_0}} \cdot \frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y}}{t_0}}
\end{array}\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \frac{z}{y}\\
\end{array}
(FPCore (x y z) :precision binary64 (/ (* x (- y z)) y))
(FPCore (x y z)
:precision binary64
(if (or (<= z -1.715631163475474e+50) (not (<= z 2.1939773630248555e+116)))
(let* ((t_0 (cbrt (- y z))))
(*
(/ (* (cbrt x) (cbrt x)) (/ (* (cbrt y) (cbrt y)) (* t_0 t_0)))
(/ (cbrt x) (/ (cbrt y) t_0))))
(- x (* x (/ z 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 ((z <= -1.715631163475474e+50) || !(z <= 2.1939773630248555e+116)) {
double t_0_1 = cbrt(y - z);
tmp = ((cbrt(x) * cbrt(x)) / ((cbrt(y) * cbrt(y)) / (t_0_1 * t_0_1))) * (cbrt(x) / (cbrt(y) / t_0_1));
} else {
tmp = x - (x * (z / y));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.4 |
|---|---|
| Target | 3.1 |
| Herbie | 1.4 |
if z < -1.71563116347547401e50 or 2.19397736302485552e116 < z Initial program 12.2
Applied associate-/l*_binary6410.0
Applied add-cube-cbrt_binary6410.9
Applied add-cube-cbrt_binary6410.8
Applied times-frac_binary6410.8
Applied add-cube-cbrt_binary6411.3
Applied times-frac_binary643.0
if -1.71563116347547401e50 < z < 2.19397736302485552e116Initial program 12.4
Applied associate-/l*_binary640.7
Applied div-inv_binary640.8
Simplified0.8
Applied sub-neg_binary640.8
Applied distribute-rgt-in_binary640.8
Simplified0.8
Simplified0.8
Final simplification1.4
herbie shell --seed 2022068
(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))