\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -9761946362776926507016235515904:\\
\;\;\;\;\left(y \cdot 2\right) \cdot \frac{x}{x - y}\\
\mathbf{elif}\;x \le 3.45921811371722128919155174305014492874 \cdot 10^{-46}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot 2\right) \cdot \frac{x}{x - y}\\
\end{array}double f(double x, double y) {
double r26341458 = x;
double r26341459 = 2.0;
double r26341460 = r26341458 * r26341459;
double r26341461 = y;
double r26341462 = r26341460 * r26341461;
double r26341463 = r26341458 - r26341461;
double r26341464 = r26341462 / r26341463;
return r26341464;
}
double f(double x, double y) {
double r26341465 = x;
double r26341466 = -9.761946362776927e+30;
bool r26341467 = r26341465 <= r26341466;
double r26341468 = y;
double r26341469 = 2.0;
double r26341470 = r26341468 * r26341469;
double r26341471 = r26341465 - r26341468;
double r26341472 = r26341465 / r26341471;
double r26341473 = r26341470 * r26341472;
double r26341474 = 3.4592181137172213e-46;
bool r26341475 = r26341465 <= r26341474;
double r26341476 = r26341465 * r26341469;
double r26341477 = r26341471 / r26341468;
double r26341478 = r26341476 / r26341477;
double r26341479 = r26341475 ? r26341478 : r26341473;
double r26341480 = r26341467 ? r26341473 : r26341479;
return r26341480;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
if x < -9.761946362776927e+30 or 3.4592181137172213e-46 < x Initial program 15.6
rmApplied associate-/l*14.4
rmApplied div-inv14.5
Applied times-frac0.4
Simplified0.3
if -9.761946362776927e+30 < x < 3.4592181137172213e-46Initial program 14.8
rmApplied associate-/l*0.1
Final simplification0.2
herbie shell --seed 2019192
(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)))