\frac{\left(x \cdot 2.0\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -3.0638957814586657 \cdot 10^{-28}:\\
\;\;\;\;\frac{y}{x - y} \cdot \left(2.0 \cdot x\right)\\
\mathbf{elif}\;y \le 1.3615474866246526 \cdot 10^{+17}:\\
\;\;\;\;\frac{x}{x - y} \cdot \left(2.0 \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x - y} \cdot \left(2.0 \cdot x\right)\\
\end{array}double f(double x, double y) {
double r28087642 = x;
double r28087643 = 2.0;
double r28087644 = r28087642 * r28087643;
double r28087645 = y;
double r28087646 = r28087644 * r28087645;
double r28087647 = r28087642 - r28087645;
double r28087648 = r28087646 / r28087647;
return r28087648;
}
double f(double x, double y) {
double r28087649 = y;
double r28087650 = -3.0638957814586657e-28;
bool r28087651 = r28087649 <= r28087650;
double r28087652 = x;
double r28087653 = r28087652 - r28087649;
double r28087654 = r28087649 / r28087653;
double r28087655 = 2.0;
double r28087656 = r28087655 * r28087652;
double r28087657 = r28087654 * r28087656;
double r28087658 = 1.3615474866246526e+17;
bool r28087659 = r28087649 <= r28087658;
double r28087660 = r28087652 / r28087653;
double r28087661 = r28087655 * r28087649;
double r28087662 = r28087660 * r28087661;
double r28087663 = r28087659 ? r28087662 : r28087657;
double r28087664 = r28087651 ? r28087657 : r28087663;
return r28087664;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.4 |
|---|---|
| Target | 0.3 |
| Herbie | 0.1 |
if y < -3.0638957814586657e-28 or 1.3615474866246526e+17 < y Initial program 14.9
rmApplied *-un-lft-identity14.9
Applied times-frac0.1
Simplified0.1
if -3.0638957814586657e-28 < y < 1.3615474866246526e+17Initial program 13.9
rmApplied associate-/l*15.0
rmApplied div-inv15.2
Applied times-frac0.3
Simplified0.1
Final simplification0.1
herbie shell --seed 2019162
(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)))