\frac{\left(x \cdot 2.0\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -9.50828047314787 \cdot 10^{+45}:\\
\;\;\;\;\left(y \cdot 2.0\right) \cdot \frac{x}{x - y}\\
\mathbf{elif}\;x \le 9.799425869832502 \cdot 10^{+101}:\\
\;\;\;\;\frac{x \cdot 2.0}{\frac{x}{y} - 1}\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot 2.0\right) \cdot \frac{x}{x - y}\\
\end{array}double f(double x, double y) {
double r9256080 = x;
double r9256081 = 2.0;
double r9256082 = r9256080 * r9256081;
double r9256083 = y;
double r9256084 = r9256082 * r9256083;
double r9256085 = r9256080 - r9256083;
double r9256086 = r9256084 / r9256085;
return r9256086;
}
double f(double x, double y) {
double r9256087 = x;
double r9256088 = -9.50828047314787e+45;
bool r9256089 = r9256087 <= r9256088;
double r9256090 = y;
double r9256091 = 2.0;
double r9256092 = r9256090 * r9256091;
double r9256093 = r9256087 - r9256090;
double r9256094 = r9256087 / r9256093;
double r9256095 = r9256092 * r9256094;
double r9256096 = 9.799425869832502e+101;
bool r9256097 = r9256087 <= r9256096;
double r9256098 = r9256087 * r9256091;
double r9256099 = r9256087 / r9256090;
double r9256100 = 1.0;
double r9256101 = r9256099 - r9256100;
double r9256102 = r9256098 / r9256101;
double r9256103 = r9256097 ? r9256102 : r9256095;
double r9256104 = r9256089 ? r9256095 : r9256103;
return r9256104;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.8 |
|---|---|
| Target | 0.4 |
| Herbie | 0.5 |
if x < -9.50828047314787e+45 or 9.799425869832502e+101 < x Initial program 18.7
rmApplied associate-/l*18.9
rmApplied div-inv19.0
Applied times-frac0.3
Simplified0.1
if -9.50828047314787e+45 < x < 9.799425869832502e+101Initial program 12.4
rmApplied associate-/l*0.8
rmApplied div-sub0.8
Simplified0.8
Final simplification0.5
herbie shell --seed 2019156 +o rules:numerics
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:herbie-target
(if (< x -1.7210442634149447e+81) (* (/ (* 2.0 x) (- x y)) y) (if (< x 8.364504563556443e+16) (/ (* x 2.0) (/ (- x y) y)) (* (/ (* 2.0 x) (- x y)) y)))
(/ (* (* x 2.0) y) (- x y)))