\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -37872562220022.53125:\\
\;\;\;\;2 \cdot \left(\frac{y}{x - y} \cdot x\right)\\
\mathbf{elif}\;y \le 1032537.977745023905299603939056396484375:\\
\;\;\;\;\frac{2 \cdot x}{x - y} \cdot y\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{y}{x - y} \cdot x\right)\\
\end{array}double f(double x, double y) {
double r21299249 = x;
double r21299250 = 2.0;
double r21299251 = r21299249 * r21299250;
double r21299252 = y;
double r21299253 = r21299251 * r21299252;
double r21299254 = r21299249 - r21299252;
double r21299255 = r21299253 / r21299254;
return r21299255;
}
double f(double x, double y) {
double r21299256 = y;
double r21299257 = -37872562220022.53;
bool r21299258 = r21299256 <= r21299257;
double r21299259 = 2.0;
double r21299260 = x;
double r21299261 = r21299260 - r21299256;
double r21299262 = r21299256 / r21299261;
double r21299263 = r21299262 * r21299260;
double r21299264 = r21299259 * r21299263;
double r21299265 = 1032537.9777450239;
bool r21299266 = r21299256 <= r21299265;
double r21299267 = r21299259 * r21299260;
double r21299268 = r21299267 / r21299261;
double r21299269 = r21299268 * r21299256;
double r21299270 = r21299266 ? r21299269 : r21299264;
double r21299271 = r21299258 ? r21299264 : r21299270;
return r21299271;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.1 |
if y < -37872562220022.53 or 1032537.9777450239 < y Initial program 16.8
rmApplied *-un-lft-identity16.8
Applied times-frac0.1
Simplified0.1
rmApplied associate-*l*0.0
if -37872562220022.53 < y < 1032537.9777450239Initial program 13.0
rmApplied associate-/l*14.7
rmApplied associate-/r/0.1
Final simplification0.1
herbie shell --seed 2019174 +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)))