\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 r41256097 = x;
double r41256098 = y;
double r41256099 = z;
double r41256100 = r41256098 - r41256099;
double r41256101 = r41256097 * r41256100;
double r41256102 = r41256101 / r41256098;
return r41256102;
}
double f(double x, double y, double z) {
double r41256103 = y;
double r41256104 = -2.8568771498115e-44;
bool r41256105 = r41256103 <= r41256104;
double r41256106 = z;
double r41256107 = r41256103 - r41256106;
double r41256108 = r41256107 / r41256103;
double r41256109 = x;
double r41256110 = r41256108 * r41256109;
double r41256111 = -5.930195457290964e-283;
bool r41256112 = r41256103 <= r41256111;
double r41256113 = r41256109 * r41256107;
double r41256114 = r41256113 / r41256103;
double r41256115 = r41256112 ? r41256114 : r41256110;
double r41256116 = r41256105 ? r41256110 : r41256115;
return r41256116;
}




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