(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 (cbrt (fma (+ x y) (+ x y) (pow (+ x y) 3.0)))))
(if (<= x -1.754960936749458e+112)
(/ y (* x x))
(if (<= x -5.664768576413203e-146)
(* (/ x (* t_1 t_1)) (/ y t_1))
(/ (* x (/ y t_0)) 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 = cbrt(fma((x + y), (x + y), pow((x + y), 3.0)));
double tmp;
if (x <= -1.754960936749458e+112) {
tmp = y / (x * x);
} else if (x <= -5.664768576413203e-146) {
tmp = (x / (t_1 * t_1)) * (y / t_1);
} else {
tmp = (x * (y / t_0)) / t_0;
}
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 = hypot(Float64(x + y), (Float64(x + y) ^ 1.5)) t_1 = cbrt(fma(Float64(x + y), Float64(x + y), (Float64(x + y) ^ 3.0))) tmp = 0.0 if (x <= -1.754960936749458e+112) tmp = Float64(y / Float64(x * x)); elseif (x <= -5.664768576413203e-146) tmp = Float64(Float64(x / Float64(t_1 * t_1)) * Float64(y / t_1)); else tmp = Float64(Float64(x * Float64(y / t_0)) / t_0); 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[Sqrt[N[(x + y), $MachinePrecision] ^ 2 + N[Power[N[(x + y), $MachinePrecision], 1.5], $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision] + N[Power[N[(x + y), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[x, -1.754960936749458e+112], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.664768576413203e-146], N[(N[(x / N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $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 := \mathsf{hypot}\left(x + y, {\left(x + y\right)}^{1.5}\right)\\
t_1 := \sqrt[3]{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}\\
\mathbf{if}\;x \leq -1.754960936749458 \cdot 10^{+112}:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -5.664768576413203 \cdot 10^{-146}:\\
\;\;\;\;\frac{x}{t_1 \cdot t_1} \cdot \frac{y}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{y}{t_0}}{t_0}\\
\end{array}




Bits error versus x




Bits error versus y
| Original | 19.3 |
|---|---|
| Target | 0.1 |
| Herbie | 7.1 |
if x < -1.754960936749458e112Initial program 25.5
Simplified25.5
Applied *-un-lft-identity_binary6425.5
Applied times-frac_binary6413.5
Taylor expanded in x around inf 10.6
Simplified10.6
if -1.754960936749458e112 < x < -5.664768576413203e-146Initial program 10.1
Simplified10.0
Applied add-cube-cbrt_binary6410.5
Applied times-frac_binary644.4
if -5.664768576413203e-146 < x Initial program 22.3
Simplified22.3
Applied add-sqr-sqrt_binary6422.3
Applied times-frac_binary6413.4
Simplified14.2
Simplified6.8
Applied associate-*l/_binary646.8
Final simplification7.1
herbie shell --seed 2022130
(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))))