\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;y \le -7.699929332195363087572042602326430898574 \cdot 10^{-162} \lor \neg \left(y \le 2.724407101896751811416130978286132894297 \cdot 10^{-107}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{z}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y}{x \cdot \left(y - z\right)}}\\
\end{array}double f(double x, double y, double z) {
double r500920 = x;
double r500921 = y;
double r500922 = z;
double r500923 = r500921 - r500922;
double r500924 = r500920 * r500923;
double r500925 = r500924 / r500921;
return r500925;
}
double f(double x, double y, double z) {
double r500926 = y;
double r500927 = -7.699929332195363e-162;
bool r500928 = r500926 <= r500927;
double r500929 = 2.7244071018967518e-107;
bool r500930 = r500926 <= r500929;
double r500931 = !r500930;
bool r500932 = r500928 || r500931;
double r500933 = x;
double r500934 = 1.0;
double r500935 = z;
double r500936 = r500935 / r500926;
double r500937 = r500934 - r500936;
double r500938 = r500933 * r500937;
double r500939 = r500926 - r500935;
double r500940 = r500933 * r500939;
double r500941 = r500926 / r500940;
double r500942 = r500934 / r500941;
double r500943 = r500932 ? r500938 : r500942;
return r500943;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.4 |
|---|---|
| Target | 3.2 |
| Herbie | 2.9 |
if y < -7.699929332195363e-162 or 2.7244071018967518e-107 < y Initial program 13.2
rmApplied associate-/l*0.9
rmApplied div-inv1.2
Simplified1.1
if -7.699929332195363e-162 < y < 2.7244071018967518e-107Initial program 9.5
rmApplied associate-/l*11.1
rmApplied clear-num11.1
rmApplied *-un-lft-identity11.1
Applied *-un-lft-identity11.1
Applied *-un-lft-identity11.1
Applied times-frac11.1
Applied times-frac11.1
Simplified11.1
Simplified9.5
Final simplification2.9
herbie shell --seed 2019325
(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))