\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 r22766332 = x;
double r22766333 = 2.0;
double r22766334 = r22766332 * r22766333;
double r22766335 = y;
double r22766336 = r22766334 * r22766335;
double r22766337 = r22766332 - r22766335;
double r22766338 = r22766336 / r22766337;
return r22766338;
}
double f(double x, double y) {
double r22766339 = x;
double r22766340 = -1.435942788027777e+60;
bool r22766341 = r22766339 <= r22766340;
double r22766342 = 2.0;
double r22766343 = r22766342 * r22766339;
double r22766344 = y;
double r22766345 = r22766339 - r22766344;
double r22766346 = r22766343 / r22766345;
double r22766347 = r22766346 * r22766344;
double r22766348 = 1.5452684980844889e+57;
bool r22766349 = r22766339 <= r22766348;
double r22766350 = r22766339 / r22766344;
double r22766351 = 1.0;
double r22766352 = r22766350 - r22766351;
double r22766353 = r22766343 / r22766352;
double r22766354 = r22766349 ? r22766353 : r22766347;
double r22766355 = r22766341 ? r22766347 : r22766354;
return r22766355;
}




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 +o rules:numerics
(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)))