\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} = -\infty \lor \neg \left(\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -1.4108510848905031 \cdot 10^{-307} \lor \neg \left(\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -0.0 \lor \neg \left(\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 7.98976594251477736 \cdot 10^{-110}\right)\right)\right):\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\end{array}double f(double x, double y) {
double r429171 = x;
double r429172 = 2.0;
double r429173 = r429171 * r429172;
double r429174 = y;
double r429175 = r429173 * r429174;
double r429176 = r429171 - r429174;
double r429177 = r429175 / r429176;
return r429177;
}
double f(double x, double y) {
double r429178 = x;
double r429179 = 2.0;
double r429180 = r429178 * r429179;
double r429181 = y;
double r429182 = r429180 * r429181;
double r429183 = r429178 - r429181;
double r429184 = r429182 / r429183;
double r429185 = -inf.0;
bool r429186 = r429184 <= r429185;
double r429187 = -1.410851084890503e-307;
bool r429188 = r429184 <= r429187;
double r429189 = -0.0;
bool r429190 = r429184 <= r429189;
double r429191 = 7.989765942514777e-110;
bool r429192 = r429184 <= r429191;
double r429193 = !r429192;
bool r429194 = r429190 || r429193;
double r429195 = !r429194;
bool r429196 = r429188 || r429195;
double r429197 = !r429196;
bool r429198 = r429186 || r429197;
double r429199 = r429181 / r429183;
double r429200 = r429180 * r429199;
double r429201 = r429198 ? r429200 : r429184;
return r429201;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.1 |
|---|---|
| Target | 0.4 |
| Herbie | 0.9 |
if (/ (* (* x 2.0) y) (- x y)) < -inf.0 or -1.410851084890503e-307 < (/ (* (* x 2.0) y) (- x y)) < -0.0 or 7.989765942514777e-110 < (/ (* (* x 2.0) y) (- x y)) Initial program 35.8
rmApplied *-un-lft-identity35.8
Applied times-frac1.2
Simplified1.2
if -inf.0 < (/ (* (* x 2.0) y) (- x y)) < -1.410851084890503e-307 or -0.0 < (/ (* (* x 2.0) y) (- x y)) < 7.989765942514777e-110Initial program 0.7
Final simplification0.9
herbie shell --seed 2020024
(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)))