\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;y \le -2.856877149811500137575176024355404248892 \cdot 10^{-44}:\\
\;\;\;\;\frac{y - z}{y} \cdot x\\
\mathbf{elif}\;y \le -5.930195457290963565232371333597639522659 \cdot 10^{-283}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - z}{y} \cdot x\\
\end{array}double f(double x, double y, double z) {
double r32929619 = x;
double r32929620 = y;
double r32929621 = z;
double r32929622 = r32929620 - r32929621;
double r32929623 = r32929619 * r32929622;
double r32929624 = r32929623 / r32929620;
return r32929624;
}
double f(double x, double y, double z) {
double r32929625 = y;
double r32929626 = -2.8568771498115e-44;
bool r32929627 = r32929625 <= r32929626;
double r32929628 = z;
double r32929629 = r32929625 - r32929628;
double r32929630 = r32929629 / r32929625;
double r32929631 = x;
double r32929632 = r32929630 * r32929631;
double r32929633 = -5.930195457290964e-283;
bool r32929634 = r32929625 <= r32929633;
double r32929635 = r32929631 * r32929629;
double r32929636 = r32929635 / r32929625;
double r32929637 = r32929634 ? r32929636 : r32929632;
double r32929638 = r32929627 ? r32929632 : r32929637;
return r32929638;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.7 |
|---|---|
| Target | 3.3 |
| Herbie | 3.2 |
if y < -2.8568771498115e-44 or -5.930195457290964e-283 < y Initial program 13.6
rmApplied associate-/l*2.0
rmApplied clear-num2.1
rmApplied div-inv2.1
Applied add-cube-cbrt2.1
Applied times-frac2.4
Simplified2.3
Simplified2.2
if -2.8568771498115e-44 < y < -5.930195457290964e-283Initial program 8.1
Final simplification3.2
herbie shell --seed 2019169 +o rules:numerics
(FPCore (x y z)
:name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
: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))