\frac{\left(x \cdot 2.0\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -1.435942788027777 \cdot 10^{+60}:\\
\;\;\;\;\frac{2.0 \cdot x}{x - y} \cdot y\\
\mathbf{elif}\;x \le 1.5452684980844889 \cdot 10^{+57}:\\
\;\;\;\;\frac{2.0 \cdot x}{\frac{x}{y} - 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2.0 \cdot x}{x - y} \cdot y\\
\end{array}double f(double x, double y) {
double r26433376 = x;
double r26433377 = 2.0;
double r26433378 = r26433376 * r26433377;
double r26433379 = y;
double r26433380 = r26433378 * r26433379;
double r26433381 = r26433376 - r26433379;
double r26433382 = r26433380 / r26433381;
return r26433382;
}
double f(double x, double y) {
double r26433383 = x;
double r26433384 = -1.435942788027777e+60;
bool r26433385 = r26433383 <= r26433384;
double r26433386 = 2.0;
double r26433387 = r26433386 * r26433383;
double r26433388 = y;
double r26433389 = r26433383 - r26433388;
double r26433390 = r26433387 / r26433389;
double r26433391 = r26433390 * r26433388;
double r26433392 = 1.5452684980844889e+57;
bool r26433393 = r26433383 <= r26433392;
double r26433394 = r26433383 / r26433388;
double r26433395 = 1.0;
double r26433396 = r26433394 - r26433395;
double r26433397 = r26433387 / r26433396;
double r26433398 = r26433393 ? r26433397 : r26433391;
double r26433399 = r26433385 ? r26433391 : r26433398;
return r26433399;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.5 |
|---|---|
| Target | 0.4 |
| Herbie | 0.3 |
if x < -1.435942788027777e+60 or 1.5452684980844889e+57 < x Initial program 18.6
rmApplied associate-/l*17.3
rmApplied associate-/r/0.0
if -1.435942788027777e+60 < x < 1.5452684980844889e+57Initial program 11.8
rmApplied associate-/l*0.6
rmApplied div-sub0.6
Simplified0.6
Final simplification0.3
herbie shell --seed 2019163
(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)))