
(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 22 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 (+ beta (+ alpha 2.0))))
(/
(/ (* (+ beta 1.0) (/ (+ 1.0 alpha) t_0)) t_0)
(+ 1.0 (+ 2.0 (+ beta alpha))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = beta + (alpha + 2.0);
return (((beta + 1.0) * ((1.0 + alpha) / t_0)) / t_0) / (1.0 + (2.0 + (beta + alpha)));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = beta + (alpha + 2.0d0)
code = (((beta + 1.0d0) * ((1.0d0 + alpha) / t_0)) / t_0) / (1.0d0 + (2.0d0 + (beta + alpha)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = beta + (alpha + 2.0);
return (((beta + 1.0) * ((1.0 + alpha) / t_0)) / t_0) / (1.0 + (2.0 + (beta + alpha)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = beta + (alpha + 2.0) return (((beta + 1.0) * ((1.0 + alpha) / t_0)) / t_0) / (1.0 + (2.0 + (beta + alpha)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(beta + Float64(alpha + 2.0)) return Float64(Float64(Float64(Float64(beta + 1.0) * Float64(Float64(1.0 + alpha) / t_0)) / t_0) / Float64(1.0 + Float64(2.0 + Float64(beta + alpha)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = beta + (alpha + 2.0);
tmp = (((beta + 1.0) * ((1.0 + alpha) / t_0)) / t_0) / (1.0 + (2.0 + (beta + alpha)));
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[(beta + 1.0), $MachinePrecision] * N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(1.0 + N[(2.0 + N[(beta + alpha), $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(\beta + 1\right) \cdot \frac{1 + \alpha}{t_0}}{t_0}}{1 + \left(2 + \left(\beta + \alpha\right)\right)}
\end{array}
\end{array}
Initial program 96.4%
div-inv96.4%
+-commutative96.4%
associate-+l+96.4%
*-commutative96.4%
metadata-eval96.4%
+-commutative96.4%
metadata-eval96.4%
+-commutative96.4%
Applied egg-rr96.4%
associate-*l/96.4%
associate-*r/96.4%
*-rgt-identity96.4%
associate-+r+96.4%
*-rgt-identity96.4%
+-commutative96.4%
distribute-rgt1-in96.4%
distribute-lft-in96.4%
+-commutative96.4%
+-commutative96.4%
*-commutative96.4%
+-commutative96.4%
+-commutative96.4%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))))
(if (<= beta 2e+93)
(* (+ 1.0 alpha) (/ (/ (+ beta 1.0) t_0) (* t_0 (+ alpha (+ beta 3.0)))))
(/
(* (/ (+ 1.0 alpha) t_0) (+ 1.0 (/ (- -1.0 alpha) beta)))
(+ beta (+ alpha 3.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 2e+93) {
tmp = (1.0 + alpha) * (((beta + 1.0) / t_0) / (t_0 * (alpha + (beta + 3.0))));
} else {
tmp = (((1.0 + alpha) / t_0) * (1.0 + ((-1.0 - alpha) / beta))) / (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) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 2d+93) then
tmp = (1.0d0 + alpha) * (((beta + 1.0d0) / t_0) / (t_0 * (alpha + (beta + 3.0d0))))
else
tmp = (((1.0d0 + alpha) / t_0) * (1.0d0 + (((-1.0d0) - alpha) / beta))) / (beta + (alpha + 3.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 <= 2e+93) {
tmp = (1.0 + alpha) * (((beta + 1.0) / t_0) / (t_0 * (alpha + (beta + 3.0))));
} else {
tmp = (((1.0 + alpha) / t_0) * (1.0 + ((-1.0 - alpha) / beta))) / (beta + (alpha + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 2e+93: tmp = (1.0 + alpha) * (((beta + 1.0) / t_0) / (t_0 * (alpha + (beta + 3.0)))) else: tmp = (((1.0 + alpha) / t_0) * (1.0 + ((-1.0 - alpha) / beta))) / (beta + (alpha + 3.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 <= 2e+93) tmp = Float64(Float64(1.0 + alpha) * Float64(Float64(Float64(beta + 1.0) / t_0) / Float64(t_0 * Float64(alpha + Float64(beta + 3.0))))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / t_0) * Float64(1.0 + Float64(Float64(-1.0 - alpha) / beta))) / Float64(beta + Float64(alpha + 3.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 <= 2e+93)
tmp = (1.0 + alpha) * (((beta + 1.0) / t_0) / (t_0 * (alpha + (beta + 3.0))));
else
tmp = (((1.0 + alpha) / t_0) * (1.0 + ((-1.0 - alpha) / beta))) / (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_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 2e+93], N[(N[(1.0 + alpha), $MachinePrecision] * N[(N[(N[(beta + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 * N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(1.0 + N[(N[(-1.0 - alpha), $MachinePrecision] / beta), $MachinePrecision]), $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)\\
\mathbf{if}\;\beta \leq 2 \cdot 10^{+93}:\\
\;\;\;\;\left(1 + \alpha\right) \cdot \frac{\frac{\beta + 1}{t_0}}{t_0 \cdot \left(\alpha + \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0} \cdot \left(1 + \frac{-1 - \alpha}{\beta}\right)}{\beta + \left(\alpha + 3\right)}\\
\end{array}
\end{array}
if beta < 2.00000000000000009e93Initial program 99.8%
associate-/l/99.1%
associate-+l+99.1%
+-commutative99.1%
associate-+r+99.1%
associate-+l+99.1%
distribute-rgt1-in99.1%
*-rgt-identity99.1%
distribute-lft-out99.1%
+-commutative99.1%
associate-*l/99.1%
*-commutative99.1%
associate-*r/96.5%
Simplified96.5%
if 2.00000000000000009e93 < beta Initial program 83.9%
div-inv83.9%
+-commutative83.9%
associate-+l+83.9%
*-commutative83.9%
metadata-eval83.9%
+-commutative83.9%
metadata-eval83.9%
+-commutative83.9%
Applied egg-rr83.9%
associate-*l/83.9%
associate-*r/83.9%
*-rgt-identity83.9%
associate-+r+83.9%
*-rgt-identity83.9%
+-commutative83.9%
distribute-rgt1-in83.9%
distribute-lft-in83.9%
+-commutative83.9%
+-commutative83.9%
*-commutative83.9%
+-commutative83.9%
+-commutative83.9%
associate-*r/99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
Simplified99.9%
div-inv99.8%
associate-/l*98.8%
associate-+r+98.8%
+-commutative98.8%
associate-+r+98.8%
+-commutative98.8%
metadata-eval98.8%
associate-+l+98.8%
+-commutative98.8%
metadata-eval98.8%
Applied egg-rr98.8%
associate-*r/98.9%
*-rgt-identity98.9%
associate-/r/99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in beta around inf 87.9%
mul-1-neg87.9%
unsub-neg87.9%
Simplified87.9%
Final simplification94.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 3.8)
(* (/ 1.0 (+ alpha 3.0)) (/ (+ 1.0 alpha) (+ 4.0 (* alpha (+ alpha 4.0)))))
(/
(*
(/ (+ 1.0 alpha) (+ alpha (+ beta 2.0)))
(+ 1.0 (/ (- -1.0 alpha) beta)))
(+ beta (+ alpha 3.0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.8) {
tmp = (1.0 / (alpha + 3.0)) * ((1.0 + alpha) / (4.0 + (alpha * (alpha + 4.0))));
} else {
tmp = (((1.0 + alpha) / (alpha + (beta + 2.0))) * (1.0 + ((-1.0 - alpha) / beta))) / (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 <= 3.8d0) then
tmp = (1.0d0 / (alpha + 3.0d0)) * ((1.0d0 + alpha) / (4.0d0 + (alpha * (alpha + 4.0d0))))
else
tmp = (((1.0d0 + alpha) / (alpha + (beta + 2.0d0))) * (1.0d0 + (((-1.0d0) - alpha) / beta))) / (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 <= 3.8) {
tmp = (1.0 / (alpha + 3.0)) * ((1.0 + alpha) / (4.0 + (alpha * (alpha + 4.0))));
} else {
tmp = (((1.0 + alpha) / (alpha + (beta + 2.0))) * (1.0 + ((-1.0 - alpha) / beta))) / (beta + (alpha + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.8: tmp = (1.0 / (alpha + 3.0)) * ((1.0 + alpha) / (4.0 + (alpha * (alpha + 4.0)))) else: tmp = (((1.0 + alpha) / (alpha + (beta + 2.0))) * (1.0 + ((-1.0 - alpha) / beta))) / (beta + (alpha + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.8) tmp = Float64(Float64(1.0 / Float64(alpha + 3.0)) * Float64(Float64(1.0 + alpha) / Float64(4.0 + Float64(alpha * Float64(alpha + 4.0))))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 2.0))) * Float64(1.0 + Float64(Float64(-1.0 - alpha) / beta))) / 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 <= 3.8)
tmp = (1.0 / (alpha + 3.0)) * ((1.0 + alpha) / (4.0 + (alpha * (alpha + 4.0))));
else
tmp = (((1.0 + alpha) / (alpha + (beta + 2.0))) * (1.0 + ((-1.0 - alpha) / beta))) / (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, 3.8], N[(N[(1.0 / N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + alpha), $MachinePrecision] / N[(4.0 + N[(alpha * N[(alpha + 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(-1.0 - alpha), $MachinePrecision] / beta), $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 3.8:\\
\;\;\;\;\frac{1}{\alpha + 3} \cdot \frac{1 + \alpha}{4 + \alpha \cdot \left(\alpha + 4\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(\beta + 2\right)} \cdot \left(1 + \frac{-1 - \alpha}{\beta}\right)}{\beta + \left(\alpha + 3\right)}\\
\end{array}
\end{array}
if beta < 3.7999999999999998Initial program 99.8%
associate-/l/99.5%
associate-/l/96.5%
associate-+l+96.5%
+-commutative96.5%
associate-+r+96.5%
associate-+l+96.5%
distribute-rgt1-in96.5%
*-rgt-identity96.5%
distribute-lft-out96.5%
+-commutative96.5%
times-frac99.5%
Simplified99.5%
distribute-lft-in99.5%
associate-+r+99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in beta around 0 99.3%
Taylor expanded in alpha around 0 99.4%
unpow299.4%
distribute-rgt-out99.4%
Simplified99.4%
Taylor expanded in beta around 0 99.0%
if 3.7999999999999998 < beta Initial program 88.0%
div-inv88.1%
+-commutative88.1%
associate-+l+88.1%
*-commutative88.1%
metadata-eval88.1%
+-commutative88.1%
metadata-eval88.1%
+-commutative88.1%
Applied egg-rr88.1%
associate-*l/88.1%
associate-*r/88.0%
*-rgt-identity88.0%
associate-+r+88.0%
*-rgt-identity88.0%
+-commutative88.0%
distribute-rgt1-in88.0%
distribute-lft-in88.0%
+-commutative88.0%
+-commutative88.0%
*-commutative88.0%
+-commutative88.0%
+-commutative88.0%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.7%
associate-/l*99.0%
associate-+r+99.0%
+-commutative99.0%
associate-+r+99.0%
+-commutative99.0%
metadata-eval99.0%
associate-+l+99.0%
+-commutative99.0%
metadata-eval99.0%
Applied egg-rr99.0%
associate-*r/99.1%
*-rgt-identity99.1%
associate-/r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in beta around inf 82.9%
mul-1-neg82.9%
unsub-neg82.9%
Simplified82.9%
Final simplification94.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ alpha (+ beta 2.0)))) (/ (* (/ (+ 1.0 alpha) t_0) (/ (+ beta 1.0) 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 + alpha) / t_0) * ((beta + 1.0) / 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 + alpha) / t_0) * ((beta + 1.0d0) / 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 + alpha) / t_0) * ((beta + 1.0) / t_0)) / (beta + (alpha + 3.0));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return (((1.0 + alpha) / t_0) * ((beta + 1.0) / 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 + alpha) / t_0) * Float64(Float64(beta + 1.0) / 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 + alpha) / t_0) * ((beta + 1.0) / 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 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(beta + 1.0), $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 + \alpha}{t_0} \cdot \frac{\beta + 1}{t_0}}{\beta + \left(\alpha + 3\right)}
\end{array}
\end{array}
Initial program 96.4%
div-inv96.4%
+-commutative96.4%
associate-+l+96.4%
*-commutative96.4%
metadata-eval96.4%
+-commutative96.4%
metadata-eval96.4%
+-commutative96.4%
Applied egg-rr96.4%
associate-*l/96.4%
associate-*r/96.4%
*-rgt-identity96.4%
associate-+r+96.4%
*-rgt-identity96.4%
+-commutative96.4%
distribute-rgt1-in96.4%
distribute-lft-in96.4%
+-commutative96.4%
+-commutative96.4%
*-commutative96.4%
+-commutative96.4%
+-commutative96.4%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.7%
associate-/l*99.5%
associate-+r+99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
+-commutative99.5%
metadata-eval99.5%
Applied egg-rr99.5%
associate-*r/99.6%
*-rgt-identity99.6%
associate-/r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
Simplified99.8%
Final simplification99.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ alpha (+ beta 2.0)))) (/ (/ (* (+ beta 1.0) (/ (+ 1.0 alpha) t_0)) t_0) (+ beta (+ alpha 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return (((beta + 1.0) * ((1.0 + alpha) / t_0)) / 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 = (((beta + 1.0d0) * ((1.0d0 + alpha) / t_0)) / 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 (((beta + 1.0) * ((1.0 + alpha) / t_0)) / t_0) / (beta + (alpha + 3.0));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return (((beta + 1.0) * ((1.0 + alpha) / t_0)) / 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(beta + 1.0) * Float64(Float64(1.0 + alpha) / t_0)) / 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 = (((beta + 1.0) * ((1.0 + alpha) / t_0)) / 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[(beta + 1.0), $MachinePrecision] * N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $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{\left(\beta + 1\right) \cdot \frac{1 + \alpha}{t_0}}{t_0}}{\beta + \left(\alpha + 3\right)}
\end{array}
\end{array}
Initial program 96.4%
div-inv96.4%
+-commutative96.4%
associate-+l+96.4%
*-commutative96.4%
metadata-eval96.4%
+-commutative96.4%
metadata-eval96.4%
+-commutative96.4%
Applied egg-rr96.4%
associate-*l/96.4%
associate-*r/96.4%
*-rgt-identity96.4%
associate-+r+96.4%
*-rgt-identity96.4%
+-commutative96.4%
distribute-rgt1-in96.4%
distribute-lft-in96.4%
+-commutative96.4%
+-commutative96.4%
*-commutative96.4%
+-commutative96.4%
+-commutative96.4%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.7%
associate-/l*99.5%
associate-+r+99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
+-commutative99.5%
metadata-eval99.5%
Applied egg-rr99.5%
associate-*r/99.6%
*-rgt-identity99.6%
associate-/r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
Simplified99.8%
associate-*l/99.8%
+-commutative99.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
(let* ((t_0 (+ alpha (+ beta 2.0))))
(if (<= beta 9e+32)
(/ (* (+ beta 1.0) (+ 1.0 alpha)) (* t_0 (* (+ beta 2.0) (+ beta 3.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);
double tmp;
if (beta <= 9e+32) {
tmp = ((beta + 1.0) * (1.0 + alpha)) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / t_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) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 9d+32) then
tmp = ((beta + 1.0d0) * (1.0d0 + alpha)) / (t_0 * ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = ((1.0d0 + alpha) / t_0) / (beta + (alpha + 3.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 <= 9e+32) {
tmp = ((beta + 1.0) * (1.0 + alpha)) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / t_0) / (beta + (alpha + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 9e+32: tmp = ((beta + 1.0) * (1.0 + alpha)) / (t_0 * ((beta + 2.0) * (beta + 3.0))) else: tmp = ((1.0 + alpha) / t_0) / (beta + (alpha + 3.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 <= 9e+32) tmp = Float64(Float64(Float64(beta + 1.0) * Float64(1.0 + alpha)) / Float64(t_0 * Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(beta + Float64(alpha + 3.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 <= 9e+32)
tmp = ((beta + 1.0) * (1.0 + alpha)) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
else
tmp = ((1.0 + alpha) / t_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_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 9e+32], N[(N[(N[(beta + 1.0), $MachinePrecision] * N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $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)\\
\mathbf{if}\;\beta \leq 9 \cdot 10^{+32}:\\
\;\;\;\;\frac{\left(\beta + 1\right) \cdot \left(1 + \alpha\right)}{t_0 \cdot \left(\left(\beta + 2\right) \cdot \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0}}{\beta + \left(\alpha + 3\right)}\\
\end{array}
\end{array}
if beta < 9.0000000000000007e32Initial program 99.8%
associate-/l/99.6%
associate-/r*96.1%
associate-+l+96.1%
+-commutative96.1%
associate-+r+96.1%
associate-+l+96.1%
distribute-rgt1-in96.1%
*-rgt-identity96.1%
distribute-lft-out96.1%
*-commutative96.1%
metadata-eval96.1%
associate-+l+96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in alpha around 0 65.7%
if 9.0000000000000007e32 < beta Initial program 87.0%
div-inv87.0%
+-commutative87.0%
associate-+l+87.0%
*-commutative87.0%
metadata-eval87.0%
+-commutative87.0%
metadata-eval87.0%
+-commutative87.0%
Applied egg-rr87.0%
associate-*l/87.0%
associate-*r/87.0%
*-rgt-identity87.0%
associate-+r+87.0%
*-rgt-identity87.0%
+-commutative87.0%
distribute-rgt1-in87.0%
distribute-lft-in87.0%
+-commutative87.0%
+-commutative87.0%
*-commutative87.0%
+-commutative87.0%
+-commutative87.0%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.7%
associate-/l*98.9%
associate-+r+98.9%
+-commutative98.9%
associate-+r+98.9%
+-commutative98.9%
metadata-eval98.9%
associate-+l+98.9%
+-commutative98.9%
metadata-eval98.9%
Applied egg-rr98.9%
associate-*r/99.0%
*-rgt-identity99.0%
associate-/r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
Simplified99.8%
associate-*l/99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in beta around inf 86.2%
Final simplification71.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))))
(if (<= beta 9e+32)
(/ (* (+ beta 1.0) (+ 1.0 alpha)) (* t_0 (* (+ beta 2.0) (+ beta 3.0))))
(/
(* (/ (+ beta 1.0) t_0) (/ (+ 1.0 alpha) beta))
(+ beta (+ alpha 3.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 9e+32) {
tmp = ((beta + 1.0) * (1.0 + alpha)) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = (((beta + 1.0) / t_0) * ((1.0 + alpha) / beta)) / (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) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 9d+32) then
tmp = ((beta + 1.0d0) * (1.0d0 + alpha)) / (t_0 * ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = (((beta + 1.0d0) / t_0) * ((1.0d0 + alpha) / beta)) / (beta + (alpha + 3.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 <= 9e+32) {
tmp = ((beta + 1.0) * (1.0 + alpha)) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = (((beta + 1.0) / t_0) * ((1.0 + alpha) / beta)) / (beta + (alpha + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 9e+32: tmp = ((beta + 1.0) * (1.0 + alpha)) / (t_0 * ((beta + 2.0) * (beta + 3.0))) else: tmp = (((beta + 1.0) / t_0) * ((1.0 + alpha) / beta)) / (beta + (alpha + 3.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 <= 9e+32) tmp = Float64(Float64(Float64(beta + 1.0) * Float64(1.0 + alpha)) / Float64(t_0 * Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(Float64(beta + 1.0) / t_0) * Float64(Float64(1.0 + alpha) / beta)) / Float64(beta + Float64(alpha + 3.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 <= 9e+32)
tmp = ((beta + 1.0) * (1.0 + alpha)) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
else
tmp = (((beta + 1.0) / t_0) * ((1.0 + alpha) / beta)) / (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_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 9e+32], N[(N[(N[(beta + 1.0), $MachinePrecision] * N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(beta + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(1.0 + alpha), $MachinePrecision] / beta), $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)\\
\mathbf{if}\;\beta \leq 9 \cdot 10^{+32}:\\
\;\;\;\;\frac{\left(\beta + 1\right) \cdot \left(1 + \alpha\right)}{t_0 \cdot \left(\left(\beta + 2\right) \cdot \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\beta + 1}{t_0} \cdot \frac{1 + \alpha}{\beta}}{\beta + \left(\alpha + 3\right)}\\
\end{array}
\end{array}
if beta < 9.0000000000000007e32Initial program 99.8%
associate-/l/99.6%
associate-/r*96.1%
associate-+l+96.1%
+-commutative96.1%
associate-+r+96.1%
associate-+l+96.1%
distribute-rgt1-in96.1%
*-rgt-identity96.1%
distribute-lft-out96.1%
*-commutative96.1%
metadata-eval96.1%
associate-+l+96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in alpha around 0 65.7%
if 9.0000000000000007e32 < beta Initial program 87.0%
div-inv87.0%
+-commutative87.0%
associate-+l+87.0%
*-commutative87.0%
metadata-eval87.0%
+-commutative87.0%
metadata-eval87.0%
+-commutative87.0%
Applied egg-rr87.0%
associate-*l/87.0%
associate-*r/87.0%
*-rgt-identity87.0%
associate-+r+87.0%
*-rgt-identity87.0%
+-commutative87.0%
distribute-rgt1-in87.0%
distribute-lft-in87.0%
+-commutative87.0%
+-commutative87.0%
*-commutative87.0%
+-commutative87.0%
+-commutative87.0%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.7%
associate-/l*98.9%
associate-+r+98.9%
+-commutative98.9%
associate-+r+98.9%
+-commutative98.9%
metadata-eval98.9%
associate-+l+98.9%
+-commutative98.9%
metadata-eval98.9%
Applied egg-rr98.9%
associate-*r/99.0%
*-rgt-identity99.0%
associate-/r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in beta around inf 86.2%
Final simplification71.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ beta (+ alpha 3.0))) (t_1 (+ alpha (+ beta 2.0))))
(if (<= beta 1.42e+16)
(/ (/ (* (+ beta 1.0) (/ 1.0 (+ beta 2.0))) t_1) t_0)
(/ (* (/ (+ beta 1.0) t_1) (/ (+ 1.0 alpha) beta)) t_0))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = beta + (alpha + 3.0);
double t_1 = alpha + (beta + 2.0);
double tmp;
if (beta <= 1.42e+16) {
tmp = (((beta + 1.0) * (1.0 / (beta + 2.0))) / t_1) / t_0;
} else {
tmp = (((beta + 1.0) / t_1) * ((1.0 + alpha) / beta)) / 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 = beta + (alpha + 3.0d0)
t_1 = alpha + (beta + 2.0d0)
if (beta <= 1.42d+16) then
tmp = (((beta + 1.0d0) * (1.0d0 / (beta + 2.0d0))) / t_1) / t_0
else
tmp = (((beta + 1.0d0) / t_1) * ((1.0d0 + alpha) / beta)) / t_0
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = beta + (alpha + 3.0);
double t_1 = alpha + (beta + 2.0);
double tmp;
if (beta <= 1.42e+16) {
tmp = (((beta + 1.0) * (1.0 / (beta + 2.0))) / t_1) / t_0;
} else {
tmp = (((beta + 1.0) / t_1) * ((1.0 + alpha) / beta)) / t_0;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = beta + (alpha + 3.0) t_1 = alpha + (beta + 2.0) tmp = 0 if beta <= 1.42e+16: tmp = (((beta + 1.0) * (1.0 / (beta + 2.0))) / t_1) / t_0 else: tmp = (((beta + 1.0) / t_1) * ((1.0 + alpha) / beta)) / t_0 return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(beta + Float64(alpha + 3.0)) t_1 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 1.42e+16) tmp = Float64(Float64(Float64(Float64(beta + 1.0) * Float64(1.0 / Float64(beta + 2.0))) / t_1) / t_0); else tmp = Float64(Float64(Float64(Float64(beta + 1.0) / t_1) * Float64(Float64(1.0 + alpha) / beta)) / t_0); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = beta + (alpha + 3.0);
t_1 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 1.42e+16)
tmp = (((beta + 1.0) * (1.0 / (beta + 2.0))) / t_1) / t_0;
else
tmp = (((beta + 1.0) / t_1) * ((1.0 + alpha) / beta)) / 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[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 1.42e+16], N[(N[(N[(N[(beta + 1.0), $MachinePrecision] * N[(1.0 / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[(N[(beta + 1.0), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \beta + \left(\alpha + 3\right)\\
t_1 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 1.42 \cdot 10^{+16}:\\
\;\;\;\;\frac{\frac{\left(\beta + 1\right) \cdot \frac{1}{\beta + 2}}{t_1}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\beta + 1}{t_1} \cdot \frac{1 + \alpha}{\beta}}{t_0}\\
\end{array}
\end{array}
if beta < 1.42e16Initial program 99.8%
div-inv99.8%
+-commutative99.8%
associate-+l+99.8%
*-commutative99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-*l/99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-+r+99.8%
*-rgt-identity99.8%
+-commutative99.8%
distribute-rgt1-in99.8%
distribute-lft-in99.8%
+-commutative99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.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%
div-inv99.8%
associate-/l*99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
+-commutative99.8%
metadata-eval99.8%
Applied egg-rr99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-/r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
Simplified99.8%
associate-*l/99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in alpha around 0 86.2%
if 1.42e16 < beta Initial program 87.7%
div-inv87.7%
+-commutative87.7%
associate-+l+87.7%
*-commutative87.7%
metadata-eval87.7%
+-commutative87.7%
metadata-eval87.7%
+-commutative87.7%
Applied egg-rr87.7%
associate-*l/87.7%
associate-*r/87.7%
*-rgt-identity87.7%
associate-+r+87.7%
*-rgt-identity87.7%
+-commutative87.7%
distribute-rgt1-in87.7%
distribute-lft-in87.7%
+-commutative87.7%
+-commutative87.7%
*-commutative87.7%
+-commutative87.7%
+-commutative87.7%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.7%
associate-/l*99.0%
associate-+r+99.0%
+-commutative99.0%
associate-+r+99.0%
+-commutative99.0%
metadata-eval99.0%
associate-+l+99.0%
+-commutative99.0%
metadata-eval99.0%
Applied egg-rr99.0%
associate-*r/99.1%
*-rgt-identity99.1%
associate-/r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in beta around inf 84.4%
Final simplification85.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 9e+32)
(/
(* (+ beta 1.0) (+ 1.0 alpha))
(* (+ beta 2.0) (* (+ beta 2.0) (+ beta 3.0))))
(/ (/ (+ 1.0 alpha) (+ alpha (+ beta 2.0))) (+ beta (+ alpha 3.0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 9e+32) {
tmp = ((beta + 1.0) * (1.0 + alpha)) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 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 <= 9d+32) then
tmp = ((beta + 1.0d0) * (1.0d0 + alpha)) / ((beta + 2.0d0) * ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = ((1.0d0 + alpha) / (alpha + (beta + 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 <= 9e+32) {
tmp = ((beta + 1.0) * (1.0 + alpha)) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / (beta + (alpha + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 9e+32: tmp = ((beta + 1.0) * (1.0 + alpha)) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0))) else: tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / (beta + (alpha + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 9e+32) tmp = Float64(Float64(Float64(beta + 1.0) * Float64(1.0 + alpha)) / Float64(Float64(beta + 2.0) * Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 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 <= 9e+32)
tmp = ((beta + 1.0) * (1.0 + alpha)) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0)));
else
tmp = ((1.0 + alpha) / (alpha + (beta + 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, 9e+32], N[(N[(N[(beta + 1.0), $MachinePrecision] * N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 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 9 \cdot 10^{+32}:\\
\;\;\;\;\frac{\left(\beta + 1\right) \cdot \left(1 + \alpha\right)}{\left(\beta + 2\right) \cdot \left(\left(\beta + 2\right) \cdot \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(\beta + 2\right)}}{\beta + \left(\alpha + 3\right)}\\
\end{array}
\end{array}
if beta < 9.0000000000000007e32Initial program 99.8%
associate-/l/99.6%
associate-/r*96.1%
associate-+l+96.1%
+-commutative96.1%
associate-+r+96.1%
associate-+l+96.1%
distribute-rgt1-in96.1%
*-rgt-identity96.1%
distribute-lft-out96.1%
*-commutative96.1%
metadata-eval96.1%
associate-+l+96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in alpha around 0 65.7%
Taylor expanded in alpha around 0 65.2%
if 9.0000000000000007e32 < beta Initial program 87.0%
div-inv87.0%
+-commutative87.0%
associate-+l+87.0%
*-commutative87.0%
metadata-eval87.0%
+-commutative87.0%
metadata-eval87.0%
+-commutative87.0%
Applied egg-rr87.0%
associate-*l/87.0%
associate-*r/87.0%
*-rgt-identity87.0%
associate-+r+87.0%
*-rgt-identity87.0%
+-commutative87.0%
distribute-rgt1-in87.0%
distribute-lft-in87.0%
+-commutative87.0%
+-commutative87.0%
*-commutative87.0%
+-commutative87.0%
+-commutative87.0%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.7%
associate-/l*98.9%
associate-+r+98.9%
+-commutative98.9%
associate-+r+98.9%
+-commutative98.9%
metadata-eval98.9%
associate-+l+98.9%
+-commutative98.9%
metadata-eval98.9%
Applied egg-rr98.9%
associate-*r/99.0%
*-rgt-identity99.0%
associate-/r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
Simplified99.8%
associate-*l/99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in beta around inf 86.2%
Final simplification70.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.55) (* (/ 1.0 (+ alpha 3.0)) (/ (+ 1.0 alpha) (+ 4.0 (* alpha (+ alpha 4.0))))) (/ (/ (+ 1.0 alpha) (+ alpha (+ beta 2.0))) (+ beta (+ alpha 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.55) {
tmp = (1.0 / (alpha + 3.0)) * ((1.0 + alpha) / (4.0 + (alpha * (alpha + 4.0))));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 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.55d0) then
tmp = (1.0d0 / (alpha + 3.0d0)) * ((1.0d0 + alpha) / (4.0d0 + (alpha * (alpha + 4.0d0))))
else
tmp = ((1.0d0 + alpha) / (alpha + (beta + 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.55) {
tmp = (1.0 / (alpha + 3.0)) * ((1.0 + alpha) / (4.0 + (alpha * (alpha + 4.0))));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / (beta + (alpha + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.55: tmp = (1.0 / (alpha + 3.0)) * ((1.0 + alpha) / (4.0 + (alpha * (alpha + 4.0)))) else: tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / (beta + (alpha + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.55) tmp = Float64(Float64(1.0 / Float64(alpha + 3.0)) * Float64(Float64(1.0 + alpha) / Float64(4.0 + Float64(alpha * Float64(alpha + 4.0))))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 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.55)
tmp = (1.0 / (alpha + 3.0)) * ((1.0 + alpha) / (4.0 + (alpha * (alpha + 4.0))));
else
tmp = ((1.0 + alpha) / (alpha + (beta + 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.55], N[(N[(1.0 / N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + alpha), $MachinePrecision] / N[(4.0 + N[(alpha * N[(alpha + 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 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.55:\\
\;\;\;\;\frac{1}{\alpha + 3} \cdot \frac{1 + \alpha}{4 + \alpha \cdot \left(\alpha + 4\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(\beta + 2\right)}}{\beta + \left(\alpha + 3\right)}\\
\end{array}
\end{array}
if beta < 1.55000000000000004Initial program 99.8%
associate-/l/99.5%
associate-/l/96.5%
associate-+l+96.5%
+-commutative96.5%
associate-+r+96.5%
associate-+l+96.5%
distribute-rgt1-in96.5%
*-rgt-identity96.5%
distribute-lft-out96.5%
+-commutative96.5%
times-frac99.5%
Simplified99.5%
distribute-lft-in99.5%
associate-+r+99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in beta around 0 99.3%
Taylor expanded in alpha around 0 99.4%
unpow299.4%
distribute-rgt-out99.4%
Simplified99.4%
Taylor expanded in beta around 0 99.0%
if 1.55000000000000004 < beta Initial program 88.0%
div-inv88.1%
+-commutative88.1%
associate-+l+88.1%
*-commutative88.1%
metadata-eval88.1%
+-commutative88.1%
metadata-eval88.1%
+-commutative88.1%
Applied egg-rr88.1%
associate-*l/88.1%
associate-*r/88.0%
*-rgt-identity88.0%
associate-+r+88.0%
*-rgt-identity88.0%
+-commutative88.0%
distribute-rgt1-in88.0%
distribute-lft-in88.0%
+-commutative88.0%
+-commutative88.0%
*-commutative88.0%
+-commutative88.0%
+-commutative88.0%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.7%
associate-/l*99.0%
associate-+r+99.0%
+-commutative99.0%
associate-+r+99.0%
+-commutative99.0%
metadata-eval99.0%
associate-+l+99.0%
+-commutative99.0%
metadata-eval99.0%
Applied egg-rr99.0%
associate-*r/99.1%
*-rgt-identity99.1%
associate-/r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
Simplified99.8%
associate-*l/99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in beta around inf 82.8%
Final simplification94.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.8) (/ (/ (+ 1.0 alpha) (+ alpha 3.0)) (+ 4.0 (* alpha (+ alpha 4.0)))) (+ (/ 1.0 (* beta beta)) (/ alpha (* beta beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.8) {
tmp = ((1.0 + alpha) / (alpha + 3.0)) / (4.0 + (alpha * (alpha + 4.0)));
} else {
tmp = (1.0 / (beta * beta)) + (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 <= 4.8d0) then
tmp = ((1.0d0 + alpha) / (alpha + 3.0d0)) / (4.0d0 + (alpha * (alpha + 4.0d0)))
else
tmp = (1.0d0 / (beta * beta)) + (alpha / (beta * beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 4.8) {
tmp = ((1.0 + alpha) / (alpha + 3.0)) / (4.0 + (alpha * (alpha + 4.0)));
} else {
tmp = (1.0 / (beta * beta)) + (alpha / (beta * beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.8: tmp = ((1.0 + alpha) / (alpha + 3.0)) / (4.0 + (alpha * (alpha + 4.0))) else: tmp = (1.0 / (beta * beta)) + (alpha / (beta * beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.8) tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + 3.0)) / Float64(4.0 + Float64(alpha * Float64(alpha + 4.0)))); else tmp = Float64(Float64(1.0 / Float64(beta * beta)) + Float64(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 <= 4.8)
tmp = ((1.0 + alpha) / (alpha + 3.0)) / (4.0 + (alpha * (alpha + 4.0)));
else
tmp = (1.0 / (beta * beta)) + (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, 4.8], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision] / N[(4.0 + N[(alpha * N[(alpha + 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(beta * beta), $MachinePrecision]), $MachinePrecision] + N[(alpha / N[(beta * beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4.8:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + 3}}{4 + \alpha \cdot \left(\alpha + 4\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \beta} + \frac{\alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 4.79999999999999982Initial program 99.8%
associate-/l/99.5%
associate-/l/96.5%
associate-+l+96.5%
+-commutative96.5%
associate-+r+96.5%
associate-+l+96.5%
distribute-rgt1-in96.5%
*-rgt-identity96.5%
distribute-lft-out96.5%
+-commutative96.5%
times-frac99.5%
Simplified99.5%
distribute-lft-in99.5%
associate-+r+99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in beta around 0 99.3%
Taylor expanded in alpha around 0 99.4%
unpow299.4%
distribute-rgt-out99.4%
Simplified99.4%
Taylor expanded in beta around 0 96.1%
associate-/r*99.0%
+-commutative99.0%
+-commutative99.0%
*-commutative99.0%
Simplified99.0%
if 4.79999999999999982 < beta Initial program 88.0%
associate-/l/84.7%
associate-+l+84.7%
+-commutative84.7%
associate-+r+84.7%
associate-+l+84.7%
distribute-rgt1-in84.7%
*-rgt-identity84.7%
distribute-lft-out84.7%
+-commutative84.7%
associate-*l/90.6%
*-commutative90.6%
associate-*r/88.8%
Simplified88.8%
Taylor expanded in beta around inf 80.2%
unpow280.2%
Simplified80.2%
Taylor expanded in alpha around 0 80.2%
unpow280.2%
unpow280.2%
Simplified80.2%
Final simplification93.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.8) (/ (/ (+ 1.0 alpha) (+ alpha 3.0)) (+ 4.0 (* alpha (+ alpha 4.0)))) (/ (/ (+ 1.0 alpha) (+ alpha (+ beta 2.0))) (+ beta (+ alpha 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.8) {
tmp = ((1.0 + alpha) / (alpha + 3.0)) / (4.0 + (alpha * (alpha + 4.0)));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 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.8d0) then
tmp = ((1.0d0 + alpha) / (alpha + 3.0d0)) / (4.0d0 + (alpha * (alpha + 4.0d0)))
else
tmp = ((1.0d0 + alpha) / (alpha + (beta + 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.8) {
tmp = ((1.0 + alpha) / (alpha + 3.0)) / (4.0 + (alpha * (alpha + 4.0)));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / (beta + (alpha + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.8: tmp = ((1.0 + alpha) / (alpha + 3.0)) / (4.0 + (alpha * (alpha + 4.0))) else: tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / (beta + (alpha + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.8) tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + 3.0)) / Float64(4.0 + Float64(alpha * Float64(alpha + 4.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 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.8)
tmp = ((1.0 + alpha) / (alpha + 3.0)) / (4.0 + (alpha * (alpha + 4.0)));
else
tmp = ((1.0 + alpha) / (alpha + (beta + 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.8], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision] / N[(4.0 + N[(alpha * N[(alpha + 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 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.8:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + 3}}{4 + \alpha \cdot \left(\alpha + 4\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(\beta + 2\right)}}{\beta + \left(\alpha + 3\right)}\\
\end{array}
\end{array}
if beta < 1.80000000000000004Initial program 99.8%
associate-/l/99.5%
associate-/l/96.5%
associate-+l+96.5%
+-commutative96.5%
associate-+r+96.5%
associate-+l+96.5%
distribute-rgt1-in96.5%
*-rgt-identity96.5%
distribute-lft-out96.5%
+-commutative96.5%
times-frac99.5%
Simplified99.5%
distribute-lft-in99.5%
associate-+r+99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in beta around 0 99.3%
Taylor expanded in alpha around 0 99.4%
unpow299.4%
distribute-rgt-out99.4%
Simplified99.4%
Taylor expanded in beta around 0 96.1%
associate-/r*99.0%
+-commutative99.0%
+-commutative99.0%
*-commutative99.0%
Simplified99.0%
if 1.80000000000000004 < beta Initial program 88.0%
div-inv88.1%
+-commutative88.1%
associate-+l+88.1%
*-commutative88.1%
metadata-eval88.1%
+-commutative88.1%
metadata-eval88.1%
+-commutative88.1%
Applied egg-rr88.1%
associate-*l/88.1%
associate-*r/88.0%
*-rgt-identity88.0%
associate-+r+88.0%
*-rgt-identity88.0%
+-commutative88.0%
distribute-rgt1-in88.0%
distribute-lft-in88.0%
+-commutative88.0%
+-commutative88.0%
*-commutative88.0%
+-commutative88.0%
+-commutative88.0%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.7%
associate-/l*99.0%
associate-+r+99.0%
+-commutative99.0%
associate-+r+99.0%
+-commutative99.0%
metadata-eval99.0%
associate-+l+99.0%
+-commutative99.0%
metadata-eval99.0%
Applied egg-rr99.0%
associate-*r/99.1%
*-rgt-identity99.1%
associate-/r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
Simplified99.8%
associate-*l/99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in beta around inf 82.8%
Final simplification94.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.5) (* (/ (+ beta 1.0) (+ alpha (+ beta 3.0))) 0.25) (/ (+ 1.0 alpha) (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = ((beta + 1.0) / (alpha + (beta + 3.0))) * 0.25;
} 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 <= 2.5d0) then
tmp = ((beta + 1.0d0) / (alpha + (beta + 3.0d0))) * 0.25d0
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 <= 2.5) {
tmp = ((beta + 1.0) / (alpha + (beta + 3.0))) * 0.25;
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.5: tmp = ((beta + 1.0) / (alpha + (beta + 3.0))) * 0.25 else: tmp = (1.0 + alpha) / (beta * beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.5) tmp = Float64(Float64(Float64(beta + 1.0) / Float64(alpha + Float64(beta + 3.0))) * 0.25); 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 <= 2.5)
tmp = ((beta + 1.0) / (alpha + (beta + 3.0))) * 0.25;
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, 2.5], N[(N[(N[(beta + 1.0), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision], 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 2.5:\\
\;\;\;\;\frac{\beta + 1}{\alpha + \left(\beta + 3\right)} \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 2.5Initial program 99.8%
associate-/l/99.5%
associate-/l/96.5%
associate-+l+96.5%
+-commutative96.5%
associate-+r+96.5%
associate-+l+96.5%
distribute-rgt1-in96.5%
*-rgt-identity96.5%
distribute-lft-out96.5%
+-commutative96.5%
times-frac99.5%
Simplified99.5%
distribute-lft-in99.5%
associate-+r+99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in beta around 0 99.3%
Taylor expanded in alpha around 0 67.6%
if 2.5 < beta Initial program 88.0%
associate-/l/84.7%
associate-+l+84.7%
+-commutative84.7%
associate-+r+84.7%
associate-+l+84.7%
distribute-rgt1-in84.7%
*-rgt-identity84.7%
distribute-lft-out84.7%
+-commutative84.7%
associate-*l/90.6%
*-commutative90.6%
associate-*r/88.8%
Simplified88.8%
Taylor expanded in beta around inf 80.2%
unpow280.2%
Simplified80.2%
Final simplification71.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.5) (* (/ (+ beta 1.0) (+ alpha (+ beta 3.0))) 0.25) (+ (/ 1.0 (* beta beta)) (/ alpha (* beta beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = ((beta + 1.0) / (alpha + (beta + 3.0))) * 0.25;
} else {
tmp = (1.0 / (beta * beta)) + (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 <= 2.5d0) then
tmp = ((beta + 1.0d0) / (alpha + (beta + 3.0d0))) * 0.25d0
else
tmp = (1.0d0 / (beta * beta)) + (alpha / (beta * beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = ((beta + 1.0) / (alpha + (beta + 3.0))) * 0.25;
} else {
tmp = (1.0 / (beta * beta)) + (alpha / (beta * beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.5: tmp = ((beta + 1.0) / (alpha + (beta + 3.0))) * 0.25 else: tmp = (1.0 / (beta * beta)) + (alpha / (beta * beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.5) tmp = Float64(Float64(Float64(beta + 1.0) / Float64(alpha + Float64(beta + 3.0))) * 0.25); else tmp = Float64(Float64(1.0 / Float64(beta * beta)) + Float64(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 <= 2.5)
tmp = ((beta + 1.0) / (alpha + (beta + 3.0))) * 0.25;
else
tmp = (1.0 / (beta * beta)) + (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, 2.5], N[(N[(N[(beta + 1.0), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision], N[(N[(1.0 / N[(beta * beta), $MachinePrecision]), $MachinePrecision] + N[(alpha / N[(beta * beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.5:\\
\;\;\;\;\frac{\beta + 1}{\alpha + \left(\beta + 3\right)} \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \beta} + \frac{\alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 2.5Initial program 99.8%
associate-/l/99.5%
associate-/l/96.5%
associate-+l+96.5%
+-commutative96.5%
associate-+r+96.5%
associate-+l+96.5%
distribute-rgt1-in96.5%
*-rgt-identity96.5%
distribute-lft-out96.5%
+-commutative96.5%
times-frac99.5%
Simplified99.5%
distribute-lft-in99.5%
associate-+r+99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in beta around 0 99.3%
Taylor expanded in alpha around 0 67.6%
if 2.5 < beta Initial program 88.0%
associate-/l/84.7%
associate-+l+84.7%
+-commutative84.7%
associate-+r+84.7%
associate-+l+84.7%
distribute-rgt1-in84.7%
*-rgt-identity84.7%
distribute-lft-out84.7%
+-commutative84.7%
associate-*l/90.6%
*-commutative90.6%
associate-*r/88.8%
Simplified88.8%
Taylor expanded in beta around inf 80.2%
unpow280.2%
Simplified80.2%
Taylor expanded in alpha around 0 80.2%
unpow280.2%
unpow280.2%
Simplified80.2%
Final simplification71.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.5) (* 0.25 (/ (+ beta 1.0) (+ beta 3.0))) (/ (+ 1.0 alpha) (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = 0.25 * ((beta + 1.0) / (beta + 3.0));
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.5d0) then
tmp = 0.25d0 * ((beta + 1.0d0) / (beta + 3.0d0))
else
tmp = (1.0d0 + alpha) / (beta * beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = 0.25 * ((beta + 1.0) / (beta + 3.0));
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.5: tmp = 0.25 * ((beta + 1.0) / (beta + 3.0)) else: tmp = (1.0 + alpha) / (beta * beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.5) tmp = Float64(0.25 * Float64(Float64(beta + 1.0) / Float64(beta + 3.0))); 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 <= 2.5)
tmp = 0.25 * ((beta + 1.0) / (beta + 3.0));
else
tmp = (1.0 + alpha) / (beta * beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.5], N[(0.25 * N[(N[(beta + 1.0), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 2.5:\\
\;\;\;\;0.25 \cdot \frac{\beta + 1}{\beta + 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 2.5Initial program 99.8%
associate-/l/99.5%
associate-/l/96.5%
associate-+l+96.5%
+-commutative96.5%
associate-+r+96.5%
associate-+l+96.5%
distribute-rgt1-in96.5%
*-rgt-identity96.5%
distribute-lft-out96.5%
+-commutative96.5%
times-frac99.5%
Simplified99.5%
distribute-lft-in99.5%
associate-+r+99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in beta around 0 99.3%
Taylor expanded in alpha around 0 99.4%
unpow299.4%
distribute-rgt-out99.4%
Simplified99.4%
Taylor expanded in alpha around 0 66.0%
if 2.5 < beta Initial program 88.0%
associate-/l/84.7%
associate-+l+84.7%
+-commutative84.7%
associate-+r+84.7%
associate-+l+84.7%
distribute-rgt1-in84.7%
*-rgt-identity84.7%
distribute-lft-out84.7%
+-commutative84.7%
associate-*l/90.6%
*-commutative90.6%
associate-*r/88.8%
Simplified88.8%
Taylor expanded in beta around inf 80.2%
unpow280.2%
Simplified80.2%
Final simplification70.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.7) (* 0.16666666666666666 (/ (+ 1.0 alpha) (+ alpha 2.0))) (/ (+ 1.0 alpha) (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.7) {
tmp = 0.16666666666666666 * ((1.0 + alpha) / (alpha + 2.0));
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.7d0) then
tmp = 0.16666666666666666d0 * ((1.0d0 + alpha) / (alpha + 2.0d0))
else
tmp = (1.0d0 + alpha) / (beta * beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.7) {
tmp = 0.16666666666666666 * ((1.0 + alpha) / (alpha + 2.0));
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.7: tmp = 0.16666666666666666 * ((1.0 + alpha) / (alpha + 2.0)) else: tmp = (1.0 + alpha) / (beta * beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.7) tmp = Float64(0.16666666666666666 * Float64(Float64(1.0 + alpha) / Float64(alpha + 2.0))); 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.7)
tmp = 0.16666666666666666 * ((1.0 + alpha) / (alpha + 2.0));
else
tmp = (1.0 + alpha) / (beta * beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.7], N[(0.16666666666666666 * N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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.7:\\
\;\;\;\;0.16666666666666666 \cdot \frac{1 + \alpha}{\alpha + 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 3.7000000000000002Initial program 99.8%
associate-/l/99.6%
associate-/r*96.5%
associate-+l+96.5%
+-commutative96.5%
associate-+r+96.5%
associate-+l+96.5%
distribute-rgt1-in96.5%
*-rgt-identity96.5%
distribute-lft-out96.5%
*-commutative96.5%
metadata-eval96.5%
associate-+l+96.5%
+-commutative96.5%
Simplified96.5%
Taylor expanded in alpha around 0 66.1%
Taylor expanded in beta around 0 66.0%
*-commutative66.0%
+-commutative66.0%
Simplified66.0%
if 3.7000000000000002 < beta Initial program 88.0%
associate-/l/84.7%
associate-+l+84.7%
+-commutative84.7%
associate-+r+84.7%
associate-+l+84.7%
distribute-rgt1-in84.7%
*-rgt-identity84.7%
distribute-lft-out84.7%
+-commutative84.7%
associate-*l/90.6%
*-commutative90.6%
associate-*r/88.8%
Simplified88.8%
Taylor expanded in beta around inf 80.2%
unpow280.2%
Simplified80.2%
Final simplification70.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.6) (/ (* (+ 1.0 alpha) 0.16666666666666666) (+ alpha 2.0)) (/ (+ 1.0 alpha) (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.6) {
tmp = ((1.0 + alpha) * 0.16666666666666666) / (alpha + 2.0);
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.6d0) then
tmp = ((1.0d0 + alpha) * 0.16666666666666666d0) / (alpha + 2.0d0)
else
tmp = (1.0d0 + alpha) / (beta * beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.6) {
tmp = ((1.0 + alpha) * 0.16666666666666666) / (alpha + 2.0);
} 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 = ((1.0 + alpha) * 0.16666666666666666) / (alpha + 2.0) 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 = Float64(Float64(Float64(1.0 + alpha) * 0.16666666666666666) / Float64(alpha + 2.0)); 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 = ((1.0 + alpha) * 0.16666666666666666) / (alpha + 2.0);
else
tmp = (1.0 + alpha) / (beta * beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.6], N[(N[(N[(1.0 + alpha), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision], 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:\\
\;\;\;\;\frac{\left(1 + \alpha\right) \cdot 0.16666666666666666}{\alpha + 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 3.60000000000000009Initial program 99.8%
associate-/l/99.6%
associate-/r*96.5%
associate-+l+96.5%
+-commutative96.5%
associate-+r+96.5%
associate-+l+96.5%
distribute-rgt1-in96.5%
*-rgt-identity96.5%
distribute-lft-out96.5%
*-commutative96.5%
metadata-eval96.5%
associate-+l+96.5%
+-commutative96.5%
Simplified96.5%
Taylor expanded in alpha around 0 66.1%
Taylor expanded in beta around 0 66.1%
*-commutative66.1%
Simplified66.1%
Taylor expanded in beta around 0 66.0%
associate-*r/66.0%
+-commutative66.0%
Simplified66.0%
if 3.60000000000000009 < beta Initial program 88.0%
associate-/l/84.7%
associate-+l+84.7%
+-commutative84.7%
associate-+r+84.7%
associate-+l+84.7%
distribute-rgt1-in84.7%
*-rgt-identity84.7%
distribute-lft-out84.7%
+-commutative84.7%
associate-*l/90.6%
*-commutative90.6%
associate-*r/88.8%
Simplified88.8%
Taylor expanded in beta around inf 80.2%
unpow280.2%
Simplified80.2%
Final simplification70.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= alpha 4.1e+15) (/ 1.0 (* beta beta)) (/ alpha (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (alpha <= 4.1e+15) {
tmp = 1.0 / (beta * beta);
} else {
tmp = alpha / (beta * beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (alpha <= 4.1d+15) then
tmp = 1.0d0 / (beta * beta)
else
tmp = alpha / (beta * beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (alpha <= 4.1e+15) {
tmp = 1.0 / (beta * beta);
} else {
tmp = alpha / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if alpha <= 4.1e+15: tmp = 1.0 / (beta * beta) else: tmp = alpha / (beta * beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (alpha <= 4.1e+15) tmp = Float64(1.0 / Float64(beta * beta)); else tmp = Float64(alpha / Float64(beta * beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (alpha <= 4.1e+15)
tmp = 1.0 / (beta * beta);
else
tmp = alpha / (beta * beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[alpha, 4.1e+15], N[(1.0 / N[(beta * beta), $MachinePrecision]), $MachinePrecision], N[(alpha / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\alpha \leq 4.1 \cdot 10^{+15}:\\
\;\;\;\;\frac{1}{\beta \cdot \beta}\\
\mathbf{else}:\\
\;\;\;\;\frac{\alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if alpha < 4.1e15Initial 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/99.5%
Simplified99.5%
Taylor expanded in beta around inf 32.3%
unpow232.3%
Simplified32.3%
Taylor expanded in alpha around 0 32.3%
unpow232.3%
Simplified32.3%
if 4.1e15 < alpha Initial program 88.7%
associate-/l/85.6%
associate-+l+85.6%
+-commutative85.6%
associate-+r+85.6%
associate-+l+85.6%
distribute-rgt1-in85.6%
*-rgt-identity85.6%
distribute-lft-out85.6%
+-commutative85.6%
associate-*l/91.1%
*-commutative91.1%
associate-*r/83.4%
Simplified83.4%
Taylor expanded in beta around inf 11.8%
unpow211.8%
Simplified11.8%
Taylor expanded in alpha around inf 11.8%
unpow211.8%
Simplified11.8%
Final simplification25.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ (+ 1.0 alpha) (* beta beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
return (1.0 + alpha) / (beta * beta);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = (1.0d0 + alpha) / (beta * beta)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return (1.0 + alpha) / (beta * beta);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return (1.0 + alpha) / (beta * beta)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(1.0 + alpha) / Float64(beta * beta)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = (1.0 + alpha) / (beta * beta);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta * beta), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{1 + \alpha}{\beta \cdot \beta}
\end{array}
Initial program 96.4%
associate-/l/95.2%
associate-+l+95.2%
+-commutative95.2%
associate-+r+95.2%
associate-+l+95.2%
distribute-rgt1-in95.2%
*-rgt-identity95.2%
distribute-lft-out95.2%
+-commutative95.2%
associate-*l/96.9%
*-commutative96.9%
associate-*r/94.5%
Simplified94.5%
Taylor expanded in beta around inf 25.9%
unpow225.9%
Simplified25.9%
Final simplification25.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.5 (* beta beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.5 / (beta * beta);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.5d0 / (beta * beta)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.5 / (beta * beta);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.5 / (beta * beta)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.5 / Float64(beta * beta)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.5 / (beta * beta);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.5 / N[(beta * beta), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.5}{\beta \cdot \beta}
\end{array}
Initial program 96.4%
associate-/l/95.2%
associate-+l+95.2%
+-commutative95.2%
associate-+r+95.2%
associate-+l+95.2%
distribute-rgt1-in95.2%
*-rgt-identity95.2%
distribute-lft-out95.2%
+-commutative95.2%
associate-*r/96.9%
associate-*r/94.6%
Simplified94.6%
Taylor expanded in beta around inf 23.7%
unpow223.7%
Simplified23.7%
Taylor expanded in alpha around 0 22.9%
+-commutative22.9%
unpow222.9%
+-commutative22.9%
Simplified22.9%
Taylor expanded in beta around 0 18.9%
unpow218.9%
Simplified18.9%
Final simplification18.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 1.0 (* beta beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
return 1.0 / (beta * beta);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 1.0d0 / (beta * beta)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 1.0 / (beta * beta);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 1.0 / (beta * beta)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(1.0 / Float64(beta * beta)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 1.0 / (beta * beta);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(1.0 / N[(beta * beta), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{1}{\beta \cdot \beta}
\end{array}
Initial program 96.4%
associate-/l/95.2%
associate-+l+95.2%
+-commutative95.2%
associate-+r+95.2%
associate-+l+95.2%
distribute-rgt1-in95.2%
*-rgt-identity95.2%
distribute-lft-out95.2%
+-commutative95.2%
associate-*l/96.9%
*-commutative96.9%
associate-*r/94.5%
Simplified94.5%
Taylor expanded in beta around inf 25.9%
unpow225.9%
Simplified25.9%
Taylor expanded in alpha around 0 24.7%
unpow224.7%
Simplified24.7%
Final simplification24.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.25 beta))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.25 / beta;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.25d0 / beta
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.25 / beta;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.25 / beta
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.25 / beta) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.25 / beta;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.25 / beta), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.25}{\beta}
\end{array}
Initial program 96.4%
associate-/l/95.2%
associate-+l+95.2%
+-commutative95.2%
associate-+r+95.2%
associate-+l+95.2%
distribute-rgt1-in95.2%
*-rgt-identity95.2%
distribute-lft-out95.2%
+-commutative95.2%
associate-*r/96.9%
associate-*r/94.6%
Simplified94.6%
Taylor expanded in beta around inf 23.7%
unpow223.7%
Simplified23.7%
Taylor expanded in alpha around 0 22.9%
+-commutative22.9%
unpow222.9%
+-commutative22.9%
Simplified22.9%
Taylor expanded in beta around 0 4.5%
associate-*r/4.5%
metadata-eval4.5%
associate-*r/4.5%
metadata-eval4.5%
unpow24.5%
Simplified4.5%
Taylor expanded in beta around inf 4.2%
Final simplification4.2%
herbie shell --seed 2023182
(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)))