\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;x \le -1.852536865846577753563856140775043031674 \cdot 10^{94} \lor \neg \left(x \le 3.306570835569777515664669260458863592173 \cdot 10^{-59}\right):\\
\;\;\;\;x \cdot \left(\left(y - z\right) \cdot \frac{1}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{x \cdot z}{y}\\
\end{array}double f(double x, double y, double z) {
double r497484 = x;
double r497485 = y;
double r497486 = z;
double r497487 = r497485 - r497486;
double r497488 = r497484 * r497487;
double r497489 = r497488 / r497485;
return r497489;
}
double f(double x, double y, double z) {
double r497490 = x;
double r497491 = -1.8525368658465778e+94;
bool r497492 = r497490 <= r497491;
double r497493 = 3.3065708355697775e-59;
bool r497494 = r497490 <= r497493;
double r497495 = !r497494;
bool r497496 = r497492 || r497495;
double r497497 = y;
double r497498 = z;
double r497499 = r497497 - r497498;
double r497500 = 1.0;
double r497501 = r497500 / r497497;
double r497502 = r497499 * r497501;
double r497503 = r497490 * r497502;
double r497504 = r497490 * r497498;
double r497505 = r497504 / r497497;
double r497506 = r497490 - r497505;
double r497507 = r497496 ? r497503 : r497506;
return r497507;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 11.9 |
|---|---|
| Target | 3.1 |
| Herbie | 1.7 |
if x < -1.8525368658465778e+94 or 3.3065708355697775e-59 < x Initial program 21.8
Simplified7.9
rmApplied clear-num8.1
Simplified0.4
rmApplied *-un-lft-identity0.4
Applied *-un-lft-identity0.4
Applied *-un-lft-identity0.4
Applied times-frac0.4
Applied times-frac0.4
Applied add-cube-cbrt0.4
Applied times-frac0.4
Simplified0.4
Simplified0.4
if -1.8525368658465778e+94 < x < 3.3065708355697775e-59Initial program 5.2
Simplified15.1
rmApplied clear-num15.2
Simplified4.6
Taylor expanded around 0 2.6
Final simplification1.7
herbie shell --seed 2019179
(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))