\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\begin{array}{l}
\mathbf{if}\;x \leq -1.1125239315049187 \cdot 10^{+107}:\\
\;\;\;\;\frac{y}{{x}^{2}}\\
\mathbf{elif}\;x \leq -5.763417785668302 \cdot 10^{-162}:\\
\;\;\;\;\begin{array}{l}
t_0 := \sqrt[3]{{\left(x + y\right)}^{3} + {\left(x + y\right)}^{2}}\\
\frac{x}{t_0 \cdot t_0} \cdot \frac{y}{t_0}
\end{array}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \mathsf{hypot}\left(x + y, {\left(x + y\right)}^{1.5}\right)\\
\frac{x}{t_1} \cdot \frac{y}{t_1}
\end{array}\\
\end{array}
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
(FPCore (x y)
:precision binary64
(if (<= x -1.1125239315049187e+107)
(/ y (pow x 2.0))
(if (<= x -5.763417785668302e-162)
(let* ((t_0 (cbrt (+ (pow (+ x y) 3.0) (pow (+ x y) 2.0)))))
(* (/ x (* t_0 t_0)) (/ y t_0)))
(let* ((t_1 (hypot (+ x y) (pow (+ x y) 1.5))))
(* (/ x t_1) (/ y t_1))))))double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
double code(double x, double y) {
double tmp;
if (x <= -1.1125239315049187e+107) {
tmp = y / pow(x, 2.0);
} else if (x <= -5.763417785668302e-162) {
double t_0 = cbrt(pow((x + y), 3.0) + pow((x + y), 2.0));
tmp = (x / (t_0 * t_0)) * (y / t_0);
} else {
double t_1 = hypot((x + y), pow((x + y), 1.5));
tmp = (x / t_1) * (y / t_1);
}
return tmp;
}




Bits error versus x




Bits error versus y
Results
| Original | 19.7 |
|---|---|
| Target | 0.2 |
| Herbie | 7.1 |
if x < -1.11252393150491872e107Initial program 25.1
Simplified25.1
Taylor expanded in x around inf 10.9
if -1.11252393150491872e107 < x < -5.763417785668302e-162Initial program 11.1
Simplified11.0
Applied add-cube-cbrt_binary6411.6
Applied times-frac_binary644.6
Simplified4.6
Simplified4.6
if -5.763417785668302e-162 < x Initial program 22.9
Simplified22.9
Applied add-sqr-sqrt_binary6423.0
Applied times-frac_binary6414.8
Simplified14.8
Simplified6.3
Final simplification7.1
herbie shell --seed 2022097
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))