\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -29856493142547368 \lor \neg \left(y \le 2.1640309147455017 \cdot 10^{-67}\right):\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x - y} \cdot \left(y \cdot 2\right)\\
\end{array}double f(double x, double y) {
double r575394 = x;
double r575395 = 2.0;
double r575396 = r575394 * r575395;
double r575397 = y;
double r575398 = r575396 * r575397;
double r575399 = r575394 - r575397;
double r575400 = r575398 / r575399;
return r575400;
}
double f(double x, double y) {
double r575401 = y;
double r575402 = -2.985649314254737e+16;
bool r575403 = r575401 <= r575402;
double r575404 = 2.1640309147455017e-67;
bool r575405 = r575401 <= r575404;
double r575406 = !r575405;
bool r575407 = r575403 || r575406;
double r575408 = x;
double r575409 = 2.0;
double r575410 = r575408 * r575409;
double r575411 = r575408 - r575401;
double r575412 = r575411 / r575401;
double r575413 = r575410 / r575412;
double r575414 = r575408 / r575411;
double r575415 = r575401 * r575409;
double r575416 = r575414 * r575415;
double r575417 = r575407 ? r575413 : r575416;
return r575417;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.3 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
if y < -2.985649314254737e+16 or 2.1640309147455017e-67 < y Initial program 15.3
rmApplied associate-/l*0.4
if -2.985649314254737e+16 < y < 2.1640309147455017e-67Initial program 15.3
rmApplied associate-/l*16.1
rmApplied div-inv16.2
Applied times-frac0.2
Simplified0.0
Final simplification0.2
herbie shell --seed 2020047 +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)))