\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 - \frac{z}{y}\right)\\
\end{array}double f(double x, double y, double z) {
double r761511 = x;
double r761512 = y;
double r761513 = z;
double r761514 = r761512 - r761513;
double r761515 = r761511 * r761514;
double r761516 = r761515 / r761512;
return r761516;
}
double f(double x, double y, double z) {
double r761517 = z;
double r761518 = -1.5669822733451465e+71;
bool r761519 = r761517 <= r761518;
double r761520 = x;
double r761521 = y;
double r761522 = r761520 / r761521;
double r761523 = r761521 - r761517;
double r761524 = r761522 * r761523;
double r761525 = 1.0;
double r761526 = r761517 / r761521;
double r761527 = r761525 - r761526;
double r761528 = r761520 * r761527;
double r761529 = r761519 ? r761524 : r761528;
return r761529;
}




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 div-sub2.0
Simplified2.0
Final simplification3.5
herbie shell --seed 2020001
(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))