\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -5.01776738281857308254796379287654417567 \cdot 10^{-5}:\\
\;\;\;\;\left(y \cdot 2\right) \cdot \frac{x}{x - y}\\
\mathbf{elif}\;x \le 3.62378838658747611836253077264636734886 \cdot 10^{-110}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot 2\right) \cdot \frac{x}{x - y}\\
\end{array}double f(double x, double y) {
double r21730167 = x;
double r21730168 = 2.0;
double r21730169 = r21730167 * r21730168;
double r21730170 = y;
double r21730171 = r21730169 * r21730170;
double r21730172 = r21730167 - r21730170;
double r21730173 = r21730171 / r21730172;
return r21730173;
}
double f(double x, double y) {
double r21730174 = x;
double r21730175 = -5.017767382818573e-05;
bool r21730176 = r21730174 <= r21730175;
double r21730177 = y;
double r21730178 = 2.0;
double r21730179 = r21730177 * r21730178;
double r21730180 = r21730174 - r21730177;
double r21730181 = r21730174 / r21730180;
double r21730182 = r21730179 * r21730181;
double r21730183 = 3.623788386587476e-110;
bool r21730184 = r21730174 <= r21730183;
double r21730185 = r21730174 * r21730178;
double r21730186 = r21730180 / r21730177;
double r21730187 = r21730185 / r21730186;
double r21730188 = r21730184 ? r21730187 : r21730182;
double r21730189 = r21730176 ? r21730182 : r21730188;
return r21730189;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.1 |
|---|---|
| Target | 0.3 |
| Herbie | 0.5 |
if x < -5.017767382818573e-05 or 3.623788386587476e-110 < x Initial program 14.4
rmApplied associate-/l*12.7
rmApplied div-inv12.9
Applied times-frac1.0
Simplified0.8
if -5.017767382818573e-05 < x < 3.623788386587476e-110Initial program 16.2
rmApplied associate-/l*0.0
Final simplification0.5
herbie shell --seed 2019169
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:herbie-target
(if (< x -1.7210442634149447e+81) (* (/ (* 2.0 x) (- x y)) y) (if (< x 8.364504563556443e+16) (/ (* x 2.0) (/ (- x y) y)) (* (/ (* 2.0 x) (- x y)) y)))
(/ (* (* x 2.0) y) (- x y)))