\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 -5.79766759371720844 \cdot 10^{-68}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -6.832690604332275 \cdot 10^{-308}:\\
\;\;\;\;\frac{1}{\frac{x - y}{\left(x \cdot 2\right) \cdot y}}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 1.0974670677454873 \cdot 10^{-305}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 2.5491712206131216 \cdot 10^{-36}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\end{array}double f(double x, double y) {
double r2835 = x;
double r2836 = 2.0;
double r2837 = r2835 * r2836;
double r2838 = y;
double r2839 = r2837 * r2838;
double r2840 = r2835 - r2838;
double r2841 = r2839 / r2840;
return r2841;
}
double f(double x, double y) {
double r2842 = x;
double r2843 = 2.0;
double r2844 = r2842 * r2843;
double r2845 = y;
double r2846 = r2844 * r2845;
double r2847 = r2842 - r2845;
double r2848 = r2846 / r2847;
double r2849 = -5.7976675937172084e-68;
bool r2850 = r2848 <= r2849;
double r2851 = r2847 / r2845;
double r2852 = r2844 / r2851;
double r2853 = -6.832690604332275e-308;
bool r2854 = r2848 <= r2853;
double r2855 = 1.0;
double r2856 = r2847 / r2846;
double r2857 = r2855 / r2856;
double r2858 = 1.0974670677454873e-305;
bool r2859 = r2848 <= r2858;
double r2860 = 2.5491712206131216e-36;
bool r2861 = r2848 <= r2860;
double r2862 = r2845 / r2847;
double r2863 = r2844 * r2862;
double r2864 = r2861 ? r2848 : r2863;
double r2865 = r2859 ? r2852 : r2864;
double r2866 = r2854 ? r2857 : r2865;
double r2867 = r2850 ? r2852 : r2866;
return r2867;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.8 |
if (/ (* (* x 2.0) y) (- x y)) < -5.7976675937172084e-68 or -6.832690604332275e-308 < (/ (* (* x 2.0) y) (- x y)) < 1.0974670677454873e-305Initial program 34.7
rmApplied associate-/l*0.9
if -5.7976675937172084e-68 < (/ (* (* x 2.0) y) (- x y)) < -6.832690604332275e-308Initial program 0.8
rmApplied clear-num1.0
if 1.0974670677454873e-305 < (/ (* (* x 2.0) y) (- x y)) < 2.5491712206131216e-36Initial program 0.7
if 2.5491712206131216e-36 < (/ (* (* x 2.0) y) (- x y)) Initial program 27.3
rmApplied *-un-lft-identity27.3
Applied times-frac0.3
Simplified0.3
Final simplification0.8
herbie shell --seed 2020025
(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)))