\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -826361.63285378064 \lor \neg \left(y \le 6.83900105870824044 \cdot 10^{-58}\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 r689942 = x;
double r689943 = 2.0;
double r689944 = r689942 * r689943;
double r689945 = y;
double r689946 = r689944 * r689945;
double r689947 = r689942 - r689945;
double r689948 = r689946 / r689947;
return r689948;
}
double f(double x, double y) {
double r689949 = y;
double r689950 = -826361.6328537806;
bool r689951 = r689949 <= r689950;
double r689952 = 6.83900105870824e-58;
bool r689953 = r689949 <= r689952;
double r689954 = !r689953;
bool r689955 = r689951 || r689954;
double r689956 = x;
double r689957 = 2.0;
double r689958 = r689956 * r689957;
double r689959 = r689956 - r689949;
double r689960 = r689959 / r689949;
double r689961 = r689958 / r689960;
double r689962 = r689956 / r689959;
double r689963 = r689949 * r689957;
double r689964 = r689962 * r689963;
double r689965 = r689955 ? r689961 : r689964;
return r689965;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.8 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if y < -826361.6328537806 or 6.83900105870824e-58 < y Initial program 14.9
rmApplied associate-/l*0.3
if -826361.6328537806 < y < 6.83900105870824e-58Initial program 14.7
rmApplied associate-/l*16.6
rmApplied div-inv16.7
Applied times-frac0.2
Simplified0.0
Final simplification0.2
herbie shell --seed 2020035
(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)))