\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;y \le 1.3574032127967498 \cdot 10^{63}:\\
\;\;\;\;x - \frac{x \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \frac{z}{y}\\
\end{array}double f(double x, double y, double z) {
double r778566 = x;
double r778567 = y;
double r778568 = z;
double r778569 = r778567 - r778568;
double r778570 = r778566 * r778569;
double r778571 = r778570 / r778567;
return r778571;
}
double f(double x, double y, double z) {
double r778572 = y;
double r778573 = 1.3574032127967498e+63;
bool r778574 = r778572 <= r778573;
double r778575 = x;
double r778576 = z;
double r778577 = r778575 * r778576;
double r778578 = r778577 / r778572;
double r778579 = r778575 - r778578;
double r778580 = r778576 / r778572;
double r778581 = r778575 * r778580;
double r778582 = r778575 - r778581;
double r778583 = r778574 ? r778579 : r778582;
return r778583;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.9 |
|---|---|
| Target | 3.0 |
| Herbie | 3.3 |
if y < 1.3574032127967498e+63Initial program 10.6
rmApplied associate-/l*4.0
Taylor expanded around 0 4.3
if 1.3574032127967498e+63 < y Initial program 20.5
rmApplied associate-/l*0.1
Taylor expanded around 0 6.9
rmApplied *-un-lft-identity6.9
Applied times-frac0.0
Simplified0.0
Final simplification3.3
herbie shell --seed 2020020 +o rules:numerics
(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))