(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
(FPCore (x y)
:precision binary64
(let* ((t_0 (cbrt (fma (+ x y) (+ x y) (pow (+ x y) 3.0))))
(t_1 (hypot (+ x y) (pow (+ x y) 1.5))))
(if (<= x -4.9961300774504924e+103)
(/ y (pow x 2.0))
(if (<= x -2.1861370762499374e-147)
(* (/ 1.0 t_0) (* (/ x t_0) (/ y t_0)))
(* (/ 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 t_0 = cbrt(fma((x + y), (x + y), pow((x + y), 3.0)));
double t_1 = hypot((x + y), pow((x + y), 1.5));
double tmp;
if (x <= -4.9961300774504924e+103) {
tmp = y / pow(x, 2.0);
} else if (x <= -2.1861370762499374e-147) {
tmp = (1.0 / t_0) * ((x / t_0) * (y / t_0));
} else {
tmp = (x / t_1) * (y / t_1);
}
return tmp;
}
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function code(x, y) t_0 = cbrt(fma(Float64(x + y), Float64(x + y), (Float64(x + y) ^ 3.0))) t_1 = hypot(Float64(x + y), (Float64(x + y) ^ 1.5)) tmp = 0.0 if (x <= -4.9961300774504924e+103) tmp = Float64(y / (x ^ 2.0)); elseif (x <= -2.1861370762499374e-147) tmp = Float64(Float64(1.0 / t_0) * Float64(Float64(x / t_0) * Float64(y / t_0))); else tmp = Float64(Float64(x / t_1) * Float64(y / t_1)); end return tmp end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := Block[{t$95$0 = N[Power[N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision] + N[Power[N[(x + y), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(x + y), $MachinePrecision] ^ 2 + N[Power[N[(x + y), $MachinePrecision], 1.5], $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[x, -4.9961300774504924e+103], N[(y / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.1861370762499374e-147], N[(N[(1.0 / t$95$0), $MachinePrecision] * N[(N[(x / t$95$0), $MachinePrecision] * N[(y / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t$95$1), $MachinePrecision] * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\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 := \sqrt[3]{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}\\
t_1 := \mathsf{hypot}\left(x + y, {\left(x + y\right)}^{1.5}\right)\\
\mathbf{if}\;x \leq -4.9961300774504924 \cdot 10^{+103}:\\
\;\;\;\;\frac{y}{{x}^{2}}\\
\mathbf{elif}\;x \leq -2.1861370762499374 \cdot 10^{-147}:\\
\;\;\;\;\frac{1}{t_0} \cdot \left(\frac{x}{t_0} \cdot \frac{y}{t_0}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t_1} \cdot \frac{y}{t_1}\\
\end{array}




Bits error versus x




Bits error versus y
| Original | 19.6 |
|---|---|
| Target | 0.1 |
| Herbie | 7.0 |
if x < -4.99613007745049241e103Initial program 25.3
Simplified25.3
Taylor expanded in x around inf 10.4
if -4.99613007745049241e103 < x < -2.1861370762499374e-147Initial program 9.6
Simplified9.6
Applied add-cube-cbrt_binary6410.1
Applied times-frac_binary644.1
Applied *-un-lft-identity_binary644.1
Applied times-frac_binary644.1
Applied associate-*l*_binary644.1
if -2.1861370762499374e-147 < x Initial program 22.6
Simplified22.6
Applied add-sqr-sqrt_binary6422.6
Applied times-frac_binary6414.5
Simplified15.1
Simplified6.6
Final simplification7.0
herbie shell --seed 2022129
(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))))