\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;x \le -5.003280054887692628318180433391057882342 \cdot 10^{-101}:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\mathbf{elif}\;x \le 5.758281187392745987255992146907159625285 \cdot 10^{-300}:\\
\;\;\;\;\frac{1}{y} \cdot \left(x \cdot \left(y - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\end{array}double f(double x, double y, double z) {
double r628748 = x;
double r628749 = y;
double r628750 = z;
double r628751 = r628749 - r628750;
double r628752 = r628748 * r628751;
double r628753 = r628752 / r628749;
return r628753;
}
double f(double x, double y, double z) {
double r628754 = x;
double r628755 = -5.0032800548876926e-101;
bool r628756 = r628754 <= r628755;
double r628757 = y;
double r628758 = z;
double r628759 = r628757 - r628758;
double r628760 = r628759 / r628757;
double r628761 = r628754 * r628760;
double r628762 = 5.758281187392746e-300;
bool r628763 = r628754 <= r628762;
double r628764 = 1.0;
double r628765 = r628764 / r628757;
double r628766 = r628754 * r628759;
double r628767 = r628765 * r628766;
double r628768 = r628757 / r628759;
double r628769 = r628754 / r628768;
double r628770 = r628763 ? r628767 : r628769;
double r628771 = r628756 ? r628761 : r628770;
return r628771;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.1 |
|---|---|
| Target | 2.9 |
| Herbie | 3.1 |
if x < -5.0032800548876926e-101Initial program 15.2
rmApplied *-un-lft-identity15.2
Applied times-frac0.7
Simplified0.7
if -5.0032800548876926e-101 < x < 5.758281187392746e-300Initial program 7.4
rmApplied associate-/l*5.7
rmApplied div-inv5.8
Applied *-un-lft-identity5.8
Applied times-frac7.4
Simplified7.5
if 5.758281187392746e-300 < x Initial program 12.2
rmApplied associate-/l*2.6
Final simplification3.1
herbie shell --seed 2019362
(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))