\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -3.18485405558886704329803739258795392325 \cdot 10^{75} \lor \neg \left(x \le 221068044499626994233760128308481097728\right):\\
\;\;\;\;\frac{x}{x - y} \cdot \left(2 \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\end{array}double f(double x, double y) {
double r403213 = x;
double r403214 = 2.0;
double r403215 = r403213 * r403214;
double r403216 = y;
double r403217 = r403215 * r403216;
double r403218 = r403213 - r403216;
double r403219 = r403217 / r403218;
return r403219;
}
double f(double x, double y) {
double r403220 = x;
double r403221 = -3.184854055588867e+75;
bool r403222 = r403220 <= r403221;
double r403223 = 2.21068044499627e+38;
bool r403224 = r403220 <= r403223;
double r403225 = !r403224;
bool r403226 = r403222 || r403225;
double r403227 = y;
double r403228 = r403220 - r403227;
double r403229 = r403220 / r403228;
double r403230 = 2.0;
double r403231 = r403230 * r403227;
double r403232 = r403229 * r403231;
double r403233 = r403220 * r403230;
double r403234 = r403228 / r403227;
double r403235 = r403233 / r403234;
double r403236 = r403226 ? r403232 : r403235;
return r403236;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.3 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if x < -3.184854055588867e+75 or 2.21068044499627e+38 < x Initial program 18.4
rmApplied associate-/l*18.0
rmApplied div-inv18.1
Applied times-frac0.2
Simplified0.0
if -3.184854055588867e+75 < x < 2.21068044499627e+38Initial program 13.1
rmApplied associate-/l*0.4
Final simplification0.3
herbie shell --seed 2019350 +o rules:numerics
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(if (< x -1.7210442634149447e+81) (* (/ (* 2 x) (- x y)) y) (if (< x 83645045635564432) (/ (* x 2) (/ (- x y) y)) (* (/ (* 2 x) (- x y)) y)))
(/ (* (* x 2) y) (- x y)))