\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 -2.1378619596082982 \cdot 10^{+105}:\\
\;\;\;\;\frac{y}{{x}^{2}}\\
\mathbf{elif}\;x \leq -3.3015405365043286 \cdot 10^{-205}:\\
\;\;\;\;\frac{x}{\frac{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}{y}}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_0 := \mathsf{hypot}\left(x + y, {\left(x + y\right)}^{1.5}\right)\\
\frac{x}{t_0} \cdot \frac{y}{t_0}
\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 -2.1378619596082982e+105)
(/ y (pow x 2.0))
(if (<= x -3.3015405365043286e-205)
(/ x (/ (fma (+ x y) (+ x y) (pow (+ x y) 3.0)) y))
(let* ((t_0 (hypot (+ x y) (pow (+ x y) 1.5))))
(* (/ x t_0) (/ y t_0))))))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 <= -2.1378619596082982e+105) {
tmp = y / pow(x, 2.0);
} else if (x <= -3.3015405365043286e-205) {
tmp = x / (fma((x + y), (x + y), pow((x + y), 3.0)) / y);
} else {
double t_0 = hypot((x + y), pow((x + y), 1.5));
tmp = (x / t_0) * (y / t_0);
}
return tmp;
}




Bits error versus x




Bits error versus y
| Original | 20.2 |
|---|---|
| Target | 0.1 |
| Herbie | 7.9 |
if x < -2.13786195960829816e105Initial program 26.0
Simplified26.0
Taylor expanded in x around inf 11.0
if -2.13786195960829816e105 < x < -3.30154053650432859e-205Initial program 12.4
Simplified12.4
Applied associate-/l*_binary648.6
if -3.30154053650432859e-205 < x Initial program 23.0
Simplified23.0
Applied add-sqr-sqrt_binary6423.1
Applied times-frac_binary6413.7
Simplified13.7
Simplified4.5
Final simplification7.9
herbie shell --seed 2022068
(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))))