\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -66445643085124824111628188385280 \lor \neg \left(y \le 295250056767246134706811437056\right):\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{1}{\frac{x}{y} - 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{x - y} \cdot y\\
\end{array}double f(double x, double y) {
double r402318 = x;
double r402319 = 2.0;
double r402320 = r402318 * r402319;
double r402321 = y;
double r402322 = r402320 * r402321;
double r402323 = r402318 - r402321;
double r402324 = r402322 / r402323;
return r402324;
}
double f(double x, double y) {
double r402325 = y;
double r402326 = -6.644564308512482e+31;
bool r402327 = r402325 <= r402326;
double r402328 = 2.9525005676724613e+29;
bool r402329 = r402325 <= r402328;
double r402330 = !r402329;
bool r402331 = r402327 || r402330;
double r402332 = x;
double r402333 = 2.0;
double r402334 = r402332 * r402333;
double r402335 = 1.0;
double r402336 = r402332 / r402325;
double r402337 = r402336 - r402335;
double r402338 = r402335 / r402337;
double r402339 = r402334 * r402338;
double r402340 = r402332 - r402325;
double r402341 = r402334 / r402340;
double r402342 = r402341 * r402325;
double r402343 = r402331 ? r402339 : r402342;
return r402343;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.1 |
if y < -6.644564308512482e+31 or 2.9525005676724613e+29 < y Initial program 17.5
rmApplied *-un-lft-identity17.5
Applied times-frac0.1
Simplified0.1
rmApplied clear-num0.1
rmApplied div-sub0.1
Simplified0.1
if -6.644564308512482e+31 < y < 2.9525005676724613e+29Initial program 12.3
rmApplied *-un-lft-identity12.3
Applied times-frac13.4
Simplified13.4
rmApplied clear-num14.3
rmApplied associate-/r/13.5
Applied associate-*r*0.3
Simplified0.1
Final simplification0.1
herbie shell --seed 2019212 +o rules:numerics
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(if (< x -1.7210442634149447e81) (* (/ (* 2 x) (- x y)) y) (if (< x 83645045635564432) (/ (* x 2) (/ (- x y) y)) (* (/ (* 2 x) (- x y)) y)))
(/ (* (* x 2) y) (- x y)))