\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -1.93403941868859091 \cdot 10^{-36} \lor \neg \left(y \le 1.19064852231214522 \cdot 10^{-72}\right):\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x - y} \cdot \left(y \cdot 2\right)\\
\end{array}double f(double x, double y) {
double r589903 = x;
double r589904 = 2.0;
double r589905 = r589903 * r589904;
double r589906 = y;
double r589907 = r589905 * r589906;
double r589908 = r589903 - r589906;
double r589909 = r589907 / r589908;
return r589909;
}
double f(double x, double y) {
double r589910 = y;
double r589911 = -1.934039418688591e-36;
bool r589912 = r589910 <= r589911;
double r589913 = 1.1906485223121452e-72;
bool r589914 = r589910 <= r589913;
double r589915 = !r589914;
bool r589916 = r589912 || r589915;
double r589917 = x;
double r589918 = 2.0;
double r589919 = r589917 * r589918;
double r589920 = r589917 - r589910;
double r589921 = r589920 / r589910;
double r589922 = r589919 / r589921;
double r589923 = r589917 / r589920;
double r589924 = r589910 * r589918;
double r589925 = r589923 * r589924;
double r589926 = r589916 ? r589922 : r589925;
return r589926;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.3 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if y < -1.934039418688591e-36 or 1.1906485223121452e-72 < y Initial program 14.4
rmApplied associate-/l*0.4
if -1.934039418688591e-36 < y < 1.1906485223121452e-72Initial program 16.6
rmApplied associate-/l*17.8
rmApplied div-inv17.9
Applied times-frac0.2
Simplified0.0
Final simplification0.3
herbie shell --seed 2020060
(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)))