
(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 17 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 (+ 2.0 alpha)))) (/ (* (/ (+ 1.0 beta) t_0) (/ (+ 1.0 alpha) (+ beta (+ alpha 3.0)))) t_0)))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = beta + (2.0 + alpha);
return (((1.0 + beta) / t_0) * ((1.0 + alpha) / (beta + (alpha + 3.0)))) / t_0;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = beta + (2.0d0 + alpha)
code = (((1.0d0 + beta) / t_0) * ((1.0d0 + alpha) / (beta + (alpha + 3.0d0)))) / t_0
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = beta + (2.0 + alpha);
return (((1.0 + beta) / t_0) * ((1.0 + alpha) / (beta + (alpha + 3.0)))) / t_0;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = beta + (2.0 + alpha) return (((1.0 + beta) / t_0) * ((1.0 + alpha) / (beta + (alpha + 3.0)))) / t_0
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(beta + Float64(2.0 + alpha)) return Float64(Float64(Float64(Float64(1.0 + beta) / t_0) * Float64(Float64(1.0 + alpha) / Float64(beta + Float64(alpha + 3.0)))) / t_0) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = beta + (2.0 + alpha);
tmp = (((1.0 + beta) / t_0) * ((1.0 + alpha) / (beta + (alpha + 3.0)))) / t_0;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(beta + N[(2.0 + alpha), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \beta + \left(2 + \alpha\right)\\
\frac{\frac{1 + \beta}{t_0} \cdot \frac{1 + \alpha}{\beta + \left(\alpha + 3\right)}}{t_0}
\end{array}
\end{array}
Initial program 95.2%
associate-/l/93.9%
associate-/r*85.9%
+-commutative85.9%
associate-+l+85.9%
associate-+r+85.9%
*-commutative85.9%
distribute-rgt1-in85.9%
+-commutative85.9%
*-commutative85.9%
distribute-rgt1-in85.9%
+-commutative85.9%
times-frac97.8%
Simplified97.8%
associate-*r/97.8%
+-commutative97.8%
Applied egg-rr97.8%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
associate-*l/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.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
(let* ((t_0 (+ 2.0 (+ beta alpha))) (t_1 (+ alpha (+ beta 2.0))))
(if (<= beta 2e+29)
(* (/ (+ 1.0 beta) t_1) (/ (+ 1.0 alpha) (* (+ alpha (+ beta 3.0)) t_1)))
(/ (* (/ (+ 1.0 alpha) t_0) (/ beta (+ 3.0 (+ beta alpha)))) t_0))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = 2.0 + (beta + alpha);
double t_1 = alpha + (beta + 2.0);
double tmp;
if (beta <= 2e+29) {
tmp = ((1.0 + beta) / t_1) * ((1.0 + alpha) / ((alpha + (beta + 3.0)) * t_1));
} else {
tmp = (((1.0 + alpha) / t_0) * (beta / (3.0 + (beta + alpha)))) / 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 = 2.0d0 + (beta + alpha)
t_1 = alpha + (beta + 2.0d0)
if (beta <= 2d+29) then
tmp = ((1.0d0 + beta) / t_1) * ((1.0d0 + alpha) / ((alpha + (beta + 3.0d0)) * t_1))
else
tmp = (((1.0d0 + alpha) / t_0) * (beta / (3.0d0 + (beta + alpha)))) / t_0
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = 2.0 + (beta + alpha);
double t_1 = alpha + (beta + 2.0);
double tmp;
if (beta <= 2e+29) {
tmp = ((1.0 + beta) / t_1) * ((1.0 + alpha) / ((alpha + (beta + 3.0)) * t_1));
} else {
tmp = (((1.0 + alpha) / t_0) * (beta / (3.0 + (beta + alpha)))) / t_0;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = 2.0 + (beta + alpha) t_1 = alpha + (beta + 2.0) tmp = 0 if beta <= 2e+29: tmp = ((1.0 + beta) / t_1) * ((1.0 + alpha) / ((alpha + (beta + 3.0)) * t_1)) else: tmp = (((1.0 + alpha) / t_0) * (beta / (3.0 + (beta + alpha)))) / t_0 return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(2.0 + Float64(beta + alpha)) t_1 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 2e+29) tmp = Float64(Float64(Float64(1.0 + beta) / t_1) * Float64(Float64(1.0 + alpha) / Float64(Float64(alpha + Float64(beta + 3.0)) * t_1))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / t_0) * Float64(beta / Float64(3.0 + Float64(beta + alpha)))) / t_0); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = 2.0 + (beta + alpha);
t_1 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 2e+29)
tmp = ((1.0 + beta) / t_1) * ((1.0 + alpha) / ((alpha + (beta + 3.0)) * t_1));
else
tmp = (((1.0 + alpha) / t_0) * (beta / (3.0 + (beta + alpha)))) / 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[(2.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 2e+29], N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(N[(1.0 + alpha), $MachinePrecision] / N[(N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(beta / N[(3.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := 2 + \left(\beta + \alpha\right)\\
t_1 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 2 \cdot 10^{+29}:\\
\;\;\;\;\frac{1 + \beta}{t_1} \cdot \frac{1 + \alpha}{\left(\alpha + \left(\beta + 3\right)\right) \cdot t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0} \cdot \frac{\beta}{3 + \left(\beta + \alpha\right)}}{t_0}\\
\end{array}
\end{array}
if beta < 1.99999999999999983e29Initial program 99.8%
associate-/l/99.2%
associate-/r*95.3%
+-commutative95.3%
associate-+l+95.3%
associate-+r+95.3%
*-commutative95.3%
distribute-rgt1-in95.3%
+-commutative95.3%
*-commutative95.3%
distribute-rgt1-in95.3%
+-commutative95.3%
times-frac99.2%
Simplified99.2%
if 1.99999999999999983e29 < beta Initial program 82.1%
associate-/l/78.7%
associate-/r*59.5%
+-commutative59.5%
associate-+r+59.5%
+-commutative59.5%
associate-+r+59.5%
associate-+r+59.5%
distribute-rgt1-in59.5%
+-commutative59.5%
*-commutative59.5%
distribute-rgt1-in59.5%
+-commutative59.5%
metadata-eval59.5%
associate-+l+59.5%
*-commutative59.5%
metadata-eval59.5%
associate-+l+59.5%
Simplified59.5%
Taylor expanded in beta around inf 59.5%
*-un-lft-identity59.5%
times-frac78.5%
+-commutative78.5%
*-commutative78.5%
associate-+r+78.5%
+-commutative78.5%
Applied egg-rr78.5%
associate-*l/78.6%
*-lft-identity78.6%
times-frac99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.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))))
(if (<= beta 2e+29)
(* (/ (+ 1.0 beta) t_0) (/ 1.0 (* (+ beta 2.0) (+ beta 3.0))))
(*
(/ (+ 1.0 alpha) (+ alpha (+ beta 3.0)))
(/ (+ 1.0 (/ (- -1.0 alpha) beta)) t_0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 2e+29) {
tmp = ((1.0 + beta) / t_0) * (1.0 / ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) * ((1.0 + ((-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) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 2d+29) then
tmp = ((1.0d0 + beta) / t_0) * (1.0d0 / ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = ((1.0d0 + alpha) / (alpha + (beta + 3.0d0))) * ((1.0d0 + (((-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 = alpha + (beta + 2.0);
double tmp;
if (beta <= 2e+29) {
tmp = ((1.0 + beta) / t_0) * (1.0 / ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) * ((1.0 + ((-1.0 - alpha) / beta)) / t_0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 2e+29: tmp = ((1.0 + beta) / t_0) * (1.0 / ((beta + 2.0) * (beta + 3.0))) else: tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) * ((1.0 + ((-1.0 - alpha) / beta)) / t_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+29) tmp = Float64(Float64(Float64(1.0 + beta) / t_0) * Float64(1.0 / Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 3.0))) * Float64(Float64(1.0 + 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 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 2e+29)
tmp = ((1.0 + beta) / t_0) * (1.0 / ((beta + 2.0) * (beta + 3.0)));
else
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) * ((1.0 + ((-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[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 2e+29], N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $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[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(N[(-1.0 - alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision] / t$95$0), $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^{+29}:\\
\;\;\;\;\frac{1 + \beta}{t_0} \cdot \frac{1}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\alpha + \left(\beta + 3\right)} \cdot \frac{1 + \frac{-1 - \alpha}{\beta}}{t_0}\\
\end{array}
\end{array}
if beta < 1.99999999999999983e29Initial program 99.8%
associate-/l/99.2%
associate-/r*95.3%
+-commutative95.3%
associate-+l+95.3%
associate-+r+95.3%
*-commutative95.3%
distribute-rgt1-in95.3%
+-commutative95.3%
*-commutative95.3%
distribute-rgt1-in95.3%
+-commutative95.3%
times-frac99.2%
Simplified99.2%
Taylor expanded in alpha around 0 65.9%
+-commutative65.9%
Simplified65.9%
if 1.99999999999999983e29 < beta Initial program 82.1%
associate-/l/78.7%
associate-/r*59.5%
+-commutative59.5%
associate-+l+59.5%
associate-+r+59.5%
*-commutative59.5%
distribute-rgt1-in59.5%
+-commutative59.5%
*-commutative59.5%
distribute-rgt1-in59.5%
+-commutative59.5%
times-frac93.9%
Simplified93.9%
associate-*r/93.9%
+-commutative93.9%
Applied egg-rr93.9%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in beta around inf 84.6%
mul-1-neg84.6%
unsub-neg84.6%
Simplified84.6%
Final simplification70.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 7.5e+31)
(*
(/ (+ 1.0 beta) (+ alpha (+ beta 2.0)))
(/ 1.0 (* (+ beta 2.0) (+ beta 3.0))))
(/
(*
(/ (+ 1.0 alpha) (+ beta (+ alpha 3.0)))
(+ 1.0 (/ (- -1.0 alpha) beta)))
(+ beta (+ 2.0 alpha)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 7.5e+31) {
tmp = ((1.0 + beta) / (alpha + (beta + 2.0))) * (1.0 / ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = (((1.0 + alpha) / (beta + (alpha + 3.0))) * (1.0 + ((-1.0 - alpha) / beta))) / (beta + (2.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 7.5d+31) then
tmp = ((1.0d0 + beta) / (alpha + (beta + 2.0d0))) * (1.0d0 / ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = (((1.0d0 + alpha) / (beta + (alpha + 3.0d0))) * (1.0d0 + (((-1.0d0) - alpha) / beta))) / (beta + (2.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 7.5e+31) {
tmp = ((1.0 + beta) / (alpha + (beta + 2.0))) * (1.0 / ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = (((1.0 + alpha) / (beta + (alpha + 3.0))) * (1.0 + ((-1.0 - alpha) / beta))) / (beta + (2.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 7.5e+31: tmp = ((1.0 + beta) / (alpha + (beta + 2.0))) * (1.0 / ((beta + 2.0) * (beta + 3.0))) else: tmp = (((1.0 + alpha) / (beta + (alpha + 3.0))) * (1.0 + ((-1.0 - alpha) / beta))) / (beta + (2.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 7.5e+31) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(alpha + Float64(beta + 2.0))) * Float64(1.0 / Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / Float64(beta + Float64(alpha + 3.0))) * Float64(1.0 + Float64(Float64(-1.0 - alpha) / beta))) / Float64(beta + Float64(2.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 7.5e+31)
tmp = ((1.0 + beta) / (alpha + (beta + 2.0))) * (1.0 / ((beta + 2.0) * (beta + 3.0)));
else
tmp = (((1.0 + alpha) / (beta + (alpha + 3.0))) * (1.0 + ((-1.0 - alpha) / beta))) / (beta + (2.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 7.5e+31], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(alpha + N[(beta + 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[(N[(1.0 + alpha), $MachinePrecision] / N[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(-1.0 - alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + N[(2.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 7.5 \cdot 10^{+31}:\\
\;\;\;\;\frac{1 + \beta}{\alpha + \left(\beta + 2\right)} \cdot \frac{1}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta + \left(\alpha + 3\right)} \cdot \left(1 + \frac{-1 - \alpha}{\beta}\right)}{\beta + \left(2 + \alpha\right)}\\
\end{array}
\end{array}
if beta < 7.5e31Initial program 99.8%
associate-/l/99.2%
associate-/r*94.8%
+-commutative94.8%
associate-+l+94.8%
associate-+r+94.8%
*-commutative94.8%
distribute-rgt1-in94.8%
+-commutative94.8%
*-commutative94.8%
distribute-rgt1-in94.8%
+-commutative94.8%
times-frac99.2%
Simplified99.2%
Taylor expanded in alpha around 0 65.6%
+-commutative65.6%
Simplified65.6%
if 7.5e31 < beta Initial program 81.9%
associate-/l/78.4%
associate-/r*60.3%
+-commutative60.3%
associate-+l+60.3%
associate-+r+60.3%
*-commutative60.3%
distribute-rgt1-in60.3%
+-commutative60.3%
*-commutative60.3%
distribute-rgt1-in60.3%
+-commutative60.3%
times-frac93.8%
Simplified93.8%
associate-*r/93.8%
+-commutative93.8%
Applied egg-rr93.8%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
associate-*l/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in beta around inf 85.9%
associate-*r/85.9%
neg-mul-185.9%
distribute-neg-in85.9%
metadata-eval85.9%
unsub-neg85.9%
Simplified85.9%
Final simplification70.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ 2.0 (+ beta alpha))))
(if (<= beta 2e+29)
(*
(/ (+ 1.0 beta) (+ alpha (+ beta 2.0)))
(/ 1.0 (* (+ beta 2.0) (+ beta 3.0))))
(/ (* (/ (+ 1.0 alpha) t_0) (/ beta (+ 3.0 (+ beta alpha)))) t_0))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = 2.0 + (beta + alpha);
double tmp;
if (beta <= 2e+29) {
tmp = ((1.0 + beta) / (alpha + (beta + 2.0))) * (1.0 / ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = (((1.0 + alpha) / t_0) * (beta / (3.0 + (beta + alpha)))) / 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) :: tmp
t_0 = 2.0d0 + (beta + alpha)
if (beta <= 2d+29) then
tmp = ((1.0d0 + beta) / (alpha + (beta + 2.0d0))) * (1.0d0 / ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = (((1.0d0 + alpha) / t_0) * (beta / (3.0d0 + (beta + alpha)))) / t_0
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = 2.0 + (beta + alpha);
double tmp;
if (beta <= 2e+29) {
tmp = ((1.0 + beta) / (alpha + (beta + 2.0))) * (1.0 / ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = (((1.0 + alpha) / t_0) * (beta / (3.0 + (beta + alpha)))) / t_0;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = 2.0 + (beta + alpha) tmp = 0 if beta <= 2e+29: tmp = ((1.0 + beta) / (alpha + (beta + 2.0))) * (1.0 / ((beta + 2.0) * (beta + 3.0))) else: tmp = (((1.0 + alpha) / t_0) * (beta / (3.0 + (beta + alpha)))) / t_0 return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(2.0 + Float64(beta + alpha)) tmp = 0.0 if (beta <= 2e+29) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(alpha + Float64(beta + 2.0))) * Float64(1.0 / Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / t_0) * Float64(beta / Float64(3.0 + Float64(beta + alpha)))) / t_0); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = 2.0 + (beta + alpha);
tmp = 0.0;
if (beta <= 2e+29)
tmp = ((1.0 + beta) / (alpha + (beta + 2.0))) * (1.0 / ((beta + 2.0) * (beta + 3.0)));
else
tmp = (((1.0 + alpha) / t_0) * (beta / (3.0 + (beta + alpha)))) / 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[(2.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 2e+29], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(alpha + N[(beta + 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[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(beta / N[(3.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := 2 + \left(\beta + \alpha\right)\\
\mathbf{if}\;\beta \leq 2 \cdot 10^{+29}:\\
\;\;\;\;\frac{1 + \beta}{\alpha + \left(\beta + 2\right)} \cdot \frac{1}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0} \cdot \frac{\beta}{3 + \left(\beta + \alpha\right)}}{t_0}\\
\end{array}
\end{array}
if beta < 1.99999999999999983e29Initial program 99.8%
associate-/l/99.2%
associate-/r*95.3%
+-commutative95.3%
associate-+l+95.3%
associate-+r+95.3%
*-commutative95.3%
distribute-rgt1-in95.3%
+-commutative95.3%
*-commutative95.3%
distribute-rgt1-in95.3%
+-commutative95.3%
times-frac99.2%
Simplified99.2%
Taylor expanded in alpha around 0 65.9%
+-commutative65.9%
Simplified65.9%
if 1.99999999999999983e29 < beta Initial program 82.1%
associate-/l/78.7%
associate-/r*59.5%
+-commutative59.5%
associate-+r+59.5%
+-commutative59.5%
associate-+r+59.5%
associate-+r+59.5%
distribute-rgt1-in59.5%
+-commutative59.5%
*-commutative59.5%
distribute-rgt1-in59.5%
+-commutative59.5%
metadata-eval59.5%
associate-+l+59.5%
*-commutative59.5%
metadata-eval59.5%
associate-+l+59.5%
Simplified59.5%
Taylor expanded in beta around inf 59.5%
*-un-lft-identity59.5%
times-frac78.5%
+-commutative78.5%
*-commutative78.5%
associate-+r+78.5%
+-commutative78.5%
Applied egg-rr78.5%
associate-*l/78.6%
*-lft-identity78.6%
times-frac99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Final simplification74.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ alpha (+ beta 2.0)))) (* (/ (/ (+ 1.0 beta) t_0) t_0) (/ (+ 1.0 alpha) (+ alpha (+ beta 3.0))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return (((1.0 + beta) / t_0) / t_0) * ((1.0 + alpha) / (alpha + (beta + 3.0)));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = alpha + (beta + 2.0d0)
code = (((1.0d0 + beta) / t_0) / t_0) * ((1.0d0 + alpha) / (alpha + (beta + 3.0d0)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return (((1.0 + beta) / t_0) / t_0) * ((1.0 + alpha) / (alpha + (beta + 3.0)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return (((1.0 + beta) / t_0) / t_0) * ((1.0 + alpha) / (alpha + (beta + 3.0)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) return Float64(Float64(Float64(Float64(1.0 + beta) / t_0) / t_0) * Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 3.0)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = (((1.0 + beta) / t_0) / t_0) * ((1.0 + alpha) / (alpha + (beta + 3.0)));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\frac{\frac{1 + \beta}{t_0}}{t_0} \cdot \frac{1 + \alpha}{\alpha + \left(\beta + 3\right)}
\end{array}
\end{array}
Initial program 95.2%
associate-/l/93.9%
associate-/r*85.9%
+-commutative85.9%
associate-+l+85.9%
associate-+r+85.9%
*-commutative85.9%
distribute-rgt1-in85.9%
+-commutative85.9%
*-commutative85.9%
distribute-rgt1-in85.9%
+-commutative85.9%
times-frac97.8%
Simplified97.8%
associate-*r/97.8%
+-commutative97.8%
Applied egg-rr97.8%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.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
(if (<= beta 2e+29)
(*
(/ (+ 1.0 beta) (+ alpha (+ beta 2.0)))
(/ 1.0 (* (+ beta 2.0) (+ beta 3.0))))
(/ (/ (+ 1.0 alpha) (+ beta (+ alpha 3.0))) (+ beta (+ 2.0 alpha)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2e+29) {
tmp = ((1.0 + beta) / (alpha + (beta + 2.0))) * (1.0 / ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / (beta + (alpha + 3.0))) / (beta + (2.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2d+29) then
tmp = ((1.0d0 + beta) / (alpha + (beta + 2.0d0))) * (1.0d0 / ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = ((1.0d0 + alpha) / (beta + (alpha + 3.0d0))) / (beta + (2.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2e+29) {
tmp = ((1.0 + beta) / (alpha + (beta + 2.0))) * (1.0 / ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / (beta + (alpha + 3.0))) / (beta + (2.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2e+29: tmp = ((1.0 + beta) / (alpha + (beta + 2.0))) * (1.0 / ((beta + 2.0) * (beta + 3.0))) else: tmp = ((1.0 + alpha) / (beta + (alpha + 3.0))) / (beta + (2.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2e+29) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(alpha + Float64(beta + 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(alpha + 3.0))) / Float64(beta + Float64(2.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2e+29)
tmp = ((1.0 + beta) / (alpha + (beta + 2.0))) * (1.0 / ((beta + 2.0) * (beta + 3.0)));
else
tmp = ((1.0 + alpha) / (beta + (alpha + 3.0))) / (beta + (2.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2e+29], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(alpha + N[(beta + 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[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + N[(2.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2 \cdot 10^{+29}:\\
\;\;\;\;\frac{1 + \beta}{\alpha + \left(\beta + 2\right)} \cdot \frac{1}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta + \left(\alpha + 3\right)}}{\beta + \left(2 + \alpha\right)}\\
\end{array}
\end{array}
if beta < 1.99999999999999983e29Initial program 99.8%
associate-/l/99.2%
associate-/r*95.3%
+-commutative95.3%
associate-+l+95.3%
associate-+r+95.3%
*-commutative95.3%
distribute-rgt1-in95.3%
+-commutative95.3%
*-commutative95.3%
distribute-rgt1-in95.3%
+-commutative95.3%
times-frac99.2%
Simplified99.2%
Taylor expanded in alpha around 0 65.9%
+-commutative65.9%
Simplified65.9%
if 1.99999999999999983e29 < beta Initial program 82.1%
associate-/l/78.7%
associate-/r*59.5%
+-commutative59.5%
associate-+l+59.5%
associate-+r+59.5%
*-commutative59.5%
distribute-rgt1-in59.5%
+-commutative59.5%
*-commutative59.5%
distribute-rgt1-in59.5%
+-commutative59.5%
times-frac93.9%
Simplified93.9%
associate-*r/93.9%
+-commutative93.9%
Applied egg-rr93.9%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
associate-*l/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in beta around inf 84.6%
Final simplification70.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 5.5) (/ (+ 0.5 (* alpha 0.25)) (* (+ 2.0 alpha) (+ 3.0 (+ beta alpha)))) (/ (/ (+ 1.0 alpha) beta) (+ beta (+ 2.0 alpha)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 5.5) {
tmp = (0.5 + (alpha * 0.25)) / ((2.0 + alpha) * (3.0 + (beta + alpha)));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 5.5d0) then
tmp = (0.5d0 + (alpha * 0.25d0)) / ((2.0d0 + alpha) * (3.0d0 + (beta + alpha)))
else
tmp = ((1.0d0 + alpha) / beta) / (beta + (2.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 5.5) {
tmp = (0.5 + (alpha * 0.25)) / ((2.0 + alpha) * (3.0 + (beta + alpha)));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 5.5: tmp = (0.5 + (alpha * 0.25)) / ((2.0 + alpha) * (3.0 + (beta + alpha))) else: tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 5.5) tmp = Float64(Float64(0.5 + Float64(alpha * 0.25)) / Float64(Float64(2.0 + alpha) * Float64(3.0 + Float64(beta + alpha)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(beta + Float64(2.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 5.5)
tmp = (0.5 + (alpha * 0.25)) / ((2.0 + alpha) * (3.0 + (beta + alpha)));
else
tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 5.5], N[(N[(0.5 + N[(alpha * 0.25), $MachinePrecision]), $MachinePrecision] / N[(N[(2.0 + alpha), $MachinePrecision] * N[(3.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta + N[(2.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 5.5:\\
\;\;\;\;\frac{0.5 + \alpha \cdot 0.25}{\left(2 + \alpha\right) \cdot \left(3 + \left(\beta + \alpha\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + \left(2 + \alpha\right)}\\
\end{array}
\end{array}
if beta < 5.5Initial program 99.8%
associate-/l/99.2%
associate-+l+99.2%
*-commutative99.2%
+-commutative99.2%
metadata-eval99.2%
associate-+l+99.2%
metadata-eval99.2%
associate-+l+99.2%
metadata-eval99.2%
+-commutative99.2%
metadata-eval99.2%
associate-+l+99.2%
Simplified99.2%
Taylor expanded in beta around 0 97.3%
Taylor expanded in alpha around 0 82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in beta around 0 83.2%
if 5.5 < beta Initial program 83.4%
associate-/l/80.2%
associate-/r*62.3%
+-commutative62.3%
associate-+l+62.3%
associate-+r+62.3%
*-commutative62.3%
distribute-rgt1-in62.3%
+-commutative62.3%
*-commutative62.3%
distribute-rgt1-in62.3%
+-commutative62.3%
times-frac94.3%
Simplified94.3%
associate-*r/94.3%
+-commutative94.3%
Applied egg-rr94.3%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
associate-*l/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in beta around inf 82.4%
Final simplification83.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.2e+30) (/ (+ 1.0 beta) (* (+ beta 2.0) (+ 6.0 (* beta (+ beta 5.0))))) (/ (/ (+ 1.0 alpha) beta) (+ beta (+ 2.0 alpha)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.2e+30) {
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * (beta + 5.0))));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 4.2d+30) then
tmp = (1.0d0 + beta) / ((beta + 2.0d0) * (6.0d0 + (beta * (beta + 5.0d0))))
else
tmp = ((1.0d0 + alpha) / beta) / (beta + (2.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 4.2e+30) {
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * (beta + 5.0))));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.2e+30: tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * (beta + 5.0)))) else: tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.2e+30) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(6.0 + Float64(beta * Float64(beta + 5.0))))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(beta + Float64(2.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 4.2e+30)
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * (beta + 5.0))));
else
tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 4.2e+30], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(6.0 + N[(beta * N[(beta + 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta + N[(2.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4.2 \cdot 10^{+30}:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(6 + \beta \cdot \left(\beta + 5\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + \left(2 + \alpha\right)}\\
\end{array}
\end{array}
if beta < 4.2e30Initial program 99.8%
associate-/l/99.2%
associate-/r*95.3%
+-commutative95.3%
associate-+l+95.3%
associate-+r+95.3%
*-commutative95.3%
distribute-rgt1-in95.3%
+-commutative95.3%
*-commutative95.3%
distribute-rgt1-in95.3%
+-commutative95.3%
times-frac99.2%
Simplified99.2%
Taylor expanded in beta around 0 99.2%
Taylor expanded in alpha around 0 64.8%
+-commutative64.8%
*-un-lft-identity64.8%
fma-def64.8%
*-commutative64.8%
Applied egg-rr64.8%
fma-udef64.8%
*-lft-identity64.8%
unpow264.8%
distribute-lft-out64.8%
Simplified64.8%
if 4.2e30 < beta Initial program 82.1%
associate-/l/78.7%
associate-/r*59.5%
+-commutative59.5%
associate-+l+59.5%
associate-+r+59.5%
*-commutative59.5%
distribute-rgt1-in59.5%
+-commutative59.5%
*-commutative59.5%
distribute-rgt1-in59.5%
+-commutative59.5%
times-frac93.9%
Simplified93.9%
associate-*r/93.9%
+-commutative93.9%
Applied egg-rr93.9%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
associate-*l/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in beta around inf 84.2%
Final simplification69.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 6e+31) (/ (/ (+ 1.0 beta) (+ beta 2.0)) (+ 6.0 (* beta (+ beta 5.0)))) (/ (/ (+ 1.0 alpha) beta) (+ beta (+ 2.0 alpha)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 6e+31) {
tmp = ((1.0 + beta) / (beta + 2.0)) / (6.0 + (beta * (beta + 5.0)));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 6d+31) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) / (6.0d0 + (beta * (beta + 5.0d0)))
else
tmp = ((1.0d0 + alpha) / beta) / (beta + (2.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 6e+31) {
tmp = ((1.0 + beta) / (beta + 2.0)) / (6.0 + (beta * (beta + 5.0)));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 6e+31: tmp = ((1.0 + beta) / (beta + 2.0)) / (6.0 + (beta * (beta + 5.0))) else: tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 6e+31) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) / Float64(6.0 + Float64(beta * Float64(beta + 5.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(beta + Float64(2.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 6e+31)
tmp = ((1.0 + beta) / (beta + 2.0)) / (6.0 + (beta * (beta + 5.0)));
else
tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 6e+31], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(6.0 + N[(beta * N[(beta + 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta + N[(2.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 6 \cdot 10^{+31}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\beta + 2}}{6 + \beta \cdot \left(\beta + 5\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + \left(2 + \alpha\right)}\\
\end{array}
\end{array}
if beta < 5.99999999999999978e31Initial program 99.8%
associate-/l/99.2%
associate-/r*94.8%
+-commutative94.8%
associate-+l+94.8%
associate-+r+94.8%
*-commutative94.8%
distribute-rgt1-in94.8%
+-commutative94.8%
*-commutative94.8%
distribute-rgt1-in94.8%
+-commutative94.8%
times-frac99.2%
Simplified99.2%
Taylor expanded in beta around 0 99.2%
Taylor expanded in alpha around 0 64.5%
expm1-log1p-u64.5%
expm1-udef60.7%
+-commutative60.7%
*-commutative60.7%
fma-def60.7%
Applied egg-rr60.7%
expm1-def64.5%
expm1-log1p64.5%
associate-/r*64.5%
+-commutative64.5%
fma-udef64.5%
unpow264.5%
distribute-lft-out64.5%
Simplified64.5%
if 5.99999999999999978e31 < beta Initial program 81.9%
associate-/l/78.4%
associate-/r*60.3%
+-commutative60.3%
associate-+l+60.3%
associate-+r+60.3%
*-commutative60.3%
distribute-rgt1-in60.3%
+-commutative60.3%
*-commutative60.3%
distribute-rgt1-in60.3%
+-commutative60.3%
times-frac93.8%
Simplified93.8%
associate-*r/93.8%
+-commutative93.8%
Applied egg-rr93.8%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
associate-*l/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in beta around inf 85.4%
Final simplification69.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.4e+29) (/ (/ (+ 1.0 beta) (+ beta 2.0)) (+ 6.0 (* beta (+ beta 5.0)))) (/ (/ (+ 1.0 alpha) (+ beta (+ alpha 3.0))) (+ beta (+ 2.0 alpha)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.4e+29) {
tmp = ((1.0 + beta) / (beta + 2.0)) / (6.0 + (beta * (beta + 5.0)));
} else {
tmp = ((1.0 + alpha) / (beta + (alpha + 3.0))) / (beta + (2.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.4d+29) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) / (6.0d0 + (beta * (beta + 5.0d0)))
else
tmp = ((1.0d0 + alpha) / (beta + (alpha + 3.0d0))) / (beta + (2.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.4e+29) {
tmp = ((1.0 + beta) / (beta + 2.0)) / (6.0 + (beta * (beta + 5.0)));
} else {
tmp = ((1.0 + alpha) / (beta + (alpha + 3.0))) / (beta + (2.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.4e+29: tmp = ((1.0 + beta) / (beta + 2.0)) / (6.0 + (beta * (beta + 5.0))) else: tmp = ((1.0 + alpha) / (beta + (alpha + 3.0))) / (beta + (2.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.4e+29) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) / Float64(6.0 + Float64(beta * Float64(beta + 5.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(beta + Float64(alpha + 3.0))) / Float64(beta + Float64(2.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.4e+29)
tmp = ((1.0 + beta) / (beta + 2.0)) / (6.0 + (beta * (beta + 5.0)));
else
tmp = ((1.0 + alpha) / (beta + (alpha + 3.0))) / (beta + (2.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.4e+29], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(6.0 + N[(beta * N[(beta + 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + N[(2.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.4 \cdot 10^{+29}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\beta + 2}}{6 + \beta \cdot \left(\beta + 5\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta + \left(\alpha + 3\right)}}{\beta + \left(2 + \alpha\right)}\\
\end{array}
\end{array}
if beta < 1.4e29Initial program 99.8%
associate-/l/99.2%
associate-/r*95.3%
+-commutative95.3%
associate-+l+95.3%
associate-+r+95.3%
*-commutative95.3%
distribute-rgt1-in95.3%
+-commutative95.3%
*-commutative95.3%
distribute-rgt1-in95.3%
+-commutative95.3%
times-frac99.2%
Simplified99.2%
Taylor expanded in beta around 0 99.2%
Taylor expanded in alpha around 0 64.8%
expm1-log1p-u64.8%
expm1-udef60.9%
+-commutative60.9%
*-commutative60.9%
fma-def60.9%
Applied egg-rr60.9%
expm1-def64.8%
expm1-log1p64.8%
associate-/r*64.9%
+-commutative64.9%
fma-udef64.9%
unpow264.9%
distribute-lft-out64.9%
Simplified64.9%
if 1.4e29 < beta Initial program 82.1%
associate-/l/78.7%
associate-/r*59.5%
+-commutative59.5%
associate-+l+59.5%
associate-+r+59.5%
*-commutative59.5%
distribute-rgt1-in59.5%
+-commutative59.5%
*-commutative59.5%
distribute-rgt1-in59.5%
+-commutative59.5%
times-frac93.9%
Simplified93.9%
associate-*r/93.9%
+-commutative93.9%
Applied egg-rr93.9%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
associate-*l/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in beta around inf 84.6%
Final simplification70.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.55) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ (/ (+ 1.0 alpha) beta) (+ beta (+ 2.0 alpha)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.55) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.55d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = ((1.0d0 + alpha) / beta) / (beta + (2.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.55) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.55: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.55) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(beta + Float64(2.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.55)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.55], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta + N[(2.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.55:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + \left(2 + \alpha\right)}\\
\end{array}
\end{array}
if beta < 2.5499999999999998Initial program 99.8%
associate-/l/99.2%
associate-/r*95.2%
+-commutative95.2%
associate-+l+95.2%
associate-+r+95.2%
*-commutative95.2%
distribute-rgt1-in95.2%
+-commutative95.2%
*-commutative95.2%
distribute-rgt1-in95.2%
+-commutative95.2%
times-frac99.1%
Simplified99.1%
Taylor expanded in beta around 0 99.2%
Taylor expanded in alpha around 0 64.4%
Taylor expanded in beta around 0 64.0%
*-commutative64.0%
Simplified64.0%
if 2.5499999999999998 < beta Initial program 83.4%
associate-/l/80.2%
associate-/r*62.3%
+-commutative62.3%
associate-+l+62.3%
associate-+r+62.3%
*-commutative62.3%
distribute-rgt1-in62.3%
+-commutative62.3%
*-commutative62.3%
distribute-rgt1-in62.3%
+-commutative62.3%
times-frac94.3%
Simplified94.3%
associate-*r/94.3%
+-commutative94.3%
Applied egg-rr94.3%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
associate-*l/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in beta around inf 82.4%
Final simplification69.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.0) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ (/ 0.5 beta) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.0) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = (0.5 / beta) / (beta + 3.0);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.0d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = (0.5d0 / beta) / (beta + 3.0d0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.0) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = (0.5 / beta) / (beta + 3.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.0: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = (0.5 / beta) / (beta + 3.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.0) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(Float64(0.5 / beta) / Float64(beta + 3.0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.0)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = (0.5 / beta) / (beta + 3.0);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.0], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 / beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{0.5}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 2Initial program 99.8%
associate-/l/99.2%
associate-/r*95.2%
+-commutative95.2%
associate-+l+95.2%
associate-+r+95.2%
*-commutative95.2%
distribute-rgt1-in95.2%
+-commutative95.2%
*-commutative95.2%
distribute-rgt1-in95.2%
+-commutative95.2%
times-frac99.1%
Simplified99.1%
Taylor expanded in beta around 0 99.2%
Taylor expanded in alpha around 0 64.4%
Taylor expanded in beta around 0 64.0%
*-commutative64.0%
Simplified64.0%
if 2 < beta Initial program 83.4%
associate-/l/80.2%
associate-+l+80.2%
*-commutative80.2%
+-commutative80.2%
metadata-eval80.2%
associate-+l+80.2%
metadata-eval80.2%
associate-+l+80.2%
metadata-eval80.2%
+-commutative80.2%
metadata-eval80.2%
associate-+l+80.2%
Simplified80.2%
Taylor expanded in beta around 0 57.1%
Taylor expanded in alpha around 0 51.4%
associate-/r*51.5%
Simplified51.5%
Taylor expanded in beta around inf 51.5%
Final simplification60.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.5 (* (+ beta 2.0) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.5 / ((beta + 2.0) * (beta + 3.0));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.5d0 / ((beta + 2.0d0) * (beta + 3.0d0))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.5 / ((beta + 2.0) * (beta + 3.0));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.5 / ((beta + 2.0) * (beta + 3.0))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.5 / Float64(Float64(beta + 2.0) * Float64(beta + 3.0))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.5 / ((beta + 2.0) * (beta + 3.0));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.5 / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.5}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}
\end{array}
Initial program 95.2%
associate-/l/93.9%
associate-+l+93.9%
*-commutative93.9%
+-commutative93.9%
metadata-eval93.9%
associate-+l+93.9%
metadata-eval93.9%
associate-+l+93.9%
metadata-eval93.9%
+-commutative93.9%
metadata-eval93.9%
associate-+l+93.9%
Simplified93.9%
Taylor expanded in beta around 0 86.0%
Taylor expanded in alpha around 0 59.9%
Final simplification59.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ (/ 0.5 (+ beta 2.0)) (+ beta 3.0)))
assert(alpha < beta);
double code(double alpha, double beta) {
return (0.5 / (beta + 2.0)) / (beta + 3.0);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = (0.5d0 / (beta + 2.0d0)) / (beta + 3.0d0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return (0.5 / (beta + 2.0)) / (beta + 3.0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return (0.5 / (beta + 2.0)) / (beta + 3.0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(0.5 / Float64(beta + 2.0)) / Float64(beta + 3.0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = (0.5 / (beta + 2.0)) / (beta + 3.0);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(N[(0.5 / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{\frac{0.5}{\beta + 2}}{\beta + 3}
\end{array}
Initial program 95.2%
associate-/l/93.9%
associate-+l+93.9%
*-commutative93.9%
+-commutative93.9%
metadata-eval93.9%
associate-+l+93.9%
metadata-eval93.9%
associate-+l+93.9%
metadata-eval93.9%
+-commutative93.9%
metadata-eval93.9%
associate-+l+93.9%
Simplified93.9%
Taylor expanded in beta around 0 86.0%
Taylor expanded in alpha around 0 59.9%
associate-/r*59.9%
Simplified59.9%
Final simplification59.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.25 (+ beta 3.0)))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.25 / (beta + 3.0);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.25d0 / (beta + 3.0d0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.25 / (beta + 3.0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.25 / (beta + 3.0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.25 / Float64(beta + 3.0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.25 / (beta + 3.0);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.25 / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.25}{\beta + 3}
\end{array}
Initial program 95.2%
associate-/l/93.9%
associate-+l+93.9%
*-commutative93.9%
+-commutative93.9%
metadata-eval93.9%
associate-+l+93.9%
metadata-eval93.9%
associate-+l+93.9%
metadata-eval93.9%
+-commutative93.9%
metadata-eval93.9%
associate-+l+93.9%
Simplified93.9%
Taylor expanded in beta around 0 86.0%
Taylor expanded in alpha around 0 75.5%
*-commutative75.5%
Simplified75.5%
Taylor expanded in beta around 0 66.3%
Taylor expanded in alpha around 0 48.0%
+-commutative48.0%
Simplified48.0%
Final simplification48.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.2%
associate-/l/93.9%
associate-/r*85.9%
+-commutative85.9%
associate-+l+85.9%
associate-+r+85.9%
*-commutative85.9%
distribute-rgt1-in85.9%
+-commutative85.9%
*-commutative85.9%
distribute-rgt1-in85.9%
+-commutative85.9%
times-frac97.8%
Simplified97.8%
Taylor expanded in beta around 0 97.8%
Taylor expanded in alpha around 0 65.8%
Taylor expanded in beta around 0 46.6%
Final simplification46.6%
herbie shell --seed 2023306
(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)))