
(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 (+ 2.0 alpha)))) (* (/ (+ 1.0 beta) t_0) (/ (/ (+ 1.0 alpha) t_0) (+ beta (+ alpha 3.0))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = beta + (2.0 + alpha);
return ((1.0 + beta) / t_0) * (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0)));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = beta + (2.0d0 + alpha)
code = ((1.0d0 + beta) / t_0) * (((1.0d0 + alpha) / t_0) / (beta + (alpha + 3.0d0)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = beta + (2.0 + alpha);
return ((1.0 + beta) / t_0) * (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = beta + (2.0 + alpha) return ((1.0 + beta) / t_0) * (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(beta + Float64(2.0 + alpha)) return Float64(Float64(Float64(1.0 + beta) / t_0) * Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(beta + Float64(alpha + 3.0)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = beta + (2.0 + alpha);
tmp = ((1.0 + beta) / t_0) * (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0)));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(beta + N[(2.0 + alpha), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \beta + \left(2 + \alpha\right)\\
\frac{1 + \beta}{t_0} \cdot \frac{\frac{1 + \alpha}{t_0}}{\beta + \left(\alpha + 3\right)}
\end{array}
\end{array}
Initial program 93.7%
associate-/l/92.5%
associate-+l+92.5%
+-commutative92.5%
associate-+r+92.5%
associate-+l+92.5%
distribute-rgt1-in92.5%
*-rgt-identity92.5%
distribute-lft-out92.5%
+-commutative92.5%
associate-*l/97.3%
*-commutative97.3%
associate-*r/92.7%
Simplified92.7%
associate-*r/97.3%
+-commutative97.3%
Applied egg-rr97.3%
+-commutative97.3%
*-commutative97.3%
+-commutative97.3%
associate-*r/97.3%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))))
(if (<= beta 2e+108)
(* (+ 1.0 alpha) (/ (/ (+ 1.0 beta) t_0) (* t_0 (+ alpha (+ beta 3.0)))))
(*
(/ (+ 1.0 beta) (+ beta (+ 2.0 alpha)))
(/ (/ (+ 1.0 alpha) beta) (+ (+ beta 5.0) (* 2.0 alpha)))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 2e+108) {
tmp = (1.0 + alpha) * (((1.0 + beta) / t_0) / (t_0 * (alpha + (beta + 3.0))));
} else {
tmp = ((1.0 + beta) / (beta + (2.0 + alpha))) * (((1.0 + alpha) / beta) / ((beta + 5.0) + (2.0 * alpha)));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 2d+108) then
tmp = (1.0d0 + alpha) * (((1.0d0 + beta) / t_0) / (t_0 * (alpha + (beta + 3.0d0))))
else
tmp = ((1.0d0 + beta) / (beta + (2.0d0 + alpha))) * (((1.0d0 + alpha) / beta) / ((beta + 5.0d0) + (2.0d0 * alpha)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 2e+108) {
tmp = (1.0 + alpha) * (((1.0 + beta) / t_0) / (t_0 * (alpha + (beta + 3.0))));
} else {
tmp = ((1.0 + beta) / (beta + (2.0 + alpha))) * (((1.0 + alpha) / beta) / ((beta + 5.0) + (2.0 * alpha)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 2e+108: tmp = (1.0 + alpha) * (((1.0 + beta) / t_0) / (t_0 * (alpha + (beta + 3.0)))) else: tmp = ((1.0 + beta) / (beta + (2.0 + alpha))) * (((1.0 + alpha) / beta) / ((beta + 5.0) + (2.0 * alpha))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 2e+108) tmp = Float64(Float64(1.0 + alpha) * Float64(Float64(Float64(1.0 + beta) / t_0) / Float64(t_0 * Float64(alpha + Float64(beta + 3.0))))); else tmp = Float64(Float64(Float64(1.0 + beta) / Float64(beta + Float64(2.0 + alpha))) * Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(Float64(beta + 5.0) + Float64(2.0 * alpha)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 2e+108)
tmp = (1.0 + alpha) * (((1.0 + beta) / t_0) / (t_0 * (alpha + (beta + 3.0))));
else
tmp = ((1.0 + beta) / (beta + (2.0 + alpha))) * (((1.0 + alpha) / beta) / ((beta + 5.0) + (2.0 * alpha)));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 2e+108], N[(N[(1.0 + alpha), $MachinePrecision] * N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 * N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + N[(2.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(N[(beta + 5.0), $MachinePrecision] + N[(2.0 * alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 2 \cdot 10^{+108}:\\
\;\;\;\;\left(1 + \alpha\right) \cdot \frac{\frac{1 + \beta}{t_0}}{t_0 \cdot \left(\alpha + \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \beta}{\beta + \left(2 + \alpha\right)} \cdot \frac{\frac{1 + \alpha}{\beta}}{\left(\beta + 5\right) + 2 \cdot \alpha}\\
\end{array}
\end{array}
if beta < 2.0000000000000001e108Initial program 97.5%
associate-/l/97.4%
associate-+l+97.4%
+-commutative97.4%
associate-+r+97.4%
associate-+l+97.4%
distribute-rgt1-in97.4%
*-rgt-identity97.4%
distribute-lft-out97.4%
+-commutative97.4%
associate-*l/99.8%
*-commutative99.8%
associate-*r/94.2%
Simplified94.2%
if 2.0000000000000001e108 < beta Initial program 75.3%
associate-/l/68.6%
associate-+l+68.6%
+-commutative68.6%
associate-+r+68.6%
associate-+l+68.6%
distribute-rgt1-in68.6%
*-rgt-identity68.6%
distribute-lft-out68.6%
+-commutative68.6%
associate-*l/85.2%
*-commutative85.2%
associate-*r/85.2%
Simplified85.2%
associate-*r/85.2%
+-commutative85.2%
Applied egg-rr85.2%
+-commutative85.2%
*-commutative85.2%
+-commutative85.2%
associate-*r/85.2%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
associate-*l/99.9%
Applied egg-rr85.1%
associate-/l*74.9%
+-commutative74.9%
+-commutative74.9%
+-commutative74.9%
Simplified74.9%
Taylor expanded in beta around inf 74.9%
+-commutative74.9%
unpow274.9%
distribute-lft-out74.9%
Simplified74.9%
*-un-lft-identity74.9%
associate-/r/85.2%
associate-+r+85.2%
Applied egg-rr85.2%
*-lft-identity85.2%
+-commutative85.2%
associate-/r*85.5%
associate-+r+85.5%
Simplified85.5%
Final simplification92.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ beta (+ 2.0 alpha))))
(if (<= beta 330000000.0)
(/ (+ 1.0 beta) (* t_0 (* (+ beta 2.0) (+ beta 3.0))))
(*
(/ (/ (+ 1.0 alpha) t_0) (+ beta (+ alpha 3.0)))
(- 1.0 (/ (+ 1.0 alpha) beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = beta + (2.0 + alpha);
double tmp;
if (beta <= 330000000.0) {
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0))) * (1.0 - ((1.0 + alpha) / beta));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = beta + (2.0d0 + alpha)
if (beta <= 330000000.0d0) then
tmp = (1.0d0 + beta) / (t_0 * ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = (((1.0d0 + alpha) / t_0) / (beta + (alpha + 3.0d0))) * (1.0d0 - ((1.0d0 + alpha) / beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = beta + (2.0 + alpha);
double tmp;
if (beta <= 330000000.0) {
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0))) * (1.0 - ((1.0 + alpha) / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = beta + (2.0 + alpha) tmp = 0 if beta <= 330000000.0: tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0))) else: tmp = (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0))) * (1.0 - ((1.0 + alpha) / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(beta + Float64(2.0 + alpha)) tmp = 0.0 if (beta <= 330000000.0) tmp = Float64(Float64(1.0 + beta) / Float64(t_0 * Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(beta + Float64(alpha + 3.0))) * Float64(1.0 - Float64(Float64(1.0 + alpha) / beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = beta + (2.0 + alpha);
tmp = 0.0;
if (beta <= 330000000.0)
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
else
tmp = (((1.0 + alpha) / t_0) / (beta + (alpha + 3.0))) * (1.0 - ((1.0 + alpha) / beta));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(beta + N[(2.0 + alpha), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 330000000.0], N[(N[(1.0 + beta), $MachinePrecision] / N[(t$95$0 * N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \beta + \left(2 + \alpha\right)\\
\mathbf{if}\;\beta \leq 330000000:\\
\;\;\;\;\frac{1 + \beta}{t_0 \cdot \left(\left(\beta + 2\right) \cdot \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0}}{\beta + \left(\alpha + 3\right)} \cdot \left(1 - \frac{1 + \alpha}{\beta}\right)\\
\end{array}
\end{array}
if beta < 3.3e8Initial program 99.9%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.9%
Simplified93.9%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 69.4%
un-div-inv69.4%
Applied egg-rr69.4%
associate-/r*69.5%
+-commutative69.5%
Simplified69.5%
if 3.3e8 < beta Initial program 78.4%
associate-/l/74.3%
associate-+l+74.3%
+-commutative74.3%
associate-+r+74.3%
associate-+l+74.3%
distribute-rgt1-in74.3%
*-rgt-identity74.3%
distribute-lft-out74.3%
+-commutative74.3%
associate-*l/91.0%
*-commutative91.0%
associate-*r/89.7%
Simplified89.7%
associate-*r/91.0%
+-commutative91.0%
Applied egg-rr91.0%
+-commutative91.0%
*-commutative91.0%
+-commutative91.0%
associate-*r/91.0%
associate-/r*99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 78.9%
mul-1-neg78.9%
unsub-neg78.9%
Simplified78.9%
Final simplification72.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ beta (+ 2.0 alpha))))
(if (<= beta 215000000.0)
(/ (+ 1.0 beta) (* t_0 (* (+ beta 2.0) (+ beta 3.0))))
(*
(/ (+ 1.0 beta) t_0)
(/ (/ (+ 1.0 alpha) beta) (+ (+ beta 5.0) (* 2.0 alpha)))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = beta + (2.0 + alpha);
double tmp;
if (beta <= 215000000.0) {
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + beta) / t_0) * (((1.0 + alpha) / beta) / ((beta + 5.0) + (2.0 * alpha)));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = beta + (2.0d0 + alpha)
if (beta <= 215000000.0d0) then
tmp = (1.0d0 + beta) / (t_0 * ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = ((1.0d0 + beta) / t_0) * (((1.0d0 + alpha) / beta) / ((beta + 5.0d0) + (2.0d0 * alpha)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = beta + (2.0 + alpha);
double tmp;
if (beta <= 215000000.0) {
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + beta) / t_0) * (((1.0 + alpha) / beta) / ((beta + 5.0) + (2.0 * alpha)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = beta + (2.0 + alpha) tmp = 0 if beta <= 215000000.0: tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0))) else: tmp = ((1.0 + beta) / t_0) * (((1.0 + alpha) / beta) / ((beta + 5.0) + (2.0 * alpha))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(beta + Float64(2.0 + alpha)) tmp = 0.0 if (beta <= 215000000.0) tmp = Float64(Float64(1.0 + beta) / Float64(t_0 * Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(1.0 + beta) / t_0) * Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(Float64(beta + 5.0) + Float64(2.0 * alpha)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = beta + (2.0 + alpha);
tmp = 0.0;
if (beta <= 215000000.0)
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
else
tmp = ((1.0 + beta) / t_0) * (((1.0 + alpha) / beta) / ((beta + 5.0) + (2.0 * alpha)));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(beta + N[(2.0 + alpha), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 215000000.0], N[(N[(1.0 + beta), $MachinePrecision] / N[(t$95$0 * N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(N[(beta + 5.0), $MachinePrecision] + N[(2.0 * alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \beta + \left(2 + \alpha\right)\\
\mathbf{if}\;\beta \leq 215000000:\\
\;\;\;\;\frac{1 + \beta}{t_0 \cdot \left(\left(\beta + 2\right) \cdot \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \beta}{t_0} \cdot \frac{\frac{1 + \alpha}{\beta}}{\left(\beta + 5\right) + 2 \cdot \alpha}\\
\end{array}
\end{array}
if beta < 2.15e8Initial program 99.9%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.9%
Simplified93.9%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 69.4%
un-div-inv69.4%
Applied egg-rr69.4%
associate-/r*69.5%
+-commutative69.5%
Simplified69.5%
if 2.15e8 < beta Initial program 78.4%
associate-/l/74.3%
associate-+l+74.3%
+-commutative74.3%
associate-+r+74.3%
associate-+l+74.3%
distribute-rgt1-in74.3%
*-rgt-identity74.3%
distribute-lft-out74.3%
+-commutative74.3%
associate-*l/91.0%
*-commutative91.0%
associate-*r/89.7%
Simplified89.7%
associate-*r/91.0%
+-commutative91.0%
Applied egg-rr91.0%
+-commutative91.0%
*-commutative91.0%
+-commutative91.0%
associate-*r/91.0%
associate-/r*99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
Simplified99.7%
associate-*l/99.7%
Applied egg-rr90.9%
associate-/l*81.0%
+-commutative81.0%
+-commutative81.0%
+-commutative81.0%
Simplified81.0%
Taylor expanded in beta around inf 76.2%
+-commutative76.2%
unpow276.2%
distribute-lft-out76.2%
Simplified76.2%
*-un-lft-identity76.2%
associate-/r/86.2%
associate-+r+86.2%
Applied egg-rr86.2%
*-lft-identity86.2%
+-commutative86.2%
associate-/r*80.1%
associate-+r+80.1%
Simplified80.1%
Final simplification72.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 2.0)))) (* (/ (+ 1.0 alpha) t_0) (/ (/ (+ 1.0 beta) t_0) (+ beta (+ alpha 3.0))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((1.0 + alpha) / t_0) * (((1.0 + beta) / t_0) / (beta + (alpha + 3.0)));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = alpha + (beta + 2.0d0)
code = ((1.0d0 + alpha) / t_0) * (((1.0d0 + beta) / t_0) / (beta + (alpha + 3.0d0)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((1.0 + alpha) / t_0) * (((1.0 + beta) / t_0) / (beta + (alpha + 3.0)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return ((1.0 + alpha) / t_0) * (((1.0 + beta) / t_0) / (beta + (alpha + 3.0)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) return Float64(Float64(Float64(1.0 + alpha) / t_0) * Float64(Float64(Float64(1.0 + beta) / t_0) / Float64(beta + Float64(alpha + 3.0)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = ((1.0 + alpha) / t_0) * (((1.0 + beta) / t_0) / (beta + (alpha + 3.0)));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\frac{1 + \alpha}{t_0} \cdot \frac{\frac{1 + \beta}{t_0}}{\beta + \left(\alpha + 3\right)}
\end{array}
\end{array}
Initial program 93.7%
associate-/l/92.5%
associate-+l+92.5%
+-commutative92.5%
associate-+r+92.5%
associate-+l+92.5%
distribute-rgt1-in92.5%
*-rgt-identity92.5%
distribute-lft-out92.5%
+-commutative92.5%
associate-*l/97.3%
*-commutative97.3%
associate-*r/92.7%
Simplified92.7%
associate-*r/97.3%
+-commutative97.3%
Applied egg-rr97.3%
+-commutative97.3%
*-commutative97.3%
+-commutative97.3%
associate-*r/97.3%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
frac-times97.3%
associate-+r+97.3%
+-commutative97.3%
associate-+r+97.3%
+-commutative97.3%
Applied egg-rr97.3%
associate-*r/92.5%
+-commutative92.5%
*-commutative92.5%
+-commutative92.5%
associate-*r/97.3%
times-frac99.8%
+-commutative99.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 (+ beta (+ 2.0 alpha))))
(if (<= beta 1.78e+19)
(* (/ (+ 1.0 beta) t_0) (/ 1.0 (+ 6.0 (* beta (+ beta 5.0)))))
(/ (/ (+ 1.0 alpha) t_0) (+ 1.0 t_0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = beta + (2.0 + alpha);
double tmp;
if (beta <= 1.78e+19) {
tmp = ((1.0 + beta) / t_0) * (1.0 / (6.0 + (beta * (beta + 5.0))));
} else {
tmp = ((1.0 + alpha) / t_0) / (1.0 + t_0);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = beta + (2.0d0 + alpha)
if (beta <= 1.78d+19) then
tmp = ((1.0d0 + beta) / t_0) * (1.0d0 / (6.0d0 + (beta * (beta + 5.0d0))))
else
tmp = ((1.0d0 + alpha) / t_0) / (1.0d0 + t_0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = beta + (2.0 + alpha);
double tmp;
if (beta <= 1.78e+19) {
tmp = ((1.0 + beta) / t_0) * (1.0 / (6.0 + (beta * (beta + 5.0))));
} else {
tmp = ((1.0 + alpha) / t_0) / (1.0 + t_0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = beta + (2.0 + alpha) tmp = 0 if beta <= 1.78e+19: tmp = ((1.0 + beta) / t_0) * (1.0 / (6.0 + (beta * (beta + 5.0)))) else: tmp = ((1.0 + alpha) / t_0) / (1.0 + t_0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(beta + Float64(2.0 + alpha)) tmp = 0.0 if (beta <= 1.78e+19) tmp = Float64(Float64(Float64(1.0 + beta) / t_0) * Float64(1.0 / Float64(6.0 + Float64(beta * Float64(beta + 5.0))))); else tmp = Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(1.0 + t_0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = beta + (2.0 + alpha);
tmp = 0.0;
if (beta <= 1.78e+19)
tmp = ((1.0 + beta) / t_0) * (1.0 / (6.0 + (beta * (beta + 5.0))));
else
tmp = ((1.0 + alpha) / t_0) / (1.0 + t_0);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(beta + N[(2.0 + alpha), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 1.78e+19], N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(1.0 / N[(6.0 + N[(beta * N[(beta + 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \beta + \left(2 + \alpha\right)\\
\mathbf{if}\;\beta \leq 1.78 \cdot 10^{+19}:\\
\;\;\;\;\frac{1 + \beta}{t_0} \cdot \frac{1}{6 + \beta \cdot \left(\beta + 5\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0}}{1 + t_0}\\
\end{array}
\end{array}
if beta < 1.78e19Initial program 99.9%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.9%
Simplified93.9%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 69.6%
Taylor expanded in beta around 0 69.6%
+-commutative69.6%
unpow269.6%
distribute-rgt-in69.6%
Simplified69.6%
if 1.78e19 < beta Initial program 78.1%
Taylor expanded in beta around inf 79.5%
Taylor expanded in alpha around 0 79.5%
Taylor expanded in alpha around 0 79.5%
Final simplification72.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.7e+19) (* (/ (+ 1.0 beta) (+ beta 2.0)) (/ 1.0 (* (+ beta 2.0) (+ beta 3.0)))) (/ (/ (+ 1.0 alpha) beta) (+ beta (+ 2.0 alpha)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.7e+19) {
tmp = ((1.0 + beta) / (beta + 2.0)) * (1.0 / ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.7d+19) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) * (1.0d0 / ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = ((1.0d0 + alpha) / beta) / (beta + (2.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.7e+19) {
tmp = ((1.0 + beta) / (beta + 2.0)) * (1.0 / ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.7e+19: tmp = ((1.0 + beta) / (beta + 2.0)) * (1.0 / ((beta + 2.0) * (beta + 3.0))) else: tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.7e+19) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) * Float64(1.0 / Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(beta + Float64(2.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.7e+19)
tmp = ((1.0 + beta) / (beta + 2.0)) * (1.0 / ((beta + 2.0) * (beta + 3.0)));
else
tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.7e+19], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta + N[(2.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.7 \cdot 10^{+19}:\\
\;\;\;\;\frac{1 + \beta}{\beta + 2} \cdot \frac{1}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + \left(2 + \alpha\right)}\\
\end{array}
\end{array}
if beta < 1.7e19Initial program 99.9%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.9%
Simplified93.9%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 69.6%
Taylor expanded in alpha around 0 68.8%
if 1.7e19 < beta Initial program 78.1%
associate-/l/73.9%
associate-+l+73.9%
+-commutative73.9%
associate-+r+73.9%
associate-+l+73.9%
distribute-rgt1-in73.9%
*-rgt-identity73.9%
distribute-lft-out73.9%
+-commutative73.9%
associate-*l/90.8%
*-commutative90.8%
associate-*r/89.6%
Simplified89.6%
associate-*r/90.8%
+-commutative90.8%
Applied egg-rr90.8%
+-commutative90.8%
*-commutative90.8%
+-commutative90.8%
associate-*r/90.9%
associate-/r*99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
Simplified99.7%
frac-times90.8%
associate-+r+90.8%
+-commutative90.8%
associate-+r+90.8%
+-commutative90.8%
Applied egg-rr90.8%
associate-*r/73.9%
+-commutative73.9%
*-commutative73.9%
+-commutative73.9%
associate-*r/90.8%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 78.9%
associate-*l/78.9%
div-inv78.9%
associate-+r+78.9%
Applied egg-rr78.9%
Final simplification71.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ beta (+ 2.0 alpha))))
(if (<= beta 1e+18)
(/ (+ 1.0 beta) (* t_0 (* (+ beta 2.0) (+ beta 3.0))))
(/ (/ (+ 1.0 alpha) beta) t_0))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = beta + (2.0 + alpha);
double tmp;
if (beta <= 1e+18) {
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / beta) / t_0;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = beta + (2.0d0 + alpha)
if (beta <= 1d+18) then
tmp = (1.0d0 + beta) / (t_0 * ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = ((1.0d0 + alpha) / beta) / t_0
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = beta + (2.0 + alpha);
double tmp;
if (beta <= 1e+18) {
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / beta) / t_0;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = beta + (2.0 + alpha) tmp = 0 if beta <= 1e+18: tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0))) else: tmp = ((1.0 + alpha) / beta) / t_0 return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(beta + Float64(2.0 + alpha)) tmp = 0.0 if (beta <= 1e+18) tmp = Float64(Float64(1.0 + beta) / Float64(t_0 * Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / t_0); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = beta + (2.0 + alpha);
tmp = 0.0;
if (beta <= 1e+18)
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
else
tmp = ((1.0 + alpha) / beta) / t_0;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(beta + N[(2.0 + alpha), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 1e+18], N[(N[(1.0 + beta), $MachinePrecision] / N[(t$95$0 * N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \beta + \left(2 + \alpha\right)\\
\mathbf{if}\;\beta \leq 10^{+18}:\\
\;\;\;\;\frac{1 + \beta}{t_0 \cdot \left(\left(\beta + 2\right) \cdot \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{t_0}\\
\end{array}
\end{array}
if beta < 1e18Initial program 99.9%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.9%
Simplified93.9%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 69.6%
un-div-inv69.6%
Applied egg-rr69.6%
associate-/r*69.6%
+-commutative69.6%
Simplified69.6%
if 1e18 < beta Initial program 78.1%
associate-/l/73.9%
associate-+l+73.9%
+-commutative73.9%
associate-+r+73.9%
associate-+l+73.9%
distribute-rgt1-in73.9%
*-rgt-identity73.9%
distribute-lft-out73.9%
+-commutative73.9%
associate-*l/90.8%
*-commutative90.8%
associate-*r/89.6%
Simplified89.6%
associate-*r/90.8%
+-commutative90.8%
Applied egg-rr90.8%
+-commutative90.8%
*-commutative90.8%
+-commutative90.8%
associate-*r/90.9%
associate-/r*99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
Simplified99.7%
frac-times90.8%
associate-+r+90.8%
+-commutative90.8%
associate-+r+90.8%
+-commutative90.8%
Applied egg-rr90.8%
associate-*r/73.9%
+-commutative73.9%
*-commutative73.9%
+-commutative73.9%
associate-*r/90.8%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 78.9%
associate-*l/78.9%
div-inv78.9%
associate-+r+78.9%
Applied egg-rr78.9%
Final simplification72.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ beta (+ 2.0 alpha))))
(if (<= beta 2.7e+15)
(/ (+ 1.0 beta) (* t_0 (* (+ beta 2.0) (+ beta 3.0))))
(/ (/ (+ 1.0 alpha) t_0) (+ 1.0 t_0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = beta + (2.0 + alpha);
double tmp;
if (beta <= 2.7e+15) {
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / t_0) / (1.0 + t_0);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = beta + (2.0d0 + alpha)
if (beta <= 2.7d+15) then
tmp = (1.0d0 + beta) / (t_0 * ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = ((1.0d0 + alpha) / t_0) / (1.0d0 + t_0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = beta + (2.0 + alpha);
double tmp;
if (beta <= 2.7e+15) {
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / t_0) / (1.0 + t_0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = beta + (2.0 + alpha) tmp = 0 if beta <= 2.7e+15: tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0))) else: tmp = ((1.0 + alpha) / t_0) / (1.0 + t_0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(beta + Float64(2.0 + alpha)) tmp = 0.0 if (beta <= 2.7e+15) tmp = Float64(Float64(1.0 + beta) / Float64(t_0 * Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(1.0 + t_0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = beta + (2.0 + alpha);
tmp = 0.0;
if (beta <= 2.7e+15)
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
else
tmp = ((1.0 + alpha) / t_0) / (1.0 + t_0);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(beta + N[(2.0 + alpha), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 2.7e+15], N[(N[(1.0 + beta), $MachinePrecision] / N[(t$95$0 * N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \beta + \left(2 + \alpha\right)\\
\mathbf{if}\;\beta \leq 2.7 \cdot 10^{+15}:\\
\;\;\;\;\frac{1 + \beta}{t_0 \cdot \left(\left(\beta + 2\right) \cdot \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0}}{1 + t_0}\\
\end{array}
\end{array}
if beta < 2.7e15Initial program 99.9%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.9%
Simplified93.9%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 69.6%
un-div-inv69.6%
Applied egg-rr69.6%
associate-/r*69.6%
+-commutative69.6%
Simplified69.6%
if 2.7e15 < beta Initial program 78.1%
Taylor expanded in beta around inf 79.5%
Taylor expanded in alpha around 0 79.5%
Taylor expanded in alpha around 0 79.5%
Final simplification72.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.0) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ (/ (+ 1.0 alpha) (+ beta 2.0)) (+ 1.0 (+ beta (+ 2.0 alpha))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.0) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / (beta + 2.0)) / (1.0 + (beta + (2.0 + alpha)));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.0d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = ((1.0d0 + alpha) / (beta + 2.0d0)) / (1.0d0 + (beta + (2.0d0 + alpha)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.0) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / (beta + 2.0)) / (1.0 + (beta + (2.0 + alpha)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.0: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = ((1.0 + alpha) / (beta + 2.0)) / (1.0 + (beta + (2.0 + alpha))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.0) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(beta + 2.0)) / Float64(1.0 + Float64(beta + Float64(2.0 + alpha)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.0)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = ((1.0 + alpha) / (beta + 2.0)) / (1.0 + (beta + (2.0 + alpha)));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.0], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(beta + N[(2.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta + 2}}{1 + \left(\beta + \left(2 + \alpha\right)\right)}\\
\end{array}
\end{array}
if beta < 2Initial program 99.9%
associate-/l/99.8%
associate-/r*93.8%
associate-+l+93.8%
+-commutative93.8%
associate-+r+93.8%
associate-+l+93.8%
distribute-rgt1-in93.8%
*-rgt-identity93.8%
distribute-lft-out93.8%
*-commutative93.8%
metadata-eval93.8%
associate-+l+93.8%
+-commutative93.8%
Simplified93.8%
Taylor expanded in beta around 0 93.3%
Taylor expanded in alpha around 0 68.5%
Taylor expanded in beta around 0 68.6%
*-commutative68.6%
Simplified68.6%
if 2 < beta Initial program 79.5%
Taylor expanded in beta around inf 77.0%
Taylor expanded in alpha around 0 77.0%
Taylor expanded in alpha around 0 76.4%
Final simplification70.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.6) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ (/ (+ 1.0 alpha) beta) (+ beta (+ 2.0 alpha)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.6d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = ((1.0d0 + alpha) / beta) / (beta + (2.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.6: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.6) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(beta + Float64(2.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.6)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = ((1.0 + alpha) / beta) / (beta + (2.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.6], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta + N[(2.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.6:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + \left(2 + \alpha\right)}\\
\end{array}
\end{array}
if beta < 2.60000000000000009Initial program 99.9%
associate-/l/99.8%
associate-/r*93.8%
associate-+l+93.8%
+-commutative93.8%
associate-+r+93.8%
associate-+l+93.8%
distribute-rgt1-in93.8%
*-rgt-identity93.8%
distribute-lft-out93.8%
*-commutative93.8%
metadata-eval93.8%
associate-+l+93.8%
+-commutative93.8%
Simplified93.8%
Taylor expanded in beta around 0 93.3%
Taylor expanded in alpha around 0 68.5%
Taylor expanded in beta around 0 68.6%
*-commutative68.6%
Simplified68.6%
if 2.60000000000000009 < beta Initial program 79.5%
associate-/l/75.6%
associate-+l+75.6%
+-commutative75.6%
associate-+r+75.6%
associate-+l+75.6%
distribute-rgt1-in75.6%
*-rgt-identity75.6%
distribute-lft-out75.6%
+-commutative75.6%
associate-*l/91.4%
*-commutative91.4%
associate-*r/90.2%
Simplified90.2%
associate-*r/91.4%
+-commutative91.4%
Applied egg-rr91.4%
+-commutative91.4%
*-commutative91.4%
+-commutative91.4%
associate-*r/91.4%
associate-/r*99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
Simplified99.6%
frac-times91.4%
associate-+r+91.4%
+-commutative91.4%
associate-+r+91.4%
+-commutative91.4%
Applied egg-rr91.4%
associate-*r/75.6%
+-commutative75.6%
*-commutative75.6%
+-commutative75.6%
associate-*r/91.4%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 76.2%
associate-*l/76.2%
div-inv76.3%
associate-+r+76.3%
Applied egg-rr76.3%
Final simplification70.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.8) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (* (/ (+ 1.0 alpha) beta) (/ 1.0 beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.8) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) * (1.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 <= 2.8d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = ((1.0d0 + alpha) / beta) * (1.0d0 / beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.8) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) * (1.0 / beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.8: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = ((1.0 + alpha) / beta) * (1.0 / beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.8) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) * Float64(1.0 / beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.8)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = ((1.0 + alpha) / beta) * (1.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, 2.8], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] * N[(1.0 / beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.8:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta} \cdot \frac{1}{\beta}\\
\end{array}
\end{array}
if beta < 2.7999999999999998Initial program 99.9%
associate-/l/99.8%
associate-/r*93.8%
associate-+l+93.8%
+-commutative93.8%
associate-+r+93.8%
associate-+l+93.8%
distribute-rgt1-in93.8%
*-rgt-identity93.8%
distribute-lft-out93.8%
*-commutative93.8%
metadata-eval93.8%
associate-+l+93.8%
+-commutative93.8%
Simplified93.8%
Taylor expanded in beta around 0 93.3%
Taylor expanded in alpha around 0 68.5%
Taylor expanded in beta around 0 68.6%
*-commutative68.6%
Simplified68.6%
if 2.7999999999999998 < beta Initial program 79.5%
associate-/l/75.6%
associate-+l+75.6%
+-commutative75.6%
associate-+r+75.6%
associate-+l+75.6%
distribute-rgt1-in75.6%
*-rgt-identity75.6%
distribute-lft-out75.6%
+-commutative75.6%
associate-*l/91.4%
*-commutative91.4%
associate-*r/90.2%
Simplified90.2%
associate-*r/91.4%
+-commutative91.4%
Applied egg-rr91.4%
+-commutative91.4%
*-commutative91.4%
+-commutative91.4%
associate-*r/91.4%
associate-/r*99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
Simplified99.6%
frac-times91.4%
associate-+r+91.4%
+-commutative91.4%
associate-+r+91.4%
+-commutative91.4%
Applied egg-rr91.4%
associate-*r/75.6%
+-commutative75.6%
*-commutative75.6%
+-commutative75.6%
associate-*r/91.4%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 76.2%
Taylor expanded in beta around inf 75.9%
Final simplification70.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.6) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ 1.0 (* beta (+ beta 2.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = 1.0 / (beta * (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 <= 2.6d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = 1.0d0 / (beta * (beta + 2.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = 1.0 / (beta * (beta + 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.6: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = 1.0 / (beta * (beta + 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.6) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(1.0 / Float64(beta * 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 <= 2.6)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = 1.0 / (beta * (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, 2.6], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(beta * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.6:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \left(\beta + 2\right)}\\
\end{array}
\end{array}
if beta < 2.60000000000000009Initial program 99.9%
associate-/l/99.8%
associate-/r*93.8%
associate-+l+93.8%
+-commutative93.8%
associate-+r+93.8%
associate-+l+93.8%
distribute-rgt1-in93.8%
*-rgt-identity93.8%
distribute-lft-out93.8%
*-commutative93.8%
metadata-eval93.8%
associate-+l+93.8%
+-commutative93.8%
Simplified93.8%
Taylor expanded in beta around 0 93.3%
Taylor expanded in alpha around 0 68.5%
Taylor expanded in beta around 0 68.6%
*-commutative68.6%
Simplified68.6%
if 2.60000000000000009 < beta Initial program 79.5%
associate-/l/75.6%
associate-+l+75.6%
+-commutative75.6%
associate-+r+75.6%
associate-+l+75.6%
distribute-rgt1-in75.6%
*-rgt-identity75.6%
distribute-lft-out75.6%
+-commutative75.6%
associate-*l/91.4%
*-commutative91.4%
associate-*r/90.2%
Simplified90.2%
associate-*r/91.4%
+-commutative91.4%
Applied egg-rr91.4%
+-commutative91.4%
*-commutative91.4%
+-commutative91.4%
associate-*r/91.4%
associate-/r*99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
Simplified99.6%
frac-times91.4%
associate-+r+91.4%
+-commutative91.4%
associate-+r+91.4%
+-commutative91.4%
Applied egg-rr91.4%
associate-*r/75.6%
+-commutative75.6%
*-commutative75.6%
+-commutative75.6%
associate-*r/91.4%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 76.2%
Taylor expanded in alpha around 0 73.1%
Final simplification70.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.8) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ (+ 1.0 alpha) (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.8) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} 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.8d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
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.8) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.8: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = (1.0 + alpha) / (beta * beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.8) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); 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.8)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
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.8], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.8:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 2.7999999999999998Initial program 99.9%
associate-/l/99.8%
associate-/r*93.8%
associate-+l+93.8%
+-commutative93.8%
associate-+r+93.8%
associate-+l+93.8%
distribute-rgt1-in93.8%
*-rgt-identity93.8%
distribute-lft-out93.8%
*-commutative93.8%
metadata-eval93.8%
associate-+l+93.8%
+-commutative93.8%
Simplified93.8%
Taylor expanded in beta around 0 93.3%
Taylor expanded in alpha around 0 68.5%
Taylor expanded in beta around 0 68.6%
*-commutative68.6%
Simplified68.6%
if 2.7999999999999998 < beta Initial program 79.5%
associate-/l/75.6%
associate-+l+75.6%
+-commutative75.6%
associate-+r+75.6%
associate-+l+75.6%
distribute-rgt1-in75.6%
*-rgt-identity75.6%
distribute-lft-out75.6%
+-commutative75.6%
associate-*l/91.4%
*-commutative91.4%
associate-*r/90.2%
Simplified90.2%
associate-*r/91.4%
+-commutative91.4%
Applied egg-rr91.4%
+-commutative91.4%
*-commutative91.4%
+-commutative91.4%
associate-*r/91.4%
associate-/r*99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
Simplified99.6%
frac-times91.4%
associate-+r+91.4%
+-commutative91.4%
associate-+r+91.4%
+-commutative91.4%
Applied egg-rr91.4%
associate-*r/75.6%
+-commutative75.6%
*-commutative75.6%
+-commutative75.6%
associate-*r/91.4%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 74.9%
unpow274.9%
Simplified74.9%
Final simplification70.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.5) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ 0.2 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} 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 <= 2.5d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
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 <= 2.5) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = 0.2 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.5: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = 0.2 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.5) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); 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 <= 2.5)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
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, 2.5], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(0.2 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.5:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{0.2}{\beta}\\
\end{array}
\end{array}
if beta < 2.5Initial program 99.9%
associate-/l/99.8%
associate-/r*93.8%
associate-+l+93.8%
+-commutative93.8%
associate-+r+93.8%
associate-+l+93.8%
distribute-rgt1-in93.8%
*-rgt-identity93.8%
distribute-lft-out93.8%
*-commutative93.8%
metadata-eval93.8%
associate-+l+93.8%
+-commutative93.8%
Simplified93.8%
Taylor expanded in beta around 0 93.3%
Taylor expanded in alpha around 0 68.5%
Taylor expanded in beta around 0 68.6%
*-commutative68.6%
Simplified68.6%
if 2.5 < beta Initial program 79.5%
associate-/l/75.6%
associate-/r*65.0%
associate-+l+65.0%
+-commutative65.0%
associate-+r+65.0%
associate-+l+65.0%
distribute-rgt1-in65.0%
*-rgt-identity65.0%
distribute-lft-out65.0%
*-commutative65.0%
metadata-eval65.0%
associate-+l+65.0%
+-commutative65.0%
Simplified65.0%
Taylor expanded in beta around 0 40.7%
Taylor expanded in alpha around 0 43.7%
Taylor expanded in beta around inf 6.7%
Final simplification49.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 0.08333333333333333)
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.08333333333333333;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.08333333333333333d0
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.08333333333333333;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.08333333333333333
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return 0.08333333333333333 end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.08333333333333333;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := 0.08333333333333333
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
0.08333333333333333
\end{array}
Initial program 93.7%
associate-/l/92.5%
associate-/r*85.0%
associate-+l+85.0%
+-commutative85.0%
associate-+r+85.0%
associate-+l+85.0%
distribute-rgt1-in85.0%
*-rgt-identity85.0%
distribute-lft-out85.0%
*-commutative85.0%
metadata-eval85.0%
associate-+l+85.0%
+-commutative85.0%
Simplified85.0%
Taylor expanded in beta around 0 77.3%
Taylor expanded in alpha around 0 61.0%
Taylor expanded in beta around 0 48.6%
Final simplification48.6%
herbie shell --seed 2023252
(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)))