\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} = -\infty:\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -6.745122070843779617146525347103711815123 \cdot 10^{-307}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}} \cdot \left(x \cdot 2\right)\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{x - y}}\\
\end{array}double f(double x, double y) {
double r387594 = x;
double r387595 = 2.0;
double r387596 = r387594 * r387595;
double r387597 = y;
double r387598 = r387596 * r387597;
double r387599 = r387594 - r387597;
double r387600 = r387598 / r387599;
return r387600;
}
double f(double x, double y) {
double r387601 = x;
double r387602 = 2.0;
double r387603 = r387601 * r387602;
double r387604 = y;
double r387605 = r387603 * r387604;
double r387606 = r387601 - r387604;
double r387607 = r387605 / r387606;
double r387608 = -inf.0;
bool r387609 = r387607 <= r387608;
double r387610 = r387604 / r387606;
double r387611 = r387603 * r387610;
double r387612 = -6.74512207084378e-307;
bool r387613 = r387607 <= r387612;
double r387614 = cbrt(r387604);
double r387615 = r387614 * r387614;
double r387616 = cbrt(r387606);
double r387617 = r387616 * r387616;
double r387618 = r387615 / r387617;
double r387619 = r387618 * r387603;
double r387620 = r387614 / r387616;
double r387621 = r387619 * r387620;
double r387622 = r387613 ? r387607 : r387621;
double r387623 = r387609 ? r387611 : r387622;
return r387623;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.7 |
|---|---|
| Target | 0.3 |
| Herbie | 1.5 |
if (/ (* (* x 2.0) y) (- x y)) < -inf.0Initial program 64.0
rmApplied *-un-lft-identity64.0
Applied times-frac0.2
Simplified0.2
if -inf.0 < (/ (* (* x 2.0) y) (- x y)) < -6.74512207084378e-307Initial program 0.4
if -6.74512207084378e-307 < (/ (* (* x 2.0) y) (- x y)) Initial program 18.8
rmApplied *-un-lft-identity18.8
Applied times-frac6.4
Simplified6.4
rmApplied add-cube-cbrt7.6
Applied add-cube-cbrt7.1
Applied times-frac7.1
Applied associate-*r*2.3
Simplified2.3
Final simplification1.5
herbie shell --seed 2019208
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(if (< x -1.7210442634149447e81) (* (/ (* 2 x) (- x y)) y) (if (< x 83645045635564432) (/ (* x 2) (/ (- x y) y)) (* (/ (* 2 x) (- x y)) y)))
(/ (* (* x 2) y) (- x y)))