\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -3.47596719439230232 \cdot 10^{122} \lor \neg \left(x \le 67448507228.817856\right):\\
\;\;\;\;\frac{x \cdot 2}{x - y} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\end{array}double f(double x, double y) {
double r437802 = x;
double r437803 = 2.0;
double r437804 = r437802 * r437803;
double r437805 = y;
double r437806 = r437804 * r437805;
double r437807 = r437802 - r437805;
double r437808 = r437806 / r437807;
return r437808;
}
double f(double x, double y) {
double r437809 = x;
double r437810 = -3.475967194392302e+122;
bool r437811 = r437809 <= r437810;
double r437812 = 67448507228.817856;
bool r437813 = r437809 <= r437812;
double r437814 = !r437813;
bool r437815 = r437811 || r437814;
double r437816 = 2.0;
double r437817 = r437809 * r437816;
double r437818 = y;
double r437819 = r437809 - r437818;
double r437820 = r437817 / r437819;
double r437821 = r437820 * r437818;
double r437822 = r437819 / r437818;
double r437823 = r437817 / r437822;
double r437824 = r437815 ? r437821 : r437823;
return r437824;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.6 |
if x < -3.475967194392302e+122 or 67448507228.817856 < x Initial program 19.2
rmApplied associate-/l*17.5
rmApplied associate-/r/0.1
if -3.475967194392302e+122 < x < 67448507228.817856Initial program 12.3
rmApplied associate-/l*0.9
Final simplification0.6
herbie shell --seed 2020021 +o rules:numerics
(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)))