
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t_0}}{t_0}}{t_0 + 1}
\end{array}
\end{array}
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ beta (+ alpha 2.0)))) (* (/ (+ 1.0 beta) t_0) (/ (/ (+ 1.0 alpha) (+ alpha (+ beta 3.0))) t_0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = beta + (alpha + 2.0);
return ((1.0 + beta) / t_0) * (((1.0 + alpha) / (alpha + (beta + 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 + (alpha + 2.0d0)
code = ((1.0d0 + beta) / t_0) * (((1.0d0 + alpha) / (alpha + (beta + 3.0d0))) / t_0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = beta + (alpha + 2.0);
return ((1.0 + beta) / t_0) * (((1.0 + alpha) / (alpha + (beta + 3.0))) / t_0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = beta + (alpha + 2.0) return ((1.0 + beta) / t_0) * (((1.0 + alpha) / (alpha + (beta + 3.0))) / t_0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(beta + Float64(alpha + 2.0)) return Float64(Float64(Float64(1.0 + beta) / t_0) * Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 3.0))) / t_0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = beta + (alpha + 2.0);
tmp = ((1.0 + beta) / t_0) * (((1.0 + alpha) / (alpha + (beta + 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[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \beta + \left(\alpha + 2\right)\\
\frac{1 + \beta}{t_0} \cdot \frac{\frac{1 + \alpha}{\alpha + \left(\beta + 3\right)}}{t_0}
\end{array}
\end{array}
Initial program 95.6%
associate-/l/93.9%
associate-/r*86.4%
associate-+l+86.4%
+-commutative86.4%
associate-+r+86.4%
associate-+l+86.4%
distribute-rgt1-in86.4%
*-rgt-identity86.4%
distribute-lft-out86.4%
*-commutative86.4%
metadata-eval86.4%
associate-+l+86.4%
+-commutative86.4%
Simplified86.4%
times-frac97.9%
associate-+r+97.9%
+-commutative97.9%
+-commutative97.9%
+-commutative97.9%
associate-+r+97.9%
+-commutative97.9%
+-commutative97.9%
Applied egg-rr97.9%
frac-times86.4%
*-commutative86.4%
+-commutative86.4%
+-commutative86.4%
+-commutative86.4%
associate-+r+86.4%
+-commutative86.4%
*-commutative86.4%
+-commutative86.4%
+-commutative86.4%
associate-+r+86.4%
+-commutative86.4%
Applied egg-rr86.4%
associate-/r*94.0%
+-commutative94.0%
*-commutative94.0%
+-commutative94.0%
associate-*l/97.9%
*-commutative97.9%
associate-*l/97.9%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 3.0))) (t_1 (+ alpha (+ beta 2.0))))
(if (<= beta 1e+87)
(* (+ 1.0 beta) (/ (/ (+ 1.0 alpha) t_1) (* t_0 t_1)))
(*
(+ 1.0 (/ (- -1.0 alpha) beta))
(/ (/ (+ 1.0 alpha) t_0) (+ beta (+ alpha 2.0)))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 3.0);
double t_1 = alpha + (beta + 2.0);
double tmp;
if (beta <= 1e+87) {
tmp = (1.0 + beta) * (((1.0 + alpha) / t_1) / (t_0 * t_1));
} else {
tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / t_0) / (beta + (alpha + 2.0)));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = alpha + (beta + 3.0d0)
t_1 = alpha + (beta + 2.0d0)
if (beta <= 1d+87) then
tmp = (1.0d0 + beta) * (((1.0d0 + alpha) / t_1) / (t_0 * t_1))
else
tmp = (1.0d0 + (((-1.0d0) - alpha) / beta)) * (((1.0d0 + alpha) / t_0) / (beta + (alpha + 2.0d0)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 3.0);
double t_1 = alpha + (beta + 2.0);
double tmp;
if (beta <= 1e+87) {
tmp = (1.0 + beta) * (((1.0 + alpha) / t_1) / (t_0 * t_1));
} else {
tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / t_0) / (beta + (alpha + 2.0)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 3.0) t_1 = alpha + (beta + 2.0) tmp = 0 if beta <= 1e+87: tmp = (1.0 + beta) * (((1.0 + alpha) / t_1) / (t_0 * t_1)) else: tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / t_0) / (beta + (alpha + 2.0))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 3.0)) t_1 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 1e+87) tmp = Float64(Float64(1.0 + beta) * Float64(Float64(Float64(1.0 + alpha) / t_1) / Float64(t_0 * t_1))); else tmp = Float64(Float64(1.0 + Float64(Float64(-1.0 - alpha) / beta)) * Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(beta + Float64(alpha + 2.0)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 3.0);
t_1 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 1e+87)
tmp = (1.0 + beta) * (((1.0 + alpha) / t_1) / (t_0 * t_1));
else
tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / t_0) / (beta + (alpha + 2.0)));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 1e+87], N[(N[(1.0 + beta), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$1), $MachinePrecision] / N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(-1.0 - alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 3\right)\\
t_1 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 10^{+87}:\\
\;\;\;\;\left(1 + \beta\right) \cdot \frac{\frac{1 + \alpha}{t_1}}{t_0 \cdot t_1}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{-1 - \alpha}{\beta}\right) \cdot \frac{\frac{1 + \alpha}{t_0}}{\beta + \left(\alpha + 2\right)}\\
\end{array}
\end{array}
if beta < 9.9999999999999996e86Initial program 98.8%
associate-/l/98.1%
associate-+l+98.1%
+-commutative98.1%
associate-+r+98.1%
associate-+l+98.1%
distribute-rgt1-in98.1%
*-rgt-identity98.1%
distribute-lft-out98.1%
+-commutative98.1%
associate-*r/99.1%
associate-*r/99.1%
Simplified99.1%
if 9.9999999999999996e86 < beta Initial program 84.8%
associate-/l/80.2%
associate-/r*66.1%
associate-+l+66.1%
+-commutative66.1%
associate-+r+66.1%
associate-+l+66.1%
distribute-rgt1-in66.1%
*-rgt-identity66.1%
distribute-lft-out66.1%
*-commutative66.1%
metadata-eval66.1%
associate-+l+66.1%
+-commutative66.1%
Simplified66.1%
times-frac94.0%
associate-+r+94.0%
+-commutative94.0%
+-commutative94.0%
+-commutative94.0%
associate-+r+94.0%
+-commutative94.0%
+-commutative94.0%
Applied egg-rr94.0%
frac-times66.1%
*-commutative66.1%
+-commutative66.1%
+-commutative66.1%
+-commutative66.1%
associate-+r+66.1%
+-commutative66.1%
*-commutative66.1%
+-commutative66.1%
+-commutative66.1%
associate-+r+66.1%
+-commutative66.1%
Applied egg-rr66.1%
associate-/r*80.2%
+-commutative80.2%
*-commutative80.2%
+-commutative80.2%
associate-*l/94.0%
*-commutative94.0%
associate-*l/94.0%
associate-/r*99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in beta around inf 88.0%
mul-1-neg88.0%
unsub-neg88.0%
Simplified88.0%
Final simplification96.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 3.0))) (t_1 (+ 2.0 (+ alpha beta))))
(if (<= beta 9e+138)
(* (/ (+ 1.0 beta) t_1) (/ (+ 1.0 alpha) (* t_0 t_1)))
(*
(+ 1.0 (/ (- -1.0 alpha) beta))
(/ (/ (+ 1.0 alpha) t_0) (+ beta (+ alpha 2.0)))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 3.0);
double t_1 = 2.0 + (alpha + beta);
double tmp;
if (beta <= 9e+138) {
tmp = ((1.0 + beta) / t_1) * ((1.0 + alpha) / (t_0 * t_1));
} else {
tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / t_0) / (beta + (alpha + 2.0)));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = alpha + (beta + 3.0d0)
t_1 = 2.0d0 + (alpha + beta)
if (beta <= 9d+138) then
tmp = ((1.0d0 + beta) / t_1) * ((1.0d0 + alpha) / (t_0 * t_1))
else
tmp = (1.0d0 + (((-1.0d0) - alpha) / beta)) * (((1.0d0 + alpha) / t_0) / (beta + (alpha + 2.0d0)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 3.0);
double t_1 = 2.0 + (alpha + beta);
double tmp;
if (beta <= 9e+138) {
tmp = ((1.0 + beta) / t_1) * ((1.0 + alpha) / (t_0 * t_1));
} else {
tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / t_0) / (beta + (alpha + 2.0)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 3.0) t_1 = 2.0 + (alpha + beta) tmp = 0 if beta <= 9e+138: tmp = ((1.0 + beta) / t_1) * ((1.0 + alpha) / (t_0 * t_1)) else: tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / t_0) / (beta + (alpha + 2.0))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 3.0)) t_1 = Float64(2.0 + Float64(alpha + beta)) tmp = 0.0 if (beta <= 9e+138) tmp = Float64(Float64(Float64(1.0 + beta) / t_1) * Float64(Float64(1.0 + alpha) / Float64(t_0 * t_1))); else tmp = Float64(Float64(1.0 + Float64(Float64(-1.0 - alpha) / beta)) * Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(beta + Float64(alpha + 2.0)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 3.0);
t_1 = 2.0 + (alpha + beta);
tmp = 0.0;
if (beta <= 9e+138)
tmp = ((1.0 + beta) / t_1) * ((1.0 + alpha) / (t_0 * t_1));
else
tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / t_0) / (beta + (alpha + 2.0)));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 9e+138], N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(N[(1.0 + alpha), $MachinePrecision] / N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(-1.0 - alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 3\right)\\
t_1 := 2 + \left(\alpha + \beta\right)\\
\mathbf{if}\;\beta \leq 9 \cdot 10^{+138}:\\
\;\;\;\;\frac{1 + \beta}{t_1} \cdot \frac{1 + \alpha}{t_0 \cdot t_1}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{-1 - \alpha}{\beta}\right) \cdot \frac{\frac{1 + \alpha}{t_0}}{\beta + \left(\alpha + 2\right)}\\
\end{array}
\end{array}
if beta < 8.99999999999999963e138Initial program 96.6%
associate-/l/95.5%
associate-/r*86.9%
associate-+l+86.9%
+-commutative86.9%
associate-+r+86.9%
associate-+l+86.9%
distribute-rgt1-in86.9%
*-rgt-identity86.9%
distribute-lft-out86.9%
*-commutative86.9%
metadata-eval86.9%
associate-+l+86.9%
+-commutative86.9%
Simplified86.9%
times-frac98.3%
associate-+r+98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
associate-+r+98.3%
+-commutative98.3%
+-commutative98.3%
Applied egg-rr98.3%
if 8.99999999999999963e138 < beta Initial program 90.6%
associate-/l/86.3%
associate-/r*84.2%
associate-+l+84.2%
+-commutative84.2%
associate-+r+84.2%
associate-+l+84.2%
distribute-rgt1-in84.2%
*-rgt-identity84.2%
distribute-lft-out84.2%
*-commutative84.2%
metadata-eval84.2%
associate-+l+84.2%
+-commutative84.2%
Simplified84.2%
times-frac95.8%
associate-+r+95.8%
+-commutative95.8%
+-commutative95.8%
+-commutative95.8%
associate-+r+95.8%
+-commutative95.8%
+-commutative95.8%
Applied egg-rr95.8%
frac-times84.2%
*-commutative84.2%
+-commutative84.2%
+-commutative84.2%
+-commutative84.2%
associate-+r+84.2%
+-commutative84.2%
*-commutative84.2%
+-commutative84.2%
+-commutative84.2%
associate-+r+84.2%
+-commutative84.2%
Applied egg-rr84.2%
associate-/r*86.3%
+-commutative86.3%
*-commutative86.3%
+-commutative86.3%
associate-*l/95.8%
*-commutative95.8%
associate-*l/95.8%
associate-/r*100.0%
+-commutative100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+r+100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in beta around inf 97.1%
mul-1-neg97.1%
unsub-neg97.1%
Simplified97.1%
Final simplification98.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 3.0))) (t_1 (+ alpha (+ beta 2.0))))
(if (<= beta 9.5e+138)
(* (/ (- -1.0 alpha) (* t_1 t_1)) (/ (- -1.0 beta) t_0))
(*
(+ 1.0 (/ (- -1.0 alpha) beta))
(/ (/ (+ 1.0 alpha) t_0) (+ beta (+ alpha 2.0)))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 3.0);
double t_1 = alpha + (beta + 2.0);
double tmp;
if (beta <= 9.5e+138) {
tmp = ((-1.0 - alpha) / (t_1 * t_1)) * ((-1.0 - beta) / t_0);
} else {
tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / t_0) / (beta + (alpha + 2.0)));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = alpha + (beta + 3.0d0)
t_1 = alpha + (beta + 2.0d0)
if (beta <= 9.5d+138) then
tmp = (((-1.0d0) - alpha) / (t_1 * t_1)) * (((-1.0d0) - beta) / t_0)
else
tmp = (1.0d0 + (((-1.0d0) - alpha) / beta)) * (((1.0d0 + alpha) / t_0) / (beta + (alpha + 2.0d0)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 3.0);
double t_1 = alpha + (beta + 2.0);
double tmp;
if (beta <= 9.5e+138) {
tmp = ((-1.0 - alpha) / (t_1 * t_1)) * ((-1.0 - beta) / t_0);
} else {
tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / t_0) / (beta + (alpha + 2.0)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 3.0) t_1 = alpha + (beta + 2.0) tmp = 0 if beta <= 9.5e+138: tmp = ((-1.0 - alpha) / (t_1 * t_1)) * ((-1.0 - beta) / t_0) else: tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / t_0) / (beta + (alpha + 2.0))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 3.0)) t_1 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 9.5e+138) tmp = Float64(Float64(Float64(-1.0 - alpha) / Float64(t_1 * t_1)) * Float64(Float64(-1.0 - beta) / t_0)); else tmp = Float64(Float64(1.0 + Float64(Float64(-1.0 - alpha) / beta)) * Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(beta + Float64(alpha + 2.0)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 3.0);
t_1 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 9.5e+138)
tmp = ((-1.0 - alpha) / (t_1 * t_1)) * ((-1.0 - beta) / t_0);
else
tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / t_0) / (beta + (alpha + 2.0)));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 9.5e+138], N[(N[(N[(-1.0 - alpha), $MachinePrecision] / N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(N[(-1.0 - beta), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(-1.0 - alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 3\right)\\
t_1 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 9.5 \cdot 10^{+138}:\\
\;\;\;\;\frac{-1 - \alpha}{t_1 \cdot t_1} \cdot \frac{-1 - \beta}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{-1 - \alpha}{\beta}\right) \cdot \frac{\frac{1 + \alpha}{t_0}}{\beta + \left(\alpha + 2\right)}\\
\end{array}
\end{array}
if beta < 9.49999999999999998e138Initial program 96.6%
associate-/l/95.4%
associate-/l/86.9%
associate-+l+86.9%
+-commutative86.9%
associate-+r+86.9%
associate-+l+86.9%
distribute-rgt1-in86.9%
*-rgt-identity86.9%
distribute-lft-out86.9%
+-commutative86.9%
times-frac98.3%
Simplified98.3%
if 9.49999999999999998e138 < beta Initial program 90.6%
associate-/l/86.3%
associate-/r*84.2%
associate-+l+84.2%
+-commutative84.2%
associate-+r+84.2%
associate-+l+84.2%
distribute-rgt1-in84.2%
*-rgt-identity84.2%
distribute-lft-out84.2%
*-commutative84.2%
metadata-eval84.2%
associate-+l+84.2%
+-commutative84.2%
Simplified84.2%
times-frac95.8%
associate-+r+95.8%
+-commutative95.8%
+-commutative95.8%
+-commutative95.8%
associate-+r+95.8%
+-commutative95.8%
+-commutative95.8%
Applied egg-rr95.8%
frac-times84.2%
*-commutative84.2%
+-commutative84.2%
+-commutative84.2%
+-commutative84.2%
associate-+r+84.2%
+-commutative84.2%
*-commutative84.2%
+-commutative84.2%
+-commutative84.2%
associate-+r+84.2%
+-commutative84.2%
Applied egg-rr84.2%
associate-/r*86.3%
+-commutative86.3%
*-commutative86.3%
+-commutative86.3%
associate-*l/95.8%
*-commutative95.8%
associate-*l/95.8%
associate-/r*100.0%
+-commutative100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+r+100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in beta around inf 97.1%
mul-1-neg97.1%
unsub-neg97.1%
Simplified97.1%
Final simplification98.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 2.6e+20)
(/ (+ 1.0 beta) (* (+ alpha (+ beta 2.0)) (* (+ beta 3.0) (+ beta 2.0))))
(*
(+ 1.0 (/ (- -1.0 alpha) beta))
(/ (/ (+ 1.0 alpha) (+ alpha (+ beta 3.0))) (+ beta (+ alpha 2.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6e+20) {
tmp = (1.0 + beta) / ((alpha + (beta + 2.0)) * ((beta + 3.0) * (beta + 2.0)));
} else {
tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / (alpha + (beta + 3.0))) / (beta + (alpha + 2.0)));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.6d+20) then
tmp = (1.0d0 + beta) / ((alpha + (beta + 2.0d0)) * ((beta + 3.0d0) * (beta + 2.0d0)))
else
tmp = (1.0d0 + (((-1.0d0) - alpha) / beta)) * (((1.0d0 + alpha) / (alpha + (beta + 3.0d0))) / (beta + (alpha + 2.0d0)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6e+20) {
tmp = (1.0 + beta) / ((alpha + (beta + 2.0)) * ((beta + 3.0) * (beta + 2.0)));
} else {
tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / (alpha + (beta + 3.0))) / (beta + (alpha + 2.0)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.6e+20: tmp = (1.0 + beta) / ((alpha + (beta + 2.0)) * ((beta + 3.0) * (beta + 2.0))) else: tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / (alpha + (beta + 3.0))) / (beta + (alpha + 2.0))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.6e+20) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(alpha + Float64(beta + 2.0)) * Float64(Float64(beta + 3.0) * Float64(beta + 2.0)))); else tmp = Float64(Float64(1.0 + Float64(Float64(-1.0 - alpha) / beta)) * Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 3.0))) / Float64(beta + Float64(alpha + 2.0)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.6e+20)
tmp = (1.0 + beta) / ((alpha + (beta + 2.0)) * ((beta + 3.0) * (beta + 2.0)));
else
tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / (alpha + (beta + 3.0))) / (beta + (alpha + 2.0)));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.6e+20], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(beta + 3.0), $MachinePrecision] * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(-1.0 - alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.6 \cdot 10^{+20}:\\
\;\;\;\;\frac{1 + \beta}{\left(\alpha + \left(\beta + 2\right)\right) \cdot \left(\left(\beta + 3\right) \cdot \left(\beta + 2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{-1 - \alpha}{\beta}\right) \cdot \frac{\frac{1 + \alpha}{\alpha + \left(\beta + 3\right)}}{\beta + \left(\alpha + 2\right)}\\
\end{array}
\end{array}
if beta < 2.6e20Initial program 99.9%
associate-/l/99.0%
associate-/r*92.8%
associate-+l+92.8%
+-commutative92.8%
associate-+r+92.8%
associate-+l+92.8%
distribute-rgt1-in92.8%
*-rgt-identity92.8%
distribute-lft-out92.8%
*-commutative92.8%
metadata-eval92.8%
associate-+l+92.8%
+-commutative92.8%
Simplified92.8%
Taylor expanded in alpha around 0 82.1%
Taylor expanded in alpha around 0 63.6%
if 2.6e20 < beta Initial program 86.1%
associate-/l/82.6%
associate-/r*72.1%
associate-+l+72.1%
+-commutative72.1%
associate-+r+72.1%
associate-+l+72.1%
distribute-rgt1-in72.1%
*-rgt-identity72.1%
distribute-lft-out72.1%
*-commutative72.1%
metadata-eval72.1%
associate-+l+72.1%
+-commutative72.1%
Simplified72.1%
times-frac95.4%
associate-+r+95.4%
+-commutative95.4%
+-commutative95.4%
+-commutative95.4%
associate-+r+95.4%
+-commutative95.4%
+-commutative95.4%
Applied egg-rr95.4%
frac-times72.1%
*-commutative72.1%
+-commutative72.1%
+-commutative72.1%
+-commutative72.1%
associate-+r+72.1%
+-commutative72.1%
*-commutative72.1%
+-commutative72.1%
+-commutative72.1%
associate-+r+72.1%
+-commutative72.1%
Applied egg-rr72.1%
associate-/r*82.6%
+-commutative82.6%
*-commutative82.6%
+-commutative82.6%
associate-*l/95.4%
*-commutative95.4%
associate-*l/95.4%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in beta around inf 83.6%
mul-1-neg83.6%
unsub-neg83.6%
Simplified83.6%
Final simplification69.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.0) (* (/ (+ 1.0 alpha) (* (+ alpha 2.0) (+ alpha 3.0))) (/ 1.0 (+ alpha 2.0))) (/ (/ (+ 1.0 alpha) (+ alpha (+ beta 3.0))) (+ beta (+ alpha 2.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.0) {
tmp = ((1.0 + alpha) / ((alpha + 2.0) * (alpha + 3.0))) * (1.0 / (alpha + 2.0));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / (beta + (alpha + 2.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.0d0) then
tmp = ((1.0d0 + alpha) / ((alpha + 2.0d0) * (alpha + 3.0d0))) * (1.0d0 / (alpha + 2.0d0))
else
tmp = ((1.0d0 + alpha) / (alpha + (beta + 3.0d0))) / (beta + (alpha + 2.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.0) {
tmp = ((1.0 + alpha) / ((alpha + 2.0) * (alpha + 3.0))) * (1.0 / (alpha + 2.0));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / (beta + (alpha + 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.0: tmp = ((1.0 + alpha) / ((alpha + 2.0) * (alpha + 3.0))) * (1.0 / (alpha + 2.0)) else: tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / (beta + (alpha + 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.0) tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(Float64(alpha + 2.0) * Float64(alpha + 3.0))) * Float64(1.0 / Float64(alpha + 2.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 3.0))) / Float64(beta + Float64(alpha + 2.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.0)
tmp = ((1.0 + alpha) / ((alpha + 2.0) * (alpha + 3.0))) * (1.0 / (alpha + 2.0));
else
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / (beta + (alpha + 2.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.0], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(N[(alpha + 2.0), $MachinePrecision] * N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1:\\
\;\;\;\;\frac{1 + \alpha}{\left(\alpha + 2\right) \cdot \left(\alpha + 3\right)} \cdot \frac{1}{\alpha + 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(\beta + 3\right)}}{\beta + \left(\alpha + 2\right)}\\
\end{array}
\end{array}
if beta < 1Initial program 99.9%
associate-/l/99.3%
associate-/r*93.0%
associate-+l+93.0%
+-commutative93.0%
associate-+r+93.0%
associate-+l+93.0%
distribute-rgt1-in93.0%
*-rgt-identity93.0%
distribute-lft-out93.0%
*-commutative93.0%
metadata-eval93.0%
associate-+l+93.0%
+-commutative93.0%
Simplified93.0%
times-frac99.3%
associate-+r+99.3%
+-commutative99.3%
+-commutative99.3%
+-commutative99.3%
associate-+r+99.3%
+-commutative99.3%
+-commutative99.3%
Applied egg-rr99.3%
frac-times93.0%
*-commutative93.0%
+-commutative93.0%
+-commutative93.0%
+-commutative93.0%
associate-+r+93.0%
+-commutative93.0%
*-commutative93.0%
+-commutative93.0%
+-commutative93.0%
associate-+r+93.0%
+-commutative93.0%
Applied egg-rr93.0%
associate-/r*99.4%
+-commutative99.4%
*-commutative99.4%
+-commutative99.4%
associate-*l/99.3%
*-commutative99.3%
associate-*l/99.3%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in beta around 0 98.5%
Taylor expanded in beta around 0 98.1%
if 1 < beta Initial program 86.7%
associate-/l/82.7%
associate-/r*72.7%
associate-+l+72.7%
+-commutative72.7%
associate-+r+72.7%
associate-+l+72.7%
distribute-rgt1-in72.7%
*-rgt-identity72.7%
distribute-lft-out72.7%
*-commutative72.7%
metadata-eval72.7%
associate-+l+72.7%
+-commutative72.7%
Simplified72.7%
times-frac94.9%
associate-+r+94.9%
+-commutative94.9%
+-commutative94.9%
+-commutative94.9%
associate-+r+94.9%
+-commutative94.9%
+-commutative94.9%
Applied egg-rr94.9%
Taylor expanded in beta around inf 92.7%
*-un-lft-identity92.7%
*-commutative92.7%
+-commutative92.7%
+-commutative92.7%
associate-+r+92.7%
+-commutative92.7%
Applied egg-rr92.7%
*-lft-identity92.7%
associate-/r*82.5%
+-commutative82.5%
associate-+r+82.5%
+-commutative82.5%
Simplified82.5%
Final simplification93.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.7e+20) (/ (+ 1.0 beta) (* (+ alpha (+ beta 2.0)) (* (+ beta 3.0) (+ beta 2.0)))) (/ (/ (+ 1.0 alpha) (+ alpha (+ beta 3.0))) (+ beta (+ alpha 2.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.7e+20) {
tmp = (1.0 + beta) / ((alpha + (beta + 2.0)) * ((beta + 3.0) * (beta + 2.0)));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / (beta + (alpha + 2.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.7d+20) then
tmp = (1.0d0 + beta) / ((alpha + (beta + 2.0d0)) * ((beta + 3.0d0) * (beta + 2.0d0)))
else
tmp = ((1.0d0 + alpha) / (alpha + (beta + 3.0d0))) / (beta + (alpha + 2.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.7e+20) {
tmp = (1.0 + beta) / ((alpha + (beta + 2.0)) * ((beta + 3.0) * (beta + 2.0)));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / (beta + (alpha + 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.7e+20: tmp = (1.0 + beta) / ((alpha + (beta + 2.0)) * ((beta + 3.0) * (beta + 2.0))) else: tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / (beta + (alpha + 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.7e+20) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(alpha + Float64(beta + 2.0)) * Float64(Float64(beta + 3.0) * Float64(beta + 2.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 3.0))) / Float64(beta + Float64(alpha + 2.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.7e+20)
tmp = (1.0 + beta) / ((alpha + (beta + 2.0)) * ((beta + 3.0) * (beta + 2.0)));
else
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / (beta + (alpha + 2.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.7e+20], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(beta + 3.0), $MachinePrecision] * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.7 \cdot 10^{+20}:\\
\;\;\;\;\frac{1 + \beta}{\left(\alpha + \left(\beta + 2\right)\right) \cdot \left(\left(\beta + 3\right) \cdot \left(\beta + 2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(\beta + 3\right)}}{\beta + \left(\alpha + 2\right)}\\
\end{array}
\end{array}
if beta < 2.7e20Initial program 99.9%
associate-/l/99.0%
associate-/r*92.8%
associate-+l+92.8%
+-commutative92.8%
associate-+r+92.8%
associate-+l+92.8%
distribute-rgt1-in92.8%
*-rgt-identity92.8%
distribute-lft-out92.8%
*-commutative92.8%
metadata-eval92.8%
associate-+l+92.8%
+-commutative92.8%
Simplified92.8%
Taylor expanded in alpha around 0 82.1%
Taylor expanded in alpha around 0 63.6%
if 2.7e20 < beta Initial program 86.1%
associate-/l/82.6%
associate-/r*72.1%
associate-+l+72.1%
+-commutative72.1%
associate-+r+72.1%
associate-+l+72.1%
distribute-rgt1-in72.1%
*-rgt-identity72.1%
distribute-lft-out72.1%
*-commutative72.1%
metadata-eval72.1%
associate-+l+72.1%
+-commutative72.1%
Simplified72.1%
times-frac95.4%
associate-+r+95.4%
+-commutative95.4%
+-commutative95.4%
+-commutative95.4%
associate-+r+95.4%
+-commutative95.4%
+-commutative95.4%
Applied egg-rr95.4%
Taylor expanded in beta around inf 94.3%
*-un-lft-identity94.3%
*-commutative94.3%
+-commutative94.3%
+-commutative94.3%
associate-+r+94.3%
+-commutative94.3%
Applied egg-rr94.3%
*-lft-identity94.3%
associate-/r*84.1%
+-commutative84.1%
associate-+r+84.1%
+-commutative84.1%
Simplified84.1%
Final simplification69.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.3) (/ (+ 1.0 beta) (* (+ beta 2.0) (+ 6.0 (* beta 5.0)))) (/ (/ (+ 1.0 alpha) (+ alpha (+ beta 3.0))) (+ beta (+ alpha 2.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.3) {
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / (beta + (alpha + 2.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.3d0) then
tmp = (1.0d0 + beta) / ((beta + 2.0d0) * (6.0d0 + (beta * 5.0d0)))
else
tmp = ((1.0d0 + alpha) / (alpha + (beta + 3.0d0))) / (beta + (alpha + 2.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.3) {
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / (beta + (alpha + 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.3: tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0))) else: tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / (beta + (alpha + 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.3) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(6.0 + Float64(beta * 5.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 3.0))) / Float64(beta + Float64(alpha + 2.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.3)
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
else
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / (beta + (alpha + 2.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.3], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(6.0 + N[(beta * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.3:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(6 + \beta \cdot 5\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(\beta + 3\right)}}{\beta + \left(\alpha + 2\right)}\\
\end{array}
\end{array}
if beta < 2.2999999999999998Initial program 99.9%
associate-/l/99.3%
associate-/r*93.0%
associate-+l+93.0%
+-commutative93.0%
associate-+r+93.0%
associate-+l+93.0%
distribute-rgt1-in93.0%
*-rgt-identity93.0%
distribute-lft-out93.0%
*-commutative93.0%
metadata-eval93.0%
associate-+l+93.0%
+-commutative93.0%
Simplified93.0%
Taylor expanded in beta around 0 92.5%
Taylor expanded in alpha around 0 61.6%
if 2.2999999999999998 < beta Initial program 86.7%
associate-/l/82.7%
associate-/r*72.7%
associate-+l+72.7%
+-commutative72.7%
associate-+r+72.7%
associate-+l+72.7%
distribute-rgt1-in72.7%
*-rgt-identity72.7%
distribute-lft-out72.7%
*-commutative72.7%
metadata-eval72.7%
associate-+l+72.7%
+-commutative72.7%
Simplified72.7%
times-frac94.9%
associate-+r+94.9%
+-commutative94.9%
+-commutative94.9%
+-commutative94.9%
associate-+r+94.9%
+-commutative94.9%
+-commutative94.9%
Applied egg-rr94.9%
Taylor expanded in beta around inf 92.7%
*-un-lft-identity92.7%
*-commutative92.7%
+-commutative92.7%
+-commutative92.7%
associate-+r+92.7%
+-commutative92.7%
Applied egg-rr92.7%
*-lft-identity92.7%
associate-/r*82.5%
+-commutative82.5%
associate-+r+82.5%
+-commutative82.5%
Simplified82.5%
Final simplification68.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 6.6) (/ (+ 1.0 beta) (* (+ beta 2.0) (+ 6.0 (* beta 5.0)))) (/ (+ 1.0 alpha) (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 6.6) {
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.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 <= 6.6d0) then
tmp = (1.0d0 + beta) / ((beta + 2.0d0) * (6.0d0 + (beta * 5.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 <= 6.6) {
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 6.6: tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0))) else: tmp = (1.0 + alpha) / (beta * beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 6.6) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(6.0 + Float64(beta * 5.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 <= 6.6)
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.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, 6.6], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(6.0 + N[(beta * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(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 6.6:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(6 + \beta \cdot 5\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 6.5999999999999996Initial program 99.9%
associate-/l/99.3%
associate-/r*93.0%
associate-+l+93.0%
+-commutative93.0%
associate-+r+93.0%
associate-+l+93.0%
distribute-rgt1-in93.0%
*-rgt-identity93.0%
distribute-lft-out93.0%
*-commutative93.0%
metadata-eval93.0%
associate-+l+93.0%
+-commutative93.0%
Simplified93.0%
Taylor expanded in beta around 0 92.5%
Taylor expanded in alpha around 0 61.6%
if 6.5999999999999996 < beta Initial program 86.7%
associate-/l/82.7%
associate-+l+82.7%
+-commutative82.7%
associate-+r+82.7%
associate-+l+82.7%
distribute-rgt1-in82.7%
*-rgt-identity82.7%
distribute-lft-out82.7%
+-commutative82.7%
associate-*r/94.8%
associate-*r/85.5%
Simplified85.5%
Taylor expanded in beta around inf 81.3%
unpow281.3%
Simplified81.3%
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.5) (/ (+ 1.0 beta) (* (+ beta 2.0) (+ 6.0 (* beta 5.0)))) (/ (/ (+ 1.0 alpha) beta) (+ 1.0 (+ 2.0 (+ alpha beta))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.5) {
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
} else {
tmp = ((1.0 + alpha) / beta) / (1.0 + (2.0 + (alpha + beta)));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 4.5d0) then
tmp = (1.0d0 + beta) / ((beta + 2.0d0) * (6.0d0 + (beta * 5.0d0)))
else
tmp = ((1.0d0 + alpha) / beta) / (1.0d0 + (2.0d0 + (alpha + beta)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 4.5) {
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
} else {
tmp = ((1.0 + alpha) / beta) / (1.0 + (2.0 + (alpha + beta)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.5: tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0))) else: tmp = ((1.0 + alpha) / beta) / (1.0 + (2.0 + (alpha + beta))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.5) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(6.0 + Float64(beta * 5.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(1.0 + Float64(2.0 + Float64(alpha + beta)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 4.5)
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
else
tmp = ((1.0 + alpha) / beta) / (1.0 + (2.0 + (alpha + beta)));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 4.5], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(6.0 + N[(beta * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(1.0 + N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4.5:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(6 + \beta \cdot 5\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{1 + \left(2 + \left(\alpha + \beta\right)\right)}\\
\end{array}
\end{array}
if beta < 4.5Initial program 99.9%
associate-/l/99.3%
associate-/r*93.0%
associate-+l+93.0%
+-commutative93.0%
associate-+r+93.0%
associate-+l+93.0%
distribute-rgt1-in93.0%
*-rgt-identity93.0%
distribute-lft-out93.0%
*-commutative93.0%
metadata-eval93.0%
associate-+l+93.0%
+-commutative93.0%
Simplified93.0%
Taylor expanded in beta around 0 92.5%
Taylor expanded in alpha around 0 61.6%
if 4.5 < beta Initial program 86.7%
Taylor expanded in beta around -inf 81.8%
associate-*r/81.8%
mul-1-neg81.8%
sub-neg81.8%
mul-1-neg81.8%
distribute-neg-in81.8%
+-commutative81.8%
mul-1-neg81.8%
distribute-lft-in81.8%
metadata-eval81.8%
mul-1-neg81.8%
unsub-neg81.8%
Simplified81.8%
Final simplification68.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 9.6) (/ 0.5 (* (+ beta 3.0) (+ beta 2.0))) (/ (+ 1.0 alpha) (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 9.6) {
tmp = 0.5 / ((beta + 3.0) * (beta + 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 <= 9.6d0) then
tmp = 0.5d0 / ((beta + 3.0d0) * (beta + 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 <= 9.6) {
tmp = 0.5 / ((beta + 3.0) * (beta + 2.0));
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 9.6: tmp = 0.5 / ((beta + 3.0) * (beta + 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 <= 9.6) tmp = Float64(0.5 / Float64(Float64(beta + 3.0) * Float64(beta + 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 <= 9.6)
tmp = 0.5 / ((beta + 3.0) * (beta + 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, 9.6], N[(0.5 / N[(N[(beta + 3.0), $MachinePrecision] * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 9.6:\\
\;\;\;\;\frac{0.5}{\left(\beta + 3\right) \cdot \left(\beta + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 9.59999999999999964Initial program 99.9%
associate-/l/99.3%
associate-/r*93.0%
associate-+l+93.0%
+-commutative93.0%
associate-+r+93.0%
associate-+l+93.0%
distribute-rgt1-in93.0%
*-rgt-identity93.0%
distribute-lft-out93.0%
*-commutative93.0%
metadata-eval93.0%
associate-+l+93.0%
+-commutative93.0%
Simplified93.0%
times-frac99.3%
associate-+r+99.3%
+-commutative99.3%
+-commutative99.3%
+-commutative99.3%
associate-+r+99.3%
+-commutative99.3%
+-commutative99.3%
Applied egg-rr99.3%
frac-times93.0%
*-commutative93.0%
+-commutative93.0%
+-commutative93.0%
+-commutative93.0%
associate-+r+93.0%
+-commutative93.0%
*-commutative93.0%
+-commutative93.0%
+-commutative93.0%
associate-+r+93.0%
+-commutative93.0%
Applied egg-rr93.0%
associate-/r*99.4%
+-commutative99.4%
*-commutative99.4%
+-commutative99.4%
associate-*l/99.3%
*-commutative99.3%
associate-*l/99.3%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in beta around 0 98.5%
Taylor expanded in alpha around 0 60.9%
if 9.59999999999999964 < beta Initial program 86.7%
associate-/l/82.7%
associate-+l+82.7%
+-commutative82.7%
associate-+r+82.7%
associate-+l+82.7%
distribute-rgt1-in82.7%
*-rgt-identity82.7%
distribute-lft-out82.7%
+-commutative82.7%
associate-*r/94.8%
associate-*r/85.5%
Simplified85.5%
Taylor expanded in beta around inf 81.3%
unpow281.3%
Simplified81.3%
Final simplification67.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.55) 0.16666666666666666 (/ (+ 1.0 alpha) (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.55) {
tmp = 0.16666666666666666;
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.55d0) then
tmp = 0.16666666666666666d0
else
tmp = (1.0d0 + alpha) / (beta * beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.55) {
tmp = 0.16666666666666666;
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.55: tmp = 0.16666666666666666 else: tmp = (1.0 + alpha) / (beta * beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.55) tmp = 0.16666666666666666; else tmp = Float64(Float64(1.0 + alpha) / Float64(beta * beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.55)
tmp = 0.16666666666666666;
else
tmp = (1.0 + alpha) / (beta * beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.55], 0.16666666666666666, N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.55:\\
\;\;\;\;0.16666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 2.5499999999999998Initial program 99.9%
associate-/l/99.3%
associate-+l+99.3%
+-commutative99.3%
associate-+r+99.3%
associate-+l+99.3%
distribute-rgt1-in99.3%
*-rgt-identity99.3%
distribute-lft-out99.3%
+-commutative99.3%
associate-*r/99.3%
associate-*r/99.3%
Simplified99.3%
Taylor expanded in alpha around inf 47.6%
Taylor expanded in beta around 0 47.6%
associate-/r*48.1%
Simplified48.1%
Taylor expanded in alpha around 0 13.3%
if 2.5499999999999998 < beta Initial program 86.7%
associate-/l/82.7%
associate-+l+82.7%
+-commutative82.7%
associate-+r+82.7%
associate-+l+82.7%
distribute-rgt1-in82.7%
*-rgt-identity82.7%
distribute-lft-out82.7%
+-commutative82.7%
associate-*r/94.8%
associate-*r/85.5%
Simplified85.5%
Taylor expanded in beta around inf 81.3%
unpow281.3%
Simplified81.3%
Final simplification35.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.45) 0.16666666666666666 (/ 1.0 (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.45) {
tmp = 0.16666666666666666;
} 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 <= 2.45d0) then
tmp = 0.16666666666666666d0
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 <= 2.45) {
tmp = 0.16666666666666666;
} else {
tmp = 1.0 / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.45: tmp = 0.16666666666666666 else: tmp = 1.0 / (beta * beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.45) tmp = 0.16666666666666666; 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 <= 2.45)
tmp = 0.16666666666666666;
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, 2.45], 0.16666666666666666, N[(1.0 / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.45:\\
\;\;\;\;0.16666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 2.4500000000000002Initial program 99.9%
associate-/l/99.3%
associate-+l+99.3%
+-commutative99.3%
associate-+r+99.3%
associate-+l+99.3%
distribute-rgt1-in99.3%
*-rgt-identity99.3%
distribute-lft-out99.3%
+-commutative99.3%
associate-*r/99.3%
associate-*r/99.3%
Simplified99.3%
Taylor expanded in alpha around inf 47.6%
Taylor expanded in beta around 0 47.6%
associate-/r*48.1%
Simplified48.1%
Taylor expanded in alpha around 0 13.3%
if 2.4500000000000002 < beta Initial program 86.7%
associate-/l/82.7%
associate-+l+82.7%
+-commutative82.7%
associate-+r+82.7%
associate-+l+82.7%
distribute-rgt1-in82.7%
*-rgt-identity82.7%
distribute-lft-out82.7%
+-commutative82.7%
associate-*r/94.8%
associate-*r/85.5%
Simplified85.5%
Taylor expanded in beta around inf 81.3%
unpow281.3%
Simplified81.3%
Taylor expanded in alpha around 0 78.6%
unpow278.6%
Simplified78.6%
Final simplification34.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.2) 0.16666666666666666 (/ 0.2 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.2) {
tmp = 0.16666666666666666;
} else {
tmp = 0.2 / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.2d0) then
tmp = 0.16666666666666666d0
else
tmp = 0.2d0 / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.2) {
tmp = 0.16666666666666666;
} else {
tmp = 0.2 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.2: tmp = 0.16666666666666666 else: tmp = 0.2 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.2) tmp = 0.16666666666666666; else tmp = Float64(0.2 / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.2)
tmp = 0.16666666666666666;
else
tmp = 0.2 / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.2], 0.16666666666666666, N[(0.2 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.2:\\
\;\;\;\;0.16666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{0.2}{\beta}\\
\end{array}
\end{array}
if beta < 1.19999999999999996Initial program 99.9%
associate-/l/99.3%
associate-+l+99.3%
+-commutative99.3%
associate-+r+99.3%
associate-+l+99.3%
distribute-rgt1-in99.3%
*-rgt-identity99.3%
distribute-lft-out99.3%
+-commutative99.3%
associate-*r/99.3%
associate-*r/99.3%
Simplified99.3%
Taylor expanded in alpha around inf 47.6%
Taylor expanded in beta around 0 47.6%
associate-/r*48.1%
Simplified48.1%
Taylor expanded in alpha around 0 13.3%
if 1.19999999999999996 < beta Initial program 86.7%
associate-/l/82.7%
associate-/r*72.7%
associate-+l+72.7%
+-commutative72.7%
associate-+r+72.7%
associate-+l+72.7%
distribute-rgt1-in72.7%
*-rgt-identity72.7%
distribute-lft-out72.7%
*-commutative72.7%
metadata-eval72.7%
associate-+l+72.7%
+-commutative72.7%
Simplified72.7%
Taylor expanded in beta around 0 50.0%
Taylor expanded in beta around inf 18.1%
Taylor expanded in alpha around 0 6.8%
Final simplification11.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 0.16666666666666666)
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.16666666666666666;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.16666666666666666d0
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.16666666666666666;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.16666666666666666
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return 0.16666666666666666 end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.16666666666666666;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := 0.16666666666666666
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
0.16666666666666666
\end{array}
Initial program 95.6%
associate-/l/93.9%
associate-+l+93.9%
+-commutative93.9%
associate-+r+93.9%
associate-+l+93.9%
distribute-rgt1-in93.9%
*-rgt-identity93.9%
distribute-lft-out93.9%
+-commutative93.9%
associate-*r/97.9%
associate-*r/94.8%
Simplified94.8%
Taylor expanded in alpha around inf 52.2%
Taylor expanded in beta around 0 37.9%
associate-/r*38.2%
Simplified38.2%
Taylor expanded in alpha around 0 10.3%
Final simplification10.3%
herbie shell --seed 2023230
(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)))