
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t_0}}{t_0}}{t_0 + 1}
\end{array}
\end{array}
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ alpha (+ 2.0 beta)))) (* (/ (/ (+ 1.0 alpha) t_0) t_0) (/ (+ 1.0 beta) (+ 3.0 (+ alpha beta))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (2.0 + beta);
return (((1.0 + alpha) / t_0) / t_0) * ((1.0 + beta) / (3.0 + (alpha + beta)));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = alpha + (2.0d0 + beta)
code = (((1.0d0 + alpha) / t_0) / t_0) * ((1.0d0 + beta) / (3.0d0 + (alpha + beta)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (2.0 + beta);
return (((1.0 + alpha) / t_0) / t_0) * ((1.0 + beta) / (3.0 + (alpha + beta)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (2.0 + beta) return (((1.0 + alpha) / t_0) / t_0) * ((1.0 + beta) / (3.0 + (alpha + beta)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(2.0 + beta)) return Float64(Float64(Float64(Float64(1.0 + alpha) / t_0) / t_0) * Float64(Float64(1.0 + beta) / Float64(3.0 + Float64(alpha + beta)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (2.0 + beta);
tmp = (((1.0 + alpha) / t_0) / t_0) * ((1.0 + beta) / (3.0 + (alpha + beta)));
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[(2.0 + beta), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(1.0 + beta), $MachinePrecision] / N[(3.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(2 + \beta\right)\\
\frac{\frac{1 + \alpha}{t_0}}{t_0} \cdot \frac{1 + \beta}{3 + \left(\alpha + \beta\right)}
\end{array}
\end{array}
Initial program 95.6%
associate-/l/94.0%
associate-/r*87.5%
+-commutative87.5%
associate-+r+87.5%
+-commutative87.5%
associate-+r+87.5%
associate-+r+87.5%
distribute-rgt1-in87.5%
+-commutative87.5%
*-commutative87.5%
distribute-rgt1-in87.5%
+-commutative87.5%
times-frac97.4%
Simplified97.4%
expm1-log1p-u97.4%
expm1-udef76.2%
*-commutative76.2%
+-commutative76.2%
Applied egg-rr76.2%
expm1-def97.4%
expm1-log1p97.4%
*-commutative97.4%
associate-*r/97.3%
times-frac99.8%
+-commutative99.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 (+ 2.0 beta))) (t_1 (/ (+ 1.0 alpha) t_0)))
(if (<= beta 200000000000.0)
(* t_1 (/ (+ 1.0 beta) (* t_0 (+ beta (+ alpha 3.0)))))
(* (/ t_1 t_0) (- 1.0 (/ (+ alpha 2.0) beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (2.0 + beta);
double t_1 = (1.0 + alpha) / t_0;
double tmp;
if (beta <= 200000000000.0) {
tmp = t_1 * ((1.0 + beta) / (t_0 * (beta + (alpha + 3.0))));
} else {
tmp = (t_1 / t_0) * (1.0 - ((alpha + 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = alpha + (2.0d0 + beta)
t_1 = (1.0d0 + alpha) / t_0
if (beta <= 200000000000.0d0) then
tmp = t_1 * ((1.0d0 + beta) / (t_0 * (beta + (alpha + 3.0d0))))
else
tmp = (t_1 / t_0) * (1.0d0 - ((alpha + 2.0d0) / beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (2.0 + beta);
double t_1 = (1.0 + alpha) / t_0;
double tmp;
if (beta <= 200000000000.0) {
tmp = t_1 * ((1.0 + beta) / (t_0 * (beta + (alpha + 3.0))));
} else {
tmp = (t_1 / t_0) * (1.0 - ((alpha + 2.0) / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (2.0 + beta) t_1 = (1.0 + alpha) / t_0 tmp = 0 if beta <= 200000000000.0: tmp = t_1 * ((1.0 + beta) / (t_0 * (beta + (alpha + 3.0)))) else: tmp = (t_1 / t_0) * (1.0 - ((alpha + 2.0) / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(2.0 + beta)) t_1 = Float64(Float64(1.0 + alpha) / t_0) tmp = 0.0 if (beta <= 200000000000.0) tmp = Float64(t_1 * Float64(Float64(1.0 + beta) / Float64(t_0 * Float64(beta + Float64(alpha + 3.0))))); else tmp = Float64(Float64(t_1 / t_0) * Float64(1.0 - Float64(Float64(alpha + 2.0) / beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (2.0 + beta);
t_1 = (1.0 + alpha) / t_0;
tmp = 0.0;
if (beta <= 200000000000.0)
tmp = t_1 * ((1.0 + beta) / (t_0 * (beta + (alpha + 3.0))));
else
tmp = (t_1 / t_0) * (1.0 - ((alpha + 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_] := Block[{t$95$0 = N[(alpha + N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[beta, 200000000000.0], N[(t$95$1 * N[(N[(1.0 + beta), $MachinePrecision] / N[(t$95$0 * N[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 / t$95$0), $MachinePrecision] * N[(1.0 - N[(N[(alpha + 2.0), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(2 + \beta\right)\\
t_1 := \frac{1 + \alpha}{t_0}\\
\mathbf{if}\;\beta \leq 200000000000:\\
\;\;\;\;t_1 \cdot \frac{1 + \beta}{t_0 \cdot \left(\beta + \left(\alpha + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{t_0} \cdot \left(1 - \frac{\alpha + 2}{\beta}\right)\\
\end{array}
\end{array}
if beta < 2e11Initial program 99.8%
associate-/l/99.8%
associate-/r*95.2%
+-commutative95.2%
associate-+r+95.2%
+-commutative95.2%
associate-+r+95.2%
associate-+r+95.2%
distribute-rgt1-in95.2%
+-commutative95.2%
*-commutative95.2%
distribute-rgt1-in95.2%
+-commutative95.2%
times-frac99.8%
Simplified99.8%
if 2e11 < beta Initial program 85.4%
associate-/l/79.9%
associate-/r*68.8%
+-commutative68.8%
associate-+r+68.8%
+-commutative68.8%
associate-+r+68.8%
associate-+r+68.8%
distribute-rgt1-in68.8%
+-commutative68.8%
*-commutative68.8%
distribute-rgt1-in68.8%
+-commutative68.8%
times-frac91.5%
Simplified91.5%
expm1-log1p-u91.5%
expm1-udef56.2%
*-commutative56.2%
+-commutative56.2%
Applied egg-rr56.2%
expm1-def91.5%
expm1-log1p91.5%
*-commutative91.5%
associate-*r/91.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in beta around inf 85.0%
mul-1-neg84.3%
unsub-neg84.3%
Simplified85.0%
Final simplification95.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ 2.0 beta))))
(if (<= alpha 1.35e-12)
(* (/ (+ 1.0 beta) (+ 3.0 (+ alpha beta))) (/ (/ 1.0 (+ 2.0 beta)) t_0))
(*
(/ (+ 1.0 alpha) t_0)
(- (/ 1.0 beta) (* (/ (+ alpha 2.0) beta) (/ 2.0 beta)))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (2.0 + beta);
double tmp;
if (alpha <= 1.35e-12) {
tmp = ((1.0 + beta) / (3.0 + (alpha + beta))) * ((1.0 / (2.0 + beta)) / t_0);
} else {
tmp = ((1.0 + alpha) / t_0) * ((1.0 / beta) - (((alpha + 2.0) / 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) :: t_0
real(8) :: tmp
t_0 = alpha + (2.0d0 + beta)
if (alpha <= 1.35d-12) then
tmp = ((1.0d0 + beta) / (3.0d0 + (alpha + beta))) * ((1.0d0 / (2.0d0 + beta)) / t_0)
else
tmp = ((1.0d0 + alpha) / t_0) * ((1.0d0 / beta) - (((alpha + 2.0d0) / beta) * (2.0d0 / beta)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (2.0 + beta);
double tmp;
if (alpha <= 1.35e-12) {
tmp = ((1.0 + beta) / (3.0 + (alpha + beta))) * ((1.0 / (2.0 + beta)) / t_0);
} else {
tmp = ((1.0 + alpha) / t_0) * ((1.0 / beta) - (((alpha + 2.0) / beta) * (2.0 / beta)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (2.0 + beta) tmp = 0 if alpha <= 1.35e-12: tmp = ((1.0 + beta) / (3.0 + (alpha + beta))) * ((1.0 / (2.0 + beta)) / t_0) else: tmp = ((1.0 + alpha) / t_0) * ((1.0 / beta) - (((alpha + 2.0) / beta) * (2.0 / beta))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(2.0 + beta)) tmp = 0.0 if (alpha <= 1.35e-12) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(3.0 + Float64(alpha + beta))) * Float64(Float64(1.0 / Float64(2.0 + beta)) / t_0)); else tmp = Float64(Float64(Float64(1.0 + alpha) / t_0) * Float64(Float64(1.0 / beta) - Float64(Float64(Float64(alpha + 2.0) / beta) * Float64(2.0 / beta)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (2.0 + beta);
tmp = 0.0;
if (alpha <= 1.35e-12)
tmp = ((1.0 + beta) / (3.0 + (alpha + beta))) * ((1.0 / (2.0 + beta)) / t_0);
else
tmp = ((1.0 + alpha) / t_0) * ((1.0 / beta) - (((alpha + 2.0) / 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_] := Block[{t$95$0 = N[(alpha + N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[alpha, 1.35e-12], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(3.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(1.0 / beta), $MachinePrecision] - N[(N[(N[(alpha + 2.0), $MachinePrecision] / beta), $MachinePrecision] * N[(2.0 / beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(2 + \beta\right)\\
\mathbf{if}\;\alpha \leq 1.35 \cdot 10^{-12}:\\
\;\;\;\;\frac{1 + \beta}{3 + \left(\alpha + \beta\right)} \cdot \frac{\frac{1}{2 + \beta}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{t_0} \cdot \left(\frac{1}{\beta} - \frac{\alpha + 2}{\beta} \cdot \frac{2}{\beta}\right)\\
\end{array}
\end{array}
if alpha < 1.3499999999999999e-12Initial program 99.9%
associate-/l/99.8%
associate-/r*97.1%
+-commutative97.1%
associate-+r+97.1%
+-commutative97.1%
associate-+r+97.1%
associate-+r+97.1%
distribute-rgt1-in97.1%
+-commutative97.1%
*-commutative97.1%
distribute-rgt1-in97.1%
+-commutative97.1%
times-frac99.8%
Simplified99.8%
expm1-log1p-u99.8%
expm1-udef83.8%
*-commutative83.8%
+-commutative83.8%
Applied egg-rr83.8%
expm1-def99.8%
expm1-log1p99.8%
*-commutative99.8%
associate-*r/99.8%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in alpha around 0 98.3%
if 1.3499999999999999e-12 < alpha Initial program 87.2%
associate-/l/82.5%
associate-/r*68.5%
+-commutative68.5%
associate-+r+68.5%
+-commutative68.5%
associate-+r+68.5%
associate-+r+68.5%
distribute-rgt1-in68.5%
+-commutative68.5%
*-commutative68.5%
distribute-rgt1-in68.4%
+-commutative68.4%
times-frac92.5%
Simplified92.5%
Taylor expanded in beta around inf 21.5%
+-commutative21.5%
mul-1-neg21.5%
unsub-neg21.5%
metadata-eval21.5%
distribute-lft-in21.5%
*-commutative21.5%
unpow221.5%
times-frac21.5%
Simplified21.5%
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 (+ 2.0 beta))))
(if (<= beta 650000000.0)
(/ (+ 1.0 beta) (* (+ 2.0 beta) (* (+ 2.0 beta) (+ beta 3.0))))
(* (/ (/ (+ 1.0 alpha) t_0) t_0) (- 1.0 (/ (+ alpha 2.0) beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (2.0 + beta);
double tmp;
if (beta <= 650000000.0) {
tmp = (1.0 + beta) / ((2.0 + beta) * ((2.0 + beta) * (beta + 3.0)));
} else {
tmp = (((1.0 + alpha) / t_0) / t_0) * (1.0 - ((alpha + 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) :: t_0
real(8) :: tmp
t_0 = alpha + (2.0d0 + beta)
if (beta <= 650000000.0d0) then
tmp = (1.0d0 + beta) / ((2.0d0 + beta) * ((2.0d0 + beta) * (beta + 3.0d0)))
else
tmp = (((1.0d0 + alpha) / t_0) / t_0) * (1.0d0 - ((alpha + 2.0d0) / beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (2.0 + beta);
double tmp;
if (beta <= 650000000.0) {
tmp = (1.0 + beta) / ((2.0 + beta) * ((2.0 + beta) * (beta + 3.0)));
} else {
tmp = (((1.0 + alpha) / t_0) / t_0) * (1.0 - ((alpha + 2.0) / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (2.0 + beta) tmp = 0 if beta <= 650000000.0: tmp = (1.0 + beta) / ((2.0 + beta) * ((2.0 + beta) * (beta + 3.0))) else: tmp = (((1.0 + alpha) / t_0) / t_0) * (1.0 - ((alpha + 2.0) / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(2.0 + beta)) tmp = 0.0 if (beta <= 650000000.0) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(2.0 + beta) * Float64(Float64(2.0 + beta) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / t_0) / t_0) * Float64(1.0 - Float64(Float64(alpha + 2.0) / beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (2.0 + beta);
tmp = 0.0;
if (beta <= 650000000.0)
tmp = (1.0 + beta) / ((2.0 + beta) * ((2.0 + beta) * (beta + 3.0)));
else
tmp = (((1.0 + alpha) / t_0) / t_0) * (1.0 - ((alpha + 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_] := Block[{t$95$0 = N[(alpha + N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 650000000.0], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(2.0 + beta), $MachinePrecision] * N[(N[(2.0 + beta), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(1.0 - N[(N[(alpha + 2.0), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(2 + \beta\right)\\
\mathbf{if}\;\beta \leq 650000000:\\
\;\;\;\;\frac{1 + \beta}{\left(2 + \beta\right) \cdot \left(\left(2 + \beta\right) \cdot \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0}}{t_0} \cdot \left(1 - \frac{\alpha + 2}{\beta}\right)\\
\end{array}
\end{array}
if beta < 6.5e8Initial program 99.8%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 88.1%
Taylor expanded in alpha around 0 68.2%
+-commutative68.2%
Simplified68.2%
expm1-log1p-u68.2%
expm1-udef64.8%
associate-/l/64.8%
+-commutative64.8%
+-commutative64.8%
Applied egg-rr64.8%
expm1-def68.2%
expm1-log1p68.3%
associate-*l*68.3%
Simplified68.3%
if 6.5e8 < beta Initial program 85.4%
associate-/l/79.9%
associate-/r*68.8%
+-commutative68.8%
associate-+r+68.8%
+-commutative68.8%
associate-+r+68.8%
associate-+r+68.8%
distribute-rgt1-in68.8%
+-commutative68.8%
*-commutative68.8%
distribute-rgt1-in68.8%
+-commutative68.8%
times-frac91.5%
Simplified91.5%
expm1-log1p-u91.5%
expm1-udef56.2%
*-commutative56.2%
+-commutative56.2%
Applied egg-rr56.2%
expm1-def91.5%
expm1-log1p91.5%
*-commutative91.5%
associate-*r/91.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in beta around inf 85.0%
mul-1-neg84.3%
unsub-neg84.3%
Simplified85.0%
Final simplification73.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ 2.0 beta))))
(if (<= beta 480000000.0)
(/ (/ (+ 1.0 (+ alpha beta)) t_0) (* (+ 3.0 (+ alpha beta)) t_0))
(* (/ (/ (+ 1.0 alpha) t_0) t_0) (- 1.0 (/ (+ alpha 2.0) beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (2.0 + beta);
double tmp;
if (beta <= 480000000.0) {
tmp = ((1.0 + (alpha + beta)) / t_0) / ((3.0 + (alpha + beta)) * t_0);
} else {
tmp = (((1.0 + alpha) / t_0) / t_0) * (1.0 - ((alpha + 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) :: t_0
real(8) :: tmp
t_0 = alpha + (2.0d0 + beta)
if (beta <= 480000000.0d0) then
tmp = ((1.0d0 + (alpha + beta)) / t_0) / ((3.0d0 + (alpha + beta)) * t_0)
else
tmp = (((1.0d0 + alpha) / t_0) / t_0) * (1.0d0 - ((alpha + 2.0d0) / beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (2.0 + beta);
double tmp;
if (beta <= 480000000.0) {
tmp = ((1.0 + (alpha + beta)) / t_0) / ((3.0 + (alpha + beta)) * t_0);
} else {
tmp = (((1.0 + alpha) / t_0) / t_0) * (1.0 - ((alpha + 2.0) / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (2.0 + beta) tmp = 0 if beta <= 480000000.0: tmp = ((1.0 + (alpha + beta)) / t_0) / ((3.0 + (alpha + beta)) * t_0) else: tmp = (((1.0 + alpha) / t_0) / t_0) * (1.0 - ((alpha + 2.0) / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(2.0 + beta)) tmp = 0.0 if (beta <= 480000000.0) tmp = Float64(Float64(Float64(1.0 + Float64(alpha + beta)) / t_0) / Float64(Float64(3.0 + Float64(alpha + beta)) * t_0)); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / t_0) / t_0) * Float64(1.0 - Float64(Float64(alpha + 2.0) / beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (2.0 + beta);
tmp = 0.0;
if (beta <= 480000000.0)
tmp = ((1.0 + (alpha + beta)) / t_0) / ((3.0 + (alpha + beta)) * t_0);
else
tmp = (((1.0 + alpha) / t_0) / t_0) * (1.0 - ((alpha + 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_] := Block[{t$95$0 = N[(alpha + N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 480000000.0], N[(N[(N[(1.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(N[(3.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(1.0 - N[(N[(alpha + 2.0), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(2 + \beta\right)\\
\mathbf{if}\;\beta \leq 480000000:\\
\;\;\;\;\frac{\frac{1 + \left(\alpha + \beta\right)}{t_0}}{\left(3 + \left(\alpha + \beta\right)\right) \cdot t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0}}{t_0} \cdot \left(1 - \frac{\alpha + 2}{\beta}\right)\\
\end{array}
\end{array}
if beta < 4.8e8Initial program 99.8%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in beta around 0 99.4%
if 4.8e8 < beta Initial program 85.4%
associate-/l/79.9%
associate-/r*68.8%
+-commutative68.8%
associate-+r+68.8%
+-commutative68.8%
associate-+r+68.8%
associate-+r+68.8%
distribute-rgt1-in68.8%
+-commutative68.8%
*-commutative68.8%
distribute-rgt1-in68.8%
+-commutative68.8%
times-frac91.5%
Simplified91.5%
expm1-log1p-u91.5%
expm1-udef56.2%
*-commutative56.2%
+-commutative56.2%
Applied egg-rr56.2%
expm1-def91.5%
expm1-log1p91.5%
*-commutative91.5%
associate-*r/91.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in beta around inf 85.0%
mul-1-neg84.3%
unsub-neg84.3%
Simplified85.0%
Final simplification95.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 76000000000000.0)
(/ (+ 1.0 beta) (* (+ 2.0 beta) (* (+ 2.0 beta) (+ beta 3.0))))
(*
(- 1.0 (/ (+ alpha 2.0) beta))
(/ (/ (+ 1.0 alpha) beta) (+ alpha (+ 2.0 beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 76000000000000.0) {
tmp = (1.0 + beta) / ((2.0 + beta) * ((2.0 + beta) * (beta + 3.0)));
} else {
tmp = (1.0 - ((alpha + 2.0) / beta)) * (((1.0 + alpha) / beta) / (alpha + (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 <= 76000000000000.0d0) then
tmp = (1.0d0 + beta) / ((2.0d0 + beta) * ((2.0d0 + beta) * (beta + 3.0d0)))
else
tmp = (1.0d0 - ((alpha + 2.0d0) / beta)) * (((1.0d0 + alpha) / beta) / (alpha + (2.0d0 + beta)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 76000000000000.0) {
tmp = (1.0 + beta) / ((2.0 + beta) * ((2.0 + beta) * (beta + 3.0)));
} else {
tmp = (1.0 - ((alpha + 2.0) / beta)) * (((1.0 + alpha) / beta) / (alpha + (2.0 + beta)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 76000000000000.0: tmp = (1.0 + beta) / ((2.0 + beta) * ((2.0 + beta) * (beta + 3.0))) else: tmp = (1.0 - ((alpha + 2.0) / beta)) * (((1.0 + alpha) / beta) / (alpha + (2.0 + beta))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 76000000000000.0) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(2.0 + beta) * Float64(Float64(2.0 + beta) * Float64(beta + 3.0)))); else tmp = Float64(Float64(1.0 - Float64(Float64(alpha + 2.0) / beta)) * Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(2.0 + beta)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 76000000000000.0)
tmp = (1.0 + beta) / ((2.0 + beta) * ((2.0 + beta) * (beta + 3.0)));
else
tmp = (1.0 - ((alpha + 2.0) / beta)) * (((1.0 + alpha) / beta) / (alpha + (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, 76000000000000.0], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(2.0 + beta), $MachinePrecision] * N[(N[(2.0 + beta), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(alpha + 2.0), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 76000000000000:\\
\;\;\;\;\frac{1 + \beta}{\left(2 + \beta\right) \cdot \left(\left(2 + \beta\right) \cdot \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{\alpha + 2}{\beta}\right) \cdot \frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(2 + \beta\right)}\\
\end{array}
\end{array}
if beta < 7.6e13Initial program 99.8%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 88.2%
Taylor expanded in alpha around 0 68.4%
+-commutative68.4%
Simplified68.4%
expm1-log1p-u68.4%
expm1-udef64.4%
associate-/l/64.4%
+-commutative64.4%
+-commutative64.4%
Applied egg-rr64.4%
expm1-def68.4%
expm1-log1p68.4%
associate-*l*68.4%
Simplified68.4%
if 7.6e13 < beta Initial program 85.2%
associate-/l/79.6%
associate-/r*68.4%
+-commutative68.4%
associate-+r+68.4%
+-commutative68.4%
associate-+r+68.4%
associate-+r+68.4%
distribute-rgt1-in68.4%
+-commutative68.4%
*-commutative68.4%
distribute-rgt1-in68.4%
+-commutative68.4%
times-frac91.4%
Simplified91.4%
expm1-log1p-u91.4%
expm1-udef57.0%
*-commutative57.0%
+-commutative57.0%
Applied egg-rr57.0%
expm1-def91.4%
expm1-log1p91.4%
*-commutative91.4%
associate-*r/91.3%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in beta around inf 85.0%
Taylor expanded in beta around inf 84.4%
mul-1-neg84.4%
unsub-neg84.4%
Simplified84.4%
Final simplification73.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 76000000000000.0) (/ (+ 1.0 beta) (* (+ 2.0 beta) (* (+ 2.0 beta) (+ beta 3.0)))) (/ (/ (- alpha -1.0) beta) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 76000000000000.0) {
tmp = (1.0 + beta) / ((2.0 + beta) * ((2.0 + beta) * (beta + 3.0)));
} else {
tmp = ((alpha - -1.0) / 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 <= 76000000000000.0d0) then
tmp = (1.0d0 + beta) / ((2.0d0 + beta) * ((2.0d0 + beta) * (beta + 3.0d0)))
else
tmp = ((alpha - (-1.0d0)) / 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 <= 76000000000000.0) {
tmp = (1.0 + beta) / ((2.0 + beta) * ((2.0 + beta) * (beta + 3.0)));
} else {
tmp = ((alpha - -1.0) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 76000000000000.0: tmp = (1.0 + beta) / ((2.0 + beta) * ((2.0 + beta) * (beta + 3.0))) else: tmp = ((alpha - -1.0) / beta) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 76000000000000.0) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(2.0 + beta) * Float64(Float64(2.0 + beta) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(alpha - -1.0) / 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 <= 76000000000000.0)
tmp = (1.0 + beta) / ((2.0 + beta) * ((2.0 + beta) * (beta + 3.0)));
else
tmp = ((alpha - -1.0) / 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, 76000000000000.0], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(2.0 + beta), $MachinePrecision] * N[(N[(2.0 + beta), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 76000000000000:\\
\;\;\;\;\frac{1 + \beta}{\left(2 + \beta\right) \cdot \left(\left(2 + \beta\right) \cdot \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 7.6e13Initial program 99.8%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 88.2%
Taylor expanded in alpha around 0 68.4%
+-commutative68.4%
Simplified68.4%
expm1-log1p-u68.4%
expm1-udef64.4%
associate-/l/64.4%
+-commutative64.4%
+-commutative64.4%
Applied egg-rr64.4%
expm1-def68.4%
expm1-log1p68.4%
associate-*l*68.4%
Simplified68.4%
if 7.6e13 < beta Initial program 85.2%
Taylor expanded in beta around -inf 84.6%
associate-*r/84.6%
mul-1-neg84.6%
sub-neg84.6%
mul-1-neg84.6%
distribute-neg-in84.6%
+-commutative84.6%
mul-1-neg84.6%
distribute-lft-in84.6%
metadata-eval84.6%
mul-1-neg84.6%
unsub-neg84.6%
Simplified84.6%
metadata-eval84.6%
associate-+l+84.6%
metadata-eval84.6%
associate-+l+84.6%
*-un-lft-identity84.6%
fma-def84.6%
Applied egg-rr84.6%
fma-udef84.6%
+-commutative84.6%
*-lft-identity84.6%
Simplified84.6%
Final simplification73.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.0) (/ (+ 0.5 (* beta 0.25)) (* (+ 2.0 beta) (+ beta 3.0))) (/ (/ (- alpha -1.0) beta) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.0) {
tmp = (0.5 + (beta * 0.25)) / ((2.0 + beta) * (beta + 3.0));
} else {
tmp = ((alpha - -1.0) / 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 <= 4.0d0) then
tmp = (0.5d0 + (beta * 0.25d0)) / ((2.0d0 + beta) * (beta + 3.0d0))
else
tmp = ((alpha - (-1.0d0)) / 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 <= 4.0) {
tmp = (0.5 + (beta * 0.25)) / ((2.0 + beta) * (beta + 3.0));
} else {
tmp = ((alpha - -1.0) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.0: tmp = (0.5 + (beta * 0.25)) / ((2.0 + beta) * (beta + 3.0)) else: tmp = ((alpha - -1.0) / beta) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.0) tmp = Float64(Float64(0.5 + Float64(beta * 0.25)) / Float64(Float64(2.0 + beta) * Float64(beta + 3.0))); else tmp = Float64(Float64(Float64(alpha - -1.0) / 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 <= 4.0)
tmp = (0.5 + (beta * 0.25)) / ((2.0 + beta) * (beta + 3.0));
else
tmp = ((alpha - -1.0) / 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, 4.0], N[(N[(0.5 + N[(beta * 0.25), $MachinePrecision]), $MachinePrecision] / N[(N[(2.0 + beta), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4:\\
\;\;\;\;\frac{0.5 + \beta \cdot 0.25}{\left(2 + \beta\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 4Initial program 99.8%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 87.8%
Taylor expanded in alpha around 0 67.9%
+-commutative67.9%
Simplified67.9%
Taylor expanded in beta around 0 67.5%
*-commutative67.5%
Simplified67.5%
if 4 < beta Initial program 86.3%
Taylor expanded in beta around -inf 81.4%
associate-*r/81.4%
mul-1-neg81.4%
sub-neg81.4%
mul-1-neg81.4%
distribute-neg-in81.4%
+-commutative81.4%
mul-1-neg81.4%
distribute-lft-in81.4%
metadata-eval81.4%
mul-1-neg81.4%
unsub-neg81.4%
Simplified81.4%
metadata-eval81.4%
associate-+l+81.4%
metadata-eval81.4%
associate-+l+81.4%
*-un-lft-identity81.4%
fma-def81.4%
Applied egg-rr81.4%
fma-udef81.4%
+-commutative81.4%
*-lft-identity81.4%
Simplified81.4%
Final simplification71.9%
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)) (/ (/ (- alpha -1.0) beta) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((alpha - -1.0) / 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 <= 2.5d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = ((alpha - (-1.0d0)) / 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 <= 2.5) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((alpha - -1.0) / beta) / (alpha + (beta + 3.0));
}
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 = ((alpha - -1.0) / beta) / (alpha + (beta + 3.0)) 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(Float64(Float64(alpha - -1.0) / 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 <= 2.5)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = ((alpha - -1.0) / 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, 2.5], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $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{\frac{\alpha - -1}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 2.5Initial program 99.8%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 87.8%
Taylor expanded in alpha around 0 67.9%
+-commutative67.9%
Simplified67.9%
Taylor expanded in beta around 0 67.6%
*-commutative67.6%
Simplified67.6%
if 2.5 < beta Initial program 86.3%
Taylor expanded in beta around -inf 81.4%
associate-*r/81.4%
mul-1-neg81.4%
sub-neg81.4%
mul-1-neg81.4%
distribute-neg-in81.4%
+-commutative81.4%
mul-1-neg81.4%
distribute-lft-in81.4%
metadata-eval81.4%
mul-1-neg81.4%
unsub-neg81.4%
Simplified81.4%
metadata-eval81.4%
associate-+l+81.4%
metadata-eval81.4%
associate-+l+81.4%
*-un-lft-identity81.4%
fma-def81.4%
Applied egg-rr81.4%
fma-udef81.4%
+-commutative81.4%
*-lft-identity81.4%
Simplified81.4%
Final simplification71.9%
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))
(if (<= beta 2.6e+139)
(/ 1.0 (* beta (+ beta 3.0)))
(/ (/ alpha beta) beta))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else if (beta <= 2.6e+139) {
tmp = 1.0 / (beta * (beta + 3.0));
} 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 <= 2.5d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else if (beta <= 2.6d+139) then
tmp = 1.0d0 / (beta * (beta + 3.0d0))
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 <= 2.5) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else if (beta <= 2.6e+139) {
tmp = 1.0 / (beta * (beta + 3.0));
} else {
tmp = (alpha / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.5: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) elif beta <= 2.6e+139: tmp = 1.0 / (beta * (beta + 3.0)) else: tmp = (alpha / beta) / 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)); elseif (beta <= 2.6e+139) tmp = Float64(1.0 / Float64(beta * Float64(beta + 3.0))); 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 <= 2.5)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
elseif (beta <= 2.6e+139)
tmp = 1.0 / (beta * (beta + 3.0));
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, 2.5], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], If[LessEqual[beta, 2.6e+139], N[(1.0 / N[(beta * N[(beta + 3.0), $MachinePrecision]), $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 2.5:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{elif}\;\beta \leq 2.6 \cdot 10^{+139}:\\
\;\;\;\;\frac{1}{\beta \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 2.5Initial program 99.8%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 87.8%
Taylor expanded in alpha around 0 67.9%
+-commutative67.9%
Simplified67.9%
Taylor expanded in beta around 0 67.6%
*-commutative67.6%
Simplified67.6%
if 2.5 < beta < 2.60000000000000022e139Initial program 97.1%
Taylor expanded in beta around -inf 67.4%
associate-*r/67.4%
mul-1-neg67.4%
sub-neg67.4%
mul-1-neg67.4%
distribute-neg-in67.4%
+-commutative67.4%
mul-1-neg67.4%
distribute-lft-in67.4%
metadata-eval67.4%
mul-1-neg67.4%
unsub-neg67.4%
Simplified67.4%
Taylor expanded in alpha around 0 62.3%
if 2.60000000000000022e139 < beta Initial program 76.5%
Taylor expanded in beta around -inf 94.0%
associate-*r/94.0%
mul-1-neg94.0%
sub-neg94.0%
mul-1-neg94.0%
distribute-neg-in94.0%
+-commutative94.0%
mul-1-neg94.0%
distribute-lft-in94.0%
metadata-eval94.0%
mul-1-neg94.0%
unsub-neg94.0%
Simplified94.0%
Taylor expanded in beta around inf 93.9%
Taylor expanded in alpha around inf 91.7%
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.8)
(+ 0.08333333333333333 (* beta -0.027777777777777776))
(if (<= beta 6.2e+152)
(/ (+ 1.0 alpha) (* beta beta))
(/ (/ 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 if (beta <= 6.2e+152) {
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 <= 2.8d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else if (beta <= 6.2d+152) 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 <= 2.8) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else if (beta <= 6.2e+152) {
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 <= 2.8: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) elif beta <= 6.2e+152: 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 <= 2.8) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); elseif (beta <= 6.2e+152) 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 <= 2.8)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
elseif (beta <= 6.2e+152)
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, 2.8], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], If[LessEqual[beta, 6.2e+152], 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 2.8:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{elif}\;\beta \leq 6.2 \cdot 10^{+152}:\\
\;\;\;\;\frac{1 + \alpha}{\beta \cdot \beta}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 2.7999999999999998Initial program 99.8%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 87.8%
Taylor expanded in alpha around 0 67.9%
+-commutative67.9%
Simplified67.9%
Taylor expanded in beta around 0 67.6%
*-commutative67.6%
Simplified67.6%
if 2.7999999999999998 < beta < 6.2e152Initial program 97.3%
associate-/l/92.1%
associate-/r*73.7%
+-commutative73.7%
associate-+r+73.7%
+-commutative73.7%
associate-+r+73.7%
associate-+r+73.7%
distribute-rgt1-in73.7%
+-commutative73.7%
*-commutative73.7%
distribute-rgt1-in73.7%
+-commutative73.7%
times-frac94.7%
Simplified94.7%
Taylor expanded in beta around inf 68.3%
unpow268.3%
Simplified68.3%
if 6.2e152 < beta Initial program 75.4%
Taylor expanded in beta around -inf 93.7%
associate-*r/93.7%
mul-1-neg93.7%
sub-neg93.7%
mul-1-neg93.7%
distribute-neg-in93.7%
+-commutative93.7%
mul-1-neg93.7%
distribute-lft-in93.7%
metadata-eval93.7%
mul-1-neg93.7%
unsub-neg93.7%
Simplified93.7%
Taylor expanded in beta around inf 93.6%
Taylor expanded in alpha around inf 93.6%
Final simplification71.7%
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 beta) (/ 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 / beta) + (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 / beta) + (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 / beta) + (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 / beta) + (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(Float64(1.0 / beta) + 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 <= 2.8)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = ((1.0 / beta) + (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[(N[(1.0 / beta), $MachinePrecision] + N[(alpha / beta), $MachinePrecision]), $MachinePrecision] / beta), $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{\frac{1}{\beta} + \frac{\alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 2.7999999999999998Initial program 99.8%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 87.8%
Taylor expanded in alpha around 0 67.9%
+-commutative67.9%
Simplified67.9%
Taylor expanded in beta around 0 67.6%
*-commutative67.6%
Simplified67.6%
if 2.7999999999999998 < beta Initial program 86.3%
Taylor expanded in beta around -inf 81.4%
associate-*r/81.4%
mul-1-neg81.4%
sub-neg81.4%
mul-1-neg81.4%
distribute-neg-in81.4%
+-commutative81.4%
mul-1-neg81.4%
distribute-lft-in81.4%
metadata-eval81.4%
mul-1-neg81.4%
unsub-neg81.4%
Simplified81.4%
Taylor expanded in beta around inf 81.1%
Taylor expanded in alpha around 0 81.1%
Final simplification71.8%
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)) (/ (/ (- alpha -1.0) beta) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((alpha - -1.0) / beta) / (beta + 3.0);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.5d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = ((alpha - (-1.0d0)) / beta) / (beta + 3.0d0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((alpha - -1.0) / beta) / (beta + 3.0);
}
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 = ((alpha - -1.0) / beta) / (beta + 3.0) 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(Float64(Float64(alpha - -1.0) / beta) / Float64(beta + 3.0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.5)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = ((alpha - -1.0) / beta) / (beta + 3.0);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.5], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.5:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 2.5Initial program 99.8%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 87.8%
Taylor expanded in alpha around 0 67.9%
+-commutative67.9%
Simplified67.9%
Taylor expanded in beta around 0 67.6%
*-commutative67.6%
Simplified67.6%
if 2.5 < beta Initial program 86.3%
Taylor expanded in beta around -inf 81.4%
associate-*r/81.4%
mul-1-neg81.4%
sub-neg81.4%
mul-1-neg81.4%
distribute-neg-in81.4%
+-commutative81.4%
mul-1-neg81.4%
distribute-lft-in81.4%
metadata-eval81.4%
mul-1-neg81.4%
unsub-neg81.4%
Simplified81.4%
Taylor expanded in alpha around 0 81.2%
Final simplification71.8%
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)) (if (<= beta 2.6e+139) (/ 1.0 (* beta beta)) (/ (/ 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 if (beta <= 2.6e+139) {
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 <= 2.8d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else if (beta <= 2.6d+139) 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 <= 2.8) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else if (beta <= 2.6e+139) {
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 <= 2.8: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) elif beta <= 2.6e+139: 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 <= 2.8) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); elseif (beta <= 2.6e+139) 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 <= 2.8)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
elseif (beta <= 2.6e+139)
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, 2.8], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], If[LessEqual[beta, 2.6e+139], 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 2.8:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{elif}\;\beta \leq 2.6 \cdot 10^{+139}:\\
\;\;\;\;\frac{1}{\beta \cdot \beta}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 2.7999999999999998Initial program 99.8%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 87.8%
Taylor expanded in alpha around 0 67.9%
+-commutative67.9%
Simplified67.9%
Taylor expanded in beta around 0 67.6%
*-commutative67.6%
Simplified67.6%
if 2.7999999999999998 < beta < 2.60000000000000022e139Initial program 97.1%
associate-/l/91.8%
associate-/r*77.2%
+-commutative77.2%
associate-+r+77.2%
+-commutative77.2%
associate-+r+77.2%
associate-+r+77.2%
distribute-rgt1-in77.2%
+-commutative77.2%
*-commutative77.2%
distribute-rgt1-in77.2%
+-commutative77.2%
times-frac94.4%
Simplified94.4%
Taylor expanded in beta around inf 66.7%
unpow266.7%
Simplified66.7%
Taylor expanded in alpha around 0 62.1%
unpow262.1%
Simplified62.1%
if 2.60000000000000022e139 < beta Initial program 76.5%
Taylor expanded in beta around -inf 94.0%
associate-*r/94.0%
mul-1-neg94.0%
sub-neg94.0%
mul-1-neg94.0%
distribute-neg-in94.0%
+-commutative94.0%
mul-1-neg94.0%
distribute-lft-in94.0%
metadata-eval94.0%
mul-1-neg94.0%
unsub-neg94.0%
Simplified94.0%
Taylor expanded in beta around inf 93.9%
Taylor expanded in alpha around inf 91.7%
Final simplification70.7%
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)) (/ (/ (- alpha -1.0) 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 = ((alpha - -1.0) / beta) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.8d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = ((alpha - (-1.0d0)) / beta) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.8) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((alpha - -1.0) / 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 = ((alpha - -1.0) / 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(Float64(alpha - -1.0) / 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 = ((alpha - -1.0) / beta) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.8], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / beta), $MachinePrecision] / beta), $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{\frac{\alpha - -1}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 2.7999999999999998Initial program 99.8%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 87.8%
Taylor expanded in alpha around 0 67.9%
+-commutative67.9%
Simplified67.9%
Taylor expanded in beta around 0 67.6%
*-commutative67.6%
Simplified67.6%
if 2.7999999999999998 < beta Initial program 86.3%
Taylor expanded in beta around -inf 81.4%
associate-*r/81.4%
mul-1-neg81.4%
sub-neg81.4%
mul-1-neg81.4%
distribute-neg-in81.4%
+-commutative81.4%
mul-1-neg81.4%
distribute-lft-in81.4%
metadata-eval81.4%
mul-1-neg81.4%
unsub-neg81.4%
Simplified81.4%
Taylor expanded in beta around inf 81.1%
Final simplification71.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.9) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ 1.0 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.9) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = 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.9d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = 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.9) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = 1.0 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.9: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = 1.0 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.9) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = 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.9)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = 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.9], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(1.0 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.9:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta}\\
\end{array}
\end{array}
if beta < 2.89999999999999991Initial program 99.8%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 87.8%
Taylor expanded in alpha around 0 67.9%
+-commutative67.9%
Simplified67.9%
Taylor expanded in beta around 0 67.6%
*-commutative67.6%
Simplified67.6%
if 2.89999999999999991 < beta Initial program 86.3%
Taylor expanded in beta around -inf 81.4%
associate-*r/81.4%
mul-1-neg81.4%
sub-neg81.4%
mul-1-neg81.4%
distribute-neg-in81.4%
+-commutative81.4%
mul-1-neg81.4%
distribute-lft-in81.4%
metadata-eval81.4%
mul-1-neg81.4%
unsub-neg81.4%
Simplified81.4%
Taylor expanded in alpha around inf 7.2%
Final simplification48.7%
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 (* 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 / (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 / (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 / (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 / (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(1.0 / Float64(beta * beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.8)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = 1.0 / (beta * beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.8], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $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 2.8:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 2.7999999999999998Initial program 99.8%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 87.8%
Taylor expanded in alpha around 0 67.9%
+-commutative67.9%
Simplified67.9%
Taylor expanded in beta around 0 67.6%
*-commutative67.6%
Simplified67.6%
if 2.7999999999999998 < beta Initial program 86.3%
associate-/l/81.1%
associate-/r*70.8%
+-commutative70.8%
associate-+r+70.8%
+-commutative70.8%
associate-+r+70.8%
associate-+r+70.8%
distribute-rgt1-in70.8%
+-commutative70.8%
*-commutative70.8%
distribute-rgt1-in70.7%
+-commutative70.7%
times-frac92.0%
Simplified92.0%
Taylor expanded in beta around inf 78.8%
unpow278.8%
Simplified78.8%
Taylor expanded in alpha around 0 74.3%
unpow274.3%
Simplified74.3%
Final simplification69.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 95.6%
associate-/l/94.0%
associate-+l+94.0%
+-commutative94.0%
*-commutative94.0%
associate-+l+94.0%
+-commutative94.0%
+-commutative94.0%
+-commutative94.0%
Simplified94.0%
Taylor expanded in alpha around 0 87.2%
Taylor expanded in beta around 0 65.2%
Taylor expanded in alpha around 0 47.4%
Final simplification47.4%
herbie shell --seed 2023279
(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)))