
(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 (+ (+ beta alpha) 2.0))) (* (/ (+ beta 1.0) t_0) (/ (/ (+ 1.0 alpha) t_0) (+ alpha (+ beta 3.0))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = (beta + alpha) + 2.0;
return ((beta + 1.0) / t_0) * (((1.0 + alpha) / t_0) / (alpha + (beta + 3.0)));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (beta + alpha) + 2.0d0
code = ((beta + 1.0d0) / t_0) * (((1.0d0 + alpha) / t_0) / (alpha + (beta + 3.0d0)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = (beta + alpha) + 2.0;
return ((beta + 1.0) / t_0) * (((1.0 + alpha) / t_0) / (alpha + (beta + 3.0)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = (beta + alpha) + 2.0 return ((beta + 1.0) / t_0) * (((1.0 + alpha) / t_0) / (alpha + (beta + 3.0)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(Float64(beta + alpha) + 2.0) return Float64(Float64(Float64(beta + 1.0) / t_0) * Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(alpha + Float64(beta + 3.0)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = (beta + alpha) + 2.0;
tmp = ((beta + 1.0) / t_0) * (((1.0 + alpha) / t_0) / (alpha + (beta + 3.0)));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(beta + alpha), $MachinePrecision] + 2.0), $MachinePrecision]}, N[(N[(N[(beta + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \left(\beta + \alpha\right) + 2\\
\frac{\beta + 1}{t_0} \cdot \frac{\frac{1 + \alpha}{t_0}}{\alpha + \left(\beta + 3\right)}
\end{array}
\end{array}
Initial program 94.5%
associate-/l/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%
associate-*l/95.4%
*-commutative95.4%
associate-*r/91.8%
Simplified91.8%
associate-*r/95.4%
+-commutative95.4%
Applied egg-rr95.4%
+-commutative95.4%
*-commutative95.4%
+-commutative95.4%
associate-*r/95.4%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.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+140)
(* (+ 1.0 alpha) (/ (/ (+ beta 1.0) t_1) (* t_0 t_1)))
(*
(/ (/ (+ 1.0 alpha) (+ (+ beta alpha) 2.0)) t_0)
(+ 1.0 (/ (- -1.0 alpha) beta))))))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+140) {
tmp = (1.0 + alpha) * (((beta + 1.0) / t_1) / (t_0 * t_1));
} else {
tmp = (((1.0 + alpha) / ((beta + alpha) + 2.0)) / t_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) :: t_1
real(8) :: tmp
t_0 = alpha + (beta + 3.0d0)
t_1 = alpha + (beta + 2.0d0)
if (beta <= 1d+140) then
tmp = (1.0d0 + alpha) * (((beta + 1.0d0) / t_1) / (t_0 * t_1))
else
tmp = (((1.0d0 + alpha) / ((beta + alpha) + 2.0d0)) / t_0) * (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 + 3.0);
double t_1 = alpha + (beta + 2.0);
double tmp;
if (beta <= 1e+140) {
tmp = (1.0 + alpha) * (((beta + 1.0) / t_1) / (t_0 * t_1));
} else {
tmp = (((1.0 + alpha) / ((beta + alpha) + 2.0)) / t_0) * (1.0 + ((-1.0 - alpha) / beta));
}
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+140: tmp = (1.0 + alpha) * (((beta + 1.0) / t_1) / (t_0 * t_1)) else: tmp = (((1.0 + alpha) / ((beta + alpha) + 2.0)) / t_0) * (1.0 + ((-1.0 - alpha) / beta)) 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+140) tmp = Float64(Float64(1.0 + alpha) * Float64(Float64(Float64(beta + 1.0) / t_1) / Float64(t_0 * t_1))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / Float64(Float64(beta + alpha) + 2.0)) / t_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 + 3.0);
t_1 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 1e+140)
tmp = (1.0 + alpha) * (((beta + 1.0) / t_1) / (t_0 * t_1));
else
tmp = (((1.0 + alpha) / ((beta + alpha) + 2.0)) / t_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 + 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 1e+140], N[(N[(1.0 + alpha), $MachinePrecision] * N[(N[(N[(beta + 1.0), $MachinePrecision] / t$95$1), $MachinePrecision] / N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(N[(beta + alpha), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $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 + 3\right)\\
t_1 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 10^{+140}:\\
\;\;\;\;\left(1 + \alpha\right) \cdot \frac{\frac{\beta + 1}{t_1}}{t_0 \cdot t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\left(\beta + \alpha\right) + 2}}{t_0} \cdot \left(1 + \frac{-1 - \alpha}{\beta}\right)\\
\end{array}
\end{array}
if beta < 1.00000000000000006e140Initial program 99.8%
associate-/l/98.4%
associate-+l+98.4%
+-commutative98.4%
associate-+r+98.4%
associate-+l+98.4%
distribute-rgt1-in98.4%
*-rgt-identity98.4%
distribute-lft-out98.4%
+-commutative98.4%
associate-*l/98.4%
*-commutative98.4%
associate-*r/94.0%
Simplified94.0%
if 1.00000000000000006e140 < beta Initial program 71.3%
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/82.6%
*-commutative82.6%
associate-*r/82.6%
Simplified82.6%
associate-*r/82.6%
+-commutative82.6%
Applied egg-rr82.6%
+-commutative82.6%
*-commutative82.6%
+-commutative82.6%
associate-*r/82.6%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in beta around inf 85.4%
mul-1-neg84.8%
unsub-neg84.8%
Simplified85.4%
Final simplification92.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 800000000.0)
(/ (/ (+ beta 1.0) (* (+ beta 3.0) (+ beta 2.0))) (+ beta (+ alpha 2.0)))
(*
(/ (/ (+ 1.0 alpha) (+ (+ beta alpha) 2.0)) (+ alpha (+ beta 3.0)))
(+ 1.0 (/ (- -1.0 alpha) beta)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 800000000.0) {
tmp = ((beta + 1.0) / ((beta + 3.0) * (beta + 2.0))) / (beta + (alpha + 2.0));
} else {
tmp = (((1.0 + alpha) / ((beta + alpha) + 2.0)) / (alpha + (beta + 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) :: tmp
if (beta <= 800000000.0d0) then
tmp = ((beta + 1.0d0) / ((beta + 3.0d0) * (beta + 2.0d0))) / (beta + (alpha + 2.0d0))
else
tmp = (((1.0d0 + alpha) / ((beta + alpha) + 2.0d0)) / (alpha + (beta + 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 tmp;
if (beta <= 800000000.0) {
tmp = ((beta + 1.0) / ((beta + 3.0) * (beta + 2.0))) / (beta + (alpha + 2.0));
} else {
tmp = (((1.0 + alpha) / ((beta + alpha) + 2.0)) / (alpha + (beta + 3.0))) * (1.0 + ((-1.0 - alpha) / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 800000000.0: tmp = ((beta + 1.0) / ((beta + 3.0) * (beta + 2.0))) / (beta + (alpha + 2.0)) else: tmp = (((1.0 + alpha) / ((beta + alpha) + 2.0)) / (alpha + (beta + 3.0))) * (1.0 + ((-1.0 - alpha) / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 800000000.0) tmp = Float64(Float64(Float64(beta + 1.0) / Float64(Float64(beta + 3.0) * Float64(beta + 2.0))) / Float64(beta + Float64(alpha + 2.0))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / Float64(Float64(beta + alpha) + 2.0)) / Float64(alpha + Float64(beta + 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)
tmp = 0.0;
if (beta <= 800000000.0)
tmp = ((beta + 1.0) / ((beta + 3.0) * (beta + 2.0))) / (beta + (alpha + 2.0));
else
tmp = (((1.0 + alpha) / ((beta + alpha) + 2.0)) / (alpha + (beta + 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_] := If[LessEqual[beta, 800000000.0], N[(N[(N[(beta + 1.0), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(N[(beta + alpha), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] / N[(alpha + N[(beta + 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}
\mathbf{if}\;\beta \leq 800000000:\\
\;\;\;\;\frac{\frac{\beta + 1}{\left(\beta + 3\right) \cdot \left(\beta + 2\right)}}{\beta + \left(\alpha + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\left(\beta + \alpha\right) + 2}}{\alpha + \left(\beta + 3\right)} \cdot \left(1 + \frac{-1 - \alpha}{\beta}\right)\\
\end{array}
\end{array}
if beta < 8e8Initial program 99.9%
associate-/l/99.2%
associate-+l+99.2%
+-commutative99.2%
associate-+r+99.2%
associate-+l+99.2%
distribute-rgt1-in99.2%
*-rgt-identity99.2%
distribute-lft-out99.2%
+-commutative99.2%
associate-*l/99.2%
*-commutative99.2%
associate-*r/93.9%
Simplified93.9%
associate-*r/99.2%
+-commutative99.2%
Applied egg-rr99.2%
+-commutative99.2%
*-commutative99.2%
+-commutative99.2%
associate-*r/99.2%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in alpha around 0 69.4%
associate-/r*69.4%
Simplified69.4%
associate-*l/69.5%
+-commutative69.5%
associate-/r*69.5%
associate-+l+69.5%
Applied egg-rr69.5%
associate-*r/69.5%
+-commutative69.5%
*-rgt-identity69.5%
+-commutative69.5%
Simplified69.5%
if 8e8 < beta Initial program 83.2%
associate-/l/80.1%
associate-+l+80.1%
+-commutative80.1%
associate-+r+80.1%
associate-+l+80.1%
distribute-rgt1-in80.1%
*-rgt-identity80.1%
distribute-lft-out80.1%
+-commutative80.1%
associate-*l/87.6%
*-commutative87.6%
associate-*r/87.6%
Simplified87.6%
associate-*r/87.6%
+-commutative87.6%
Applied egg-rr87.6%
+-commutative87.6%
*-commutative87.6%
+-commutative87.6%
associate-*r/87.6%
associate-/r*99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 86.7%
mul-1-neg85.8%
unsub-neg85.8%
Simplified86.7%
Final simplification75.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 7.8e+15)
(/ (/ (+ beta 1.0) (* (+ beta 3.0) (+ beta 2.0))) (+ beta (+ alpha 2.0)))
(*
(+ 1.0 (/ (- -1.0 alpha) beta))
(/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 3.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 7.8e+15) {
tmp = ((beta + 1.0) / ((beta + 3.0) * (beta + 2.0))) / (beta + (alpha + 2.0));
} else {
tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / beta) / (alpha + (beta + 3.0)));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 7.8d+15) then
tmp = ((beta + 1.0d0) / ((beta + 3.0d0) * (beta + 2.0d0))) / (beta + (alpha + 2.0d0))
else
tmp = (1.0d0 + (((-1.0d0) - alpha) / beta)) * (((1.0d0 + alpha) / beta) / (alpha + (beta + 3.0d0)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 7.8e+15) {
tmp = ((beta + 1.0) / ((beta + 3.0) * (beta + 2.0))) / (beta + (alpha + 2.0));
} else {
tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / beta) / (alpha + (beta + 3.0)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 7.8e+15: tmp = ((beta + 1.0) / ((beta + 3.0) * (beta + 2.0))) / (beta + (alpha + 2.0)) else: tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / beta) / (alpha + (beta + 3.0))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 7.8e+15) tmp = Float64(Float64(Float64(beta + 1.0) / Float64(Float64(beta + 3.0) * Float64(beta + 2.0))) / Float64(beta + Float64(alpha + 2.0))); else tmp = Float64(Float64(1.0 + Float64(Float64(-1.0 - alpha) / beta)) * Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 3.0)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 7.8e+15)
tmp = ((beta + 1.0) / ((beta + 3.0) * (beta + 2.0))) / (beta + (alpha + 2.0));
else
tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / beta) / (alpha + (beta + 3.0)));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 7.8e+15], N[(N[(N[(beta + 1.0), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(-1.0 - alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 7.8 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{\beta + 1}{\left(\beta + 3\right) \cdot \left(\beta + 2\right)}}{\beta + \left(\alpha + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{-1 - \alpha}{\beta}\right) \cdot \frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 7.8e15Initial program 99.9%
associate-/l/99.2%
associate-+l+99.2%
+-commutative99.2%
associate-+r+99.2%
associate-+l+99.2%
distribute-rgt1-in99.2%
*-rgt-identity99.2%
distribute-lft-out99.2%
+-commutative99.2%
associate-*l/99.2%
*-commutative99.2%
associate-*r/93.9%
Simplified93.9%
associate-*r/99.2%
+-commutative99.2%
Applied egg-rr99.2%
+-commutative99.2%
*-commutative99.2%
+-commutative99.2%
associate-*r/99.2%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in alpha around 0 69.4%
associate-/r*69.4%
Simplified69.4%
associate-*l/69.5%
+-commutative69.5%
associate-/r*69.5%
associate-+l+69.5%
Applied egg-rr69.5%
associate-*r/69.5%
+-commutative69.5%
*-rgt-identity69.5%
+-commutative69.5%
Simplified69.5%
if 7.8e15 < beta Initial program 83.2%
associate-/l/80.1%
associate-+l+80.1%
+-commutative80.1%
associate-+r+80.1%
associate-+l+80.1%
distribute-rgt1-in80.1%
*-rgt-identity80.1%
distribute-lft-out80.1%
+-commutative80.1%
associate-*l/87.6%
*-commutative87.6%
associate-*r/87.6%
Simplified87.6%
associate-*r/87.6%
+-commutative87.6%
Applied egg-rr87.6%
+-commutative87.6%
*-commutative87.6%
+-commutative87.6%
associate-*r/87.6%
associate-/r*99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 86.4%
Taylor expanded in beta around inf 85.8%
mul-1-neg85.8%
unsub-neg85.8%
Simplified85.8%
Final simplification74.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 8.2e+15) (* (+ beta 1.0) (/ (/ 1.0 (+ beta 2.0)) (* (+ beta 3.0) (+ beta 2.0)))) (/ (/ (+ 1.0 alpha) (+ beta 3.0)) (+ beta 2.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 8.2e+15) {
tmp = (beta + 1.0) * ((1.0 / (beta + 2.0)) / ((beta + 3.0) * (beta + 2.0)));
} else {
tmp = ((1.0 + alpha) / (beta + 3.0)) / (beta + 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 <= 8.2d+15) then
tmp = (beta + 1.0d0) * ((1.0d0 / (beta + 2.0d0)) / ((beta + 3.0d0) * (beta + 2.0d0)))
else
tmp = ((1.0d0 + alpha) / (beta + 3.0d0)) / (beta + 2.0d0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 8.2e+15) {
tmp = (beta + 1.0) * ((1.0 / (beta + 2.0)) / ((beta + 3.0) * (beta + 2.0)));
} else {
tmp = ((1.0 + alpha) / (beta + 3.0)) / (beta + 2.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 8.2e+15: tmp = (beta + 1.0) * ((1.0 / (beta + 2.0)) / ((beta + 3.0) * (beta + 2.0))) else: tmp = ((1.0 + alpha) / (beta + 3.0)) / (beta + 2.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 8.2e+15) tmp = Float64(Float64(beta + 1.0) * Float64(Float64(1.0 / Float64(beta + 2.0)) / Float64(Float64(beta + 3.0) * Float64(beta + 2.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(beta + 3.0)) / Float64(beta + 2.0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 8.2e+15)
tmp = (beta + 1.0) * ((1.0 / (beta + 2.0)) / ((beta + 3.0) * (beta + 2.0)));
else
tmp = ((1.0 + alpha) / (beta + 3.0)) / (beta + 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, 8.2e+15], N[(N[(beta + 1.0), $MachinePrecision] * N[(N[(1.0 / 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[(beta + 3.0), $MachinePrecision]), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 8.2 \cdot 10^{+15}:\\
\;\;\;\;\left(\beta + 1\right) \cdot \frac{\frac{1}{\beta + 2}}{\left(\beta + 3\right) \cdot \left(\beta + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta + 3}}{\beta + 2}\\
\end{array}
\end{array}
if beta < 8.2e15Initial program 99.9%
associate-/l/99.2%
associate-+l+99.2%
+-commutative99.2%
associate-+r+99.2%
associate-+l+99.2%
distribute-rgt1-in99.2%
*-rgt-identity99.2%
distribute-lft-out99.2%
+-commutative99.2%
associate-*r/99.2%
associate-*r/99.3%
Simplified99.3%
Taylor expanded in alpha around 0 83.8%
Taylor expanded in alpha around 0 68.7%
if 8.2e15 < beta Initial program 83.2%
associate-/l/80.1%
associate-+l+80.1%
+-commutative80.1%
associate-+r+80.1%
associate-+l+80.1%
distribute-rgt1-in80.1%
*-rgt-identity80.1%
distribute-lft-out80.1%
+-commutative80.1%
associate-*l/87.6%
*-commutative87.6%
associate-*r/87.6%
Simplified87.6%
Taylor expanded in alpha around 0 84.8%
Taylor expanded in beta around inf 84.7%
expm1-log1p-u84.7%
expm1-udef46.6%
un-div-inv46.6%
+-commutative46.6%
Applied egg-rr46.6%
expm1-def84.7%
expm1-log1p84.7%
associate-/r*85.9%
Simplified85.9%
Final simplification74.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 6.5e+16)
(* (+ beta 1.0) (/ (/ 1.0 (+ beta 2.0)) (* (+ beta 3.0) (+ beta 2.0))))
(*
(/ (+ beta 1.0) beta)
(/ (/ (+ 1.0 alpha) (+ alpha (+ beta 2.0))) beta))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 6.5e+16) {
tmp = (beta + 1.0) * ((1.0 / (beta + 2.0)) / ((beta + 3.0) * (beta + 2.0)));
} else {
tmp = ((beta + 1.0) / beta) * (((1.0 + alpha) / (alpha + (beta + 2.0))) / 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.5d+16) then
tmp = (beta + 1.0d0) * ((1.0d0 / (beta + 2.0d0)) / ((beta + 3.0d0) * (beta + 2.0d0)))
else
tmp = ((beta + 1.0d0) / beta) * (((1.0d0 + alpha) / (alpha + (beta + 2.0d0))) / beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 6.5e+16) {
tmp = (beta + 1.0) * ((1.0 / (beta + 2.0)) / ((beta + 3.0) * (beta + 2.0)));
} else {
tmp = ((beta + 1.0) / beta) * (((1.0 + alpha) / (alpha + (beta + 2.0))) / beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 6.5e+16: tmp = (beta + 1.0) * ((1.0 / (beta + 2.0)) / ((beta + 3.0) * (beta + 2.0))) else: tmp = ((beta + 1.0) / beta) * (((1.0 + alpha) / (alpha + (beta + 2.0))) / beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 6.5e+16) tmp = Float64(Float64(beta + 1.0) * Float64(Float64(1.0 / Float64(beta + 2.0)) / Float64(Float64(beta + 3.0) * Float64(beta + 2.0)))); else tmp = Float64(Float64(Float64(beta + 1.0) / beta) * Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 2.0))) / beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 6.5e+16)
tmp = (beta + 1.0) * ((1.0 / (beta + 2.0)) / ((beta + 3.0) * (beta + 2.0)));
else
tmp = ((beta + 1.0) / beta) * (((1.0 + alpha) / (alpha + (beta + 2.0))) / 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.5e+16], N[(N[(beta + 1.0), $MachinePrecision] * N[(N[(1.0 / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(beta + 1.0), $MachinePrecision] / beta), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 6.5 \cdot 10^{+16}:\\
\;\;\;\;\left(\beta + 1\right) \cdot \frac{\frac{1}{\beta + 2}}{\left(\beta + 3\right) \cdot \left(\beta + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\beta + 1}{\beta} \cdot \frac{\frac{1 + \alpha}{\alpha + \left(\beta + 2\right)}}{\beta}\\
\end{array}
\end{array}
if beta < 6.5e16Initial program 99.9%
associate-/l/99.2%
associate-+l+99.2%
+-commutative99.2%
associate-+r+99.2%
associate-+l+99.2%
distribute-rgt1-in99.2%
*-rgt-identity99.2%
distribute-lft-out99.2%
+-commutative99.2%
associate-*r/99.2%
associate-*r/99.3%
Simplified99.3%
Taylor expanded in alpha around 0 83.8%
Taylor expanded in alpha around 0 68.7%
if 6.5e16 < beta Initial program 83.2%
associate-/l/80.1%
associate-+l+80.1%
+-commutative80.1%
associate-+r+80.1%
associate-+l+80.1%
distribute-rgt1-in80.1%
*-rgt-identity80.1%
distribute-lft-out80.1%
+-commutative80.1%
associate-*r/87.6%
associate-*r/71.6%
Simplified71.6%
Taylor expanded in beta around inf 68.7%
unpow268.7%
Simplified68.7%
associate-*r/84.7%
+-commutative84.7%
+-commutative84.7%
Applied egg-rr84.7%
times-frac86.1%
+-commutative86.1%
Simplified86.1%
Final simplification74.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 1.08e+16)
(/ (/ (+ beta 1.0) (* (+ beta 3.0) (+ beta 2.0))) (+ beta (+ alpha 2.0)))
(*
(/ (+ beta 1.0) beta)
(/ (/ (+ 1.0 alpha) (+ alpha (+ beta 2.0))) beta))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.08e+16) {
tmp = ((beta + 1.0) / ((beta + 3.0) * (beta + 2.0))) / (beta + (alpha + 2.0));
} else {
tmp = ((beta + 1.0) / beta) * (((1.0 + alpha) / (alpha + (beta + 2.0))) / 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.08d+16) then
tmp = ((beta + 1.0d0) / ((beta + 3.0d0) * (beta + 2.0d0))) / (beta + (alpha + 2.0d0))
else
tmp = ((beta + 1.0d0) / beta) * (((1.0d0 + alpha) / (alpha + (beta + 2.0d0))) / beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.08e+16) {
tmp = ((beta + 1.0) / ((beta + 3.0) * (beta + 2.0))) / (beta + (alpha + 2.0));
} else {
tmp = ((beta + 1.0) / beta) * (((1.0 + alpha) / (alpha + (beta + 2.0))) / beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.08e+16: tmp = ((beta + 1.0) / ((beta + 3.0) * (beta + 2.0))) / (beta + (alpha + 2.0)) else: tmp = ((beta + 1.0) / beta) * (((1.0 + alpha) / (alpha + (beta + 2.0))) / beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.08e+16) tmp = Float64(Float64(Float64(beta + 1.0) / Float64(Float64(beta + 3.0) * Float64(beta + 2.0))) / Float64(beta + Float64(alpha + 2.0))); else tmp = Float64(Float64(Float64(beta + 1.0) / beta) * Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 2.0))) / beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.08e+16)
tmp = ((beta + 1.0) / ((beta + 3.0) * (beta + 2.0))) / (beta + (alpha + 2.0));
else
tmp = ((beta + 1.0) / beta) * (((1.0 + alpha) / (alpha + (beta + 2.0))) / 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.08e+16], N[(N[(N[(beta + 1.0), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(beta + 1.0), $MachinePrecision] / beta), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.08 \cdot 10^{+16}:\\
\;\;\;\;\frac{\frac{\beta + 1}{\left(\beta + 3\right) \cdot \left(\beta + 2\right)}}{\beta + \left(\alpha + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\beta + 1}{\beta} \cdot \frac{\frac{1 + \alpha}{\alpha + \left(\beta + 2\right)}}{\beta}\\
\end{array}
\end{array}
if beta < 1.08e16Initial program 99.9%
associate-/l/99.2%
associate-+l+99.2%
+-commutative99.2%
associate-+r+99.2%
associate-+l+99.2%
distribute-rgt1-in99.2%
*-rgt-identity99.2%
distribute-lft-out99.2%
+-commutative99.2%
associate-*l/99.2%
*-commutative99.2%
associate-*r/93.9%
Simplified93.9%
associate-*r/99.2%
+-commutative99.2%
Applied egg-rr99.2%
+-commutative99.2%
*-commutative99.2%
+-commutative99.2%
associate-*r/99.2%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in alpha around 0 69.4%
associate-/r*69.4%
Simplified69.4%
associate-*l/69.5%
+-commutative69.5%
associate-/r*69.5%
associate-+l+69.5%
Applied egg-rr69.5%
associate-*r/69.5%
+-commutative69.5%
*-rgt-identity69.5%
+-commutative69.5%
Simplified69.5%
if 1.08e16 < beta Initial program 83.2%
associate-/l/80.1%
associate-+l+80.1%
+-commutative80.1%
associate-+r+80.1%
associate-+l+80.1%
distribute-rgt1-in80.1%
*-rgt-identity80.1%
distribute-lft-out80.1%
+-commutative80.1%
associate-*r/87.6%
associate-*r/71.6%
Simplified71.6%
Taylor expanded in beta around inf 68.7%
unpow268.7%
Simplified68.7%
associate-*r/84.7%
+-commutative84.7%
+-commutative84.7%
Applied egg-rr84.7%
times-frac86.1%
+-commutative86.1%
Simplified86.1%
Final simplification74.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 0.8)
(*
(/ (+ beta 1.0) (+ (+ beta alpha) 2.0))
(+ (* beta -0.1388888888888889) 0.16666666666666666))
(/ (/ (+ 1.0 alpha) (+ beta 3.0)) (+ beta 2.0))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 0.8) {
tmp = ((beta + 1.0) / ((beta + alpha) + 2.0)) * ((beta * -0.1388888888888889) + 0.16666666666666666);
} else {
tmp = ((1.0 + alpha) / (beta + 3.0)) / (beta + 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 <= 0.8d0) then
tmp = ((beta + 1.0d0) / ((beta + alpha) + 2.0d0)) * ((beta * (-0.1388888888888889d0)) + 0.16666666666666666d0)
else
tmp = ((1.0d0 + alpha) / (beta + 3.0d0)) / (beta + 2.0d0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 0.8) {
tmp = ((beta + 1.0) / ((beta + alpha) + 2.0)) * ((beta * -0.1388888888888889) + 0.16666666666666666);
} else {
tmp = ((1.0 + alpha) / (beta + 3.0)) / (beta + 2.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 0.8: tmp = ((beta + 1.0) / ((beta + alpha) + 2.0)) * ((beta * -0.1388888888888889) + 0.16666666666666666) else: tmp = ((1.0 + alpha) / (beta + 3.0)) / (beta + 2.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 0.8) tmp = Float64(Float64(Float64(beta + 1.0) / Float64(Float64(beta + alpha) + 2.0)) * Float64(Float64(beta * -0.1388888888888889) + 0.16666666666666666)); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(beta + 3.0)) / Float64(beta + 2.0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 0.8)
tmp = ((beta + 1.0) / ((beta + alpha) + 2.0)) * ((beta * -0.1388888888888889) + 0.16666666666666666);
else
tmp = ((1.0 + alpha) / (beta + 3.0)) / (beta + 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, 0.8], N[(N[(N[(beta + 1.0), $MachinePrecision] / N[(N[(beta + alpha), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(beta * -0.1388888888888889), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 0.8:\\
\;\;\;\;\frac{\beta + 1}{\left(\beta + \alpha\right) + 2} \cdot \left(\beta \cdot -0.1388888888888889 + 0.16666666666666666\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta + 3}}{\beta + 2}\\
\end{array}
\end{array}
if beta < 0.80000000000000004Initial program 99.9%
associate-/l/99.2%
associate-+l+99.2%
+-commutative99.2%
associate-+r+99.2%
associate-+l+99.2%
distribute-rgt1-in99.2%
*-rgt-identity99.2%
distribute-lft-out99.2%
+-commutative99.2%
associate-*l/99.2%
*-commutative99.2%
associate-*r/94.3%
Simplified94.3%
associate-*r/99.2%
+-commutative99.2%
Applied egg-rr99.2%
+-commutative99.2%
*-commutative99.2%
+-commutative99.2%
associate-*r/99.2%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in alpha around 0 70.2%
associate-/r*70.2%
Simplified70.2%
Taylor expanded in beta around 0 69.3%
if 0.80000000000000004 < beta Initial program 83.5%
associate-/l/80.5%
associate-+l+80.5%
+-commutative80.5%
associate-+r+80.5%
associate-+l+80.5%
distribute-rgt1-in80.6%
*-rgt-identity80.6%
distribute-lft-out80.6%
+-commutative80.6%
associate-*l/87.9%
*-commutative87.9%
associate-*r/86.8%
Simplified86.8%
Taylor expanded in alpha around 0 82.8%
Taylor expanded in beta around inf 82.8%
expm1-log1p-u82.8%
expm1-udef45.6%
un-div-inv45.6%
+-commutative45.6%
Applied egg-rr45.6%
expm1-def82.8%
expm1-log1p82.8%
associate-/r*83.9%
Simplified83.9%
Final simplification74.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.7) (/ (+ 1.0 alpha) (* (+ alpha 2.0) (+ 6.0 (* alpha 5.0)))) (/ (/ (+ 1.0 alpha) (+ beta 3.0)) (+ beta 2.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.7) {
tmp = (1.0 + alpha) / ((alpha + 2.0) * (6.0 + (alpha * 5.0)));
} else {
tmp = ((1.0 + alpha) / (beta + 3.0)) / (beta + 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.7d0) then
tmp = (1.0d0 + alpha) / ((alpha + 2.0d0) * (6.0d0 + (alpha * 5.0d0)))
else
tmp = ((1.0d0 + alpha) / (beta + 3.0d0)) / (beta + 2.0d0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.7) {
tmp = (1.0 + alpha) / ((alpha + 2.0) * (6.0 + (alpha * 5.0)));
} else {
tmp = ((1.0 + alpha) / (beta + 3.0)) / (beta + 2.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.7: tmp = (1.0 + alpha) / ((alpha + 2.0) * (6.0 + (alpha * 5.0))) else: tmp = ((1.0 + alpha) / (beta + 3.0)) / (beta + 2.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.7) tmp = Float64(Float64(1.0 + alpha) / Float64(Float64(alpha + 2.0) * Float64(6.0 + Float64(alpha * 5.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(beta + 3.0)) / Float64(beta + 2.0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.7)
tmp = (1.0 + alpha) / ((alpha + 2.0) * (6.0 + (alpha * 5.0)));
else
tmp = ((1.0 + alpha) / (beta + 3.0)) / (beta + 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.7], N[(N[(1.0 + alpha), $MachinePrecision] / N[(N[(alpha + 2.0), $MachinePrecision] * N[(6.0 + N[(alpha * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.7:\\
\;\;\;\;\frac{1 + \alpha}{\left(\alpha + 2\right) \cdot \left(6 + \alpha \cdot 5\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta + 3}}{\beta + 2}\\
\end{array}
\end{array}
if beta < 1.69999999999999996Initial program 99.9%
associate-/l/99.2%
associate-+l+99.2%
+-commutative99.2%
associate-+r+99.2%
associate-+l+99.2%
distribute-rgt1-in99.2%
*-rgt-identity99.2%
distribute-lft-out99.2%
+-commutative99.2%
associate-*r/99.2%
associate-*r/99.2%
Simplified99.2%
Taylor expanded in alpha around 0 70.5%
Taylor expanded in beta around 0 80.9%
if 1.69999999999999996 < beta Initial program 83.4%
associate-/l/80.3%
associate-+l+80.3%
+-commutative80.3%
associate-+r+80.3%
associate-+l+80.3%
distribute-rgt1-in80.3%
*-rgt-identity80.3%
distribute-lft-out80.3%
+-commutative80.3%
associate-*l/87.8%
*-commutative87.8%
associate-*r/87.8%
Simplified87.8%
Taylor expanded in alpha around 0 83.8%
Taylor expanded in beta around inf 83.7%
expm1-log1p-u83.7%
expm1-udef46.1%
un-div-inv46.1%
+-commutative46.1%
Applied egg-rr46.1%
expm1-def83.7%
expm1-log1p83.7%
associate-/r*84.9%
Simplified84.9%
Final simplification82.2%
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 (+ alpha 2.0)) (/ (/ (+ 1.0 alpha) (+ beta 3.0)) (+ beta 2.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.2) {
tmp = 0.16666666666666666 / (alpha + 2.0);
} else {
tmp = ((1.0 + alpha) / (beta + 3.0)) / (beta + 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.2d0) then
tmp = 0.16666666666666666d0 / (alpha + 2.0d0)
else
tmp = ((1.0d0 + alpha) / (beta + 3.0d0)) / (beta + 2.0d0)
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 / (alpha + 2.0);
} else {
tmp = ((1.0 + alpha) / (beta + 3.0)) / (beta + 2.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.2: tmp = 0.16666666666666666 / (alpha + 2.0) else: tmp = ((1.0 + alpha) / (beta + 3.0)) / (beta + 2.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.2) tmp = Float64(0.16666666666666666 / Float64(alpha + 2.0)); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(beta + 3.0)) / Float64(beta + 2.0)); 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 / (alpha + 2.0);
else
tmp = ((1.0 + alpha) / (beta + 3.0)) / (beta + 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.2], N[(0.16666666666666666 / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.2:\\
\;\;\;\;\frac{0.16666666666666666}{\alpha + 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta + 3}}{\beta + 2}\\
\end{array}
\end{array}
if beta < 1.19999999999999996Initial program 99.9%
associate-/l/99.2%
associate-+l+99.2%
+-commutative99.2%
associate-+r+99.2%
associate-+l+99.2%
distribute-rgt1-in99.2%
*-rgt-identity99.2%
distribute-lft-out99.2%
+-commutative99.2%
associate-*l/99.2%
*-commutative99.2%
associate-*r/93.8%
Simplified93.8%
associate-*r/99.2%
+-commutative99.2%
Applied egg-rr99.2%
+-commutative99.2%
*-commutative99.2%
+-commutative99.2%
associate-*r/99.2%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in alpha around 0 69.8%
associate-/r*69.8%
Simplified69.8%
Taylor expanded in beta around 0 68.4%
if 1.19999999999999996 < beta Initial program 83.4%
associate-/l/80.3%
associate-+l+80.3%
+-commutative80.3%
associate-+r+80.3%
associate-+l+80.3%
distribute-rgt1-in80.3%
*-rgt-identity80.3%
distribute-lft-out80.3%
+-commutative80.3%
associate-*l/87.8%
*-commutative87.8%
associate-*r/87.8%
Simplified87.8%
Taylor expanded in alpha around 0 83.8%
Taylor expanded in beta around inf 83.7%
expm1-log1p-u83.7%
expm1-udef46.1%
un-div-inv46.1%
+-commutative46.1%
Applied egg-rr46.1%
expm1-def83.7%
expm1-log1p83.7%
associate-/r*84.9%
Simplified84.9%
Final simplification73.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 3.7)
(/ 0.16666666666666666 (+ alpha 2.0))
(if (<= beta 2e+167)
(* (/ 1.0 beta) (/ 1.0 beta))
(/ (/ alpha beta) beta))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.7) {
tmp = 0.16666666666666666 / (alpha + 2.0);
} else if (beta <= 2e+167) {
tmp = (1.0 / beta) * (1.0 / beta);
} else {
tmp = (alpha / beta) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.7d0) then
tmp = 0.16666666666666666d0 / (alpha + 2.0d0)
else if (beta <= 2d+167) then
tmp = (1.0d0 / beta) * (1.0d0 / beta)
else
tmp = (alpha / beta) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.7) {
tmp = 0.16666666666666666 / (alpha + 2.0);
} else if (beta <= 2e+167) {
tmp = (1.0 / beta) * (1.0 / beta);
} else {
tmp = (alpha / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.7: tmp = 0.16666666666666666 / (alpha + 2.0) elif beta <= 2e+167: tmp = (1.0 / beta) * (1.0 / beta) else: tmp = (alpha / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.7) tmp = Float64(0.16666666666666666 / Float64(alpha + 2.0)); elseif (beta <= 2e+167) tmp = Float64(Float64(1.0 / beta) * Float64(1.0 / beta)); else tmp = Float64(Float64(alpha / beta) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.7)
tmp = 0.16666666666666666 / (alpha + 2.0);
elseif (beta <= 2e+167)
tmp = (1.0 / beta) * (1.0 / beta);
else
tmp = (alpha / beta) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.7], N[(0.16666666666666666 / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[beta, 2e+167], N[(N[(1.0 / beta), $MachinePrecision] * N[(1.0 / beta), $MachinePrecision]), $MachinePrecision], N[(N[(alpha / beta), $MachinePrecision] / beta), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.7:\\
\;\;\;\;\frac{0.16666666666666666}{\alpha + 2}\\
\mathbf{elif}\;\beta \leq 2 \cdot 10^{+167}:\\
\;\;\;\;\frac{1}{\beta} \cdot \frac{1}{\beta}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 3.7000000000000002Initial program 99.9%
associate-/l/99.2%
associate-+l+99.2%
+-commutative99.2%
associate-+r+99.2%
associate-+l+99.2%
distribute-rgt1-in99.2%
*-rgt-identity99.2%
distribute-lft-out99.2%
+-commutative99.2%
associate-*l/99.2%
*-commutative99.2%
associate-*r/93.8%
Simplified93.8%
associate-*r/99.2%
+-commutative99.2%
Applied egg-rr99.2%
+-commutative99.2%
*-commutative99.2%
+-commutative99.2%
associate-*r/99.2%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in alpha around 0 69.8%
associate-/r*69.8%
Simplified69.8%
Taylor expanded in beta around 0 68.4%
if 3.7000000000000002 < beta < 2.0000000000000001e167Initial program 97.2%
associate-/l/91.6%
associate-+l+91.6%
+-commutative91.6%
associate-+r+91.6%
associate-+l+91.6%
distribute-rgt1-in91.6%
*-rgt-identity91.6%
distribute-lft-out91.6%
+-commutative91.6%
associate-*l/94.1%
*-commutative94.1%
associate-*r/94.0%
Simplified94.0%
Taylor expanded in beta around inf 85.9%
unpow285.9%
Simplified85.9%
Taylor expanded in alpha around 0 79.3%
unpow279.3%
Simplified79.3%
inv-pow79.3%
unpow-prod-down79.3%
inv-pow79.3%
inv-pow79.3%
Applied egg-rr79.3%
if 2.0000000000000001e167 < beta Initial program 69.6%
associate-/l/69.0%
associate-+l+69.0%
+-commutative69.0%
associate-+r+69.0%
associate-+l+69.0%
distribute-rgt1-in69.0%
*-rgt-identity69.0%
distribute-lft-out69.0%
+-commutative69.0%
associate-*l/81.5%
*-commutative81.5%
associate-*r/81.5%
Simplified81.5%
Taylor expanded in beta around inf 81.5%
unpow281.5%
Simplified81.5%
Taylor expanded in alpha around inf 81.5%
unpow281.5%
Simplified81.5%
Taylor expanded in alpha around 0 81.5%
unpow281.5%
associate-/r*84.9%
Simplified84.9%
Final simplification72.9%
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))
(if (<= beta 1.35e+154)
(/ (+ 1.0 alpha) (* beta beta))
(/ (/ 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 if (beta <= 1.35e+154) {
tmp = (1.0 + alpha) / (beta * beta);
} else {
tmp = (alpha / beta) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.8d0) then
tmp = 0.16666666666666666d0 / (alpha + 2.0d0)
else if (beta <= 1.35d+154) then
tmp = (1.0d0 + alpha) / (beta * beta)
else
tmp = (alpha / beta) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.8) {
tmp = 0.16666666666666666 / (alpha + 2.0);
} else if (beta <= 1.35e+154) {
tmp = (1.0 + alpha) / (beta * beta);
} else {
tmp = (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) elif beta <= 1.35e+154: tmp = (1.0 + alpha) / (beta * beta) else: tmp = (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)); elseif (beta <= 1.35e+154) tmp = Float64(Float64(1.0 + alpha) / Float64(beta * beta)); else tmp = Float64(Float64(alpha / 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);
elseif (beta <= 1.35e+154)
tmp = (1.0 + alpha) / (beta * beta);
else
tmp = (alpha / beta) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.8], N[(0.16666666666666666 / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[beta, 1.35e+154], N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta * beta), $MachinePrecision]), $MachinePrecision], N[(N[(alpha / beta), $MachinePrecision] / beta), $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{elif}\;\beta \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{1 + \alpha}{\beta \cdot \beta}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 3.7999999999999998Initial program 99.9%
associate-/l/99.2%
associate-+l+99.2%
+-commutative99.2%
associate-+r+99.2%
associate-+l+99.2%
distribute-rgt1-in99.2%
*-rgt-identity99.2%
distribute-lft-out99.2%
+-commutative99.2%
associate-*l/99.2%
*-commutative99.2%
associate-*r/93.8%
Simplified93.8%
associate-*r/99.2%
+-commutative99.2%
Applied egg-rr99.2%
+-commutative99.2%
*-commutative99.2%
+-commutative99.2%
associate-*r/99.2%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in alpha around 0 69.8%
associate-/r*69.8%
Simplified69.8%
Taylor expanded in beta around 0 68.4%
if 3.7999999999999998 < beta < 1.35000000000000003e154Initial program 99.5%
associate-/l/95.0%
associate-+l+95.0%
+-commutative95.0%
associate-+r+95.0%
associate-+l+95.0%
distribute-rgt1-in95.0%
*-rgt-identity95.0%
distribute-lft-out95.1%
+-commutative95.1%
associate-*l/95.1%
*-commutative95.1%
associate-*r/95.1%
Simplified95.1%
Taylor expanded in beta around inf 86.3%
unpow286.3%
Simplified86.3%
if 1.35000000000000003e154 < beta Initial program 69.4%
associate-/l/67.6%
associate-+l+67.6%
+-commutative67.6%
associate-+r+67.6%
associate-+l+67.6%
distribute-rgt1-in67.6%
*-rgt-identity67.6%
distribute-lft-out67.6%
+-commutative67.6%
associate-*l/81.4%
*-commutative81.4%
associate-*r/81.4%
Simplified81.4%
Taylor expanded in beta around inf 81.4%
unpow281.4%
Simplified81.4%
Taylor expanded in alpha around inf 81.4%
unpow281.4%
Simplified81.4%
Taylor expanded in alpha around 0 81.4%
unpow281.4%
associate-/r*82.5%
Simplified82.5%
Final simplification73.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.7) (/ 0.16666666666666666 (+ alpha 2.0)) (if (<= beta 1.4e+154) (/ 1.0 (* beta beta)) (/ (/ alpha beta) beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.7) {
tmp = 0.16666666666666666 / (alpha + 2.0);
} else if (beta <= 1.4e+154) {
tmp = 1.0 / (beta * beta);
} else {
tmp = (alpha / beta) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.7d0) then
tmp = 0.16666666666666666d0 / (alpha + 2.0d0)
else if (beta <= 1.4d+154) then
tmp = 1.0d0 / (beta * beta)
else
tmp = (alpha / beta) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.7) {
tmp = 0.16666666666666666 / (alpha + 2.0);
} else if (beta <= 1.4e+154) {
tmp = 1.0 / (beta * beta);
} else {
tmp = (alpha / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.7: tmp = 0.16666666666666666 / (alpha + 2.0) elif beta <= 1.4e+154: tmp = 1.0 / (beta * beta) else: tmp = (alpha / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.7) tmp = Float64(0.16666666666666666 / Float64(alpha + 2.0)); elseif (beta <= 1.4e+154) tmp = Float64(1.0 / Float64(beta * beta)); else tmp = Float64(Float64(alpha / beta) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.7)
tmp = 0.16666666666666666 / (alpha + 2.0);
elseif (beta <= 1.4e+154)
tmp = 1.0 / (beta * beta);
else
tmp = (alpha / beta) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.7], N[(0.16666666666666666 / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[beta, 1.4e+154], N[(1.0 / N[(beta * beta), $MachinePrecision]), $MachinePrecision], N[(N[(alpha / beta), $MachinePrecision] / beta), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.7:\\
\;\;\;\;\frac{0.16666666666666666}{\alpha + 2}\\
\mathbf{elif}\;\beta \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{\beta \cdot \beta}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 3.7000000000000002Initial program 99.9%
associate-/l/99.2%
associate-+l+99.2%
+-commutative99.2%
associate-+r+99.2%
associate-+l+99.2%
distribute-rgt1-in99.2%
*-rgt-identity99.2%
distribute-lft-out99.2%
+-commutative99.2%
associate-*l/99.2%
*-commutative99.2%
associate-*r/93.8%
Simplified93.8%
associate-*r/99.2%
+-commutative99.2%
Applied egg-rr99.2%
+-commutative99.2%
*-commutative99.2%
+-commutative99.2%
associate-*r/99.2%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in alpha around 0 69.8%
associate-/r*69.8%
Simplified69.8%
Taylor expanded in beta around 0 68.4%
if 3.7000000000000002 < beta < 1.4e154Initial program 99.5%
associate-/l/95.0%
associate-+l+95.0%
+-commutative95.0%
associate-+r+95.0%
associate-+l+95.0%
distribute-rgt1-in95.0%
*-rgt-identity95.0%
distribute-lft-out95.1%
+-commutative95.1%
associate-*l/95.1%
*-commutative95.1%
associate-*r/95.1%
Simplified95.1%
Taylor expanded in beta around inf 86.3%
unpow286.3%
Simplified86.3%
Taylor expanded in alpha around 0 79.2%
unpow279.2%
Simplified79.2%
if 1.4e154 < beta Initial program 69.4%
associate-/l/67.6%
associate-+l+67.6%
+-commutative67.6%
associate-+r+67.6%
associate-+l+67.6%
distribute-rgt1-in67.6%
*-rgt-identity67.6%
distribute-lft-out67.6%
+-commutative67.6%
associate-*l/81.4%
*-commutative81.4%
associate-*r/81.4%
Simplified81.4%
Taylor expanded in beta around inf 81.4%
unpow281.4%
Simplified81.4%
Taylor expanded in alpha around inf 81.4%
unpow281.4%
Simplified81.4%
Taylor expanded in alpha around 0 81.4%
unpow281.4%
associate-/r*82.5%
Simplified82.5%
Final simplification72.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.2) (/ 0.16666666666666666 (+ alpha 2.0)) (/ 1.0 (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.2) {
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 <= 4.2d0) 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 <= 4.2) {
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 <= 4.2: 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 <= 4.2) 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 <= 4.2)
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, 4.2], 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 4.2:\\
\;\;\;\;\frac{0.16666666666666666}{\alpha + 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 4.20000000000000018Initial program 99.9%
associate-/l/99.2%
associate-+l+99.2%
+-commutative99.2%
associate-+r+99.2%
associate-+l+99.2%
distribute-rgt1-in99.2%
*-rgt-identity99.2%
distribute-lft-out99.2%
+-commutative99.2%
associate-*l/99.2%
*-commutative99.2%
associate-*r/93.8%
Simplified93.8%
associate-*r/99.2%
+-commutative99.2%
Applied egg-rr99.2%
+-commutative99.2%
*-commutative99.2%
+-commutative99.2%
associate-*r/99.2%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in alpha around 0 69.8%
associate-/r*69.8%
Simplified69.8%
Taylor expanded in beta around 0 68.4%
if 4.20000000000000018 < beta Initial program 83.4%
associate-/l/80.3%
associate-+l+80.3%
+-commutative80.3%
associate-+r+80.3%
associate-+l+80.3%
distribute-rgt1-in80.3%
*-rgt-identity80.3%
distribute-lft-out80.3%
+-commutative80.3%
associate-*l/87.8%
*-commutative87.8%
associate-*r/87.8%
Simplified87.8%
Taylor expanded in beta around inf 83.7%
unpow283.7%
Simplified83.7%
Taylor expanded in alpha around 0 80.4%
unpow280.4%
Simplified80.4%
Final simplification72.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.16666666666666666 (+ alpha 2.0)))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.16666666666666666 / (alpha + 2.0);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.16666666666666666d0 / (alpha + 2.0d0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.16666666666666666 / (alpha + 2.0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.16666666666666666 / (alpha + 2.0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.16666666666666666 / Float64(alpha + 2.0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.16666666666666666 / (alpha + 2.0);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.16666666666666666 / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.16666666666666666}{\alpha + 2}
\end{array}
Initial program 94.5%
associate-/l/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%
associate-*l/95.4%
*-commutative95.4%
associate-*r/91.8%
Simplified91.8%
associate-*r/95.4%
+-commutative95.4%
Applied egg-rr95.4%
+-commutative95.4%
*-commutative95.4%
+-commutative95.4%
associate-*r/95.4%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in alpha around 0 73.3%
associate-/r*73.5%
Simplified73.5%
Taylor expanded in beta around 0 47.6%
Final simplification47.6%
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 94.5%
associate-/l/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%
associate-*l/95.4%
*-commutative95.4%
associate-*r/91.8%
Simplified91.8%
Taylor expanded in alpha around 0 73.8%
Taylor expanded in alpha around inf 24.9%
associate-/r*11.8%
+-commutative11.8%
Simplified11.8%
Taylor expanded in beta around 0 10.9%
Final simplification10.9%
herbie shell --seed 2023257
(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)))