\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 -5.870948528129125 \cdot 10^{+102}:\\
\;\;\;\;\frac{y}{{x}^{2}}\\
\mathbf{elif}\;x \leq -4.557595512962212 \cdot 10^{-163}:\\
\;\;\;\;\frac{\frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}}{\frac{1}{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 -5.870948528129125e+102)
(/ y (pow x 2.0))
(if (<= x -4.557595512962212e-163)
(/ (/ x (fma (+ x y) (+ x y) (pow (+ x y) 3.0))) (/ 1.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 <= -5.870948528129125e+102) {
tmp = y / pow(x, 2.0);
} else if (x <= -4.557595512962212e-163) {
tmp = (x / fma((x + y), (x + y), pow((x + y), 3.0))) / (1.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.0 |
|---|---|
| Target | 0.1 |
| Herbie | 6.9 |
if x < -5.87094852812912494e102Initial program 25.4
Simplified25.4
Taylor expanded in x around inf 10.1
if -5.87094852812912494e102 < x < -4.55759551296221209e-163Initial program 10.9
Simplified10.9
Applied associate-/l*_binary646.9
Applied div-inv_binary646.9
Applied associate-/r*_binary644.8
Simplified4.8
if -4.55759551296221209e-163 < x Initial program 23.2
Simplified23.2
Applied add-sqr-sqrt_binary6423.2
Applied times-frac_binary6415.0
Simplified15.0
Simplified6.1
Final simplification6.9
herbie shell --seed 2022081
(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))))