\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 r681655 = x;
double r681656 = y;
double r681657 = z;
double r681658 = r681656 - r681657;
double r681659 = r681655 * r681658;
double r681660 = r681659 / r681656;
return r681660;
}
double f(double x, double y, double z) {
double r681661 = z;
double r681662 = -1.5669822733451465e+71;
bool r681663 = r681661 <= r681662;
double r681664 = x;
double r681665 = y;
double r681666 = r681664 / r681665;
double r681667 = r681665 - r681661;
double r681668 = r681666 * r681667;
double r681669 = 1.0;
double r681670 = r681661 / r681665;
double r681671 = r681669 - r681670;
double r681672 = r681664 * r681671;
double r681673 = r681663 ? r681668 : r681672;
return r681673;
}




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