\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 r25484000 = x;
double r25484001 = 2.0;
double r25484002 = r25484000 * r25484001;
double r25484003 = y;
double r25484004 = r25484002 * r25484003;
double r25484005 = r25484000 - r25484003;
double r25484006 = r25484004 / r25484005;
return r25484006;
}
double f(double x, double y) {
double r25484007 = y;
double r25484008 = -6.30586821746719e+45;
bool r25484009 = r25484007 <= r25484008;
double r25484010 = x;
double r25484011 = r25484010 - r25484007;
double r25484012 = r25484007 / r25484011;
double r25484013 = 2.0;
double r25484014 = r25484013 * r25484010;
double r25484015 = r25484012 * r25484014;
double r25484016 = 5.377814118926896e-32;
bool r25484017 = r25484007 <= r25484016;
double r25484018 = r25484010 / r25484011;
double r25484019 = r25484013 * r25484007;
double r25484020 = r25484018 * r25484019;
double r25484021 = r25484017 ? r25484020 : r25484015;
double r25484022 = r25484009 ? r25484015 : r25484021;
return r25484022;
}




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
(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)))