\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -1.133041248169889485704928868462676821371 \cdot 10^{154}:\\
\;\;\;\;\frac{x - y}{y - x}\\
\mathbf{elif}\;y \le -6.692220829649749294501672462795840344495 \cdot 10^{-158} \lor \neg \left(y \le 1.219697898657824473673616108359575531018 \cdot 10^{-167}\right):\\
\;\;\;\;\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r135033 = x;
double r135034 = y;
double r135035 = r135033 - r135034;
double r135036 = r135033 + r135034;
double r135037 = r135035 * r135036;
double r135038 = r135033 * r135033;
double r135039 = r135034 * r135034;
double r135040 = r135038 + r135039;
double r135041 = r135037 / r135040;
return r135041;
}
double f(double x, double y) {
double r135042 = y;
double r135043 = -1.1330412481698895e+154;
bool r135044 = r135042 <= r135043;
double r135045 = x;
double r135046 = r135045 - r135042;
double r135047 = r135042 - r135045;
double r135048 = r135046 / r135047;
double r135049 = -6.692220829649749e-158;
bool r135050 = r135042 <= r135049;
double r135051 = 1.2196978986578245e-167;
bool r135052 = r135042 <= r135051;
double r135053 = !r135052;
bool r135054 = r135050 || r135053;
double r135055 = r135045 + r135042;
double r135056 = r135046 * r135055;
double r135057 = r135045 * r135045;
double r135058 = r135042 * r135042;
double r135059 = r135057 + r135058;
double r135060 = r135056 / r135059;
double r135061 = 1.0;
double r135062 = r135054 ? r135060 : r135061;
double r135063 = r135044 ? r135048 : r135062;
return r135063;
}




Bits error versus x




Bits error versus y
Results
| Original | 20.2 |
|---|---|
| Target | 0.0 |
| Herbie | 5.2 |
if y < -1.1330412481698895e+154Initial program 64.0
rmApplied associate-/l*62.0
Taylor expanded around 0 0
if -1.1330412481698895e+154 < y < -6.692220829649749e-158 or 1.2196978986578245e-167 < y Initial program 0.4
if -6.692220829649749e-158 < y < 1.2196978986578245e-167Initial program 30.0
Taylor expanded around inf 15.6
Final simplification5.2
herbie shell --seed 2019351
(FPCore (x y)
:name "Kahan p9 Example"
:precision binary64
:pre (and (< 0.0 x 1) (< y 1))
:herbie-target
(if (< 0.5 (fabs (/ x y)) 2) (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))) (- 1 (/ 2 (+ 1 (* (/ x y) (/ x y))))))
(/ (* (- x y) (+ x y)) (+ (* x x) (* y y))))