\frac{\left(x \cdot 2.0\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -9.50828047314787 \cdot 10^{+45}:\\
\;\;\;\;\frac{2.0 \cdot x}{x - y} \cdot y\\
\mathbf{elif}\;x \le 9.799425869832502 \cdot 10^{+101}:\\
\;\;\;\;\frac{2.0 \cdot x}{\frac{x}{y} - 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2.0 \cdot x}{x - y} \cdot y\\
\end{array}double f(double x, double y) {
double r10353648 = x;
double r10353649 = 2.0;
double r10353650 = r10353648 * r10353649;
double r10353651 = y;
double r10353652 = r10353650 * r10353651;
double r10353653 = r10353648 - r10353651;
double r10353654 = r10353652 / r10353653;
return r10353654;
}
double f(double x, double y) {
double r10353655 = x;
double r10353656 = -9.50828047314787e+45;
bool r10353657 = r10353655 <= r10353656;
double r10353658 = 2.0;
double r10353659 = r10353658 * r10353655;
double r10353660 = y;
double r10353661 = r10353655 - r10353660;
double r10353662 = r10353659 / r10353661;
double r10353663 = r10353662 * r10353660;
double r10353664 = 9.799425869832502e+101;
bool r10353665 = r10353655 <= r10353664;
double r10353666 = r10353655 / r10353660;
double r10353667 = 1.0;
double r10353668 = r10353666 - r10353667;
double r10353669 = r10353659 / r10353668;
double r10353670 = r10353665 ? r10353669 : r10353663;
double r10353671 = r10353657 ? r10353663 : r10353670;
return r10353671;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.8 |
|---|---|
| Target | 0.4 |
| Herbie | 0.6 |
if x < -9.50828047314787e+45 or 9.799425869832502e+101 < x Initial program 18.7
rmApplied associate-/l*18.9
rmApplied associate-/r/0.2
if -9.50828047314787e+45 < x < 9.799425869832502e+101Initial program 12.4
rmApplied associate-/l*0.8
rmApplied div-sub0.8
Simplified0.8
Final simplification0.6
herbie shell --seed 2019156
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:herbie-target
(if (< x -1.7210442634149447e+81) (* (/ (* 2.0 x) (- x y)) y) (if (< x 8.364504563556443e+16) (/ (* x 2.0) (/ (- x y) y)) (* (/ (* 2.0 x) (- x y)) y)))
(/ (* (* x 2.0) y) (- x y)))