\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -6.30586821746719046822219898487595819847 \cdot 10^{45}:\\
\;\;\;\;\frac{y}{x - y} \cdot \left(2 \cdot x\right)\\
\mathbf{elif}\;y \le 5.377814118926896018584556610780517528545 \cdot 10^{-32}:\\
\;\;\;\;\frac{x}{x - y} \cdot \left(2 \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x - y} \cdot \left(2 \cdot x\right)\\
\end{array}double f(double x, double y) {
double r19917438 = x;
double r19917439 = 2.0;
double r19917440 = r19917438 * r19917439;
double r19917441 = y;
double r19917442 = r19917440 * r19917441;
double r19917443 = r19917438 - r19917441;
double r19917444 = r19917442 / r19917443;
return r19917444;
}
double f(double x, double y) {
double r19917445 = y;
double r19917446 = -6.30586821746719e+45;
bool r19917447 = r19917445 <= r19917446;
double r19917448 = x;
double r19917449 = r19917448 - r19917445;
double r19917450 = r19917445 / r19917449;
double r19917451 = 2.0;
double r19917452 = r19917451 * r19917448;
double r19917453 = r19917450 * r19917452;
double r19917454 = 5.377814118926896e-32;
bool r19917455 = r19917445 <= r19917454;
double r19917456 = r19917448 / r19917449;
double r19917457 = r19917451 * r19917445;
double r19917458 = r19917456 * r19917457;
double r19917459 = r19917455 ? r19917458 : r19917453;
double r19917460 = r19917447 ? r19917453 : r19917459;
return r19917460;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.1 |
|---|---|
| Target | 0.4 |
| Herbie | 0.1 |
if y < -6.30586821746719e+45 or 5.377814118926896e-32 < y Initial program 16.7
rmApplied *-un-lft-identity16.7
Applied times-frac0.1
Simplified0.1
if -6.30586821746719e+45 < y < 5.377814118926896e-32Initial program 13.6
rmApplied associate-/l*14.8
rmApplied div-inv14.9
Applied times-frac0.3
Simplified0.1
Final simplification0.1
herbie shell --seed 2019171 +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)))