
(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 13 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 3.0))) (t_1 (+ alpha (+ beta 2.0))))
(if (<= beta 2.5e+149)
(* (+ 1.0 alpha) (/ (/ (+ 1.0 beta) t_1) (* t_1 t_0)))
(* (/ (+ 1.0 alpha) (+ beta (+ 3.0 (* alpha 2.0)))) (/ 1.0 t_0)))))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 <= 2.5e+149) {
tmp = (1.0 + alpha) * (((1.0 + beta) / t_1) / (t_1 * t_0));
} else {
tmp = ((1.0 + alpha) / (beta + (3.0 + (alpha * 2.0)))) * (1.0 / t_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) :: t_1
real(8) :: tmp
t_0 = alpha + (beta + 3.0d0)
t_1 = alpha + (beta + 2.0d0)
if (beta <= 2.5d+149) then
tmp = (1.0d0 + alpha) * (((1.0d0 + beta) / t_1) / (t_1 * t_0))
else
tmp = ((1.0d0 + alpha) / (beta + (3.0d0 + (alpha * 2.0d0)))) * (1.0d0 / t_0)
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 <= 2.5e+149) {
tmp = (1.0 + alpha) * (((1.0 + beta) / t_1) / (t_1 * t_0));
} else {
tmp = ((1.0 + alpha) / (beta + (3.0 + (alpha * 2.0)))) * (1.0 / t_0);
}
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 <= 2.5e+149: tmp = (1.0 + alpha) * (((1.0 + beta) / t_1) / (t_1 * t_0)) else: tmp = ((1.0 + alpha) / (beta + (3.0 + (alpha * 2.0)))) * (1.0 / t_0) 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 <= 2.5e+149) tmp = Float64(Float64(1.0 + alpha) * Float64(Float64(Float64(1.0 + beta) / t_1) / Float64(t_1 * t_0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(beta + Float64(3.0 + Float64(alpha * 2.0)))) * Float64(1.0 / t_0)); 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 <= 2.5e+149)
tmp = (1.0 + alpha) * (((1.0 + beta) / t_1) / (t_1 * t_0));
else
tmp = ((1.0 + alpha) / (beta + (3.0 + (alpha * 2.0)))) * (1.0 / t_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 + 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 2.5e+149], N[(N[(1.0 + alpha), $MachinePrecision] * N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$1), $MachinePrecision] / N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta + N[(3.0 + N[(alpha * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$0), $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 2.5 \cdot 10^{+149}:\\
\;\;\;\;\left(1 + \alpha\right) \cdot \frac{\frac{1 + \beta}{t_1}}{t_1 \cdot t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta + \left(3 + \alpha \cdot 2\right)} \cdot \frac{1}{t_0}\\
\end{array}
\end{array}
if beta < 2.49999999999999995e149Initial program 99.3%
associate-/l/98.2%
associate-+l+98.2%
+-commutative98.2%
associate-+r+98.2%
associate-+l+98.2%
distribute-rgt1-in98.2%
*-rgt-identity98.2%
distribute-lft-out98.2%
+-commutative98.2%
associate-*l/98.7%
*-commutative98.7%
associate-*r/96.0%
Simplified96.0%
if 2.49999999999999995e149 < beta Initial program 79.5%
div-inv79.5%
+-commutative79.5%
associate-+l+79.5%
*-commutative79.5%
metadata-eval79.5%
associate-+r+79.5%
metadata-eval79.5%
associate-+r+79.5%
Applied egg-rr79.5%
associate-*l/79.5%
associate-*r/79.5%
*-rgt-identity79.5%
associate-+r+79.5%
*-rgt-identity79.5%
+-commutative79.5%
distribute-rgt1-in79.5%
distribute-lft-in79.5%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
Simplified99.8%
div-inv99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
metadata-eval99.8%
associate-+r+99.8%
Applied egg-rr99.8%
associate-/l*99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in beta around inf 94.2%
*-commutative94.2%
Simplified94.2%
Final simplification95.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ beta (+ alpha 2.0))))
(/
(/ (* (+ 1.0 alpha) (/ (+ 1.0 beta) t_0)) t_0)
(+ 1.0 (+ 2.0 (+ alpha beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = beta + (alpha + 2.0);
return (((1.0 + alpha) * ((1.0 + beta) / t_0)) / t_0) / (1.0 + (2.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 = beta + (alpha + 2.0d0)
code = (((1.0d0 + alpha) * ((1.0d0 + beta) / t_0)) / t_0) / (1.0d0 + (2.0d0 + (alpha + beta)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = beta + (alpha + 2.0);
return (((1.0 + alpha) * ((1.0 + beta) / t_0)) / t_0) / (1.0 + (2.0 + (alpha + beta)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = beta + (alpha + 2.0) return (((1.0 + alpha) * ((1.0 + beta) / t_0)) / t_0) / (1.0 + (2.0 + (alpha + beta)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(beta + Float64(alpha + 2.0)) return Float64(Float64(Float64(Float64(1.0 + alpha) * Float64(Float64(1.0 + beta) / t_0)) / t_0) / Float64(1.0 + Float64(2.0 + Float64(alpha + beta)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = beta + (alpha + 2.0);
tmp = (((1.0 + alpha) * ((1.0 + beta) / t_0)) / t_0) / (1.0 + (2.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[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] * N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(1.0 + N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \beta + \left(\alpha + 2\right)\\
\frac{\frac{\left(1 + \alpha\right) \cdot \frac{1 + \beta}{t_0}}{t_0}}{1 + \left(2 + \left(\alpha + \beta\right)\right)}
\end{array}
\end{array}
Initial program 95.6%
div-inv95.5%
+-commutative95.5%
associate-+l+95.5%
*-commutative95.5%
metadata-eval95.5%
associate-+r+95.5%
metadata-eval95.5%
associate-+r+95.5%
Applied egg-rr95.5%
associate-*l/95.5%
associate-*r/95.6%
*-rgt-identity95.6%
associate-+r+95.6%
*-rgt-identity95.6%
+-commutative95.6%
distribute-rgt1-in95.6%
distribute-lft-in95.6%
associate-*r/99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
Simplified99.7%
Final simplification99.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ beta (+ alpha 2.0)))) (* (/ (+ 1.0 beta) t_0) (/ (/ (+ 1.0 alpha) t_0) (+ beta (+ alpha 3.0))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = beta + (alpha + 2.0);
return ((1.0 + beta) / t_0) * (((1.0 + alpha) / t_0) / (beta + (alpha + 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 = beta + (alpha + 2.0d0)
code = ((1.0d0 + beta) / t_0) * (((1.0d0 + alpha) / t_0) / (beta + (alpha + 3.0d0)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = beta + (alpha + 2.0);
return ((1.0 + beta) / t_0) * (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = beta + (alpha + 2.0) return ((1.0 + beta) / t_0) * (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(beta + Float64(alpha + 2.0)) return Float64(Float64(Float64(1.0 + beta) / t_0) * Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(beta + Float64(alpha + 3.0)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = beta + (alpha + 2.0);
tmp = ((1.0 + beta) / t_0) * (((1.0 + alpha) / t_0) / (beta + (alpha + 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[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \beta + \left(\alpha + 2\right)\\
\frac{1 + \beta}{t_0} \cdot \frac{\frac{1 + \alpha}{t_0}}{\beta + \left(\alpha + 3\right)}
\end{array}
\end{array}
Initial program 95.6%
associate-/l/93.6%
associate-+l+93.6%
+-commutative93.6%
associate-+r+93.6%
associate-+l+93.6%
distribute-rgt1-in93.6%
*-rgt-identity93.6%
distribute-lft-out93.6%
+-commutative93.6%
associate-*l/95.9%
*-commutative95.9%
associate-*r/93.7%
Simplified93.7%
associate-*r/95.9%
+-commutative95.9%
Applied egg-rr95.9%
+-commutative95.9%
*-commutative95.9%
+-commutative95.9%
associate-*r/95.9%
associate-/r*99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
Simplified99.7%
Final simplification99.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) (/ (+ 1.0 alpha) t_0)) (+ beta (+ alpha 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return (((1.0 + beta) / t_0) * ((1.0 + alpha) / t_0)) / (beta + (alpha + 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 + beta) / t_0) * ((1.0d0 + alpha) / t_0)) / (beta + (alpha + 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 + beta) / t_0) * ((1.0 + alpha) / t_0)) / (beta + (alpha + 3.0));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return (((1.0 + beta) / t_0) * ((1.0 + alpha) / t_0)) / (beta + (alpha + 3.0))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) return Float64(Float64(Float64(Float64(1.0 + beta) / t_0) * Float64(Float64(1.0 + alpha) / t_0)) / Float64(beta + Float64(alpha + 3.0))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = (((1.0 + beta) / t_0) * ((1.0 + alpha) / t_0)) / (beta + (alpha + 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[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / N[(beta + N[(alpha + 3.0), $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} \cdot \frac{1 + \alpha}{t_0}}{\beta + \left(\alpha + 3\right)}
\end{array}
\end{array}
Initial program 95.6%
associate-/l/93.6%
associate-+l+93.6%
+-commutative93.6%
associate-+r+93.6%
associate-+l+93.6%
distribute-rgt1-in93.6%
*-rgt-identity93.6%
distribute-lft-out93.6%
+-commutative93.6%
associate-*l/95.9%
*-commutative95.9%
associate-*r/93.7%
Simplified93.7%
associate-*r/95.9%
+-commutative95.9%
Applied egg-rr95.9%
+-commutative95.9%
*-commutative95.9%
+-commutative95.9%
associate-*r/95.9%
associate-/r*99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
Simplified99.7%
associate-*r/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
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
(if (<= beta 29000000.0)
(* (+ 1.0 beta) (/ (/ 1.0 (+ beta 2.0)) (* (+ beta 2.0) (+ beta 3.0))))
(*
(/ (+ 1.0 alpha) (+ beta (+ 3.0 (* alpha 2.0))))
(/ 1.0 (+ alpha (+ beta 3.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 29000000.0) {
tmp = (1.0 + beta) * ((1.0 / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / (beta + (3.0 + (alpha * 2.0)))) * (1.0 / (alpha + (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 <= 29000000.0d0) then
tmp = (1.0d0 + beta) * ((1.0d0 / (beta + 2.0d0)) / ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = ((1.0d0 + alpha) / (beta + (3.0d0 + (alpha * 2.0d0)))) * (1.0d0 / (alpha + (beta + 3.0d0)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 29000000.0) {
tmp = (1.0 + beta) * ((1.0 / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / (beta + (3.0 + (alpha * 2.0)))) * (1.0 / (alpha + (beta + 3.0)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 29000000.0: tmp = (1.0 + beta) * ((1.0 / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0))) else: tmp = ((1.0 + alpha) / (beta + (3.0 + (alpha * 2.0)))) * (1.0 / (alpha + (beta + 3.0))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 29000000.0) tmp = Float64(Float64(1.0 + beta) * Float64(Float64(1.0 / Float64(beta + 2.0)) / Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(beta + Float64(3.0 + Float64(alpha * 2.0)))) * Float64(1.0 / Float64(alpha + 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 <= 29000000.0)
tmp = (1.0 + beta) * ((1.0 / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)));
else
tmp = ((1.0 + alpha) / (beta + (3.0 + (alpha * 2.0)))) * (1.0 / (alpha + (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, 29000000.0], N[(N[(1.0 + beta), $MachinePrecision] * N[(N[(1.0 / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta + N[(3.0 + N[(alpha * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 29000000:\\
\;\;\;\;\left(1 + \beta\right) \cdot \frac{\frac{1}{\beta + 2}}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta + \left(3 + \alpha \cdot 2\right)} \cdot \frac{1}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 2.9e7Initial program 99.8%
associate-/l/99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+r+99.6%
associate-+l+99.6%
distribute-rgt1-in99.6%
*-rgt-identity99.6%
distribute-lft-out99.6%
+-commutative99.6%
associate-*r/99.6%
associate-*r/99.5%
Simplified99.5%
Taylor expanded in alpha around 0 86.4%
Taylor expanded in alpha around 0 67.5%
if 2.9e7 < beta Initial program 88.8%
div-inv88.7%
+-commutative88.7%
associate-+l+88.7%
*-commutative88.7%
metadata-eval88.7%
associate-+r+88.7%
metadata-eval88.7%
associate-+r+88.7%
Applied egg-rr88.7%
associate-*l/88.7%
associate-*r/88.8%
*-rgt-identity88.8%
associate-+r+88.8%
*-rgt-identity88.8%
+-commutative88.8%
distribute-rgt1-in88.8%
distribute-lft-in88.8%
associate-*r/99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+r+99.6%
Simplified99.6%
div-inv99.5%
associate-+r+99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+r+99.5%
Applied egg-rr99.5%
associate-/l*99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in beta around inf 83.9%
*-commutative83.9%
Simplified83.9%
Final simplification73.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 10500000.0)
(*
(/ (+ 1.0 beta) (+ beta (+ alpha 2.0)))
(/ 1.0 (* (+ beta 2.0) (+ beta 3.0))))
(*
(/ (+ 1.0 alpha) (+ beta (+ 3.0 (* alpha 2.0))))
(/ 1.0 (+ alpha (+ beta 3.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 10500000.0) {
tmp = ((1.0 + beta) / (beta + (alpha + 2.0))) * (1.0 / ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / (beta + (3.0 + (alpha * 2.0)))) * (1.0 / (alpha + (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 <= 10500000.0d0) then
tmp = ((1.0d0 + beta) / (beta + (alpha + 2.0d0))) * (1.0d0 / ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = ((1.0d0 + alpha) / (beta + (3.0d0 + (alpha * 2.0d0)))) * (1.0d0 / (alpha + (beta + 3.0d0)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 10500000.0) {
tmp = ((1.0 + beta) / (beta + (alpha + 2.0))) * (1.0 / ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / (beta + (3.0 + (alpha * 2.0)))) * (1.0 / (alpha + (beta + 3.0)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 10500000.0: tmp = ((1.0 + beta) / (beta + (alpha + 2.0))) * (1.0 / ((beta + 2.0) * (beta + 3.0))) else: tmp = ((1.0 + alpha) / (beta + (3.0 + (alpha * 2.0)))) * (1.0 / (alpha + (beta + 3.0))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 10500000.0) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(beta + Float64(alpha + 2.0))) * Float64(1.0 / Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(beta + Float64(3.0 + Float64(alpha * 2.0)))) * Float64(1.0 / Float64(alpha + 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 <= 10500000.0)
tmp = ((1.0 + beta) / (beta + (alpha + 2.0))) * (1.0 / ((beta + 2.0) * (beta + 3.0)));
else
tmp = ((1.0 + alpha) / (beta + (3.0 + (alpha * 2.0)))) * (1.0 / (alpha + (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, 10500000.0], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta + N[(3.0 + N[(alpha * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 10500000:\\
\;\;\;\;\frac{1 + \beta}{\beta + \left(\alpha + 2\right)} \cdot \frac{1}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta + \left(3 + \alpha \cdot 2\right)} \cdot \frac{1}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 1.05e7Initial program 99.8%
associate-/l/99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+r+99.6%
associate-+l+99.6%
distribute-rgt1-in99.6%
*-rgt-identity99.6%
distribute-lft-out99.6%
+-commutative99.6%
associate-*l/99.6%
*-commutative99.6%
associate-*r/97.0%
Simplified97.0%
associate-*r/99.6%
+-commutative99.6%
Applied egg-rr99.6%
+-commutative99.6%
*-commutative99.6%
+-commutative99.6%
associate-*r/99.5%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 68.7%
if 1.05e7 < beta Initial program 88.8%
div-inv88.7%
+-commutative88.7%
associate-+l+88.7%
*-commutative88.7%
metadata-eval88.7%
associate-+r+88.7%
metadata-eval88.7%
associate-+r+88.7%
Applied egg-rr88.7%
associate-*l/88.7%
associate-*r/88.8%
*-rgt-identity88.8%
associate-+r+88.8%
*-rgt-identity88.8%
+-commutative88.8%
distribute-rgt1-in88.8%
distribute-lft-in88.8%
associate-*r/99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+r+99.6%
Simplified99.6%
div-inv99.5%
associate-+r+99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+r+99.5%
Applied egg-rr99.5%
associate-/l*99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in beta around inf 83.9%
*-commutative83.9%
Simplified83.9%
Final simplification74.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.3e+15) (* (+ 1.0 beta) (/ (/ 1.0 (+ beta 2.0)) (* (+ beta 2.0) (+ beta 3.0)))) (/ (/ (+ 1.0 alpha) (+ beta (+ alpha 2.0))) (+ beta (+ alpha 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.3e+15) {
tmp = (1.0 + beta) * ((1.0 / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / (beta + (alpha + 2.0))) / (beta + (alpha + 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 <= 1.3d+15) then
tmp = (1.0d0 + beta) * ((1.0d0 / (beta + 2.0d0)) / ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = ((1.0d0 + alpha) / (beta + (alpha + 2.0d0))) / (beta + (alpha + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.3e+15) {
tmp = (1.0 + beta) * ((1.0 / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / (beta + (alpha + 2.0))) / (beta + (alpha + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.3e+15: tmp = (1.0 + beta) * ((1.0 / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0))) else: tmp = ((1.0 + alpha) / (beta + (alpha + 2.0))) / (beta + (alpha + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.3e+15) tmp = Float64(Float64(1.0 + beta) * Float64(Float64(1.0 / Float64(beta + 2.0)) / Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(beta + Float64(alpha + 2.0))) / Float64(beta + Float64(alpha + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.3e+15)
tmp = (1.0 + beta) * ((1.0 / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)));
else
tmp = ((1.0 + alpha) / (beta + (alpha + 2.0))) / (beta + (alpha + 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, 1.3e+15], N[(N[(1.0 + beta), $MachinePrecision] * N[(N[(1.0 / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.3 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + \beta\right) \cdot \frac{\frac{1}{\beta + 2}}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta + \left(\alpha + 2\right)}}{\beta + \left(\alpha + 3\right)}\\
\end{array}
\end{array}
if beta < 1.3e15Initial program 99.8%
associate-/l/99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+r+99.6%
associate-+l+99.6%
distribute-rgt1-in99.6%
*-rgt-identity99.6%
distribute-lft-out99.6%
+-commutative99.6%
associate-*r/99.5%
associate-*r/99.5%
Simplified99.5%
Taylor expanded in alpha around 0 86.6%
Taylor expanded in alpha around 0 68.1%
if 1.3e15 < beta Initial program 88.4%
associate-/l/83.7%
associate-+l+83.7%
+-commutative83.7%
associate-+r+83.7%
associate-+l+83.7%
distribute-rgt1-in83.7%
*-rgt-identity83.7%
distribute-lft-out83.7%
+-commutative83.7%
associate-*l/89.7%
*-commutative89.7%
associate-*r/88.2%
Simplified88.2%
associate-*r/89.7%
+-commutative89.7%
Applied egg-rr89.7%
+-commutative89.7%
*-commutative89.7%
+-commutative89.7%
associate-*r/89.7%
associate-/r*99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in beta around inf 83.6%
Final simplification73.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 0.9) 0.08333333333333333 (/ (/ (+ 1.0 alpha) (+ beta (+ alpha 2.0))) (+ beta (+ alpha 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 0.9) {
tmp = 0.08333333333333333;
} else {
tmp = ((1.0 + alpha) / (beta + (alpha + 2.0))) / (beta + (alpha + 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 <= 0.9d0) then
tmp = 0.08333333333333333d0
else
tmp = ((1.0d0 + alpha) / (beta + (alpha + 2.0d0))) / (beta + (alpha + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 0.9) {
tmp = 0.08333333333333333;
} else {
tmp = ((1.0 + alpha) / (beta + (alpha + 2.0))) / (beta + (alpha + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 0.9: tmp = 0.08333333333333333 else: tmp = ((1.0 + alpha) / (beta + (alpha + 2.0))) / (beta + (alpha + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 0.9) tmp = 0.08333333333333333; else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(beta + Float64(alpha + 2.0))) / Float64(beta + Float64(alpha + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 0.9)
tmp = 0.08333333333333333;
else
tmp = ((1.0 + alpha) / (beta + (alpha + 2.0))) / (beta + (alpha + 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, 0.9], 0.08333333333333333, N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 0.9:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta + \left(\alpha + 2\right)}}{\beta + \left(\alpha + 3\right)}\\
\end{array}
\end{array}
if beta < 0.900000000000000022Initial program 99.9%
associate-/l/99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+r+99.6%
associate-+l+99.6%
distribute-rgt1-in99.6%
*-rgt-identity99.6%
distribute-lft-out99.6%
+-commutative99.6%
associate-*r/99.6%
associate-*r/99.6%
Simplified99.6%
Taylor expanded in alpha around 0 86.3%
Taylor expanded in beta around 0 83.7%
Taylor expanded in alpha around 0 64.6%
if 0.900000000000000022 < beta Initial program 89.0%
associate-/l/84.4%
associate-+l+84.4%
+-commutative84.4%
associate-+r+84.4%
associate-+l+84.4%
distribute-rgt1-in84.4%
*-rgt-identity84.4%
distribute-lft-out84.4%
+-commutative84.4%
associate-*l/90.2%
*-commutative90.2%
associate-*r/88.7%
Simplified88.7%
associate-*r/90.2%
+-commutative90.2%
Applied egg-rr90.2%
+-commutative90.2%
*-commutative90.2%
+-commutative90.2%
associate-*r/90.2%
associate-/r*99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in beta around inf 82.0%
Final simplification71.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.3) 0.08333333333333333 (* (/ 1.0 (+ alpha (+ beta 3.0))) (/ (+ 1.0 alpha) beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.3) {
tmp = 0.08333333333333333;
} else {
tmp = (1.0 / (alpha + (beta + 3.0))) * ((1.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.3d0) then
tmp = 0.08333333333333333d0
else
tmp = (1.0d0 / (alpha + (beta + 3.0d0))) * ((1.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.3) {
tmp = 0.08333333333333333;
} else {
tmp = (1.0 / (alpha + (beta + 3.0))) * ((1.0 + alpha) / beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.3: tmp = 0.08333333333333333 else: tmp = (1.0 / (alpha + (beta + 3.0))) * ((1.0 + alpha) / beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.3) tmp = 0.08333333333333333; else tmp = Float64(Float64(1.0 / Float64(alpha + Float64(beta + 3.0))) * Float64(Float64(1.0 + alpha) / beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.3)
tmp = 0.08333333333333333;
else
tmp = (1.0 / (alpha + (beta + 3.0))) * ((1.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.3], 0.08333333333333333, N[(N[(1.0 / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.3:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\alpha + \left(\beta + 3\right)} \cdot \frac{1 + \alpha}{\beta}\\
\end{array}
\end{array}
if beta < 2.2999999999999998Initial program 99.9%
associate-/l/99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+r+99.6%
associate-+l+99.6%
distribute-rgt1-in99.6%
*-rgt-identity99.6%
distribute-lft-out99.6%
+-commutative99.6%
associate-*r/99.6%
associate-*r/99.6%
Simplified99.6%
Taylor expanded in alpha around 0 86.3%
Taylor expanded in beta around 0 83.7%
Taylor expanded in alpha around 0 64.6%
if 2.2999999999999998 < beta Initial program 89.0%
div-inv88.9%
+-commutative88.9%
associate-+l+88.9%
*-commutative88.9%
metadata-eval88.9%
associate-+r+88.9%
metadata-eval88.9%
associate-+r+88.9%
Applied egg-rr88.9%
associate-*l/88.9%
associate-*r/89.0%
*-rgt-identity89.0%
associate-+r+89.0%
*-rgt-identity89.0%
+-commutative89.0%
distribute-rgt1-in89.0%
distribute-lft-in89.0%
associate-*r/99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+r+99.6%
Simplified99.6%
div-inv99.5%
associate-+r+99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+r+99.5%
Applied egg-rr99.5%
associate-/l*99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in beta around inf 81.5%
Final simplification71.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.3) 0.08333333333333333 (/ (/ (+ 1.0 alpha) beta) (+ 1.0 (+ 2.0 (+ alpha beta))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.3) {
tmp = 0.08333333333333333;
} else {
tmp = ((1.0 + alpha) / beta) / (1.0 + (2.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.3d0) then
tmp = 0.08333333333333333d0
else
tmp = ((1.0d0 + alpha) / beta) / (1.0d0 + (2.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.3) {
tmp = 0.08333333333333333;
} else {
tmp = ((1.0 + alpha) / beta) / (1.0 + (2.0 + (alpha + beta)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.3: tmp = 0.08333333333333333 else: tmp = ((1.0 + alpha) / beta) / (1.0 + (2.0 + (alpha + beta))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.3) tmp = 0.08333333333333333; else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(1.0 + Float64(2.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.3)
tmp = 0.08333333333333333;
else
tmp = ((1.0 + alpha) / beta) / (1.0 + (2.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.3], 0.08333333333333333, N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(1.0 + N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.3:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{1 + \left(2 + \left(\alpha + \beta\right)\right)}\\
\end{array}
\end{array}
if beta < 2.2999999999999998Initial program 99.9%
associate-/l/99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+r+99.6%
associate-+l+99.6%
distribute-rgt1-in99.6%
*-rgt-identity99.6%
distribute-lft-out99.6%
+-commutative99.6%
associate-*r/99.6%
associate-*r/99.6%
Simplified99.6%
Taylor expanded in alpha around 0 86.3%
Taylor expanded in beta around 0 83.7%
Taylor expanded in alpha around 0 64.6%
if 2.2999999999999998 < beta Initial program 89.0%
div-inv88.9%
+-commutative88.9%
associate-+l+88.9%
*-commutative88.9%
metadata-eval88.9%
associate-+r+88.9%
metadata-eval88.9%
associate-+r+88.9%
Applied egg-rr88.9%
associate-*l/88.9%
associate-*r/89.0%
*-rgt-identity89.0%
associate-+r+89.0%
*-rgt-identity89.0%
+-commutative89.0%
distribute-rgt1-in89.0%
distribute-lft-in89.0%
associate-*r/99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+r+99.6%
Simplified99.6%
Taylor expanded in beta around inf 81.6%
Final simplification71.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.6) 0.08333333333333333 (/ (+ 1.0 alpha) (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.6) {
tmp = 0.08333333333333333;
} 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 <= 3.6d0) then
tmp = 0.08333333333333333d0
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 <= 3.6) {
tmp = 0.08333333333333333;
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.6: tmp = 0.08333333333333333 else: tmp = (1.0 + alpha) / (beta * beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.6) tmp = 0.08333333333333333; else tmp = Float64(Float64(1.0 + alpha) / Float64(beta * beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.6)
tmp = 0.08333333333333333;
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, 3.6], 0.08333333333333333, N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.6:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 3.60000000000000009Initial program 99.8%
associate-/l/99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+r+99.6%
associate-+l+99.6%
distribute-rgt1-in99.6%
*-rgt-identity99.6%
distribute-lft-out99.6%
+-commutative99.6%
associate-*r/99.6%
associate-*r/99.6%
Simplified99.6%
Taylor expanded in alpha around 0 86.3%
Taylor expanded in beta around 0 83.3%
Taylor expanded in alpha around 0 64.3%
if 3.60000000000000009 < beta Initial program 88.9%
div-inv88.8%
+-commutative88.8%
associate-+l+88.8%
*-commutative88.8%
metadata-eval88.8%
associate-+r+88.8%
metadata-eval88.8%
associate-+r+88.8%
Applied egg-rr88.8%
associate-*l/88.9%
associate-*r/88.9%
*-rgt-identity88.9%
associate-+r+88.9%
*-rgt-identity88.9%
+-commutative88.9%
distribute-rgt1-in88.9%
distribute-lft-in88.9%
associate-*r/99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+r+99.6%
Simplified99.6%
Taylor expanded in beta around inf 77.2%
unpow277.2%
Simplified77.2%
Final simplification69.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.5) 0.08333333333333333 (/ 1.0 (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.5) {
tmp = 0.08333333333333333;
} else {
tmp = 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 <= 3.5d0) then
tmp = 0.08333333333333333d0
else
tmp = 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 <= 3.5) {
tmp = 0.08333333333333333;
} else {
tmp = 1.0 / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.5: tmp = 0.08333333333333333 else: tmp = 1.0 / (beta * beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.5) tmp = 0.08333333333333333; else tmp = Float64(1.0 / Float64(beta * beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.5)
tmp = 0.08333333333333333;
else
tmp = 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, 3.5], 0.08333333333333333, N[(1.0 / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.5:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 3.5Initial program 99.8%
associate-/l/99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+r+99.6%
associate-+l+99.6%
distribute-rgt1-in99.6%
*-rgt-identity99.6%
distribute-lft-out99.6%
+-commutative99.6%
associate-*r/99.6%
associate-*r/99.6%
Simplified99.6%
Taylor expanded in alpha around 0 86.3%
Taylor expanded in beta around 0 83.3%
Taylor expanded in alpha around 0 64.3%
if 3.5 < beta Initial program 88.9%
associate-/l/84.3%
associate-+l+84.3%
+-commutative84.3%
associate-+r+84.3%
associate-+l+84.3%
distribute-rgt1-in84.3%
*-rgt-identity84.3%
distribute-lft-out84.3%
+-commutative84.3%
associate-*r/90.0%
associate-*r/77.0%
Simplified77.0%
Taylor expanded in alpha around 0 65.9%
Taylor expanded in beta around inf 73.7%
unpow273.7%
Simplified73.7%
Final simplification68.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 0.08333333333333333)
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.08333333333333333;
}
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.08333333333333333d0
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.08333333333333333;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.08333333333333333
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return 0.08333333333333333 end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.08333333333333333;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := 0.08333333333333333
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
0.08333333333333333
\end{array}
Initial program 95.6%
associate-/l/93.6%
associate-+l+93.6%
+-commutative93.6%
associate-+r+93.6%
associate-+l+93.6%
distribute-rgt1-in93.6%
*-rgt-identity93.6%
distribute-lft-out93.6%
+-commutative93.6%
associate-*r/95.8%
associate-*r/90.7%
Simplified90.7%
Taylor expanded in alpha around 0 78.3%
Taylor expanded in beta around 0 54.7%
Taylor expanded in alpha around 0 40.8%
Final simplification40.8%
herbie shell --seed 2023228
(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)))