\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \le -1950896635033006241202453604204544:\\
\;\;\;\;\frac{2 \cdot x}{x - y} \cdot y\\
\mathbf{elif}\;x \le 1.525261129384541486350799582595845140217 \cdot 10^{75}:\\
\;\;\;\;\left(2 \cdot x\right) \cdot \frac{y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot x}{x - y} \cdot y\\
\end{array}double f(double x, double y) {
double r24649326 = x;
double r24649327 = 2.0;
double r24649328 = r24649326 * r24649327;
double r24649329 = y;
double r24649330 = r24649328 * r24649329;
double r24649331 = r24649326 - r24649329;
double r24649332 = r24649330 / r24649331;
return r24649332;
}
double f(double x, double y) {
double r24649333 = x;
double r24649334 = -1.9508966350330062e+33;
bool r24649335 = r24649333 <= r24649334;
double r24649336 = 2.0;
double r24649337 = r24649336 * r24649333;
double r24649338 = y;
double r24649339 = r24649333 - r24649338;
double r24649340 = r24649337 / r24649339;
double r24649341 = r24649340 * r24649338;
double r24649342 = 1.5252611293845415e+75;
bool r24649343 = r24649333 <= r24649342;
double r24649344 = r24649338 / r24649339;
double r24649345 = r24649337 * r24649344;
double r24649346 = r24649343 ? r24649345 : r24649341;
double r24649347 = r24649335 ? r24649341 : r24649346;
return r24649347;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.2 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if x < -1.9508966350330062e+33 or 1.5252611293845415e+75 < x Initial program 19.0
rmApplied associate-/l*17.4
rmApplied associate-/r/0.1
if -1.9508966350330062e+33 < x < 1.5252611293845415e+75Initial program 12.5
rmApplied *-un-lft-identity12.5
Applied times-frac0.3
Simplified0.3
Final simplification0.2
herbie shell --seed 2019172
(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)))