\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} \leq -\infty:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \leq -4.024304033415889 \cdot 10^{+43}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \leq 6.213263482840311 \cdot 10^{-79}:\\
\;\;\;\;\frac{x}{\frac{1}{1 - \frac{z}{y}}}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \leq 4.6064334916349155 \cdot 10^{+219}:\\
\;\;\;\;x - \frac{x \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* x (- y z)) y))
(FPCore (x y z)
:precision binary64
(if (<= (/ (* x (- y z)) y) (- INFINITY))
(* x (/ (- y z) y))
(if (<= (/ (* x (- y z)) y) -4.024304033415889e+43)
(/ (* x (- y z)) y)
(if (<= (/ (* x (- y z)) y) 6.213263482840311e-79)
(/ x (/ 1.0 (- 1.0 (/ z y))))
(if (<= (/ (* x (- y z)) y) 4.6064334916349155e+219)
(- x (/ (* x z) y))
(* x (/ (- y 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 (((x * (y - z)) / y) <= -((double) INFINITY)) {
tmp = x * ((y - z) / y);
} else if (((x * (y - z)) / y) <= -4.024304033415889e+43) {
tmp = (x * (y - z)) / y;
} else if (((x * (y - z)) / y) <= 6.213263482840311e-79) {
tmp = x / (1.0 / (1.0 - (z / y)));
} else if (((x * (y - z)) / y) <= 4.6064334916349155e+219) {
tmp = x - ((x * z) / y);
} else {
tmp = x * ((y - z) / y);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.5 |
|---|---|
| Target | 3.1 |
| Herbie | 0.9 |
if (/.f64 (*.f64 x (-.f64 y z)) y) < -inf.0 or 4.60643349163491549e219 < (/.f64 (*.f64 x (-.f64 y z)) y) Initial program 49.3
rmApplied *-un-lft-identity_binary64_2019749.3
Applied times-frac_binary64_202033.3
Simplified3.3
if -inf.0 < (/.f64 (*.f64 x (-.f64 y z)) y) < -4.02430403341588877e43Initial program 0.2
if -4.02430403341588877e43 < (/.f64 (*.f64 x (-.f64 y z)) y) < 6.21326348284031129e-79Initial program 6.7
rmApplied associate-/l*_binary64_201420.2
rmApplied clear-num_binary64_201960.3
Simplified0.3
if 6.21326348284031129e-79 < (/.f64 (*.f64 x (-.f64 y z)) y) < 4.60643349163491549e219Initial program 0.4
Taylor expanded around 0 0.3
Final simplification0.9
herbie shell --seed 2021043
(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))