\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;x \leq 6.427361026581062 \cdot 10^{+268}:\\
\;\;\;\;\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(2 \cdot \left(\frac{1}{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}} \cdot \left(\sqrt[3]{x} \cdot \frac{y}{\sqrt[3]{x - y}}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(2 \cdot y\right)}{x - y}\\
\end{array}(FPCore (x y) :precision binary64 (/ (* (* x 2.0) y) (- x y)))
(FPCore (x y)
:precision binary64
(if (<= x 6.427361026581062e+268)
(*
(* (cbrt x) (cbrt x))
(*
2.0
(*
(/ 1.0 (* (cbrt (- x y)) (cbrt (- x y))))
(* (cbrt x) (/ y (cbrt (- x y)))))))
(/ (* x (* 2.0 y)) (- x y))))double code(double x, double y) {
return (((double) (((double) (x * 2.0)) * y)) / ((double) (x - y)));
}
double code(double x, double y) {
double tmp;
if ((x <= 6.427361026581062e+268)) {
tmp = ((double) (((double) (((double) cbrt(x)) * ((double) cbrt(x)))) * ((double) (2.0 * ((double) ((1.0 / ((double) (((double) cbrt(((double) (x - y)))) * ((double) cbrt(((double) (x - y))))))) * ((double) (((double) cbrt(x)) * (y / ((double) cbrt(((double) (x - y)))))))))))));
} else {
tmp = (((double) (x * ((double) (2.0 * y)))) / ((double) (x - y)));
}
return tmp;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.8 |
|---|---|
| Target | 0.3 |
| Herbie | 5.7 |
if x < 6.4273610265810619e268Initial program Error: 14.3 bits
SimplifiedError: 6.1 bits
rmApplied add-cube-cbrtError: 7.3 bits
Applied associate-*l*Error: 7.3 bits
SimplifiedError: 7.3 bits
rmApplied add-cube-cbrtError: 7.1 bits
Applied *-un-lft-identityError: 7.1 bits
Applied times-fracError: 7.1 bits
Applied associate-*l*Error: 4.9 bits
SimplifiedError: 4.9 bits
if 6.4273610265810619e268 < x Initial program Error: 29.9 bits
SimplifiedError: 29.2 bits
rmApplied associate-*r/Error: 29.2 bits
Applied associate-*r/Error: 29.4 bits
Final simplificationError: 5.7 bits
herbie shell --seed 2020203
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:precision binary64
: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)))