\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 r724742 = x;
double r724743 = y;
double r724744 = z;
double r724745 = r724743 - r724744;
double r724746 = r724742 * r724745;
double r724747 = r724746 / r724743;
return r724747;
}
double f(double x, double y, double z) {
double r724748 = z;
double r724749 = -1.5669822733451465e+71;
bool r724750 = r724748 <= r724749;
double r724751 = x;
double r724752 = y;
double r724753 = r724751 / r724752;
double r724754 = r724752 - r724748;
double r724755 = r724753 * r724754;
double r724756 = 1.0;
double r724757 = r724748 / r724752;
double r724758 = r724756 - r724757;
double r724759 = r724751 * r724758;
double r724760 = r724750 ? r724755 : r724759;
return r724760;
}




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 +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))