\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -62785949538196690289038937030656:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x}{y} - 1}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -5.803368299499310115651714592899503248245 \cdot 10^{-307}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 0.0:\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 9.896071544107303447480442631568164014492 \cdot 10^{-42}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x}{y} - 1}\\
\end{array}double f(double x, double y) {
double r367048 = x;
double r367049 = 2.0;
double r367050 = r367048 * r367049;
double r367051 = y;
double r367052 = r367050 * r367051;
double r367053 = r367048 - r367051;
double r367054 = r367052 / r367053;
return r367054;
}
double f(double x, double y) {
double r367055 = x;
double r367056 = 2.0;
double r367057 = r367055 * r367056;
double r367058 = y;
double r367059 = r367057 * r367058;
double r367060 = r367055 - r367058;
double r367061 = r367059 / r367060;
double r367062 = -6.278594953819669e+31;
bool r367063 = r367061 <= r367062;
double r367064 = r367055 / r367058;
double r367065 = 1.0;
double r367066 = r367064 - r367065;
double r367067 = r367057 / r367066;
double r367068 = -5.80336829949931e-307;
bool r367069 = r367061 <= r367068;
double r367070 = 0.0;
bool r367071 = r367061 <= r367070;
double r367072 = r367058 / r367060;
double r367073 = r367057 * r367072;
double r367074 = 9.896071544107303e-42;
bool r367075 = r367061 <= r367074;
double r367076 = r367075 ? r367061 : r367067;
double r367077 = r367071 ? r367073 : r367076;
double r367078 = r367069 ? r367061 : r367077;
double r367079 = r367063 ? r367067 : r367078;
return r367079;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.6 |
if (/ (* (* x 2.0) y) (- x y)) < -6.278594953819669e+31 or 9.896071544107303e-42 < (/ (* (* x 2.0) y) (- x y)) Initial program 29.9
rmApplied associate-/l*0.5
Simplified0.5
if -6.278594953819669e+31 < (/ (* (* x 2.0) y) (- x y)) < -5.80336829949931e-307 or 0.0 < (/ (* (* x 2.0) y) (- x y)) < 9.896071544107303e-42Initial program 5.4
if -5.80336829949931e-307 < (/ (* (* x 2.0) y) (- x y)) < 0.0Initial program 58.2
rmApplied *-un-lft-identity58.2
Applied times-frac0.6
Simplified0.6
Final simplification0.6
herbie shell --seed 2019305
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(if (< x -1.7210442634149447e81) (* (/ (* 2 x) (- x y)) y) (if (< x 83645045635564432) (/ (* x 2) (/ (- x y) y)) (* (/ (* 2 x) (- x y)) y)))
(/ (* (* x 2) y) (- x y)))