\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -3.0306756776612656 \cdot 10^{44} \lor \neg \left(x \le 8.69159111879264488 \cdot 10^{-21}\right):\\
\;\;\;\;\frac{x \cdot 2}{x - y} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{1 \cdot \left(\frac{x}{y} - 1\right)}\\
\end{array}double f(double x, double y) {
double r493801 = x;
double r493802 = 2.0;
double r493803 = r493801 * r493802;
double r493804 = y;
double r493805 = r493803 * r493804;
double r493806 = r493801 - r493804;
double r493807 = r493805 / r493806;
return r493807;
}
double f(double x, double y) {
double r493808 = x;
double r493809 = -3.0306756776612656e+44;
bool r493810 = r493808 <= r493809;
double r493811 = 8.691591118792645e-21;
bool r493812 = r493808 <= r493811;
double r493813 = !r493812;
bool r493814 = r493810 || r493813;
double r493815 = 2.0;
double r493816 = r493808 * r493815;
double r493817 = y;
double r493818 = r493808 - r493817;
double r493819 = r493816 / r493818;
double r493820 = r493819 * r493817;
double r493821 = 1.0;
double r493822 = r493808 / r493817;
double r493823 = r493822 - r493821;
double r493824 = r493821 * r493823;
double r493825 = r493816 / r493824;
double r493826 = r493814 ? r493820 : r493825;
return r493826;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.1 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if x < -3.0306756776612656e+44 or 8.691591118792645e-21 < x Initial program 16.6
rmApplied associate-/l*15.4
rmApplied associate-/r/0.2
if -3.0306756776612656e+44 < x < 8.691591118792645e-21Initial program 13.7
rmApplied associate-/l*0.2
rmApplied *-un-lft-identity0.2
Applied *-un-lft-identity0.2
Applied times-frac0.2
Simplified0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020081
(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)))