
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t_0}}{t_0}}{t_0 + 1}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t_0}}{t_0}}{t_0 + 1}
\end{array}
\end{array}
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ alpha (+ beta 2.0)))) (/ (/ (* (/ (+ 1.0 alpha) t_0) (+ 1.0 beta)) 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) * (1.0 + beta)) / 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) * (1.0d0 + beta)) / 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) * (1.0 + beta)) / 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) * (1.0 + beta)) / 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(Float64(1.0 + alpha) / t_0) * Float64(1.0 + beta)) / 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) * (1.0 + beta)) / 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[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(1.0 + beta), $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{\frac{1 + \alpha}{t_0} \cdot \left(1 + \beta\right)}{t_0}}{\beta + \left(\alpha + 3\right)}
\end{array}
\end{array}
Initial program 93.6%
associate-/l/91.8%
associate-+l+91.8%
+-commutative91.8%
associate-+r+91.8%
associate-+l+91.8%
distribute-rgt1-in91.8%
*-rgt-identity91.8%
distribute-lft-out91.8%
+-commutative91.8%
associate-*l/95.9%
*-commutative95.9%
associate-*r/91.6%
Simplified91.6%
associate-*r/95.9%
+-commutative95.9%
Applied egg-rr95.9%
associate-/r*99.8%
associate-*r/93.6%
+-commutative93.6%
+-commutative93.6%
*-commutative93.6%
+-commutative93.6%
+-commutative93.6%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.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 9.2e+77)
(* (+ 1.0 alpha) (/ (/ (+ 1.0 beta) t_0) (* t_0 (+ alpha (+ beta 3.0)))))
(*
(/ (/ (+ 1.0 alpha) t_0) (+ beta (+ alpha 3.0)))
(- 1.0 (/ (+ 1.0 alpha) beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 9.2e+77) {
tmp = (1.0 + alpha) * (((1.0 + beta) / t_0) / (t_0 * (alpha + (beta + 3.0))));
} else {
tmp = (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0))) * (1.0 - ((1.0 + alpha) / beta));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 9.2d+77) then
tmp = (1.0d0 + alpha) * (((1.0d0 + beta) / t_0) / (t_0 * (alpha + (beta + 3.0d0))))
else
tmp = (((1.0d0 + alpha) / t_0) / (beta + (alpha + 3.0d0))) * (1.0d0 - ((1.0d0 + alpha) / beta))
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 <= 9.2e+77) {
tmp = (1.0 + alpha) * (((1.0 + beta) / t_0) / (t_0 * (alpha + (beta + 3.0))));
} else {
tmp = (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0))) * (1.0 - ((1.0 + alpha) / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 9.2e+77: tmp = (1.0 + alpha) * (((1.0 + beta) / t_0) / (t_0 * (alpha + (beta + 3.0)))) else: tmp = (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0))) * (1.0 - ((1.0 + alpha) / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 9.2e+77) tmp = Float64(Float64(1.0 + alpha) * Float64(Float64(Float64(1.0 + beta) / t_0) / Float64(t_0 * Float64(alpha + Float64(beta + 3.0))))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(beta + Float64(alpha + 3.0))) * Float64(1.0 - Float64(Float64(1.0 + alpha) / beta))); 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 <= 9.2e+77)
tmp = (1.0 + alpha) * (((1.0 + beta) / t_0) / (t_0 * (alpha + (beta + 3.0))));
else
tmp = (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0))) * (1.0 - ((1.0 + alpha) / beta));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 9.2e+77], N[(N[(1.0 + alpha), $MachinePrecision] * N[(N[(N[(1.0 + beta), $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[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(1.0 + alpha), $MachinePrecision] / beta), $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.2 \cdot 10^{+77}:\\
\;\;\;\;\left(1 + \alpha\right) \cdot \frac{\frac{1 + \beta}{t_0}}{t_0 \cdot \left(\alpha + \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0}}{\beta + \left(\alpha + 3\right)} \cdot \left(1 - \frac{1 + \alpha}{\beta}\right)\\
\end{array}
\end{array}
if beta < 9.19999999999999979e77Initial program 99.3%
associate-/l/98.9%
associate-+l+98.9%
+-commutative98.9%
associate-+r+98.9%
associate-+l+98.9%
distribute-rgt1-in98.9%
*-rgt-identity98.9%
distribute-lft-out98.9%
+-commutative98.9%
associate-*l/99.4%
*-commutative99.4%
associate-*r/93.7%
Simplified93.7%
if 9.19999999999999979e77 < beta Initial program 76.1%
associate-/l/69.6%
associate-+l+69.6%
+-commutative69.6%
associate-+r+69.6%
associate-+l+69.6%
distribute-rgt1-in69.6%
*-rgt-identity69.6%
distribute-lft-out69.6%
+-commutative69.6%
associate-*l/84.8%
*-commutative84.8%
associate-*r/84.9%
Simplified84.9%
associate-*r/84.8%
+-commutative84.8%
Applied egg-rr84.8%
+-commutative84.8%
*-commutative84.8%
+-commutative84.8%
associate-*r/84.8%
associate-/r*99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 81.4%
mul-1-neg81.4%
unsub-neg81.4%
Simplified81.4%
Final simplification90.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))))
(if (<= beta 9e+77)
(* (/ (+ 1.0 beta) t_0) (/ (+ 1.0 alpha) (* t_0 (+ alpha (+ beta 3.0)))))
(*
(/ (/ (+ 1.0 alpha) t_0) (+ beta (+ alpha 3.0)))
(- 1.0 (/ (+ 1.0 alpha) beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 9e+77) {
tmp = ((1.0 + beta) / t_0) * ((1.0 + alpha) / (t_0 * (alpha + (beta + 3.0))));
} else {
tmp = (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0))) * (1.0 - ((1.0 + alpha) / beta));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 9d+77) then
tmp = ((1.0d0 + beta) / t_0) * ((1.0d0 + alpha) / (t_0 * (alpha + (beta + 3.0d0))))
else
tmp = (((1.0d0 + alpha) / t_0) / (beta + (alpha + 3.0d0))) * (1.0d0 - ((1.0d0 + alpha) / beta))
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+77) {
tmp = ((1.0 + beta) / t_0) * ((1.0 + alpha) / (t_0 * (alpha + (beta + 3.0))));
} else {
tmp = (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0))) * (1.0 - ((1.0 + alpha) / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 9e+77: tmp = ((1.0 + beta) / t_0) * ((1.0 + alpha) / (t_0 * (alpha + (beta + 3.0)))) else: tmp = (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0))) * (1.0 - ((1.0 + alpha) / beta)) 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+77) tmp = Float64(Float64(Float64(1.0 + beta) / t_0) * Float64(Float64(1.0 + alpha) / Float64(t_0 * Float64(alpha + Float64(beta + 3.0))))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(beta + Float64(alpha + 3.0))) * Float64(1.0 - Float64(Float64(1.0 + alpha) / beta))); 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+77)
tmp = ((1.0 + beta) / t_0) * ((1.0 + alpha) / (t_0 * (alpha + (beta + 3.0))));
else
tmp = (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0))) * (1.0 - ((1.0 + alpha) / beta));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 9e+77], N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(1.0 + alpha), $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[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(1.0 + alpha), $MachinePrecision] / beta), $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^{+77}:\\
\;\;\;\;\frac{1 + \beta}{t_0} \cdot \frac{1 + \alpha}{t_0 \cdot \left(\alpha + \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0}}{\beta + \left(\alpha + 3\right)} \cdot \left(1 - \frac{1 + \alpha}{\beta}\right)\\
\end{array}
\end{array}
if beta < 9.00000000000000049e77Initial program 99.3%
associate-/l/98.9%
associate-/r*93.2%
associate-+l+93.2%
+-commutative93.2%
associate-+r+93.2%
associate-+l+93.2%
distribute-rgt1-in93.2%
*-rgt-identity93.2%
distribute-lft-out93.2%
*-commutative93.2%
metadata-eval93.2%
associate-+l+93.2%
+-commutative93.2%
Simplified93.2%
times-frac99.3%
+-commutative99.3%
Applied egg-rr99.3%
if 9.00000000000000049e77 < beta Initial program 76.1%
associate-/l/69.6%
associate-+l+69.6%
+-commutative69.6%
associate-+r+69.6%
associate-+l+69.6%
distribute-rgt1-in69.6%
*-rgt-identity69.6%
distribute-lft-out69.6%
+-commutative69.6%
associate-*l/84.8%
*-commutative84.8%
associate-*r/84.9%
Simplified84.9%
associate-*r/84.8%
+-commutative84.8%
Applied egg-rr84.8%
+-commutative84.8%
*-commutative84.8%
+-commutative84.8%
associate-*r/84.8%
associate-/r*99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 81.4%
mul-1-neg81.4%
unsub-neg81.4%
Simplified81.4%
Final simplification95.0%
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 56000000.0)
(/ (+ 1.0 beta) (* t_0 (+ 6.0 (* beta (+ beta 5.0)))))
(*
(/ (/ (+ 1.0 alpha) t_0) (+ beta (+ alpha 3.0)))
(- 1.0 (/ (+ 1.0 alpha) beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 56000000.0) {
tmp = (1.0 + beta) / (t_0 * (6.0 + (beta * (beta + 5.0))));
} else {
tmp = (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0))) * (1.0 - ((1.0 + alpha) / beta));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 56000000.0d0) then
tmp = (1.0d0 + beta) / (t_0 * (6.0d0 + (beta * (beta + 5.0d0))))
else
tmp = (((1.0d0 + alpha) / t_0) / (beta + (alpha + 3.0d0))) * (1.0d0 - ((1.0d0 + alpha) / beta))
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 <= 56000000.0) {
tmp = (1.0 + beta) / (t_0 * (6.0 + (beta * (beta + 5.0))));
} else {
tmp = (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0))) * (1.0 - ((1.0 + alpha) / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 56000000.0: tmp = (1.0 + beta) / (t_0 * (6.0 + (beta * (beta + 5.0)))) else: tmp = (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0))) * (1.0 - ((1.0 + alpha) / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 56000000.0) tmp = Float64(Float64(1.0 + beta) / Float64(t_0 * Float64(6.0 + Float64(beta * Float64(beta + 5.0))))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(beta + Float64(alpha + 3.0))) * Float64(1.0 - Float64(Float64(1.0 + alpha) / beta))); 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 <= 56000000.0)
tmp = (1.0 + beta) / (t_0 * (6.0 + (beta * (beta + 5.0))));
else
tmp = (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0))) * (1.0 - ((1.0 + alpha) / beta));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 56000000.0], N[(N[(1.0 + beta), $MachinePrecision] / N[(t$95$0 * N[(6.0 + N[(beta * N[(beta + 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(1.0 + alpha), $MachinePrecision] / beta), $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 56000000:\\
\;\;\;\;\frac{1 + \beta}{t_0 \cdot \left(6 + \beta \cdot \left(\beta + 5\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0}}{\beta + \left(\alpha + 3\right)} \cdot \left(1 - \frac{1 + \alpha}{\beta}\right)\\
\end{array}
\end{array}
if beta < 5.6e7Initial program 99.8%
associate-/l/99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+r+99.4%
associate-+l+99.4%
distribute-rgt1-in99.4%
*-rgt-identity99.4%
distribute-lft-out99.4%
+-commutative99.4%
associate-*l/99.4%
*-commutative99.4%
associate-*r/93.1%
Simplified93.1%
associate-*r/99.4%
+-commutative99.4%
Applied egg-rr99.4%
+-commutative99.4%
*-commutative99.4%
+-commutative99.4%
associate-*r/99.3%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 62.5%
un-div-inv62.5%
+-commutative62.5%
*-commutative62.5%
Applied egg-rr62.5%
associate-/r*63.0%
+-commutative63.0%
+-commutative63.0%
*-commutative63.0%
Simplified63.0%
Taylor expanded in beta around 0 63.0%
+-commutative63.0%
unpow263.0%
distribute-rgt-out63.0%
Simplified63.0%
if 5.6e7 < beta Initial program 80.0%
associate-/l/75.1%
associate-+l+75.1%
+-commutative75.1%
associate-+r+75.1%
associate-+l+75.1%
distribute-rgt1-in75.1%
*-rgt-identity75.1%
distribute-lft-out75.1%
+-commutative75.1%
associate-*l/88.1%
*-commutative88.1%
associate-*r/88.1%
Simplified88.1%
associate-*r/88.1%
+-commutative88.1%
Applied egg-rr88.1%
+-commutative88.1%
*-commutative88.1%
+-commutative88.1%
associate-*r/88.1%
associate-/r*99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in beta around inf 82.2%
mul-1-neg82.2%
unsub-neg82.2%
Simplified82.2%
Final simplification69.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ alpha (+ beta 2.0)))) (* (/ (+ 1.0 beta) t_0) (/ (/ (+ 1.0 alpha) t_0) (+ beta (+ alpha 3.0))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((1.0 + beta) / t_0) * (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0)));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = alpha + (beta + 2.0d0)
code = ((1.0d0 + beta) / t_0) * (((1.0d0 + alpha) / t_0) / (beta + (alpha + 3.0d0)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((1.0 + beta) / t_0) * (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return ((1.0 + beta) / t_0) * (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) return Float64(Float64(Float64(1.0 + beta) / t_0) * Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(beta + Float64(alpha + 3.0)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = ((1.0 + beta) / t_0) * (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0)));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\frac{1 + \beta}{t_0} \cdot \frac{\frac{1 + \alpha}{t_0}}{\beta + \left(\alpha + 3\right)}
\end{array}
\end{array}
Initial program 93.6%
associate-/l/91.8%
associate-+l+91.8%
+-commutative91.8%
associate-+r+91.8%
associate-+l+91.8%
distribute-rgt1-in91.8%
*-rgt-identity91.8%
distribute-lft-out91.8%
+-commutative91.8%
associate-*l/95.9%
*-commutative95.9%
associate-*r/91.6%
Simplified91.6%
associate-*r/95.9%
+-commutative95.9%
Applied egg-rr95.9%
+-commutative95.9%
*-commutative95.9%
+-commutative95.9%
associate-*r/95.8%
associate-/r*99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
Simplified99.7%
Final simplification99.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ alpha (+ beta 2.0)))) (/ (/ (* (+ 1.0 alpha) (/ (+ 1.0 beta) 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 (((1.0 + alpha) * ((1.0 + beta) / 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 = (((1.0d0 + alpha) * ((1.0d0 + beta) / 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 (((1.0 + alpha) * ((1.0 + beta) / t_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) * ((1.0 + beta) / 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(1.0 + alpha) * Float64(Float64(1.0 + beta) / 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 = (((1.0 + alpha) * ((1.0 + beta) / 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[(1.0 + alpha), $MachinePrecision] * N[(N[(1.0 + beta), $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(1 + \alpha\right) \cdot \frac{1 + \beta}{t_0}}{t_0}}{\beta + \left(\alpha + 3\right)}
\end{array}
\end{array}
Initial program 93.6%
div-inv93.6%
+-commutative93.6%
associate-+l+93.6%
*-commutative93.6%
metadata-eval93.6%
associate-+r+93.6%
metadata-eval93.6%
associate-+r+93.6%
Applied egg-rr93.6%
associate-*l/93.6%
associate-*r/93.6%
*-rgt-identity93.6%
associate-+r+93.6%
*-rgt-identity93.6%
+-commutative93.6%
distribute-rgt1-in93.6%
distribute-lft-in93.6%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 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 4.6e+14)
(/ (+ 1.0 beta) (* 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 <= 4.6e+14) {
tmp = (1.0 + beta) / (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 <= 4.6d+14) then
tmp = (1.0d0 + beta) / (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 <= 4.6e+14) {
tmp = (1.0 + beta) / (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 <= 4.6e+14: tmp = (1.0 + beta) / (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 <= 4.6e+14) tmp = Float64(Float64(1.0 + beta) / 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 <= 4.6e+14)
tmp = (1.0 + beta) / (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, 4.6e+14], N[(N[(1.0 + beta), $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 4.6 \cdot 10^{+14}:\\
\;\;\;\;\frac{1 + \beta}{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 < 4.6e14Initial program 99.3%
associate-/l/98.8%
associate-+l+98.8%
+-commutative98.8%
associate-+r+98.8%
associate-+l+98.8%
distribute-rgt1-in98.8%
*-rgt-identity98.8%
distribute-lft-out98.8%
+-commutative98.8%
associate-*l/99.4%
*-commutative99.4%
associate-*r/93.3%
Simplified93.2%
associate-*r/99.4%
+-commutative99.4%
Applied egg-rr99.4%
+-commutative99.4%
*-commutative99.4%
+-commutative99.4%
associate-*r/99.3%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 62.3%
un-div-inv62.4%
+-commutative62.4%
*-commutative62.4%
Applied egg-rr62.4%
associate-/r*63.1%
+-commutative63.1%
+-commutative63.1%
*-commutative63.1%
Simplified63.1%
if 4.6e14 < beta Initial program 80.5%
associate-/l/75.4%
associate-+l+75.4%
+-commutative75.4%
associate-+r+75.4%
associate-+l+75.4%
distribute-rgt1-in75.4%
*-rgt-identity75.4%
distribute-lft-out75.4%
+-commutative75.4%
associate-*l/87.7%
*-commutative87.7%
associate-*r/87.7%
Simplified87.7%
associate-*r/87.7%
+-commutative87.7%
Applied egg-rr87.7%
associate-/r*99.6%
associate-*r/80.5%
+-commutative80.5%
+-commutative80.5%
*-commutative80.5%
+-commutative80.5%
+-commutative80.5%
associate-*r/99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in beta around inf 84.1%
Final simplification69.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))))
(if (<= beta 3.5e+14)
(/ (+ 1.0 beta) (* t_0 (+ 6.0 (* beta (+ beta 5.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 <= 3.5e+14) {
tmp = (1.0 + beta) / (t_0 * (6.0 + (beta * (beta + 5.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 <= 3.5d+14) then
tmp = (1.0d0 + beta) / (t_0 * (6.0d0 + (beta * (beta + 5.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 <= 3.5e+14) {
tmp = (1.0 + beta) / (t_0 * (6.0 + (beta * (beta + 5.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 <= 3.5e+14: tmp = (1.0 + beta) / (t_0 * (6.0 + (beta * (beta + 5.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 <= 3.5e+14) tmp = Float64(Float64(1.0 + beta) / Float64(t_0 * Float64(6.0 + Float64(beta * Float64(beta + 5.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 <= 3.5e+14)
tmp = (1.0 + beta) / (t_0 * (6.0 + (beta * (beta + 5.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, 3.5e+14], N[(N[(1.0 + beta), $MachinePrecision] / N[(t$95$0 * N[(6.0 + N[(beta * N[(beta + 5.0), $MachinePrecision]), $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 3.5 \cdot 10^{+14}:\\
\;\;\;\;\frac{1 + \beta}{t_0 \cdot \left(6 + \beta \cdot \left(\beta + 5\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0}}{\beta + \left(\alpha + 3\right)}\\
\end{array}
\end{array}
if beta < 3.5e14Initial program 99.3%
associate-/l/98.8%
associate-+l+98.8%
+-commutative98.8%
associate-+r+98.8%
associate-+l+98.8%
distribute-rgt1-in98.8%
*-rgt-identity98.8%
distribute-lft-out98.8%
+-commutative98.8%
associate-*l/99.4%
*-commutative99.4%
associate-*r/93.3%
Simplified93.2%
associate-*r/99.4%
+-commutative99.4%
Applied egg-rr99.4%
+-commutative99.4%
*-commutative99.4%
+-commutative99.4%
associate-*r/99.3%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 62.3%
un-div-inv62.4%
+-commutative62.4%
*-commutative62.4%
Applied egg-rr62.4%
associate-/r*63.1%
+-commutative63.1%
+-commutative63.1%
*-commutative63.1%
Simplified63.1%
Taylor expanded in beta around 0 63.1%
+-commutative63.1%
unpow263.1%
distribute-rgt-out63.1%
Simplified63.1%
if 3.5e14 < beta Initial program 80.5%
associate-/l/75.4%
associate-+l+75.4%
+-commutative75.4%
associate-+r+75.4%
associate-+l+75.4%
distribute-rgt1-in75.4%
*-rgt-identity75.4%
distribute-lft-out75.4%
+-commutative75.4%
associate-*l/87.7%
*-commutative87.7%
associate-*r/87.7%
Simplified87.7%
associate-*r/87.7%
+-commutative87.7%
Applied egg-rr87.7%
associate-/r*99.6%
associate-*r/80.5%
+-commutative80.5%
+-commutative80.5%
*-commutative80.5%
+-commutative80.5%
+-commutative80.5%
associate-*r/99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in beta around inf 84.1%
Final simplification69.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.6e+14) (/ (+ 1.0 beta) (* (+ beta 2.0) (* (+ beta 2.0) (+ beta 3.0)))) (/ (/ (+ 1.0 alpha) beta) (+ beta (+ alpha 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.6e+14) {
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((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 <= 4.6d+14) then
tmp = (1.0d0 + beta) / ((beta + 2.0d0) * ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = ((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 <= 4.6e+14) {
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.6e+14: tmp = (1.0 + beta) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0))) else: tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.6e+14) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(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 <= 4.6e+14)
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0)));
else
tmp = ((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, 4.6e+14], N[(N[(1.0 + beta), $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] / beta), $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 4.6 \cdot 10^{+14}:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(\left(\beta + 2\right) \cdot \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + \left(\alpha + 3\right)}\\
\end{array}
\end{array}
if beta < 4.6e14Initial program 99.3%
associate-/l/98.8%
associate-+l+98.8%
+-commutative98.8%
associate-+r+98.8%
associate-+l+98.8%
distribute-rgt1-in98.8%
*-rgt-identity98.8%
distribute-lft-out98.8%
+-commutative98.8%
associate-*l/99.4%
*-commutative99.4%
associate-*r/93.3%
Simplified93.2%
associate-*r/99.4%
+-commutative99.4%
Applied egg-rr99.4%
+-commutative99.4%
*-commutative99.4%
+-commutative99.4%
associate-*r/99.3%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 62.3%
un-div-inv62.4%
+-commutative62.4%
*-commutative62.4%
Applied egg-rr62.4%
associate-/r*63.1%
+-commutative63.1%
+-commutative63.1%
*-commutative63.1%
Simplified63.1%
Taylor expanded in alpha around 0 61.0%
if 4.6e14 < beta Initial program 80.5%
div-inv80.5%
+-commutative80.5%
associate-+l+80.5%
*-commutative80.5%
metadata-eval80.5%
associate-+r+80.5%
metadata-eval80.5%
associate-+r+80.5%
Applied egg-rr80.5%
associate-*l/80.5%
associate-*r/80.5%
*-rgt-identity80.5%
associate-+r+80.5%
*-rgt-identity80.5%
+-commutative80.5%
distribute-rgt1-in80.5%
distribute-lft-in80.5%
associate-*r/99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in alpha around 0 99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in beta around inf 83.7%
Final simplification67.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.4e+14) (/ (+ 1.0 beta) (* (+ 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 <= 4.4e+14) {
tmp = (1.0 + beta) / ((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 <= 4.4d+14) then
tmp = (1.0d0 + beta) / ((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 <= 4.4e+14) {
tmp = (1.0 + beta) / ((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 <= 4.4e+14: tmp = (1.0 + beta) / ((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 <= 4.4e+14) tmp = Float64(Float64(1.0 + beta) / 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 <= 4.4e+14)
tmp = (1.0 + beta) / ((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, 4.4e+14], N[(N[(1.0 + beta), $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 4.4 \cdot 10^{+14}:\\
\;\;\;\;\frac{1 + \beta}{\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 < 4.4e14Initial program 99.3%
associate-/l/98.8%
associate-+l+98.8%
+-commutative98.8%
associate-+r+98.8%
associate-+l+98.8%
distribute-rgt1-in98.8%
*-rgt-identity98.8%
distribute-lft-out98.8%
+-commutative98.8%
associate-*l/99.4%
*-commutative99.4%
associate-*r/93.3%
Simplified93.2%
associate-*r/99.4%
+-commutative99.4%
Applied egg-rr99.4%
+-commutative99.4%
*-commutative99.4%
+-commutative99.4%
associate-*r/99.3%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 62.3%
un-div-inv62.4%
+-commutative62.4%
*-commutative62.4%
Applied egg-rr62.4%
associate-/r*63.1%
+-commutative63.1%
+-commutative63.1%
*-commutative63.1%
Simplified63.1%
Taylor expanded in alpha around 0 61.0%
if 4.4e14 < beta Initial program 80.5%
associate-/l/75.4%
associate-+l+75.4%
+-commutative75.4%
associate-+r+75.4%
associate-+l+75.4%
distribute-rgt1-in75.4%
*-rgt-identity75.4%
distribute-lft-out75.4%
+-commutative75.4%
associate-*l/87.7%
*-commutative87.7%
associate-*r/87.7%
Simplified87.7%
associate-*r/87.7%
+-commutative87.7%
Applied egg-rr87.7%
associate-/r*99.6%
associate-*r/80.5%
+-commutative80.5%
+-commutative80.5%
*-commutative80.5%
+-commutative80.5%
+-commutative80.5%
associate-*r/99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in beta around inf 84.1%
Final simplification68.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.0) (/ (+ 1.0 beta) (* (+ beta 3.0) (+ 4.0 (* beta 4.0)))) (/ (/ (+ 1.0 alpha) beta) (+ beta (+ alpha 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.0) {
tmp = (1.0 + beta) / ((beta + 3.0) * (4.0 + (beta * 4.0)));
} else {
tmp = ((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 <= 4.0d0) then
tmp = (1.0d0 + beta) / ((beta + 3.0d0) * (4.0d0 + (beta * 4.0d0)))
else
tmp = ((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 <= 4.0) {
tmp = (1.0 + beta) / ((beta + 3.0) * (4.0 + (beta * 4.0)));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.0: tmp = (1.0 + beta) / ((beta + 3.0) * (4.0 + (beta * 4.0))) else: tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.0) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 3.0) * Float64(4.0 + Float64(beta * 4.0)))); else tmp = Float64(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 <= 4.0)
tmp = (1.0 + beta) / ((beta + 3.0) * (4.0 + (beta * 4.0)));
else
tmp = ((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, 4.0], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(4.0 + N[(beta * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $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 4:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 3\right) \cdot \left(4 + \beta \cdot 4\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + \left(\alpha + 3\right)}\\
\end{array}
\end{array}
if beta < 4Initial program 99.8%
associate-/l/99.4%
associate-/l/93.5%
associate-+l+93.5%
+-commutative93.5%
associate-+r+93.5%
associate-+l+93.5%
distribute-rgt1-in93.5%
*-rgt-identity93.5%
distribute-lft-out93.5%
+-commutative93.5%
times-frac99.4%
Simplified99.4%
Taylor expanded in beta around 0 98.0%
Taylor expanded in alpha around 0 60.1%
if 4 < beta Initial program 81.2%
div-inv81.1%
+-commutative81.1%
associate-+l+81.1%
*-commutative81.1%
metadata-eval81.1%
associate-+r+81.1%
metadata-eval81.1%
associate-+r+81.1%
Applied egg-rr81.1%
associate-*l/81.2%
associate-*r/81.2%
*-rgt-identity81.2%
associate-+r+81.2%
*-rgt-identity81.2%
+-commutative81.2%
distribute-rgt1-in81.2%
distribute-lft-in81.2%
associate-*r/99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in alpha around 0 99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in beta around inf 78.8%
Final simplification66.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.8) (/ 0.16666666666666666 (+ alpha 2.0)) (/ (/ (+ 1.0 alpha) beta) (+ beta (+ alpha 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.8) {
tmp = 0.16666666666666666 / (alpha + 2.0);
} else {
tmp = ((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 <= 2.8d0) then
tmp = 0.16666666666666666d0 / (alpha + 2.0d0)
else
tmp = ((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 <= 2.8) {
tmp = 0.16666666666666666 / (alpha + 2.0);
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.8: tmp = 0.16666666666666666 / (alpha + 2.0) else: tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.8) tmp = Float64(0.16666666666666666 / Float64(alpha + 2.0)); else tmp = Float64(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 <= 2.8)
tmp = 0.16666666666666666 / (alpha + 2.0);
else
tmp = ((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, 2.8], N[(0.16666666666666666 / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $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 2.8:\\
\;\;\;\;\frac{0.16666666666666666}{\alpha + 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + \left(\alpha + 3\right)}\\
\end{array}
\end{array}
if beta < 2.7999999999999998Initial program 99.8%
associate-/l/99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+r+99.4%
associate-+l+99.4%
distribute-rgt1-in99.4%
*-rgt-identity99.4%
distribute-lft-out99.4%
+-commutative99.4%
associate-*l/99.4%
*-commutative99.4%
associate-*r/93.5%
Simplified93.5%
associate-*r/99.4%
+-commutative99.4%
Applied egg-rr99.4%
+-commutative99.4%
*-commutative99.4%
+-commutative99.4%
associate-*r/99.3%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 62.0%
Taylor expanded in beta around 0 60.2%
if 2.7999999999999998 < beta Initial program 81.2%
div-inv81.1%
+-commutative81.1%
associate-+l+81.1%
*-commutative81.1%
metadata-eval81.1%
associate-+r+81.1%
metadata-eval81.1%
associate-+r+81.1%
Applied egg-rr81.1%
associate-*l/81.2%
associate-*r/81.2%
*-rgt-identity81.2%
associate-+r+81.2%
*-rgt-identity81.2%
+-commutative81.2%
distribute-rgt1-in81.2%
distribute-lft-in81.2%
associate-*r/99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in alpha around 0 99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in beta around inf 78.8%
Final simplification66.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.8) (/ 0.16666666666666666 (+ alpha 2.0)) (/ (+ 1.0 alpha) (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.8) {
tmp = 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.8d0) then
tmp = 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.8) {
tmp = 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.8: tmp = 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.8) tmp = Float64(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.8)
tmp = 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.8], N[(0.16666666666666666 / 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.8:\\
\;\;\;\;\frac{0.16666666666666666}{\alpha + 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 3.7999999999999998Initial program 99.8%
associate-/l/99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+r+99.4%
associate-+l+99.4%
distribute-rgt1-in99.4%
*-rgt-identity99.4%
distribute-lft-out99.4%
+-commutative99.4%
associate-*l/99.4%
*-commutative99.4%
associate-*r/93.5%
Simplified93.5%
associate-*r/99.4%
+-commutative99.4%
Applied egg-rr99.4%
+-commutative99.4%
*-commutative99.4%
+-commutative99.4%
associate-*r/99.3%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 62.0%
Taylor expanded in beta around 0 60.2%
if 3.7999999999999998 < beta Initial program 81.2%
associate-/l/76.5%
associate-+l+76.5%
+-commutative76.5%
associate-+r+76.5%
associate-+l+76.5%
distribute-rgt1-in76.5%
*-rgt-identity76.5%
distribute-lft-out76.5%
+-commutative76.5%
associate-*l/88.8%
*-commutative88.8%
associate-*r/87.7%
Simplified87.7%
associate-*r/88.8%
+-commutative88.8%
Applied egg-rr88.8%
associate-/r*99.6%
associate-*r/81.2%
+-commutative81.2%
+-commutative81.2%
*-commutative81.2%
+-commutative81.2%
+-commutative81.2%
associate-*r/99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in beta around inf 77.5%
unpow277.5%
Simplified77.5%
Final simplification65.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.0) (/ 0.16666666666666666 (+ alpha 2.0)) (/ 0.16666666666666666 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.0) {
tmp = 0.16666666666666666 / (alpha + 2.0);
} else {
tmp = 0.16666666666666666 / 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.0d0) then
tmp = 0.16666666666666666d0 / (alpha + 2.0d0)
else
tmp = 0.16666666666666666d0 / beta
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.16666666666666666 / (alpha + 2.0);
} else {
tmp = 0.16666666666666666 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.0: tmp = 0.16666666666666666 / (alpha + 2.0) else: tmp = 0.16666666666666666 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.0) tmp = Float64(0.16666666666666666 / Float64(alpha + 2.0)); else tmp = Float64(0.16666666666666666 / beta); 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.16666666666666666 / (alpha + 2.0);
else
tmp = 0.16666666666666666 / 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.0], N[(0.16666666666666666 / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2:\\
\;\;\;\;\frac{0.16666666666666666}{\alpha + 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.16666666666666666}{\beta}\\
\end{array}
\end{array}
if beta < 2Initial program 99.8%
associate-/l/99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+r+99.4%
associate-+l+99.4%
distribute-rgt1-in99.4%
*-rgt-identity99.4%
distribute-lft-out99.4%
+-commutative99.4%
associate-*l/99.4%
*-commutative99.4%
associate-*r/93.5%
Simplified93.5%
associate-*r/99.4%
+-commutative99.4%
Applied egg-rr99.4%
+-commutative99.4%
*-commutative99.4%
+-commutative99.4%
associate-*r/99.3%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 62.0%
Taylor expanded in beta around 0 60.2%
if 2 < beta Initial program 81.2%
associate-/l/76.5%
associate-+l+76.5%
+-commutative76.5%
associate-+r+76.5%
associate-+l+76.5%
distribute-rgt1-in76.5%
*-rgt-identity76.5%
distribute-lft-out76.5%
+-commutative76.5%
associate-*r/88.8%
associate-*r/76.9%
Simplified76.9%
Taylor expanded in beta around inf 71.7%
Taylor expanded in alpha around 0 66.3%
Taylor expanded in beta around 0 7.3%
Final simplification42.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.8) (/ 0.16666666666666666 (+ alpha 2.0)) (/ 1.0 (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.8) {
tmp = 0.16666666666666666 / (alpha + 2.0);
} else {
tmp = 1.0 / (beta * beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.8d0) then
tmp = 0.16666666666666666d0 / (alpha + 2.0d0)
else
tmp = 1.0d0 / (beta * beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.8) {
tmp = 0.16666666666666666 / (alpha + 2.0);
} else {
tmp = 1.0 / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.8: tmp = 0.16666666666666666 / (alpha + 2.0) else: tmp = 1.0 / (beta * beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.8) tmp = Float64(0.16666666666666666 / Float64(alpha + 2.0)); else tmp = Float64(1.0 / Float64(beta * beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.8)
tmp = 0.16666666666666666 / (alpha + 2.0);
else
tmp = 1.0 / (beta * beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.8], N[(0.16666666666666666 / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.8:\\
\;\;\;\;\frac{0.16666666666666666}{\alpha + 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 3.7999999999999998Initial program 99.8%
associate-/l/99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+r+99.4%
associate-+l+99.4%
distribute-rgt1-in99.4%
*-rgt-identity99.4%
distribute-lft-out99.4%
+-commutative99.4%
associate-*l/99.4%
*-commutative99.4%
associate-*r/93.5%
Simplified93.5%
associate-*r/99.4%
+-commutative99.4%
Applied egg-rr99.4%
+-commutative99.4%
*-commutative99.4%
+-commutative99.4%
associate-*r/99.3%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 62.0%
Taylor expanded in beta around 0 60.2%
if 3.7999999999999998 < beta Initial program 81.2%
associate-/l/76.5%
associate-+l+76.5%
+-commutative76.5%
associate-+r+76.5%
associate-+l+76.5%
distribute-rgt1-in76.5%
*-rgt-identity76.5%
distribute-lft-out76.5%
+-commutative76.5%
associate-*r/88.8%
associate-*r/76.9%
Simplified76.9%
Taylor expanded in beta around inf 71.7%
Taylor expanded in alpha around 0 66.3%
Taylor expanded in beta around inf 73.6%
unpow273.6%
Simplified73.6%
Final simplification64.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.16666666666666666 beta))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.16666666666666666 / 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.16666666666666666d0 / beta
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.16666666666666666 / beta;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.16666666666666666 / beta
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.16666666666666666 / beta) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.16666666666666666 / beta;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.16666666666666666 / beta), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.16666666666666666}{\beta}
\end{array}
Initial program 93.6%
associate-/l/91.8%
associate-+l+91.8%
+-commutative91.8%
associate-+r+91.8%
associate-+l+91.8%
distribute-rgt1-in91.8%
*-rgt-identity91.8%
distribute-lft-out91.8%
+-commutative91.8%
associate-*r/95.9%
associate-*r/91.9%
Simplified91.9%
Taylor expanded in beta around inf 30.4%
Taylor expanded in alpha around 0 24.1%
Taylor expanded in beta around 0 4.5%
Final simplification4.5%
herbie shell --seed 2023244
(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)))