
(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 16 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))))
(/
(/ (+ alpha 1.0) t_0)
(* (* t_0 (/ 1.0 (+ 1.0 beta))) (+ alpha (+ beta 3.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((alpha + 1.0) / t_0) / ((t_0 * (1.0 / (1.0 + beta))) * (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 = ((alpha + 1.0d0) / t_0) / ((t_0 * (1.0d0 / (1.0d0 + beta))) * (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 ((alpha + 1.0) / t_0) / ((t_0 * (1.0 / (1.0 + beta))) * (alpha + (beta + 3.0)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return ((alpha + 1.0) / t_0) / ((t_0 * (1.0 / (1.0 + beta))) * (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(alpha + 1.0) / t_0) / Float64(Float64(t_0 * Float64(1.0 / Float64(1.0 + beta))) * 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 = ((alpha + 1.0) / t_0) / ((t_0 * (1.0 / (1.0 + beta))) * (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[(alpha + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(N[(t$95$0 * N[(1.0 / N[(1.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 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{\alpha + 1}{t_0}}{\left(t_0 \cdot \frac{1}{1 + \beta}\right) \cdot \left(\alpha + \left(\beta + 3\right)\right)}
\end{array}
\end{array}
Initial program 92.9%
associate-/l/90.8%
associate-/r*81.8%
+-commutative81.8%
associate-+l+81.8%
associate-+r+81.8%
*-commutative81.8%
distribute-rgt1-in81.8%
+-commutative81.8%
*-commutative81.8%
distribute-rgt1-in81.8%
+-commutative81.8%
times-frac95.2%
Simplified95.2%
add-sqr-sqrt95.1%
pow295.1%
associate-+r+95.1%
associate-/r*99.7%
associate-+r+99.7%
Applied egg-rr99.7%
unpow299.7%
add-sqr-sqrt99.8%
div-inv99.8%
Applied egg-rr99.8%
clear-num99.8%
un-div-inv99.8%
+-commutative99.8%
associate-+r+99.8%
frac-times99.4%
metadata-eval99.4%
*-un-lft-identity99.4%
+-commutative99.4%
metadata-eval99.4%
associate-+r+99.4%
+-commutative99.4%
Applied egg-rr99.4%
div-inv99.4%
Applied egg-rr99.4%
Final simplification99.4%
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 4.2e+126)
(* (/ (+ 1.0 beta) t_0) (/ (+ alpha 1.0) (* t_0 (+ alpha (+ beta 3.0)))))
(/ (/ (+ alpha 1.0) t_0) (+ (+ beta 4.0) (* alpha 2.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 4.2e+126) {
tmp = ((1.0 + beta) / t_0) * ((alpha + 1.0) / (t_0 * (alpha + (beta + 3.0))));
} else {
tmp = ((alpha + 1.0) / t_0) / ((beta + 4.0) + (alpha * 2.0));
}
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 <= 4.2d+126) then
tmp = ((1.0d0 + beta) / t_0) * ((alpha + 1.0d0) / (t_0 * (alpha + (beta + 3.0d0))))
else
tmp = ((alpha + 1.0d0) / t_0) / ((beta + 4.0d0) + (alpha * 2.0d0))
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 <= 4.2e+126) {
tmp = ((1.0 + beta) / t_0) * ((alpha + 1.0) / (t_0 * (alpha + (beta + 3.0))));
} else {
tmp = ((alpha + 1.0) / t_0) / ((beta + 4.0) + (alpha * 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 4.2e+126: tmp = ((1.0 + beta) / t_0) * ((alpha + 1.0) / (t_0 * (alpha + (beta + 3.0)))) else: tmp = ((alpha + 1.0) / t_0) / ((beta + 4.0) + (alpha * 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 4.2e+126) tmp = Float64(Float64(Float64(1.0 + beta) / t_0) * Float64(Float64(alpha + 1.0) / Float64(t_0 * Float64(alpha + Float64(beta + 3.0))))); else tmp = Float64(Float64(Float64(alpha + 1.0) / t_0) / Float64(Float64(beta + 4.0) + Float64(alpha * 2.0))); 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 <= 4.2e+126)
tmp = ((1.0 + beta) / t_0) * ((alpha + 1.0) / (t_0 * (alpha + (beta + 3.0))));
else
tmp = ((alpha + 1.0) / t_0) / ((beta + 4.0) + (alpha * 2.0));
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, 4.2e+126], N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(alpha + 1.0), $MachinePrecision] / N[(t$95$0 * N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(N[(beta + 4.0), $MachinePrecision] + N[(alpha * 2.0), $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 4.2 \cdot 10^{+126}:\\
\;\;\;\;\frac{1 + \beta}{t_0} \cdot \frac{\alpha + 1}{t_0 \cdot \left(\alpha + \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha + 1}{t_0}}{\left(\beta + 4\right) + \alpha \cdot 2}\\
\end{array}
\end{array}
if beta < 4.1999999999999998e126Initial program 98.8%
associate-/l/97.8%
associate-/r*88.5%
+-commutative88.5%
associate-+l+88.5%
associate-+r+88.5%
*-commutative88.5%
distribute-rgt1-in88.5%
+-commutative88.5%
*-commutative88.5%
distribute-rgt1-in88.5%
+-commutative88.5%
times-frac98.7%
Simplified98.7%
if 4.1999999999999998e126 < beta Initial program 71.8%
associate-/l/66.1%
associate-/r*58.0%
+-commutative58.0%
associate-+l+58.0%
associate-+r+58.0%
*-commutative58.0%
distribute-rgt1-in58.0%
+-commutative58.0%
*-commutative58.0%
distribute-rgt1-in58.0%
+-commutative58.0%
times-frac82.6%
Simplified82.6%
add-sqr-sqrt82.6%
pow282.6%
associate-+r+82.6%
associate-/r*99.8%
associate-+r+99.8%
Applied egg-rr99.8%
unpow299.8%
add-sqr-sqrt99.9%
div-inv99.9%
Applied egg-rr99.9%
clear-num99.9%
un-div-inv99.9%
+-commutative99.9%
associate-+r+99.9%
frac-times99.0%
metadata-eval99.0%
*-un-lft-identity99.0%
+-commutative99.0%
metadata-eval99.0%
associate-+r+99.0%
+-commutative99.0%
Applied egg-rr99.0%
Taylor expanded in beta around inf 89.5%
associate-+r+89.5%
Simplified89.5%
Final simplification96.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 beta) t_0) (/ t_0 (/ (+ alpha 1.0) (+ 3.0 (+ alpha beta)))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((1.0 + beta) / t_0) / (t_0 / ((alpha + 1.0) / (3.0 + (alpha + 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 + beta) / t_0) / (t_0 / ((alpha + 1.0d0) / (3.0d0 + (alpha + beta))))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((1.0 + beta) / t_0) / (t_0 / ((alpha + 1.0) / (3.0 + (alpha + beta))));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return ((1.0 + beta) / t_0) / (t_0 / ((alpha + 1.0) / (3.0 + (alpha + beta))))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) return Float64(Float64(Float64(1.0 + beta) / t_0) / Float64(t_0 / Float64(Float64(alpha + 1.0) / Float64(3.0 + Float64(alpha + beta))))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = ((1.0 + beta) / t_0) / (t_0 / ((alpha + 1.0) / (3.0 + (alpha + 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[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 / N[(N[(alpha + 1.0), $MachinePrecision] / N[(3.0 + N[(alpha + 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 + \beta}{t_0}}{\frac{t_0}{\frac{\alpha + 1}{3 + \left(\alpha + \beta\right)}}}
\end{array}
\end{array}
Initial program 92.9%
associate-/l/90.8%
associate-/r*81.8%
+-commutative81.8%
associate-+l+81.8%
associate-+r+81.8%
*-commutative81.8%
distribute-rgt1-in81.8%
+-commutative81.8%
*-commutative81.8%
distribute-rgt1-in81.8%
+-commutative81.8%
times-frac95.2%
Simplified95.2%
associate-*r/95.2%
+-commutative95.2%
Applied egg-rr95.2%
associate-/l*95.2%
+-commutative95.2%
+-commutative95.2%
associate-/l*99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
+-commutative99.5%
Simplified99.5%
Final simplification99.5%
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)))) (/ (/ (+ alpha 1.0) t_0) (* (+ alpha (+ beta 3.0)) (/ t_0 (+ 1.0 beta))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((alpha + 1.0) / t_0) / ((alpha + (beta + 3.0)) * (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 = ((alpha + 1.0d0) / t_0) / ((alpha + (beta + 3.0d0)) * (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 ((alpha + 1.0) / t_0) / ((alpha + (beta + 3.0)) * (t_0 / (1.0 + beta)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return ((alpha + 1.0) / t_0) / ((alpha + (beta + 3.0)) * (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(Float64(alpha + 1.0) / t_0) / Float64(Float64(alpha + Float64(beta + 3.0)) * 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 = ((alpha + 1.0) / t_0) / ((alpha + (beta + 3.0)) * (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[(N[(alpha + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / N[(1.0 + beta), $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{\alpha + 1}{t_0}}{\left(\alpha + \left(\beta + 3\right)\right) \cdot \frac{t_0}{1 + \beta}}
\end{array}
\end{array}
Initial program 92.9%
associate-/l/90.8%
associate-/r*81.8%
+-commutative81.8%
associate-+l+81.8%
associate-+r+81.8%
*-commutative81.8%
distribute-rgt1-in81.8%
+-commutative81.8%
*-commutative81.8%
distribute-rgt1-in81.8%
+-commutative81.8%
times-frac95.2%
Simplified95.2%
add-sqr-sqrt95.1%
pow295.1%
associate-+r+95.1%
associate-/r*99.7%
associate-+r+99.7%
Applied egg-rr99.7%
unpow299.7%
add-sqr-sqrt99.8%
div-inv99.8%
Applied egg-rr99.8%
clear-num99.8%
un-div-inv99.8%
+-commutative99.8%
associate-+r+99.8%
frac-times99.4%
metadata-eval99.4%
*-un-lft-identity99.4%
+-commutative99.4%
metadata-eval99.4%
associate-+r+99.4%
+-commutative99.4%
Applied egg-rr99.4%
Final simplification99.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.7e+15) (* (/ (+ 1.0 beta) (+ beta 2.0)) (/ (/ 1.0 (+ beta 2.0)) (+ beta 3.0))) (/ (/ (+ alpha 1.0) beta) (+ 3.0 (+ alpha beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.7e+15) {
tmp = ((1.0 + beta) / (beta + 2.0)) * ((1.0 / (beta + 2.0)) / (beta + 3.0));
} else {
tmp = ((alpha + 1.0) / beta) / (3.0 + (alpha + 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 <= 1.7d+15) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) * ((1.0d0 / (beta + 2.0d0)) / (beta + 3.0d0))
else
tmp = ((alpha + 1.0d0) / beta) / (3.0d0 + (alpha + beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.7e+15) {
tmp = ((1.0 + beta) / (beta + 2.0)) * ((1.0 / (beta + 2.0)) / (beta + 3.0));
} else {
tmp = ((alpha + 1.0) / beta) / (3.0 + (alpha + beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.7e+15: tmp = ((1.0 + beta) / (beta + 2.0)) * ((1.0 / (beta + 2.0)) / (beta + 3.0)) else: tmp = ((alpha + 1.0) / beta) / (3.0 + (alpha + beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.7e+15) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) * Float64(Float64(1.0 / Float64(beta + 2.0)) / Float64(beta + 3.0))); else tmp = Float64(Float64(Float64(alpha + 1.0) / beta) / Float64(3.0 + Float64(alpha + beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.7e+15)
tmp = ((1.0 + beta) / (beta + 2.0)) * ((1.0 / (beta + 2.0)) / (beta + 3.0));
else
tmp = ((alpha + 1.0) / beta) / (3.0 + (alpha + 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, 1.7e+15], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha + 1.0), $MachinePrecision] / beta), $MachinePrecision] / N[(3.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.7 \cdot 10^{+15}:\\
\;\;\;\;\frac{1 + \beta}{\beta + 2} \cdot \frac{\frac{1}{\beta + 2}}{\beta + 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha + 1}{\beta}}{3 + \left(\alpha + \beta\right)}\\
\end{array}
\end{array}
if beta < 1.7e15Initial program 99.9%
associate-/l/99.6%
associate-/r*93.1%
+-commutative93.1%
associate-+l+93.1%
associate-+r+93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
times-frac99.6%
Simplified99.6%
Taylor expanded in alpha around 0 69.6%
associate-/r*69.6%
+-commutative69.6%
Simplified69.6%
Taylor expanded in alpha around 0 68.6%
if 1.7e15 < beta Initial program 79.4%
Taylor expanded in beta around inf 81.1%
Taylor expanded in alpha around 0 81.1%
+-commutative81.1%
Simplified81.1%
Final simplification72.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 8.5e+15) (/ (/ (+ 1.0 beta) (+ 2.0 (+ alpha beta))) (* (+ beta 3.0) (+ beta 2.0))) (/ (/ (+ alpha 1.0) beta) (+ 3.0 (+ alpha beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 8.5e+15) {
tmp = ((1.0 + beta) / (2.0 + (alpha + beta))) / ((beta + 3.0) * (beta + 2.0));
} else {
tmp = ((alpha + 1.0) / beta) / (3.0 + (alpha + 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 <= 8.5d+15) then
tmp = ((1.0d0 + beta) / (2.0d0 + (alpha + beta))) / ((beta + 3.0d0) * (beta + 2.0d0))
else
tmp = ((alpha + 1.0d0) / beta) / (3.0d0 + (alpha + beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 8.5e+15) {
tmp = ((1.0 + beta) / (2.0 + (alpha + beta))) / ((beta + 3.0) * (beta + 2.0));
} else {
tmp = ((alpha + 1.0) / beta) / (3.0 + (alpha + beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 8.5e+15: tmp = ((1.0 + beta) / (2.0 + (alpha + beta))) / ((beta + 3.0) * (beta + 2.0)) else: tmp = ((alpha + 1.0) / beta) / (3.0 + (alpha + beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 8.5e+15) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(2.0 + Float64(alpha + beta))) / Float64(Float64(beta + 3.0) * Float64(beta + 2.0))); else tmp = Float64(Float64(Float64(alpha + 1.0) / beta) / Float64(3.0 + Float64(alpha + beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 8.5e+15)
tmp = ((1.0 + beta) / (2.0 + (alpha + beta))) / ((beta + 3.0) * (beta + 2.0));
else
tmp = ((alpha + 1.0) / beta) / (3.0 + (alpha + 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, 8.5e+15], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha + 1.0), $MachinePrecision] / beta), $MachinePrecision] / N[(3.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 8.5 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{1 + \beta}{2 + \left(\alpha + \beta\right)}}{\left(\beta + 3\right) \cdot \left(\beta + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha + 1}{\beta}}{3 + \left(\alpha + \beta\right)}\\
\end{array}
\end{array}
if beta < 8.5e15Initial program 99.9%
associate-/l/99.6%
associate-/r*93.1%
+-commutative93.1%
associate-+l+93.1%
associate-+r+93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
times-frac99.6%
Simplified99.6%
Taylor expanded in alpha around 0 69.6%
associate-/r*69.6%
+-commutative69.6%
Simplified69.6%
expm1-log1p-u69.6%
expm1-udef80.0%
+-commutative80.0%
associate-/l/80.0%
+-commutative80.0%
Applied egg-rr80.0%
expm1-def69.6%
expm1-log1p69.6%
associate-*r/69.6%
*-rgt-identity69.6%
associate-+r+69.6%
+-commutative69.6%
+-commutative69.6%
*-commutative69.6%
+-commutative69.6%
Simplified69.6%
if 8.5e15 < beta Initial program 79.4%
Taylor expanded in beta around inf 81.1%
Taylor expanded in alpha around 0 81.1%
+-commutative81.1%
Simplified81.1%
Final simplification73.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (/ (+ alpha 1.0) (+ alpha (+ beta 2.0)))))
(if (<= beta 2.2)
(/ t_0 (* (+ alpha 2.0) (+ alpha 3.0)))
(/ t_0 (+ (+ beta 4.0) (* alpha 2.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = (alpha + 1.0) / (alpha + (beta + 2.0));
double tmp;
if (beta <= 2.2) {
tmp = t_0 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = t_0 / ((beta + 4.0) + (alpha * 2.0));
}
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 + 1.0d0) / (alpha + (beta + 2.0d0))
if (beta <= 2.2d0) then
tmp = t_0 / ((alpha + 2.0d0) * (alpha + 3.0d0))
else
tmp = t_0 / ((beta + 4.0d0) + (alpha * 2.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = (alpha + 1.0) / (alpha + (beta + 2.0));
double tmp;
if (beta <= 2.2) {
tmp = t_0 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = t_0 / ((beta + 4.0) + (alpha * 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = (alpha + 1.0) / (alpha + (beta + 2.0)) tmp = 0 if beta <= 2.2: tmp = t_0 / ((alpha + 2.0) * (alpha + 3.0)) else: tmp = t_0 / ((beta + 4.0) + (alpha * 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(Float64(alpha + 1.0) / Float64(alpha + Float64(beta + 2.0))) tmp = 0.0 if (beta <= 2.2) tmp = Float64(t_0 / Float64(Float64(alpha + 2.0) * Float64(alpha + 3.0))); else tmp = Float64(t_0 / Float64(Float64(beta + 4.0) + Float64(alpha * 2.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = (alpha + 1.0) / (alpha + (beta + 2.0));
tmp = 0.0;
if (beta <= 2.2)
tmp = t_0 / ((alpha + 2.0) * (alpha + 3.0));
else
tmp = t_0 / ((beta + 4.0) + (alpha * 2.0));
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[(N[(alpha + 1.0), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 2.2], N[(t$95$0 / N[(N[(alpha + 2.0), $MachinePrecision] * N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(N[(beta + 4.0), $MachinePrecision] + N[(alpha * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \frac{\alpha + 1}{\alpha + \left(\beta + 2\right)}\\
\mathbf{if}\;\beta \leq 2.2:\\
\;\;\;\;\frac{t_0}{\left(\alpha + 2\right) \cdot \left(\alpha + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{\left(\beta + 4\right) + \alpha \cdot 2}\\
\end{array}
\end{array}
if beta < 2.2000000000000002Initial program 99.9%
associate-/l/99.6%
associate-/r*93.1%
+-commutative93.1%
associate-+l+93.1%
associate-+r+93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
times-frac99.6%
Simplified99.6%
add-sqr-sqrt99.5%
pow299.5%
associate-+r+99.5%
associate-/r*99.8%
associate-+r+99.8%
Applied egg-rr99.8%
unpow299.8%
add-sqr-sqrt99.9%
div-inv99.9%
Applied egg-rr99.9%
clear-num99.8%
un-div-inv99.9%
+-commutative99.9%
associate-+r+99.9%
frac-times99.6%
metadata-eval99.6%
*-un-lft-identity99.6%
+-commutative99.6%
metadata-eval99.6%
associate-+r+99.6%
+-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in beta around 0 97.7%
if 2.2000000000000002 < beta Initial program 79.9%
associate-/l/74.3%
associate-/r*60.7%
+-commutative60.7%
associate-+l+60.7%
associate-+r+60.7%
*-commutative60.7%
distribute-rgt1-in60.7%
+-commutative60.7%
*-commutative60.7%
distribute-rgt1-in60.7%
+-commutative60.7%
times-frac86.9%
Simplified86.9%
add-sqr-sqrt86.7%
pow286.7%
associate-+r+86.7%
associate-/r*99.6%
associate-+r+99.6%
Applied egg-rr99.6%
unpow299.6%
add-sqr-sqrt99.7%
div-inv99.6%
Applied egg-rr99.6%
clear-num99.6%
un-div-inv99.7%
+-commutative99.7%
associate-+r+99.7%
frac-times99.1%
metadata-eval99.1%
*-un-lft-identity99.1%
+-commutative99.1%
metadata-eval99.1%
associate-+r+99.1%
+-commutative99.1%
Applied egg-rr99.1%
Taylor expanded in beta around inf 81.5%
associate-+r+81.5%
Simplified81.5%
Final simplification92.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.5) (/ (+ 1.0 beta) (* (+ beta 2.0) (+ 6.0 (* beta 5.0)))) (/ (/ (+ alpha 1.0) beta) (+ 3.0 (+ alpha beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.5) {
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
} else {
tmp = ((alpha + 1.0) / beta) / (3.0 + (alpha + 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 <= 4.5d0) then
tmp = (1.0d0 + beta) / ((beta + 2.0d0) * (6.0d0 + (beta * 5.0d0)))
else
tmp = ((alpha + 1.0d0) / beta) / (3.0d0 + (alpha + beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 4.5) {
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
} else {
tmp = ((alpha + 1.0) / beta) / (3.0 + (alpha + beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.5: tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0))) else: tmp = ((alpha + 1.0) / beta) / (3.0 + (alpha + beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.5) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(6.0 + Float64(beta * 5.0)))); else tmp = Float64(Float64(Float64(alpha + 1.0) / beta) / Float64(3.0 + Float64(alpha + beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 4.5)
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
else
tmp = ((alpha + 1.0) / beta) / (3.0 + (alpha + 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, 4.5], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(6.0 + N[(beta * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha + 1.0), $MachinePrecision] / beta), $MachinePrecision] / N[(3.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4.5:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(6 + \beta \cdot 5\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha + 1}{\beta}}{3 + \left(\alpha + \beta\right)}\\
\end{array}
\end{array}
if beta < 4.5Initial program 99.9%
associate-/l/99.6%
associate-/r*93.1%
+-commutative93.1%
associate-+r+93.1%
+-commutative93.1%
associate-+r+93.1%
associate-+r+93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
metadata-eval93.1%
associate-+l+93.1%
*-commutative93.1%
metadata-eval93.1%
associate-+l+93.1%
Simplified93.0%
Taylor expanded in beta around 0 92.5%
Taylor expanded in alpha around 0 68.3%
if 4.5 < beta Initial program 79.9%
Taylor expanded in beta around inf 79.9%
Taylor expanded in alpha around 0 79.9%
+-commutative79.9%
Simplified79.9%
Final simplification72.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.6) (* (/ 1.0 (+ alpha 2.0)) 0.16666666666666666) (/ (/ (+ alpha 1.0) beta) (+ 3.0 (+ alpha beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = (1.0 / (alpha + 2.0)) * 0.16666666666666666;
} else {
tmp = ((alpha + 1.0) / beta) / (3.0 + (alpha + 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 <= 2.6d0) then
tmp = (1.0d0 / (alpha + 2.0d0)) * 0.16666666666666666d0
else
tmp = ((alpha + 1.0d0) / beta) / (3.0d0 + (alpha + beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = (1.0 / (alpha + 2.0)) * 0.16666666666666666;
} else {
tmp = ((alpha + 1.0) / beta) / (3.0 + (alpha + beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.6: tmp = (1.0 / (alpha + 2.0)) * 0.16666666666666666 else: tmp = ((alpha + 1.0) / beta) / (3.0 + (alpha + beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.6) tmp = Float64(Float64(1.0 / Float64(alpha + 2.0)) * 0.16666666666666666); else tmp = Float64(Float64(Float64(alpha + 1.0) / beta) / Float64(3.0 + Float64(alpha + beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.6)
tmp = (1.0 / (alpha + 2.0)) * 0.16666666666666666;
else
tmp = ((alpha + 1.0) / beta) / (3.0 + (alpha + 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, 2.6], N[(N[(1.0 / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision] * 0.16666666666666666), $MachinePrecision], N[(N[(N[(alpha + 1.0), $MachinePrecision] / beta), $MachinePrecision] / N[(3.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.6:\\
\;\;\;\;\frac{1}{\alpha + 2} \cdot 0.16666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha + 1}{\beta}}{3 + \left(\alpha + \beta\right)}\\
\end{array}
\end{array}
if beta < 2.60000000000000009Initial program 99.9%
associate-/l/99.6%
associate-/r*93.1%
+-commutative93.1%
associate-+l+93.1%
associate-+r+93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
times-frac99.6%
Simplified99.6%
Taylor expanded in alpha around 0 69.8%
associate-/r*69.7%
+-commutative69.7%
Simplified69.7%
Taylor expanded in beta around 0 68.2%
Taylor expanded in beta around 0 68.2%
if 2.60000000000000009 < beta Initial program 79.9%
Taylor expanded in beta around inf 79.9%
Taylor expanded in alpha around 0 79.9%
+-commutative79.9%
Simplified79.9%
Final simplification72.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.6) (* (/ 1.0 (+ alpha 2.0)) 0.16666666666666666) (/ 1.0 (* beta (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = (1.0 / (alpha + 2.0)) * 0.16666666666666666;
} else {
tmp = 1.0 / (beta * (beta + 3.0));
}
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 <= 2.6d0) then
tmp = (1.0d0 / (alpha + 2.0d0)) * 0.16666666666666666d0
else
tmp = 1.0d0 / (beta * (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = (1.0 / (alpha + 2.0)) * 0.16666666666666666;
} else {
tmp = 1.0 / (beta * (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.6: tmp = (1.0 / (alpha + 2.0)) * 0.16666666666666666 else: tmp = 1.0 / (beta * (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.6) tmp = Float64(Float64(1.0 / Float64(alpha + 2.0)) * 0.16666666666666666); else tmp = Float64(1.0 / Float64(beta * Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.6)
tmp = (1.0 / (alpha + 2.0)) * 0.16666666666666666;
else
tmp = 1.0 / (beta * (beta + 3.0));
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, 2.6], N[(N[(1.0 / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision] * 0.16666666666666666), $MachinePrecision], N[(1.0 / N[(beta * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.6:\\
\;\;\;\;\frac{1}{\alpha + 2} \cdot 0.16666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 2.60000000000000009Initial program 99.9%
associate-/l/99.6%
associate-/r*93.1%
+-commutative93.1%
associate-+l+93.1%
associate-+r+93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
times-frac99.6%
Simplified99.6%
Taylor expanded in alpha around 0 69.8%
associate-/r*69.7%
+-commutative69.7%
Simplified69.7%
Taylor expanded in beta around 0 68.2%
Taylor expanded in beta around 0 68.2%
if 2.60000000000000009 < beta Initial program 79.9%
Taylor expanded in beta around inf 79.9%
Taylor expanded in alpha around 0 71.3%
Final simplification69.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.6) (* (/ 1.0 (+ alpha 2.0)) 0.16666666666666666) (/ (/ 1.0 beta) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = (1.0 / (alpha + 2.0)) * 0.16666666666666666;
} else {
tmp = (1.0 / beta) / (beta + 3.0);
}
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 <= 2.6d0) then
tmp = (1.0d0 / (alpha + 2.0d0)) * 0.16666666666666666d0
else
tmp = (1.0d0 / beta) / (beta + 3.0d0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = (1.0 / (alpha + 2.0)) * 0.16666666666666666;
} else {
tmp = (1.0 / beta) / (beta + 3.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.6: tmp = (1.0 / (alpha + 2.0)) * 0.16666666666666666 else: tmp = (1.0 / beta) / (beta + 3.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.6) tmp = Float64(Float64(1.0 / Float64(alpha + 2.0)) * 0.16666666666666666); else tmp = Float64(Float64(1.0 / beta) / Float64(beta + 3.0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.6)
tmp = (1.0 / (alpha + 2.0)) * 0.16666666666666666;
else
tmp = (1.0 / beta) / (beta + 3.0);
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, 2.6], N[(N[(1.0 / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision] * 0.16666666666666666), $MachinePrecision], N[(N[(1.0 / beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.6:\\
\;\;\;\;\frac{1}{\alpha + 2} \cdot 0.16666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 2.60000000000000009Initial program 99.9%
associate-/l/99.6%
associate-/r*93.1%
+-commutative93.1%
associate-+l+93.1%
associate-+r+93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
times-frac99.6%
Simplified99.6%
Taylor expanded in alpha around 0 69.8%
associate-/r*69.7%
+-commutative69.7%
Simplified69.7%
Taylor expanded in beta around 0 68.2%
Taylor expanded in beta around 0 68.2%
if 2.60000000000000009 < beta Initial program 79.9%
Taylor expanded in beta around inf 79.9%
Taylor expanded in alpha around 0 71.3%
associate-/r*71.5%
+-commutative71.5%
Simplified71.5%
Final simplification69.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.2) (* (/ 1.0 (+ alpha 2.0)) 0.16666666666666666) (/ (/ (+ alpha 1.0) beta) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.2) {
tmp = (1.0 / (alpha + 2.0)) * 0.16666666666666666;
} else {
tmp = ((alpha + 1.0) / 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 <= 4.2d0) then
tmp = (1.0d0 / (alpha + 2.0d0)) * 0.16666666666666666d0
else
tmp = ((alpha + 1.0d0) / beta) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 4.2) {
tmp = (1.0 / (alpha + 2.0)) * 0.16666666666666666;
} else {
tmp = ((alpha + 1.0) / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.2: tmp = (1.0 / (alpha + 2.0)) * 0.16666666666666666 else: tmp = ((alpha + 1.0) / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.2) tmp = Float64(Float64(1.0 / Float64(alpha + 2.0)) * 0.16666666666666666); else tmp = Float64(Float64(Float64(alpha + 1.0) / beta) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 4.2)
tmp = (1.0 / (alpha + 2.0)) * 0.16666666666666666;
else
tmp = ((alpha + 1.0) / 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, 4.2], N[(N[(1.0 / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision] * 0.16666666666666666), $MachinePrecision], N[(N[(N[(alpha + 1.0), $MachinePrecision] / beta), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4.2:\\
\;\;\;\;\frac{1}{\alpha + 2} \cdot 0.16666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha + 1}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 4.20000000000000018Initial program 99.9%
associate-/l/99.6%
associate-/r*93.1%
+-commutative93.1%
associate-+l+93.1%
associate-+r+93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
times-frac99.6%
Simplified99.6%
Taylor expanded in alpha around 0 69.8%
associate-/r*69.7%
+-commutative69.7%
Simplified69.7%
Taylor expanded in beta around 0 68.2%
Taylor expanded in beta around 0 68.2%
if 4.20000000000000018 < beta Initial program 79.9%
Taylor expanded in beta around inf 79.9%
Taylor expanded in beta around inf 79.7%
Final simplification72.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (* (/ 1.0 (+ alpha 2.0)) 0.16666666666666666))
assert(alpha < beta);
double code(double alpha, double beta) {
return (1.0 / (alpha + 2.0)) * 0.16666666666666666;
}
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 + 2.0d0)) * 0.16666666666666666d0
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return (1.0 / (alpha + 2.0)) * 0.16666666666666666;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return (1.0 / (alpha + 2.0)) * 0.16666666666666666
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(1.0 / Float64(alpha + 2.0)) * 0.16666666666666666) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = (1.0 / (alpha + 2.0)) * 0.16666666666666666;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(N[(1.0 / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{1}{\alpha + 2} \cdot 0.16666666666666666
\end{array}
Initial program 92.9%
associate-/l/90.8%
associate-/r*81.8%
+-commutative81.8%
associate-+l+81.8%
associate-+r+81.8%
*-commutative81.8%
distribute-rgt1-in81.8%
+-commutative81.8%
*-commutative81.8%
distribute-rgt1-in81.8%
+-commutative81.8%
times-frac95.2%
Simplified95.2%
Taylor expanded in alpha around 0 71.9%
associate-/r*71.9%
+-commutative71.9%
Simplified71.9%
Taylor expanded in beta around 0 45.9%
Taylor expanded in beta around 0 46.2%
Final simplification46.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 6.0) 0.16666666666666666 (/ 1.0 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 6.0) {
tmp = 0.16666666666666666;
} else {
tmp = 1.0 / 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 <= 6.0d0) then
tmp = 0.16666666666666666d0
else
tmp = 1.0d0 / beta
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.16666666666666666;
} else {
tmp = 1.0 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 6.0: tmp = 0.16666666666666666 else: tmp = 1.0 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 6.0) tmp = 0.16666666666666666; else tmp = Float64(1.0 / beta); 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.16666666666666666;
else
tmp = 1.0 / 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, 6.0], 0.16666666666666666, N[(1.0 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 6:\\
\;\;\;\;0.16666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta}\\
\end{array}
\end{array}
if beta < 6Initial program 99.9%
associate-/l/99.6%
associate-/r*93.1%
+-commutative93.1%
associate-+l+93.1%
associate-+r+93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
times-frac99.6%
Simplified99.6%
Taylor expanded in alpha around 0 69.8%
associate-/r*69.7%
+-commutative69.7%
Simplified69.7%
Taylor expanded in beta around 0 68.2%
Taylor expanded in beta around inf 14.3%
if 6 < beta Initial program 79.9%
Taylor expanded in beta around inf 79.9%
Taylor expanded in alpha around inf 6.6%
Final simplification11.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.16666666666666666 (+ alpha 2.0)))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.16666666666666666 / (alpha + 2.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 = 0.16666666666666666d0 / (alpha + 2.0d0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.16666666666666666 / (alpha + 2.0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.16666666666666666 / (alpha + 2.0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.16666666666666666 / Float64(alpha + 2.0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.16666666666666666 / (alpha + 2.0);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.16666666666666666 / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.16666666666666666}{\alpha + 2}
\end{array}
Initial program 92.9%
associate-/l/90.8%
associate-/r*81.8%
+-commutative81.8%
associate-+l+81.8%
associate-+r+81.8%
*-commutative81.8%
distribute-rgt1-in81.8%
+-commutative81.8%
*-commutative81.8%
distribute-rgt1-in81.8%
+-commutative81.8%
times-frac95.2%
Simplified95.2%
Taylor expanded in alpha around 0 71.9%
associate-/r*71.9%
+-commutative71.9%
Simplified71.9%
Taylor expanded in beta around 0 46.2%
Final simplification46.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 0.16666666666666666)
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.16666666666666666;
}
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.16666666666666666d0
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.16666666666666666;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.16666666666666666
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return 0.16666666666666666 end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.16666666666666666;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := 0.16666666666666666
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
0.16666666666666666
\end{array}
Initial program 92.9%
associate-/l/90.8%
associate-/r*81.8%
+-commutative81.8%
associate-+l+81.8%
associate-+r+81.8%
*-commutative81.8%
distribute-rgt1-in81.8%
+-commutative81.8%
*-commutative81.8%
distribute-rgt1-in81.8%
+-commutative81.8%
times-frac95.2%
Simplified95.2%
Taylor expanded in alpha around 0 71.9%
associate-/r*71.9%
+-commutative71.9%
Simplified71.9%
Taylor expanded in beta around 0 45.9%
Taylor expanded in beta around inf 10.7%
Final simplification10.7%
herbie shell --seed 2023308
(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)))