
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t_0}}{t_0}}{t_0 + 1}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t_0}}{t_0}}{t_0 + 1}
\end{array}
\end{array}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))))
(if (<= beta 5e+144)
(/ (/ (* (+ 1.0 beta) (+ 1.0 alpha)) (+ 3.0 (+ alpha beta))) (* t_0 t_0))
(/ (/ 1.0 beta) (/ beta (+ 1.0 alpha))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 5e+144) {
tmp = (((1.0 + beta) * (1.0 + alpha)) / (3.0 + (alpha + beta))) / (t_0 * t_0);
} else {
tmp = (1.0 / beta) / (beta / (1.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 5d+144) then
tmp = (((1.0d0 + beta) * (1.0d0 + alpha)) / (3.0d0 + (alpha + beta))) / (t_0 * t_0)
else
tmp = (1.0d0 / beta) / (beta / (1.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 5e+144) {
tmp = (((1.0 + beta) * (1.0 + alpha)) / (3.0 + (alpha + beta))) / (t_0 * t_0);
} else {
tmp = (1.0 / beta) / (beta / (1.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 5e+144: tmp = (((1.0 + beta) * (1.0 + alpha)) / (3.0 + (alpha + beta))) / (t_0 * t_0) else: tmp = (1.0 / beta) / (beta / (1.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 5e+144) tmp = Float64(Float64(Float64(Float64(1.0 + beta) * Float64(1.0 + alpha)) / Float64(3.0 + Float64(alpha + beta))) / Float64(t_0 * t_0)); else tmp = Float64(Float64(1.0 / beta) / Float64(beta / Float64(1.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 5e+144)
tmp = (((1.0 + beta) * (1.0 + alpha)) / (3.0 + (alpha + beta))) / (t_0 * t_0);
else
tmp = (1.0 / beta) / (beta / (1.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 5e+144], N[(N[(N[(N[(1.0 + beta), $MachinePrecision] * N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision] / N[(3.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / beta), $MachinePrecision] / N[(beta / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 5 \cdot 10^{+144}:\\
\;\;\;\;\frac{\frac{\left(1 + \beta\right) \cdot \left(1 + \alpha\right)}{3 + \left(\alpha + \beta\right)}}{t_0 \cdot t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta}}{\frac{\beta}{1 + \alpha}}\\
\end{array}
\end{array}
if beta < 4.9999999999999999e144Initial program 99.3%
associate-/l/99.2%
associate-/l/91.7%
associate-/r*99.3%
Simplified99.3%
if 4.9999999999999999e144 < beta Initial program 89.5%
associate-/l/87.4%
associate-/l/87.4%
+-commutative87.4%
*-commutative87.4%
+-commutative87.4%
associate-+l+87.4%
associate-+l+87.4%
fma-def87.4%
Simplified87.4%
Taylor expanded in beta around inf 95.1%
unpow295.1%
Simplified95.1%
+-commutative95.1%
associate-/r*93.9%
div-inv93.9%
Applied egg-rr93.9%
clear-num93.9%
associate-*l/93.9%
div-inv93.9%
+-commutative93.9%
Applied egg-rr93.9%
Final simplification98.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))))
(/
(/ 1.0 t_0)
(/ (+ alpha (+ beta 3.0)) (/ (+ 1.0 alpha) (/ t_0 (+ 1.0 beta)))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return (1.0 / t_0) / ((alpha + (beta + 3.0)) / ((1.0 + alpha) / (t_0 / (1.0 + beta))));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = alpha + (beta + 2.0d0)
code = (1.0d0 / t_0) / ((alpha + (beta + 3.0d0)) / ((1.0d0 + alpha) / (t_0 / (1.0d0 + beta))))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return (1.0 / t_0) / ((alpha + (beta + 3.0)) / ((1.0 + alpha) / (t_0 / (1.0 + beta))));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return (1.0 / t_0) / ((alpha + (beta + 3.0)) / ((1.0 + alpha) / (t_0 / (1.0 + beta))))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) return Float64(Float64(1.0 / t_0) / Float64(Float64(alpha + Float64(beta + 3.0)) / Float64(Float64(1.0 + alpha) / Float64(t_0 / Float64(1.0 + beta))))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = (1.0 / t_0) / ((alpha + (beta + 3.0)) / ((1.0 + alpha) / (t_0 / (1.0 + beta))));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(1.0 / t$95$0), $MachinePrecision] / N[(N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + alpha), $MachinePrecision] / N[(t$95$0 / N[(1.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\frac{\frac{1}{t_0}}{\frac{\alpha + \left(\beta + 3\right)}{\frac{1 + \alpha}{\frac{t_0}{1 + \beta}}}}
\end{array}
\end{array}
Initial program 97.5%
associate-/l/97.1%
associate-/l/90.9%
+-commutative90.9%
*-commutative90.9%
+-commutative90.9%
associate-+l+90.9%
associate-+l+90.9%
fma-def90.9%
Simplified90.9%
fma-def90.9%
associate-+r+90.9%
associate-+r+90.9%
*-commutative90.9%
+-commutative90.9%
*-commutative90.9%
associate-+l+90.9%
distribute-rgt1-in90.9%
associate-+r+90.9%
+-commutative90.9%
*-lft-identity90.9%
*-rgt-identity90.9%
*-lft-identity90.9%
distribute-lft-in90.9%
+-commutative90.9%
Applied egg-rr99.1%
*-commutative99.1%
associate-+r+99.1%
+-commutative99.1%
associate-*r/97.3%
*-commutative97.3%
associate-*l/97.3%
Applied egg-rr99.8%
Final simplification99.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 3.0))) (t_1 (+ alpha (+ beta 2.0))))
(if (<= beta 4.3e+17)
(/ (+ alpha (+ 1.0 beta)) (* t_1 (* t_1 t_0)))
(/ (/ 1.0 t_1) (/ t_0 (+ 1.0 alpha))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 3.0);
double t_1 = alpha + (beta + 2.0);
double tmp;
if (beta <= 4.3e+17) {
tmp = (alpha + (1.0 + beta)) / (t_1 * (t_1 * t_0));
} else {
tmp = (1.0 / t_1) / (t_0 / (1.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = alpha + (beta + 3.0d0)
t_1 = alpha + (beta + 2.0d0)
if (beta <= 4.3d+17) then
tmp = (alpha + (1.0d0 + beta)) / (t_1 * (t_1 * t_0))
else
tmp = (1.0d0 / t_1) / (t_0 / (1.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 3.0);
double t_1 = alpha + (beta + 2.0);
double tmp;
if (beta <= 4.3e+17) {
tmp = (alpha + (1.0 + beta)) / (t_1 * (t_1 * t_0));
} else {
tmp = (1.0 / t_1) / (t_0 / (1.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 3.0) t_1 = alpha + (beta + 2.0) tmp = 0 if beta <= 4.3e+17: tmp = (alpha + (1.0 + beta)) / (t_1 * (t_1 * t_0)) else: tmp = (1.0 / t_1) / (t_0 / (1.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 3.0)) t_1 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 4.3e+17) tmp = Float64(Float64(alpha + Float64(1.0 + beta)) / Float64(t_1 * Float64(t_1 * t_0))); else tmp = Float64(Float64(1.0 / t_1) / Float64(t_0 / Float64(1.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 3.0);
t_1 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 4.3e+17)
tmp = (alpha + (1.0 + beta)) / (t_1 * (t_1 * t_0));
else
tmp = (1.0 / t_1) / (t_0 / (1.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 4.3e+17], N[(N[(alpha + N[(1.0 + beta), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t$95$1), $MachinePrecision] / N[(t$95$0 / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 3\right)\\
t_1 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 4.3 \cdot 10^{+17}:\\
\;\;\;\;\frac{\alpha + \left(1 + \beta\right)}{t_1 \cdot \left(t_1 \cdot t_0\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{t_1}}{\frac{t_0}{1 + \alpha}}\\
\end{array}
\end{array}
if beta < 4.3e17Initial program 99.8%
associate-/l/99.7%
associate-/l/95.2%
+-commutative95.2%
*-commutative95.2%
+-commutative95.2%
associate-+l+95.2%
associate-+l+95.2%
fma-def95.2%
Simplified95.2%
Taylor expanded in alpha around 0 95.2%
if 4.3e17 < beta Initial program 91.8%
associate-/l/90.5%
associate-/l/80.4%
+-commutative80.4%
*-commutative80.4%
+-commutative80.4%
associate-+l+80.4%
associate-+l+80.4%
fma-def80.4%
Simplified80.4%
fma-def80.4%
associate-+r+80.4%
associate-+r+80.4%
*-commutative80.4%
+-commutative80.4%
*-commutative80.4%
associate-+l+80.4%
distribute-rgt1-in80.4%
associate-+r+80.4%
+-commutative80.4%
*-lft-identity80.4%
*-rgt-identity80.4%
*-lft-identity80.4%
distribute-lft-in80.4%
+-commutative80.4%
Applied egg-rr97.2%
*-commutative97.2%
associate-+r+97.2%
+-commutative97.2%
associate-*r/90.9%
*-commutative90.9%
associate-*l/90.9%
Applied egg-rr99.9%
Taylor expanded in beta around inf 93.5%
Final simplification94.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ alpha (+ beta 2.0)))) (/ (/ (+ 1.0 alpha) (/ t_0 (+ 1.0 beta))) (* t_0 (+ alpha (+ beta 3.0))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((1.0 + alpha) / (t_0 / (1.0 + beta))) / (t_0 * (alpha + (beta + 3.0)));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = alpha + (beta + 2.0d0)
code = ((1.0d0 + alpha) / (t_0 / (1.0d0 + beta))) / (t_0 * (alpha + (beta + 3.0d0)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((1.0 + alpha) / (t_0 / (1.0 + beta))) / (t_0 * (alpha + (beta + 3.0)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return ((1.0 + alpha) / (t_0 / (1.0 + beta))) / (t_0 * (alpha + (beta + 3.0)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) return Float64(Float64(Float64(1.0 + alpha) / Float64(t_0 / Float64(1.0 + beta))) / Float64(t_0 * Float64(alpha + Float64(beta + 3.0)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = ((1.0 + alpha) / (t_0 / (1.0 + beta))) / (t_0 * (alpha + (beta + 3.0)));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(t$95$0 / N[(1.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\frac{\frac{1 + \alpha}{\frac{t_0}{1 + \beta}}}{t_0 \cdot \left(\alpha + \left(\beta + 3\right)\right)}
\end{array}
\end{array}
Initial program 97.5%
associate-/l/97.1%
associate-/l/90.9%
+-commutative90.9%
*-commutative90.9%
+-commutative90.9%
associate-+l+90.9%
associate-+l+90.9%
fma-def90.9%
Simplified90.9%
fma-def90.9%
associate-+r+90.9%
associate-+r+90.9%
*-commutative90.9%
+-commutative90.9%
*-commutative90.9%
associate-+l+90.9%
distribute-rgt1-in90.9%
associate-+r+90.9%
+-commutative90.9%
*-lft-identity90.9%
*-rgt-identity90.9%
*-lft-identity90.9%
distribute-lft-in90.9%
+-commutative90.9%
Applied egg-rr99.1%
*-commutative99.1%
associate-+r+99.1%
+-commutative99.1%
associate-*r/97.3%
*-commutative97.3%
associate-*l/97.3%
Applied egg-rr98.9%
Final simplification98.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))))
(/
(/ (- -1.0 beta) (/ (- -3.0 (+ alpha beta)) (+ 1.0 alpha)))
(* t_0 t_0))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((-1.0 - beta) / ((-3.0 - (alpha + beta)) / (1.0 + alpha))) / (t_0 * t_0);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = alpha + (beta + 2.0d0)
code = (((-1.0d0) - beta) / (((-3.0d0) - (alpha + beta)) / (1.0d0 + alpha))) / (t_0 * t_0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((-1.0 - beta) / ((-3.0 - (alpha + beta)) / (1.0 + alpha))) / (t_0 * t_0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return ((-1.0 - beta) / ((-3.0 - (alpha + beta)) / (1.0 + alpha))) / (t_0 * t_0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) return Float64(Float64(Float64(-1.0 - beta) / Float64(Float64(-3.0 - Float64(alpha + beta)) / Float64(1.0 + alpha))) / Float64(t_0 * t_0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = ((-1.0 - beta) / ((-3.0 - (alpha + beta)) / (1.0 + alpha))) / (t_0 * t_0);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(-1.0 - beta), $MachinePrecision] / N[(N[(-3.0 - N[(alpha + beta), $MachinePrecision]), $MachinePrecision] / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\frac{\frac{-1 - \beta}{\frac{-3 - \left(\alpha + \beta\right)}{1 + \alpha}}}{t_0 \cdot t_0}
\end{array}
\end{array}
Initial program 97.5%
associate-/l/97.0%
associate-/l/90.9%
associate-/r*97.1%
Simplified97.1%
frac-2neg97.1%
distribute-frac-neg97.1%
neg-sub097.1%
*-commutative97.1%
+-commutative97.1%
distribute-neg-in97.1%
unsub-neg97.1%
metadata-eval97.1%
Applied egg-rr97.1%
neg-sub097.1%
associate-/l*98.9%
+-commutative98.9%
+-commutative98.9%
+-commutative98.9%
Simplified98.9%
Final simplification98.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (/ 1.0 (+ alpha (+ beta 2.0)))))
(if (<= beta 8.2e+40)
(/ t_0 (/ (* (+ beta 2.0) (+ beta 3.0)) (+ 1.0 beta)))
(/ t_0 (/ (+ alpha (+ beta 3.0)) (+ 1.0 alpha))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = 1.0 / (alpha + (beta + 2.0));
double tmp;
if (beta <= 8.2e+40) {
tmp = t_0 / (((beta + 2.0) * (beta + 3.0)) / (1.0 + beta));
} else {
tmp = t_0 / ((alpha + (beta + 3.0)) / (1.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 / (alpha + (beta + 2.0d0))
if (beta <= 8.2d+40) then
tmp = t_0 / (((beta + 2.0d0) * (beta + 3.0d0)) / (1.0d0 + beta))
else
tmp = t_0 / ((alpha + (beta + 3.0d0)) / (1.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = 1.0 / (alpha + (beta + 2.0));
double tmp;
if (beta <= 8.2e+40) {
tmp = t_0 / (((beta + 2.0) * (beta + 3.0)) / (1.0 + beta));
} else {
tmp = t_0 / ((alpha + (beta + 3.0)) / (1.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = 1.0 / (alpha + (beta + 2.0)) tmp = 0 if beta <= 8.2e+40: tmp = t_0 / (((beta + 2.0) * (beta + 3.0)) / (1.0 + beta)) else: tmp = t_0 / ((alpha + (beta + 3.0)) / (1.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(1.0 / Float64(alpha + Float64(beta + 2.0))) tmp = 0.0 if (beta <= 8.2e+40) tmp = Float64(t_0 / Float64(Float64(Float64(beta + 2.0) * Float64(beta + 3.0)) / Float64(1.0 + beta))); else tmp = Float64(t_0 / Float64(Float64(alpha + Float64(beta + 3.0)) / Float64(1.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = 1.0 / (alpha + (beta + 2.0));
tmp = 0.0;
if (beta <= 8.2e+40)
tmp = t_0 / (((beta + 2.0) * (beta + 3.0)) / (1.0 + beta));
else
tmp = t_0 / ((alpha + (beta + 3.0)) / (1.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(1.0 / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 8.2e+40], N[(t$95$0 / N[(N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision] / N[(1.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision] / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \frac{1}{\alpha + \left(\beta + 2\right)}\\
\mathbf{if}\;\beta \leq 8.2 \cdot 10^{+40}:\\
\;\;\;\;\frac{t_0}{\frac{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}{1 + \beta}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{\frac{\alpha + \left(\beta + 3\right)}{1 + \alpha}}\\
\end{array}
\end{array}
if beta < 8.2000000000000003e40Initial program 99.8%
associate-/l/99.7%
associate-/l/95.3%
+-commutative95.3%
*-commutative95.3%
+-commutative95.3%
associate-+l+95.3%
associate-+l+95.3%
fma-def95.3%
Simplified95.3%
fma-def95.3%
associate-+r+95.3%
associate-+r+95.3%
*-commutative95.3%
+-commutative95.3%
*-commutative95.3%
associate-+l+95.3%
distribute-rgt1-in95.3%
associate-+r+95.3%
+-commutative95.3%
*-lft-identity95.3%
*-rgt-identity95.3%
*-lft-identity95.3%
distribute-lft-in95.3%
+-commutative95.3%
Applied egg-rr99.9%
*-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-*r/99.9%
*-commutative99.9%
associate-*l/99.9%
Applied egg-rr99.8%
Taylor expanded in alpha around 0 68.6%
if 8.2000000000000003e40 < beta Initial program 91.5%
associate-/l/90.1%
associate-/l/79.6%
+-commutative79.6%
*-commutative79.6%
+-commutative79.6%
associate-+l+79.6%
associate-+l+79.6%
fma-def79.6%
Simplified79.6%
fma-def79.6%
associate-+r+79.6%
associate-+r+79.6%
*-commutative79.6%
+-commutative79.6%
*-commutative79.6%
associate-+l+79.6%
distribute-rgt1-in79.6%
associate-+r+79.6%
+-commutative79.6%
*-lft-identity79.6%
*-rgt-identity79.6%
*-lft-identity79.6%
distribute-lft-in79.6%
+-commutative79.6%
Applied egg-rr97.0%
*-commutative97.0%
associate-+r+97.0%
+-commutative97.0%
associate-*r/90.5%
*-commutative90.5%
associate-*l/90.5%
Applied egg-rr99.9%
Taylor expanded in beta around inf 94.6%
Final simplification75.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ (/ (+ 1.0 alpha) (/ (+ alpha (+ beta 2.0)) (+ 1.0 beta))) (* (+ beta 2.0) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
return ((1.0 + alpha) / ((alpha + (beta + 2.0)) / (1.0 + beta))) / ((beta + 2.0) * (beta + 3.0));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = ((1.0d0 + alpha) / ((alpha + (beta + 2.0d0)) / (1.0d0 + beta))) / ((beta + 2.0d0) * (beta + 3.0d0))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return ((1.0 + alpha) / ((alpha + (beta + 2.0)) / (1.0 + beta))) / ((beta + 2.0) * (beta + 3.0));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return ((1.0 + alpha) / ((alpha + (beta + 2.0)) / (1.0 + beta))) / ((beta + 2.0) * (beta + 3.0))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(Float64(1.0 + alpha) / Float64(Float64(alpha + Float64(beta + 2.0)) / Float64(1.0 + beta))) / Float64(Float64(beta + 2.0) * Float64(beta + 3.0))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = ((1.0 + alpha) / ((alpha + (beta + 2.0)) / (1.0 + beta))) / ((beta + 2.0) * (beta + 3.0));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(1.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{\frac{1 + \alpha}{\frac{\alpha + \left(\beta + 2\right)}{1 + \beta}}}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}
\end{array}
Initial program 97.5%
associate-/l/97.1%
associate-/l/90.9%
+-commutative90.9%
*-commutative90.9%
+-commutative90.9%
associate-+l+90.9%
associate-+l+90.9%
fma-def90.9%
Simplified90.9%
fma-def90.9%
associate-+r+90.9%
associate-+r+90.9%
*-commutative90.9%
+-commutative90.9%
*-commutative90.9%
associate-+l+90.9%
distribute-rgt1-in90.9%
associate-+r+90.9%
+-commutative90.9%
*-lft-identity90.9%
*-rgt-identity90.9%
*-lft-identity90.9%
distribute-lft-in90.9%
+-commutative90.9%
Applied egg-rr99.1%
*-commutative99.1%
associate-+r+99.1%
+-commutative99.1%
associate-*r/97.3%
*-commutative97.3%
associate-*l/97.3%
Applied egg-rr98.9%
Taylor expanded in alpha around 0 75.2%
+-commutative75.2%
+-commutative75.2%
Simplified75.2%
Final simplification75.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))))
(if (<= beta 3.9)
(/ (+ 0.3333333333333333 (* alpha 0.2222222222222222)) (* t_0 t_0))
(/ (/ 1.0 t_0) (/ beta (+ 1.0 alpha))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 3.9) {
tmp = (0.3333333333333333 + (alpha * 0.2222222222222222)) / (t_0 * t_0);
} else {
tmp = (1.0 / t_0) / (beta / (1.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 3.9d0) then
tmp = (0.3333333333333333d0 + (alpha * 0.2222222222222222d0)) / (t_0 * t_0)
else
tmp = (1.0d0 / t_0) / (beta / (1.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 3.9) {
tmp = (0.3333333333333333 + (alpha * 0.2222222222222222)) / (t_0 * t_0);
} else {
tmp = (1.0 / t_0) / (beta / (1.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 3.9: tmp = (0.3333333333333333 + (alpha * 0.2222222222222222)) / (t_0 * t_0) else: tmp = (1.0 / t_0) / (beta / (1.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 3.9) tmp = Float64(Float64(0.3333333333333333 + Float64(alpha * 0.2222222222222222)) / Float64(t_0 * t_0)); else tmp = Float64(Float64(1.0 / t_0) / Float64(beta / Float64(1.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 3.9)
tmp = (0.3333333333333333 + (alpha * 0.2222222222222222)) / (t_0 * t_0);
else
tmp = (1.0 / t_0) / (beta / (1.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 3.9], N[(N[(0.3333333333333333 + N[(alpha * 0.2222222222222222), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t$95$0), $MachinePrecision] / N[(beta / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 3.9:\\
\;\;\;\;\frac{0.3333333333333333 + \alpha \cdot 0.2222222222222222}{t_0 \cdot t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{t_0}}{\frac{\beta}{1 + \alpha}}\\
\end{array}
\end{array}
if beta < 3.89999999999999991Initial program 99.8%
associate-/l/99.7%
associate-/l/95.2%
associate-/r*99.7%
Simplified99.8%
Taylor expanded in beta around 0 98.0%
Taylor expanded in alpha around 0 82.2%
*-commutative82.2%
Simplified82.2%
if 3.89999999999999991 < beta Initial program 92.0%
associate-/l/90.8%
associate-/l/80.9%
+-commutative80.9%
*-commutative80.9%
+-commutative80.9%
associate-+l+80.9%
associate-+l+80.9%
fma-def80.9%
Simplified80.9%
fma-def80.9%
associate-+r+80.9%
associate-+r+80.9%
*-commutative80.9%
+-commutative80.9%
*-commutative80.9%
associate-+l+80.9%
distribute-rgt1-in80.9%
associate-+r+80.9%
+-commutative80.9%
*-lft-identity80.9%
*-rgt-identity80.9%
*-lft-identity80.9%
distribute-lft-in80.9%
+-commutative80.9%
Applied egg-rr97.2%
*-commutative97.2%
associate-+r+97.2%
+-commutative97.2%
associate-*r/91.2%
*-commutative91.2%
associate-*l/91.1%
Applied egg-rr99.9%
Taylor expanded in beta around inf 91.3%
Final simplification84.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 10.5) (/ (+ 0.5 (* alpha 0.25)) (* (+ 3.0 (+ alpha beta)) (+ 2.0 (+ alpha beta)))) (/ (/ 1.0 (+ alpha (+ beta 2.0))) (/ beta (+ 1.0 alpha)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 10.5) {
tmp = (0.5 + (alpha * 0.25)) / ((3.0 + (alpha + beta)) * (2.0 + (alpha + beta)));
} else {
tmp = (1.0 / (alpha + (beta + 2.0))) / (beta / (1.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 10.5d0) then
tmp = (0.5d0 + (alpha * 0.25d0)) / ((3.0d0 + (alpha + beta)) * (2.0d0 + (alpha + beta)))
else
tmp = (1.0d0 / (alpha + (beta + 2.0d0))) / (beta / (1.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 10.5) {
tmp = (0.5 + (alpha * 0.25)) / ((3.0 + (alpha + beta)) * (2.0 + (alpha + beta)));
} else {
tmp = (1.0 / (alpha + (beta + 2.0))) / (beta / (1.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 10.5: tmp = (0.5 + (alpha * 0.25)) / ((3.0 + (alpha + beta)) * (2.0 + (alpha + beta))) else: tmp = (1.0 / (alpha + (beta + 2.0))) / (beta / (1.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 10.5) tmp = Float64(Float64(0.5 + Float64(alpha * 0.25)) / Float64(Float64(3.0 + Float64(alpha + beta)) * Float64(2.0 + Float64(alpha + beta)))); else tmp = Float64(Float64(1.0 / Float64(alpha + Float64(beta + 2.0))) / Float64(beta / Float64(1.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 10.5)
tmp = (0.5 + (alpha * 0.25)) / ((3.0 + (alpha + beta)) * (2.0 + (alpha + beta)));
else
tmp = (1.0 / (alpha + (beta + 2.0))) / (beta / (1.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 10.5], N[(N[(0.5 + N[(alpha * 0.25), $MachinePrecision]), $MachinePrecision] / N[(N[(3.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 10.5:\\
\;\;\;\;\frac{0.5 + \alpha \cdot 0.25}{\left(3 + \left(\alpha + \beta\right)\right) \cdot \left(2 + \left(\alpha + \beta\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\alpha + \left(\beta + 2\right)}}{\frac{\beta}{1 + \alpha}}\\
\end{array}
\end{array}
if beta < 10.5Initial program 99.8%
associate-/l/99.7%
+-commutative99.7%
*-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around 0 98.0%
Taylor expanded in alpha around 0 82.2%
*-commutative82.2%
Simplified82.2%
if 10.5 < beta Initial program 92.0%
associate-/l/90.8%
associate-/l/80.9%
+-commutative80.9%
*-commutative80.9%
+-commutative80.9%
associate-+l+80.9%
associate-+l+80.9%
fma-def80.9%
Simplified80.9%
fma-def80.9%
associate-+r+80.9%
associate-+r+80.9%
*-commutative80.9%
+-commutative80.9%
*-commutative80.9%
associate-+l+80.9%
distribute-rgt1-in80.9%
associate-+r+80.9%
+-commutative80.9%
*-lft-identity80.9%
*-rgt-identity80.9%
*-lft-identity80.9%
distribute-lft-in80.9%
+-commutative80.9%
Applied egg-rr97.2%
*-commutative97.2%
associate-+r+97.2%
+-commutative97.2%
associate-*r/91.2%
*-commutative91.2%
associate-*l/91.1%
Applied egg-rr99.9%
Taylor expanded in beta around inf 91.3%
Final simplification84.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 1.7)
(/ (+ 0.5 (* alpha 0.25)) (* (+ 3.0 (+ alpha beta)) (+ 2.0 (+ alpha beta))))
(/
(/ 1.0 (+ alpha (+ beta 2.0)))
(/ (+ alpha (+ beta 3.0)) (+ 1.0 alpha)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.7) {
tmp = (0.5 + (alpha * 0.25)) / ((3.0 + (alpha + beta)) * (2.0 + (alpha + beta)));
} else {
tmp = (1.0 / (alpha + (beta + 2.0))) / ((alpha + (beta + 3.0)) / (1.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.7d0) then
tmp = (0.5d0 + (alpha * 0.25d0)) / ((3.0d0 + (alpha + beta)) * (2.0d0 + (alpha + beta)))
else
tmp = (1.0d0 / (alpha + (beta + 2.0d0))) / ((alpha + (beta + 3.0d0)) / (1.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.7) {
tmp = (0.5 + (alpha * 0.25)) / ((3.0 + (alpha + beta)) * (2.0 + (alpha + beta)));
} else {
tmp = (1.0 / (alpha + (beta + 2.0))) / ((alpha + (beta + 3.0)) / (1.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.7: tmp = (0.5 + (alpha * 0.25)) / ((3.0 + (alpha + beta)) * (2.0 + (alpha + beta))) else: tmp = (1.0 / (alpha + (beta + 2.0))) / ((alpha + (beta + 3.0)) / (1.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.7) tmp = Float64(Float64(0.5 + Float64(alpha * 0.25)) / Float64(Float64(3.0 + Float64(alpha + beta)) * Float64(2.0 + Float64(alpha + beta)))); else tmp = Float64(Float64(1.0 / Float64(alpha + Float64(beta + 2.0))) / Float64(Float64(alpha + Float64(beta + 3.0)) / Float64(1.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.7)
tmp = (0.5 + (alpha * 0.25)) / ((3.0 + (alpha + beta)) * (2.0 + (alpha + beta)));
else
tmp = (1.0 / (alpha + (beta + 2.0))) / ((alpha + (beta + 3.0)) / (1.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.7], N[(N[(0.5 + N[(alpha * 0.25), $MachinePrecision]), $MachinePrecision] / N[(N[(3.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision] / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.7:\\
\;\;\;\;\frac{0.5 + \alpha \cdot 0.25}{\left(3 + \left(\alpha + \beta\right)\right) \cdot \left(2 + \left(\alpha + \beta\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\alpha + \left(\beta + 2\right)}}{\frac{\alpha + \left(\beta + 3\right)}{1 + \alpha}}\\
\end{array}
\end{array}
if beta < 1.69999999999999996Initial program 99.8%
associate-/l/99.7%
+-commutative99.7%
*-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around 0 98.5%
Taylor expanded in alpha around 0 82.6%
*-commutative82.6%
Simplified82.6%
if 1.69999999999999996 < beta Initial program 92.1%
associate-/l/90.9%
associate-/l/81.2%
+-commutative81.2%
*-commutative81.2%
+-commutative81.2%
associate-+l+81.2%
associate-+l+81.2%
fma-def81.2%
Simplified81.2%
fma-def81.2%
associate-+r+81.2%
associate-+r+81.2%
*-commutative81.2%
+-commutative81.2%
*-commutative81.2%
associate-+l+81.2%
distribute-rgt1-in81.2%
associate-+r+81.2%
+-commutative81.2%
*-lft-identity81.2%
*-rgt-identity81.2%
*-lft-identity81.2%
distribute-lft-in81.2%
+-commutative81.2%
Applied egg-rr97.3%
*-commutative97.3%
associate-+r+97.3%
+-commutative97.3%
associate-*r/91.3%
*-commutative91.3%
associate-*l/91.2%
Applied egg-rr99.9%
Taylor expanded in beta around inf 90.6%
Final simplification85.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 6.0) (/ (/ 0.5 (+ beta 2.0)) (+ beta 3.0)) (/ (/ 1.0 (+ alpha (+ beta 2.0))) (/ beta (+ 1.0 alpha)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 6.0) {
tmp = (0.5 / (beta + 2.0)) / (beta + 3.0);
} else {
tmp = (1.0 / (alpha + (beta + 2.0))) / (beta / (1.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 6.0d0) then
tmp = (0.5d0 / (beta + 2.0d0)) / (beta + 3.0d0)
else
tmp = (1.0d0 / (alpha + (beta + 2.0d0))) / (beta / (1.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 6.0) {
tmp = (0.5 / (beta + 2.0)) / (beta + 3.0);
} else {
tmp = (1.0 / (alpha + (beta + 2.0))) / (beta / (1.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 6.0: tmp = (0.5 / (beta + 2.0)) / (beta + 3.0) else: tmp = (1.0 / (alpha + (beta + 2.0))) / (beta / (1.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 6.0) tmp = Float64(Float64(0.5 / Float64(beta + 2.0)) / Float64(beta + 3.0)); else tmp = Float64(Float64(1.0 / Float64(alpha + Float64(beta + 2.0))) / Float64(beta / Float64(1.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 6.0)
tmp = (0.5 / (beta + 2.0)) / (beta + 3.0);
else
tmp = (1.0 / (alpha + (beta + 2.0))) / (beta / (1.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 6.0], N[(N[(0.5 / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 6:\\
\;\;\;\;\frac{\frac{0.5}{\beta + 2}}{\beta + 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\alpha + \left(\beta + 2\right)}}{\frac{\beta}{1 + \alpha}}\\
\end{array}
\end{array}
if beta < 6Initial program 99.8%
associate-/l/99.7%
+-commutative99.7%
*-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around 0 98.0%
Taylor expanded in alpha around 0 66.1%
associate-/r*66.1%
+-commutative66.1%
+-commutative66.1%
Simplified66.1%
if 6 < beta Initial program 92.0%
associate-/l/90.8%
associate-/l/80.9%
+-commutative80.9%
*-commutative80.9%
+-commutative80.9%
associate-+l+80.9%
associate-+l+80.9%
fma-def80.9%
Simplified80.9%
fma-def80.9%
associate-+r+80.9%
associate-+r+80.9%
*-commutative80.9%
+-commutative80.9%
*-commutative80.9%
associate-+l+80.9%
distribute-rgt1-in80.9%
associate-+r+80.9%
+-commutative80.9%
*-lft-identity80.9%
*-rgt-identity80.9%
*-lft-identity80.9%
distribute-lft-in80.9%
+-commutative80.9%
Applied egg-rr97.2%
*-commutative97.2%
associate-+r+97.2%
+-commutative97.2%
associate-*r/91.2%
*-commutative91.2%
associate-*l/91.1%
Applied egg-rr99.9%
Taylor expanded in beta around inf 91.3%
Final simplification73.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 9.0) (/ 0.5 (* (+ beta 2.0) (+ beta 3.0))) (/ (/ (+ 1.0 alpha) beta) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 9.0) {
tmp = 0.5 / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 9.0d0) then
tmp = 0.5d0 / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = ((1.0d0 + alpha) / beta) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 9.0) {
tmp = 0.5 / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 9.0: tmp = 0.5 / ((beta + 2.0) * (beta + 3.0)) else: tmp = ((1.0 + alpha) / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 9.0) tmp = Float64(0.5 / Float64(Float64(beta + 2.0) * Float64(beta + 3.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 9.0)
tmp = 0.5 / ((beta + 2.0) * (beta + 3.0));
else
tmp = ((1.0 + alpha) / beta) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 9.0], N[(0.5 / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 9:\\
\;\;\;\;\frac{0.5}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 9Initial program 99.8%
associate-/l/99.7%
+-commutative99.7%
*-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around 0 98.0%
Taylor expanded in alpha around 0 66.1%
if 9 < beta Initial program 92.0%
associate-/l/90.8%
associate-/l/80.9%
+-commutative80.9%
*-commutative80.9%
+-commutative80.9%
associate-+l+80.9%
associate-+l+80.9%
fma-def80.9%
Simplified80.9%
Taylor expanded in beta around inf 91.9%
unpow291.9%
Simplified91.9%
+-commutative91.9%
associate-/r*91.2%
div-inv91.1%
Applied egg-rr91.1%
un-div-inv91.2%
+-commutative91.2%
Applied egg-rr91.2%
Final simplification73.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 9.2) (/ (/ 0.5 (+ beta 2.0)) (+ beta 3.0)) (/ (/ (+ 1.0 alpha) beta) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 9.2) {
tmp = (0.5 / (beta + 2.0)) / (beta + 3.0);
} else {
tmp = ((1.0 + alpha) / beta) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 9.2d0) then
tmp = (0.5d0 / (beta + 2.0d0)) / (beta + 3.0d0)
else
tmp = ((1.0d0 + alpha) / beta) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 9.2) {
tmp = (0.5 / (beta + 2.0)) / (beta + 3.0);
} else {
tmp = ((1.0 + alpha) / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 9.2: tmp = (0.5 / (beta + 2.0)) / (beta + 3.0) else: tmp = ((1.0 + alpha) / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 9.2) tmp = Float64(Float64(0.5 / Float64(beta + 2.0)) / Float64(beta + 3.0)); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 9.2)
tmp = (0.5 / (beta + 2.0)) / (beta + 3.0);
else
tmp = ((1.0 + alpha) / beta) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 9.2], N[(N[(0.5 / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 9.2:\\
\;\;\;\;\frac{\frac{0.5}{\beta + 2}}{\beta + 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 9.1999999999999993Initial program 99.8%
associate-/l/99.7%
+-commutative99.7%
*-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around 0 98.0%
Taylor expanded in alpha around 0 66.1%
associate-/r*66.1%
+-commutative66.1%
+-commutative66.1%
Simplified66.1%
if 9.1999999999999993 < beta Initial program 92.0%
associate-/l/90.8%
associate-/l/80.9%
+-commutative80.9%
*-commutative80.9%
+-commutative80.9%
associate-+l+80.9%
associate-+l+80.9%
fma-def80.9%
Simplified80.9%
Taylor expanded in beta around inf 91.9%
unpow291.9%
Simplified91.9%
+-commutative91.9%
associate-/r*91.2%
div-inv91.1%
Applied egg-rr91.1%
un-div-inv91.2%
+-commutative91.2%
Applied egg-rr91.2%
Final simplification73.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 10.0) (/ (/ 0.5 (+ beta 2.0)) (+ beta 3.0)) (/ (/ 1.0 beta) (/ beta (+ 1.0 alpha)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 10.0) {
tmp = (0.5 / (beta + 2.0)) / (beta + 3.0);
} else {
tmp = (1.0 / beta) / (beta / (1.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 10.0d0) then
tmp = (0.5d0 / (beta + 2.0d0)) / (beta + 3.0d0)
else
tmp = (1.0d0 / beta) / (beta / (1.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 10.0) {
tmp = (0.5 / (beta + 2.0)) / (beta + 3.0);
} else {
tmp = (1.0 / beta) / (beta / (1.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 10.0: tmp = (0.5 / (beta + 2.0)) / (beta + 3.0) else: tmp = (1.0 / beta) / (beta / (1.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 10.0) tmp = Float64(Float64(0.5 / Float64(beta + 2.0)) / Float64(beta + 3.0)); else tmp = Float64(Float64(1.0 / beta) / Float64(beta / Float64(1.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 10.0)
tmp = (0.5 / (beta + 2.0)) / (beta + 3.0);
else
tmp = (1.0 / beta) / (beta / (1.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 10.0], N[(N[(0.5 / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / beta), $MachinePrecision] / N[(beta / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 10:\\
\;\;\;\;\frac{\frac{0.5}{\beta + 2}}{\beta + 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta}}{\frac{\beta}{1 + \alpha}}\\
\end{array}
\end{array}
if beta < 10Initial program 99.8%
associate-/l/99.7%
+-commutative99.7%
*-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around 0 98.0%
Taylor expanded in alpha around 0 66.1%
associate-/r*66.1%
+-commutative66.1%
+-commutative66.1%
Simplified66.1%
if 10 < beta Initial program 92.0%
associate-/l/90.8%
associate-/l/80.9%
+-commutative80.9%
*-commutative80.9%
+-commutative80.9%
associate-+l+80.9%
associate-+l+80.9%
fma-def80.9%
Simplified80.9%
Taylor expanded in beta around inf 91.9%
unpow291.9%
Simplified91.9%
+-commutative91.9%
associate-/r*91.2%
div-inv91.1%
Applied egg-rr91.1%
clear-num91.1%
associate-*l/91.2%
div-inv91.2%
+-commutative91.2%
Applied egg-rr91.2%
Final simplification73.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= alpha 2.1e-37) (/ 1.0 (* beta beta)) (/ (/ alpha beta) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (alpha <= 2.1e-37) {
tmp = 1.0 / (beta * beta);
} else {
tmp = (alpha / beta) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (alpha <= 2.1d-37) then
tmp = 1.0d0 / (beta * beta)
else
tmp = (alpha / beta) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (alpha <= 2.1e-37) {
tmp = 1.0 / (beta * beta);
} else {
tmp = (alpha / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if alpha <= 2.1e-37: tmp = 1.0 / (beta * beta) else: tmp = (alpha / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (alpha <= 2.1e-37) tmp = Float64(1.0 / Float64(beta * beta)); else tmp = Float64(Float64(alpha / beta) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (alpha <= 2.1e-37)
tmp = 1.0 / (beta * beta);
else
tmp = (alpha / beta) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[alpha, 2.1e-37], N[(1.0 / N[(beta * beta), $MachinePrecision]), $MachinePrecision], N[(N[(alpha / beta), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\alpha \leq 2.1 \cdot 10^{-37}:\\
\;\;\;\;\frac{1}{\beta \cdot \beta}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if alpha < 2.1000000000000001e-37Initial program 99.9%
associate-/l/99.9%
+-commutative99.9%
*-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in beta around 0 87.0%
Taylor expanded in beta around inf 23.5%
*-commutative23.5%
unpow223.5%
Simplified23.5%
Taylor expanded in alpha around inf 34.2%
unpow234.2%
Simplified34.2%
if 2.1000000000000001e-37 < alpha Initial program 92.9%
associate-/l/91.7%
associate-/l/80.2%
+-commutative80.2%
*-commutative80.2%
+-commutative80.2%
associate-+l+80.2%
associate-+l+80.2%
fma-def80.2%
Simplified80.2%
Taylor expanded in beta around inf 21.7%
unpow221.7%
Simplified21.7%
Taylor expanded in alpha around inf 21.7%
unpow221.7%
Simplified21.7%
Taylor expanded in alpha around 0 21.7%
unpow221.7%
associate-/r*21.1%
Simplified21.1%
Final simplification29.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ (+ 1.0 alpha) (* beta beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
return (1.0 + alpha) / (beta * beta);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = (1.0d0 + alpha) / (beta * beta)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return (1.0 + alpha) / (beta * beta);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return (1.0 + alpha) / (beta * beta)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(1.0 + alpha) / Float64(beta * beta)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = (1.0 + alpha) / (beta * beta);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta * beta), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{1 + \alpha}{\beta \cdot \beta}
\end{array}
Initial program 97.5%
associate-/l/97.1%
associate-/l/90.9%
+-commutative90.9%
*-commutative90.9%
+-commutative90.9%
associate-+l+90.9%
associate-+l+90.9%
fma-def90.9%
Simplified90.9%
Taylor expanded in beta around inf 29.9%
unpow229.9%
Simplified29.9%
Final simplification29.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ (/ (+ 1.0 alpha) beta) beta))
assert(alpha < beta);
double code(double alpha, double beta) {
return ((1.0 + alpha) / beta) / beta;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = ((1.0d0 + alpha) / beta) / beta
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return ((1.0 + alpha) / beta) / beta;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return ((1.0 + alpha) / beta) / beta
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(Float64(1.0 + alpha) / beta) / beta) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = ((1.0 + alpha) / beta) / beta;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / beta), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{\frac{1 + \alpha}{\beta}}{\beta}
\end{array}
Initial program 97.5%
associate-/l/97.1%
associate-/l/90.9%
+-commutative90.9%
*-commutative90.9%
+-commutative90.9%
associate-+l+90.9%
associate-+l+90.9%
fma-def90.9%
Simplified90.9%
Taylor expanded in beta around inf 29.9%
unpow229.9%
Simplified29.9%
+-commutative29.9%
associate-/r*29.7%
div-inv29.6%
Applied egg-rr29.6%
un-div-inv29.7%
+-commutative29.7%
Applied egg-rr29.7%
Final simplification29.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.5 (* beta beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.5 / (beta * beta);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.5d0 / (beta * beta)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.5 / (beta * beta);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.5 / (beta * beta)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.5 / Float64(beta * beta)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.5 / (beta * beta);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.5 / N[(beta * beta), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.5}{\beta \cdot \beta}
\end{array}
Initial program 97.5%
associate-/l/97.1%
+-commutative97.1%
*-commutative97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in beta around 0 89.3%
Taylor expanded in beta around inf 22.3%
*-commutative22.3%
unpow222.3%
Simplified22.3%
Taylor expanded in alpha around 0 21.9%
unpow221.9%
Simplified21.9%
Final simplification21.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 1.0 (* beta beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
return 1.0 / (beta * beta);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 1.0d0 / (beta * beta)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 1.0 / (beta * beta);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 1.0 / (beta * beta)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(1.0 / Float64(beta * beta)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 1.0 / (beta * beta);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(1.0 / N[(beta * beta), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{1}{\beta \cdot \beta}
\end{array}
Initial program 97.5%
associate-/l/97.1%
+-commutative97.1%
*-commutative97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in beta around 0 89.3%
Taylor expanded in beta around inf 22.3%
*-commutative22.3%
unpow222.3%
Simplified22.3%
Taylor expanded in alpha around inf 28.9%
unpow228.9%
Simplified28.9%
Final simplification28.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.2222222222222222 alpha))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.2222222222222222 / alpha;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.2222222222222222d0 / alpha
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.2222222222222222 / alpha;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.2222222222222222 / alpha
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.2222222222222222 / alpha) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.2222222222222222 / alpha;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.2222222222222222 / alpha), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.2222222222222222}{\alpha}
\end{array}
Initial program 97.5%
associate-/l/97.0%
associate-/l/90.9%
associate-/r*97.1%
Simplified97.1%
Taylor expanded in beta around 0 89.2%
Taylor expanded in alpha around 0 78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in alpha around inf 3.9%
Final simplification3.9%
herbie shell --seed 2023297
(FPCore (alpha beta)
:name "Octave 3.8, jcobi/3"
:precision binary64
:pre (and (> alpha -1.0) (> beta -1.0))
(/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) (+ (+ alpha beta) (* 2.0 1.0))) (+ (+ alpha beta) (* 2.0 1.0))) (+ (+ (+ alpha beta) (* 2.0 1.0)) 1.0)))