\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -9.573025967556919874381857319699629829641 \cdot 10^{-15} \lor \neg \left(x \le 2.651436562478195718952368280494467487413 \cdot 10^{-126}\right):\\
\;\;\;\;\frac{x \cdot 2}{x - y} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\end{array}double f(double x, double y) {
double r483998 = x;
double r483999 = 2.0;
double r484000 = r483998 * r483999;
double r484001 = y;
double r484002 = r484000 * r484001;
double r484003 = r483998 - r484001;
double r484004 = r484002 / r484003;
return r484004;
}
double f(double x, double y) {
double r484005 = x;
double r484006 = -9.57302596755692e-15;
bool r484007 = r484005 <= r484006;
double r484008 = 2.6514365624781957e-126;
bool r484009 = r484005 <= r484008;
double r484010 = !r484009;
bool r484011 = r484007 || r484010;
double r484012 = 2.0;
double r484013 = r484005 * r484012;
double r484014 = y;
double r484015 = r484005 - r484014;
double r484016 = r484013 / r484015;
double r484017 = r484016 * r484014;
double r484018 = r484014 / r484015;
double r484019 = r484013 * r484018;
double r484020 = r484011 ? r484017 : r484019;
return r484020;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.9 |
|---|---|
| Target | 0.3 |
| Herbie | 0.6 |
if x < -9.57302596755692e-15 or 2.6514365624781957e-126 < x Initial program 14.0
rmApplied associate-/l*12.4
rmApplied associate-/r/1.0
if -9.57302596755692e-15 < x < 2.6514365624781957e-126Initial program 16.4
rmApplied *-un-lft-identity16.4
Applied times-frac0.0
Simplified0.0
Final simplification0.6
herbie shell --seed 2019356
(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)))