\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -1.794266843434528135733297660501734721002 \cdot 10^{-157}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x}{y} - 1}\\
\mathbf{elif}\;y \le 3.448485370032302944418093156077181588583 \cdot 10^{-155}:\\
\;\;\;\;\left(2 \cdot y\right) \cdot \sqrt[3]{{\left(\frac{x}{x - y}\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\end{array}double f(double x, double y) {
double r474340 = x;
double r474341 = 2.0;
double r474342 = r474340 * r474341;
double r474343 = y;
double r474344 = r474342 * r474343;
double r474345 = r474340 - r474343;
double r474346 = r474344 / r474345;
return r474346;
}
double f(double x, double y) {
double r474347 = y;
double r474348 = -1.794266843434528e-157;
bool r474349 = r474347 <= r474348;
double r474350 = x;
double r474351 = 2.0;
double r474352 = r474350 * r474351;
double r474353 = r474350 / r474347;
double r474354 = 1.0;
double r474355 = r474353 - r474354;
double r474356 = r474352 / r474355;
double r474357 = 3.448485370032303e-155;
bool r474358 = r474347 <= r474357;
double r474359 = r474351 * r474347;
double r474360 = r474350 - r474347;
double r474361 = r474350 / r474360;
double r474362 = 3.0;
double r474363 = pow(r474361, r474362);
double r474364 = cbrt(r474363);
double r474365 = r474359 * r474364;
double r474366 = r474360 / r474347;
double r474367 = r474352 / r474366;
double r474368 = r474358 ? r474365 : r474367;
double r474369 = r474349 ? r474356 : r474368;
return r474369;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.0 |
|---|---|
| Target | 0.3 |
| Herbie | 1.9 |
if y < -1.794266843434528e-157Initial program 13.4
Simplified2.4
rmApplied *-un-lft-identity2.4
Applied *-un-lft-identity2.4
Applied times-frac2.4
Simplified2.4
Simplified2.4
if -1.794266843434528e-157 < y < 3.448485370032303e-155Initial program 21.1
Simplified22.8
rmApplied div-inv22.9
Applied times-frac0.2
Simplified0.0
rmApplied add-cbrt-cube41.1
Applied add-cbrt-cube42.2
Applied cbrt-undiv42.2
Simplified0.7
if 3.448485370032303e-155 < y Initial program 12.6
Simplified2.3
rmApplied *-un-lft-identity2.3
Final simplification1.9
herbie shell --seed 2019194
(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)))