\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -3.47596719439230232 \cdot 10^{122} \lor \neg \left(x \le 67448507228.817856\right):\\
\;\;\;\;\frac{x \cdot 2}{x - y} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\end{array}double f(double x, double y) {
double r531035 = x;
double r531036 = 2.0;
double r531037 = r531035 * r531036;
double r531038 = y;
double r531039 = r531037 * r531038;
double r531040 = r531035 - r531038;
double r531041 = r531039 / r531040;
return r531041;
}
double f(double x, double y) {
double r531042 = x;
double r531043 = -3.475967194392302e+122;
bool r531044 = r531042 <= r531043;
double r531045 = 67448507228.817856;
bool r531046 = r531042 <= r531045;
double r531047 = !r531046;
bool r531048 = r531044 || r531047;
double r531049 = 2.0;
double r531050 = r531042 * r531049;
double r531051 = y;
double r531052 = r531042 - r531051;
double r531053 = r531050 / r531052;
double r531054 = r531053 * r531051;
double r531055 = r531052 / r531051;
double r531056 = r531050 / r531055;
double r531057 = r531048 ? r531054 : r531056;
return r531057;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.6 |
if x < -3.475967194392302e+122 or 67448507228.817856 < x Initial program 19.2
rmApplied associate-/l*17.5
rmApplied associate-/r/0.1
if -3.475967194392302e+122 < x < 67448507228.817856Initial program 12.3
rmApplied associate-/l*0.9
Final simplification0.6
herbie shell --seed 2020021
(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)))