\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -1.73735157607842638 \cdot 10^{-55} \lor \neg \left(x \le 2.31015467420133914 \cdot 10^{-42}\right):\\
\;\;\;\;\frac{x}{x - y} \cdot \left(y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\end{array}double f(double x, double y) {
double r497222 = x;
double r497223 = 2.0;
double r497224 = r497222 * r497223;
double r497225 = y;
double r497226 = r497224 * r497225;
double r497227 = r497222 - r497225;
double r497228 = r497226 / r497227;
return r497228;
}
double f(double x, double y) {
double r497229 = x;
double r497230 = -1.7373515760784264e-55;
bool r497231 = r497229 <= r497230;
double r497232 = 2.310154674201339e-42;
bool r497233 = r497229 <= r497232;
double r497234 = !r497233;
bool r497235 = r497231 || r497234;
double r497236 = y;
double r497237 = r497229 - r497236;
double r497238 = r497229 / r497237;
double r497239 = 2.0;
double r497240 = r497236 * r497239;
double r497241 = r497238 * r497240;
double r497242 = r497229 * r497239;
double r497243 = r497237 / r497236;
double r497244 = r497242 / r497243;
double r497245 = r497235 ? r497241 : r497244;
return r497245;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.1 |
|---|---|
| Target | 0.4 |
| Herbie | 0.2 |
if x < -1.7373515760784264e-55 or 2.310154674201339e-42 < x Initial program 13.7
rmApplied associate-/l*13.3
rmApplied div-inv13.4
Applied times-frac0.5
Simplified0.4
if -1.7373515760784264e-55 < x < 2.310154674201339e-42Initial program 17.0
rmApplied associate-/l*0.0
Final simplification0.2
herbie shell --seed 2020046
(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)))