\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -0.0:\\
\;\;\;\;\left(\left(x \cdot 2\right) \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{x - y}}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 1.5055267344693184 \cdot 10^{-5}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\end{array}double f(double x, double y) {
double r478353 = x;
double r478354 = 2.0;
double r478355 = r478353 * r478354;
double r478356 = y;
double r478357 = r478355 * r478356;
double r478358 = r478353 - r478356;
double r478359 = r478357 / r478358;
return r478359;
}
double f(double x, double y) {
double r478360 = x;
double r478361 = 2.0;
double r478362 = r478360 * r478361;
double r478363 = y;
double r478364 = r478362 * r478363;
double r478365 = r478360 - r478363;
double r478366 = r478364 / r478365;
double r478367 = -0.0;
bool r478368 = r478366 <= r478367;
double r478369 = cbrt(r478363);
double r478370 = r478369 * r478369;
double r478371 = cbrt(r478365);
double r478372 = r478371 * r478371;
double r478373 = r478370 / r478372;
double r478374 = r478362 * r478373;
double r478375 = r478369 / r478371;
double r478376 = r478374 * r478375;
double r478377 = 1.5055267344693184e-05;
bool r478378 = r478366 <= r478377;
double r478379 = r478365 / r478363;
double r478380 = r478362 / r478379;
double r478381 = r478378 ? r478366 : r478380;
double r478382 = r478368 ? r478376 : r478381;
return r478382;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.3 |
|---|---|
| Target | 0.4 |
| Herbie | 1.4 |
if (/ (* (* x 2.0) y) (- x y)) < -0.0Initial program 19.5
rmApplied *-un-lft-identity19.5
Applied times-frac6.3
Simplified6.3
rmApplied add-cube-cbrt7.5
Applied add-cube-cbrt6.9
Applied times-frac6.9
Applied associate-*r*2.3
if -0.0 < (/ (* (* x 2.0) y) (- x y)) < 1.5055267344693184e-05Initial program 0.4
if 1.5055267344693184e-05 < (/ (* (* x 2.0) y) (- x y)) Initial program 31.5
rmApplied associate-/l*0.1
Final simplification1.4
herbie shell --seed 2020100 +o rules:numerics
(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)))