\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -1.10892874009979371370858177892837434758 \cdot 10^{154}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \le -1.236020320932232476704484715088241182396 \cdot 10^{-161}:\\
\;\;\;\;\left(\sqrt[3]{\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}} \cdot \sqrt[3]{\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}}\right) \cdot \sqrt[3]{\sqrt[3]{{\left(\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\right)}^{3}}}\\
\mathbf{elif}\;y \le -3.640183473874900789883704258602787518783 \cdot 10^{-198}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \le 2.073039356492311435572177705373562775963 \cdot 10^{-167}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}} \cdot \sqrt[3]{\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}}\right) \cdot \sqrt[3]{\sqrt[3]{{\left(\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\right)}^{3}}}\\
\end{array}double f(double x, double y) {
double r82184 = x;
double r82185 = y;
double r82186 = r82184 - r82185;
double r82187 = r82184 + r82185;
double r82188 = r82186 * r82187;
double r82189 = r82184 * r82184;
double r82190 = r82185 * r82185;
double r82191 = r82189 + r82190;
double r82192 = r82188 / r82191;
return r82192;
}
double f(double x, double y) {
double r82193 = y;
double r82194 = -1.1089287400997937e+154;
bool r82195 = r82193 <= r82194;
double r82196 = -1.0;
double r82197 = -1.2360203209322325e-161;
bool r82198 = r82193 <= r82197;
double r82199 = x;
double r82200 = r82199 - r82193;
double r82201 = r82199 + r82193;
double r82202 = r82200 * r82201;
double r82203 = r82199 * r82199;
double r82204 = r82193 * r82193;
double r82205 = r82203 + r82204;
double r82206 = r82202 / r82205;
double r82207 = cbrt(r82206);
double r82208 = r82207 * r82207;
double r82209 = 3.0;
double r82210 = pow(r82206, r82209);
double r82211 = cbrt(r82210);
double r82212 = cbrt(r82211);
double r82213 = r82208 * r82212;
double r82214 = -3.640183473874901e-198;
bool r82215 = r82193 <= r82214;
double r82216 = 2.0730393564923114e-167;
bool r82217 = r82193 <= r82216;
double r82218 = 1.0;
double r82219 = r82217 ? r82218 : r82213;
double r82220 = r82215 ? r82196 : r82219;
double r82221 = r82198 ? r82213 : r82220;
double r82222 = r82195 ? r82196 : r82221;
return r82222;
}




Bits error versus x




Bits error versus y
Results
| Original | 20.4 |
|---|---|
| Target | 0.0 |
| Herbie | 5.5 |
if y < -1.1089287400997937e+154 or -1.2360203209322325e-161 < y < -3.640183473874901e-198Initial program 57.6
Taylor expanded around 0 7.0
if -1.1089287400997937e+154 < y < -1.2360203209322325e-161 or 2.0730393564923114e-167 < y Initial program 0.3
rmApplied add-cube-cbrt0.4
rmApplied add-cbrt-cube37.7
Applied add-cbrt-cube37.9
Applied add-cbrt-cube37.9
Applied cbrt-unprod37.9
Applied cbrt-undiv37.8
Simplified0.4
if -3.640183473874901e-198 < y < 2.0730393564923114e-167Initial program 31.4
Taylor expanded around inf 14.3
Final simplification5.5
herbie shell --seed 2019297
(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))))