\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;z \le -1.566982273345146481292091546063448334105 \cdot 10^{71}:\\
\;\;\;\;\frac{x}{y} \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 \cdot \left(1 - \frac{z}{y}\right)\right)\\
\end{array}double f(double x, double y, double z) {
double r775327 = x;
double r775328 = y;
double r775329 = z;
double r775330 = r775328 - r775329;
double r775331 = r775327 * r775330;
double r775332 = r775331 / r775328;
return r775332;
}
double f(double x, double y, double z) {
double r775333 = z;
double r775334 = -1.5669822733451465e+71;
bool r775335 = r775333 <= r775334;
double r775336 = x;
double r775337 = y;
double r775338 = r775336 / r775337;
double r775339 = r775337 - r775333;
double r775340 = r775338 * r775339;
double r775341 = 1.0;
double r775342 = r775333 / r775337;
double r775343 = r775341 - r775342;
double r775344 = r775341 * r775343;
double r775345 = r775336 * r775344;
double r775346 = r775335 ? r775340 : r775345;
return r775346;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.2 |
|---|---|
| Target | 3.0 |
| Herbie | 3.5 |
if z < -1.5669822733451465e+71Initial program 12.1
rmApplied associate-/l*8.6
rmApplied associate-/r/11.7
if -1.5669822733451465e+71 < z Initial program 12.3
rmApplied *-un-lft-identity12.3
Applied times-frac2.0
Simplified2.0
rmApplied *-un-lft-identity2.0
Applied *-un-lft-identity2.0
Applied times-frac2.0
Simplified2.0
Simplified2.0
Final simplification3.5
herbie shell --seed 2020001 +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))