\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}
t_0 := \mathsf{hypot}\left(x + y, {\left(x + y\right)}^{1.5}\right)\\
t_1 := {\left(x + y\right)}^{2}\\
t_2 := {\left(x + y\right)}^{3}\\
\mathbf{if}\;x \leq -2.9269061851776803 \cdot 10^{+98}:\\
\;\;\;\;\frac{y}{{x}^{2}}\\
\mathbf{elif}\;x \leq -9.891408611722913 \cdot 10^{-164}:\\
\;\;\;\;\frac{y \cdot \left(\frac{1}{\sqrt[3]{t_1 + t_2}} \cdot \frac{x}{\sqrt[3]{\left(x + y\right) + t_1} \cdot \sqrt[3]{x + y}}\right)}{\sqrt[3]{\mathsf{fma}\left(x + y, x + y, t_2\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t_0} \cdot \frac{y}{t_0}\\
\end{array}
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
(FPCore (x y)
:precision binary64
(let* ((t_0 (hypot (+ x y) (pow (+ x y) 1.5)))
(t_1 (pow (+ x y) 2.0))
(t_2 (pow (+ x y) 3.0)))
(if (<= x -2.9269061851776803e+98)
(/ y (pow x 2.0))
(if (<= x -9.891408611722913e-164)
(/
(*
y
(*
(/ 1.0 (cbrt (+ t_1 t_2)))
(/ x (* (cbrt (+ (+ x y) t_1)) (cbrt (+ x y))))))
(cbrt (fma (+ x y) (+ x y) t_2)))
(* (/ 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 t_0 = hypot((x + y), pow((x + y), 1.5));
double t_1 = pow((x + y), 2.0);
double t_2 = pow((x + y), 3.0);
double tmp;
if (x <= -2.9269061851776803e+98) {
tmp = y / pow(x, 2.0);
} else if (x <= -9.891408611722913e-164) {
tmp = (y * ((1.0 / cbrt((t_1 + t_2))) * (x / (cbrt(((x + y) + t_1)) * cbrt((x + y)))))) / cbrt(fma((x + y), (x + y), t_2));
} else {
tmp = (x / t_0) * (y / t_0);
}
return tmp;
}




Bits error versus x




Bits error versus y
| Original | 20.1 |
|---|---|
| Target | 0.1 |
| Herbie | 7.0 |
if x < -2.92690618517768032e98Initial program 26.8
Simplified26.8
Taylor expanded in x around inf 11.4
if -2.92690618517768032e98 < x < -9.89140861172291316e-164Initial program 10.1
Simplified10.1
Applied add-cube-cbrt_binary6410.6
Applied associate-/r*_binary6410.6
Simplified4.1
Applied unpow2_binary644.1
Applied unpow3_binary644.1
Applied distribute-rgt-out_binary644.1
Applied cbrt-prod_binary644.1
Simplified4.1
Applied *-un-lft-identity_binary644.1
Applied times-frac_binary644.1
Simplified4.1
Simplified4.1
if -9.89140861172291316e-164 < x Initial program 22.8
Simplified22.8
Applied add-sqr-sqrt_binary6422.8
Applied times-frac_binary6414.4
Simplified14.4
Simplified5.7
Final simplification7.0
herbie shell --seed 2022125
(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))))