\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} \le -6.083035639847637607654497125773830646304 \cdot 10^{292}:\\
\;\;\;\;\frac{\frac{x}{\sqrt{\frac{y}{y - z}}}}{\sqrt{\frac{y}{y - z}}}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \le -8.175248265444713739055182742884957439272 \cdot 10^{123}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \le 4597572249704838144:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \le 1.095545649072277509917652984108949902858 \cdot 10^{260}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\end{array}double f(double x, double y, double z) {
double r51390553 = x;
double r51390554 = y;
double r51390555 = z;
double r51390556 = r51390554 - r51390555;
double r51390557 = r51390553 * r51390556;
double r51390558 = r51390557 / r51390554;
return r51390558;
}
double f(double x, double y, double z) {
double r51390559 = x;
double r51390560 = y;
double r51390561 = z;
double r51390562 = r51390560 - r51390561;
double r51390563 = r51390559 * r51390562;
double r51390564 = r51390563 / r51390560;
double r51390565 = -6.083035639847638e+292;
bool r51390566 = r51390564 <= r51390565;
double r51390567 = r51390560 / r51390562;
double r51390568 = sqrt(r51390567);
double r51390569 = r51390559 / r51390568;
double r51390570 = r51390569 / r51390568;
double r51390571 = -8.175248265444714e+123;
bool r51390572 = r51390564 <= r51390571;
double r51390573 = 4.597572249704838e+18;
bool r51390574 = r51390564 <= r51390573;
double r51390575 = r51390559 / r51390567;
double r51390576 = 1.0955456490722775e+260;
bool r51390577 = r51390564 <= r51390576;
double r51390578 = r51390577 ? r51390564 : r51390575;
double r51390579 = r51390574 ? r51390575 : r51390578;
double r51390580 = r51390572 ? r51390564 : r51390579;
double r51390581 = r51390566 ? r51390570 : r51390580;
return r51390581;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.6 |
|---|---|
| Target | 2.8 |
| Herbie | 1.5 |
if (/ (* x (- y z)) y) < -6.083035639847638e+292Initial program 57.7
rmApplied associate-/l*1.0
rmApplied add-sqr-sqrt8.5
Applied associate-/r*8.5
if -6.083035639847638e+292 < (/ (* x (- y z)) y) < -8.175248265444714e+123 or 4.597572249704838e+18 < (/ (* x (- y z)) y) < 1.0955456490722775e+260Initial program 0.2
if -8.175248265444714e+123 < (/ (* x (- y z)) y) < 4.597572249704838e+18 or 1.0955456490722775e+260 < (/ (* x (- y z)) y) Initial program 11.7
rmApplied associate-/l*1.1
Final simplification1.5
herbie shell --seed 2019174 +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))