
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t_0}}{t_0}}{t_0 + 1}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t_0}}{t_0}}{t_0 + 1}
\end{array}
\end{array}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))))
(*
(/ (+ 1.0 beta) (+ alpha (+ beta 3.0)))
(/ (/ 1.0 (/ t_0 (+ 1.0 alpha))) t_0))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((1.0 + beta) / (alpha + (beta + 3.0))) * ((1.0 / (t_0 / (1.0 + alpha))) / t_0);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = alpha + (beta + 2.0d0)
code = ((1.0d0 + beta) / (alpha + (beta + 3.0d0))) * ((1.0d0 / (t_0 / (1.0d0 + alpha))) / t_0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((1.0 + beta) / (alpha + (beta + 3.0))) * ((1.0 / (t_0 / (1.0 + alpha))) / t_0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return ((1.0 + beta) / (alpha + (beta + 3.0))) * ((1.0 / (t_0 / (1.0 + alpha))) / t_0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) return Float64(Float64(Float64(1.0 + beta) / Float64(alpha + Float64(beta + 3.0))) * Float64(Float64(1.0 / Float64(t_0 / Float64(1.0 + alpha))) / t_0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = ((1.0 + beta) / (alpha + (beta + 3.0))) * ((1.0 / (t_0 / (1.0 + alpha))) / t_0);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / N[(t$95$0 / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\frac{1 + \beta}{\alpha + \left(\beta + 3\right)} \cdot \frac{\frac{1}{\frac{t_0}{1 + \alpha}}}{t_0}
\end{array}
\end{array}
Initial program 92.5%
associate-/l/90.7%
associate-+l+90.7%
+-commutative90.7%
associate-+r+90.7%
associate-+l+90.7%
distribute-rgt1-in90.7%
*-rgt-identity90.7%
distribute-lft-out90.7%
+-commutative90.7%
associate-*r/94.2%
associate-*r/92.1%
Simplified92.1%
associate-*r/94.2%
+-commutative94.2%
Applied egg-rr94.2%
*-commutative94.2%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
clear-num99.8%
+-commutative99.8%
+-commutative99.8%
inv-pow99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
unpow-199.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))) (t_1 (/ (+ 1.0 alpha) t_0)))
(if (<= beta 20000000000.0)
(* (+ 1.0 beta) (/ t_1 (* t_0 (+ alpha (+ beta 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 + (beta + 2.0);
double t_1 = (1.0 + alpha) / t_0;
double tmp;
if (beta <= 20000000000.0) {
tmp = (1.0 + beta) * (t_1 / (t_0 * (alpha + (beta + 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 + (beta + 2.0d0)
t_1 = (1.0d0 + alpha) / t_0
if (beta <= 20000000000.0d0) then
tmp = (1.0d0 + beta) * (t_1 / (t_0 * (alpha + (beta + 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 + (beta + 2.0);
double t_1 = (1.0 + alpha) / t_0;
double tmp;
if (beta <= 20000000000.0) {
tmp = (1.0 + beta) * (t_1 / (t_0 * (alpha + (beta + 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 + (beta + 2.0) t_1 = (1.0 + alpha) / t_0 tmp = 0 if beta <= 20000000000.0: tmp = (1.0 + beta) * (t_1 / (t_0 * (alpha + (beta + 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(beta + 2.0)) t_1 = Float64(Float64(1.0 + alpha) / t_0) tmp = 0.0 if (beta <= 20000000000.0) tmp = Float64(Float64(1.0 + beta) * Float64(t_1 / Float64(t_0 * Float64(alpha + Float64(beta + 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 + (beta + 2.0);
t_1 = (1.0 + alpha) / t_0;
tmp = 0.0;
if (beta <= 20000000000.0)
tmp = (1.0 + beta) * (t_1 / (t_0 * (alpha + (beta + 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[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[beta, 20000000000.0], N[(N[(1.0 + beta), $MachinePrecision] * N[(t$95$1 / N[(t$95$0 * N[(alpha + N[(beta + 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(\beta + 2\right)\\
t_1 := \frac{1 + \alpha}{t_0}\\
\mathbf{if}\;\beta \leq 20000000000:\\
\;\;\;\;\left(1 + \beta\right) \cdot \frac{t_1}{t_0 \cdot \left(\alpha + \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{t_0} \cdot \left(1 - \frac{\alpha + 2}{\beta}\right)\\
\end{array}
\end{array}
if beta < 2e10Initial program 99.9%
associate-/l/99.3%
associate-+l+99.3%
+-commutative99.3%
associate-+r+99.3%
associate-+l+99.3%
distribute-rgt1-in99.3%
*-rgt-identity99.3%
distribute-lft-out99.3%
+-commutative99.3%
associate-*r/99.3%
associate-*r/99.3%
Simplified99.3%
if 2e10 < beta Initial program 76.5%
associate-/l/71.7%
associate-+l+71.7%
+-commutative71.7%
associate-+r+71.7%
associate-+l+71.7%
distribute-rgt1-in71.7%
*-rgt-identity71.7%
distribute-lft-out71.7%
+-commutative71.7%
associate-*r/83.0%
associate-*r/76.1%
Simplified76.1%
associate-*r/83.0%
+-commutative83.0%
Applied egg-rr83.0%
*-commutative83.0%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 70.8%
mul-1-neg69.8%
unsub-neg69.8%
Simplified70.8%
Final simplification90.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ alpha (+ beta 2.0)))) (* (/ (+ 1.0 beta) (+ alpha (+ beta 3.0))) (/ (/ (+ 1.0 alpha) t_0) t_0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((1.0 + beta) / (alpha + (beta + 3.0))) * (((1.0 + alpha) / t_0) / t_0);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = alpha + (beta + 2.0d0)
code = ((1.0d0 + beta) / (alpha + (beta + 3.0d0))) * (((1.0d0 + alpha) / t_0) / t_0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((1.0 + beta) / (alpha + (beta + 3.0))) * (((1.0 + alpha) / t_0) / t_0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return ((1.0 + beta) / (alpha + (beta + 3.0))) * (((1.0 + alpha) / t_0) / t_0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) return Float64(Float64(Float64(1.0 + beta) / Float64(alpha + Float64(beta + 3.0))) * Float64(Float64(Float64(1.0 + alpha) / t_0) / t_0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = ((1.0 + beta) / (alpha + (beta + 3.0))) * (((1.0 + alpha) / t_0) / t_0);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\frac{1 + \beta}{\alpha + \left(\beta + 3\right)} \cdot \frac{\frac{1 + \alpha}{t_0}}{t_0}
\end{array}
\end{array}
Initial program 92.5%
associate-/l/90.7%
associate-+l+90.7%
+-commutative90.7%
associate-+r+90.7%
associate-+l+90.7%
distribute-rgt1-in90.7%
*-rgt-identity90.7%
distribute-lft-out90.7%
+-commutative90.7%
associate-*r/94.2%
associate-*r/92.1%
Simplified92.1%
associate-*r/94.2%
+-commutative94.2%
Applied egg-rr94.2%
*-commutative94.2%
times-frac99.8%
+-commutative99.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 (+ alpha (+ beta 2.0))))
(if (<= beta 1.35e+34)
(/ (+ 1.0 beta) (* (+ beta 2.0) (+ (* beta (+ beta 5.0)) 6.0)))
(* (/ (/ (+ 1.0 alpha) t_0) t_0) (- 1.0 (/ alpha beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 1.35e+34) {
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta * (beta + 5.0)) + 6.0));
} else {
tmp = (((1.0 + alpha) / t_0) / t_0) * (1.0 - (alpha / beta));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 1.35d+34) then
tmp = (1.0d0 + beta) / ((beta + 2.0d0) * ((beta * (beta + 5.0d0)) + 6.0d0))
else
tmp = (((1.0d0 + alpha) / t_0) / t_0) * (1.0d0 - (alpha / beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 1.35e+34) {
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta * (beta + 5.0)) + 6.0));
} else {
tmp = (((1.0 + alpha) / t_0) / t_0) * (1.0 - (alpha / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 1.35e+34: tmp = (1.0 + beta) / ((beta + 2.0) * ((beta * (beta + 5.0)) + 6.0)) else: tmp = (((1.0 + alpha) / t_0) / t_0) * (1.0 - (alpha / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 1.35e+34) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(Float64(beta * Float64(beta + 5.0)) + 6.0))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / t_0) / t_0) * Float64(1.0 - Float64(alpha / beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 1.35e+34)
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta * (beta + 5.0)) + 6.0));
else
tmp = (((1.0 + alpha) / t_0) / t_0) * (1.0 - (alpha / beta));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 1.35e+34], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(N[(beta * N[(beta + 5.0), $MachinePrecision]), $MachinePrecision] + 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(1.0 - N[(alpha / beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 1.35 \cdot 10^{+34}:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(\beta \cdot \left(\beta + 5\right) + 6\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0}}{t_0} \cdot \left(1 - \frac{\alpha}{\beta}\right)\\
\end{array}
\end{array}
if beta < 1.35e34Initial program 99.9%
associate-/l/99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+r+99.4%
associate-+l+99.4%
distribute-rgt1-in99.4%
*-rgt-identity99.4%
distribute-lft-out99.4%
+-commutative99.4%
associate-*r/99.4%
associate-*r/99.3%
Simplified99.3%
Taylor expanded in alpha around 0 67.2%
Taylor expanded in beta around 0 67.2%
+-commutative67.2%
unpow267.2%
distribute-rgt-out67.2%
Simplified67.2%
Taylor expanded in alpha around 0 67.3%
if 1.35e34 < beta Initial program 73.9%
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-*r/81.1%
associate-*r/73.5%
Simplified73.5%
associate-*r/81.1%
+-commutative81.1%
Applied egg-rr81.1%
*-commutative81.1%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 73.0%
mul-1-neg72.4%
unsub-neg72.4%
Simplified73.0%
Taylor expanded in alpha around inf 73.0%
Final simplification68.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 1.7e+34)
(/ (+ 1.0 beta) (* (+ beta 2.0) (+ (* beta (+ beta 5.0)) 6.0)))
(*
(- 1.0 (/ (+ alpha 2.0) beta))
(/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 2.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.7e+34) {
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta * (beta + 5.0)) + 6.0));
} else {
tmp = (1.0 - ((alpha + 2.0) / beta)) * (((1.0 + alpha) / beta) / (alpha + (beta + 2.0)));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.7d+34) then
tmp = (1.0d0 + beta) / ((beta + 2.0d0) * ((beta * (beta + 5.0d0)) + 6.0d0))
else
tmp = (1.0d0 - ((alpha + 2.0d0) / beta)) * (((1.0d0 + alpha) / beta) / (alpha + (beta + 2.0d0)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.7e+34) {
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta * (beta + 5.0)) + 6.0));
} else {
tmp = (1.0 - ((alpha + 2.0) / beta)) * (((1.0 + alpha) / beta) / (alpha + (beta + 2.0)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.7e+34: tmp = (1.0 + beta) / ((beta + 2.0) * ((beta * (beta + 5.0)) + 6.0)) else: tmp = (1.0 - ((alpha + 2.0) / beta)) * (((1.0 + alpha) / beta) / (alpha + (beta + 2.0))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.7e+34) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(Float64(beta * Float64(beta + 5.0)) + 6.0))); else tmp = Float64(Float64(1.0 - Float64(Float64(alpha + 2.0) / beta)) * Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 2.0)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.7e+34)
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta * (beta + 5.0)) + 6.0));
else
tmp = (1.0 - ((alpha + 2.0) / beta)) * (((1.0 + alpha) / beta) / (alpha + (beta + 2.0)));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.7e+34], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(N[(beta * N[(beta + 5.0), $MachinePrecision]), $MachinePrecision] + 6.0), $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[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.7 \cdot 10^{+34}:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(\beta \cdot \left(\beta + 5\right) + 6\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{\alpha + 2}{\beta}\right) \cdot \frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(\beta + 2\right)}\\
\end{array}
\end{array}
if beta < 1.7e34Initial program 99.9%
associate-/l/99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+r+99.4%
associate-+l+99.4%
distribute-rgt1-in99.4%
*-rgt-identity99.4%
distribute-lft-out99.4%
+-commutative99.4%
associate-*r/99.4%
associate-*r/99.3%
Simplified99.3%
Taylor expanded in alpha around 0 67.2%
Taylor expanded in beta around 0 67.2%
+-commutative67.2%
unpow267.2%
distribute-rgt-out67.2%
Simplified67.2%
Taylor expanded in alpha around 0 67.3%
if 1.7e34 < beta Initial program 73.9%
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-*r/81.1%
associate-*r/73.5%
Simplified73.5%
associate-*r/81.1%
+-commutative81.1%
Applied egg-rr81.1%
*-commutative81.1%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 73.7%
Taylor expanded in beta around inf 72.4%
mul-1-neg72.4%
unsub-neg72.4%
Simplified72.4%
Final simplification68.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 5.9e+15) (/ (+ 1.0 beta) (* (+ beta 2.0) (+ (* beta (+ beta 5.0)) 6.0))) (/ 1.0 (/ beta (/ (+ 1.0 alpha) beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 5.9e+15) {
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta * (beta + 5.0)) + 6.0));
} else {
tmp = 1.0 / (beta / ((1.0 + alpha) / beta));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 5.9d+15) then
tmp = (1.0d0 + beta) / ((beta + 2.0d0) * ((beta * (beta + 5.0d0)) + 6.0d0))
else
tmp = 1.0d0 / (beta / ((1.0d0 + alpha) / beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 5.9e+15) {
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta * (beta + 5.0)) + 6.0));
} else {
tmp = 1.0 / (beta / ((1.0 + alpha) / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 5.9e+15: tmp = (1.0 + beta) / ((beta + 2.0) * ((beta * (beta + 5.0)) + 6.0)) else: tmp = 1.0 / (beta / ((1.0 + alpha) / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 5.9e+15) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(Float64(beta * Float64(beta + 5.0)) + 6.0))); else tmp = Float64(1.0 / Float64(beta / Float64(Float64(1.0 + alpha) / beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 5.9e+15)
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta * (beta + 5.0)) + 6.0));
else
tmp = 1.0 / (beta / ((1.0 + alpha) / beta));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 5.9e+15], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(N[(beta * N[(beta + 5.0), $MachinePrecision]), $MachinePrecision] + 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(beta / N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 5.9 \cdot 10^{+15}:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(\beta \cdot \left(\beta + 5\right) + 6\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\beta}{\frac{1 + \alpha}{\beta}}}\\
\end{array}
\end{array}
if beta < 5.9e15Initial program 99.9%
associate-/l/99.3%
associate-+l+99.3%
+-commutative99.3%
associate-+r+99.3%
associate-+l+99.3%
distribute-rgt1-in99.3%
*-rgt-identity99.3%
distribute-lft-out99.3%
+-commutative99.3%
associate-*r/99.3%
associate-*r/99.3%
Simplified99.3%
Taylor expanded in alpha around 0 67.7%
Taylor expanded in beta around 0 67.7%
+-commutative67.7%
unpow267.7%
distribute-rgt-out67.7%
Simplified67.7%
Taylor expanded in alpha around 0 67.8%
if 5.9e15 < beta Initial program 75.9%
associate-/l/71.0%
associate-+l+71.0%
+-commutative71.0%
associate-+r+71.0%
associate-+l+71.0%
distribute-rgt1-in71.0%
*-rgt-identity71.0%
distribute-lft-out71.0%
+-commutative71.0%
associate-*r/82.6%
associate-*r/75.5%
Simplified75.5%
Taylor expanded in beta around inf 69.6%
unpow269.6%
Simplified69.6%
clear-num69.6%
inv-pow69.6%
Applied egg-rr69.6%
unpow-169.6%
associate-/l*70.2%
Simplified70.2%
Final simplification68.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 6.9) (/ (+ 1.0 beta) (* (+ beta 2.0) (+ 6.0 (* beta 5.0)))) (/ 1.0 (/ beta (/ (+ 1.0 alpha) beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 6.9) {
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
} else {
tmp = 1.0 / (beta / ((1.0 + alpha) / beta));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 6.9d0) then
tmp = (1.0d0 + beta) / ((beta + 2.0d0) * (6.0d0 + (beta * 5.0d0)))
else
tmp = 1.0d0 / (beta / ((1.0d0 + alpha) / beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 6.9) {
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
} else {
tmp = 1.0 / (beta / ((1.0 + alpha) / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 6.9: tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0))) else: tmp = 1.0 / (beta / ((1.0 + alpha) / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 6.9) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(6.0 + Float64(beta * 5.0)))); else tmp = Float64(1.0 / Float64(beta / Float64(Float64(1.0 + alpha) / beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 6.9)
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
else
tmp = 1.0 / (beta / ((1.0 + alpha) / beta));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 6.9], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(6.0 + N[(beta * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(beta / N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 6.9:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(6 + \beta \cdot 5\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\beta}{\frac{1 + \alpha}{\beta}}}\\
\end{array}
\end{array}
if beta < 6.9000000000000004Initial program 99.9%
associate-/l/99.3%
associate-+l+99.3%
+-commutative99.3%
associate-+r+99.3%
associate-+l+99.3%
distribute-rgt1-in99.3%
*-rgt-identity99.3%
distribute-lft-out99.3%
+-commutative99.3%
associate-*r/99.3%
associate-*r/99.3%
Simplified99.3%
Taylor expanded in alpha around 0 67.7%
Taylor expanded in beta around 0 67.3%
*-commutative67.3%
Simplified67.3%
Taylor expanded in alpha around 0 67.4%
if 6.9000000000000004 < beta Initial program 76.7%
associate-/l/72.1%
associate-+l+72.1%
+-commutative72.1%
associate-+r+72.1%
associate-+l+72.1%
distribute-rgt1-in72.1%
*-rgt-identity72.1%
distribute-lft-out72.1%
+-commutative72.1%
associate-*r/83.2%
associate-*r/76.4%
Simplified76.4%
Taylor expanded in beta around inf 68.2%
unpow268.2%
Simplified68.2%
clear-num68.2%
inv-pow68.2%
Applied egg-rr68.2%
unpow-168.2%
associate-/l*68.8%
Simplified68.8%
Final simplification67.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.5) (* 0.16666666666666666 (/ (+ 1.0 alpha) (+ alpha 2.0))) (/ (+ 1.0 alpha) (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.5) {
tmp = 0.16666666666666666 * ((1.0 + alpha) / (alpha + 2.0));
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.5d0) then
tmp = 0.16666666666666666d0 * ((1.0d0 + alpha) / (alpha + 2.0d0))
else
tmp = (1.0d0 + alpha) / (beta * beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.5) {
tmp = 0.16666666666666666 * ((1.0 + alpha) / (alpha + 2.0));
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.5: tmp = 0.16666666666666666 * ((1.0 + alpha) / (alpha + 2.0)) else: tmp = (1.0 + alpha) / (beta * beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.5) tmp = Float64(0.16666666666666666 * Float64(Float64(1.0 + alpha) / Float64(alpha + 2.0))); else tmp = Float64(Float64(1.0 + alpha) / Float64(beta * beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.5)
tmp = 0.16666666666666666 * ((1.0 + alpha) / (alpha + 2.0));
else
tmp = (1.0 + alpha) / (beta * beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.5], N[(0.16666666666666666 * N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.5:\\
\;\;\;\;0.16666666666666666 \cdot \frac{1 + \alpha}{\alpha + 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 3.5Initial program 99.9%
associate-/l/99.3%
associate-+l+99.3%
+-commutative99.3%
associate-+r+99.3%
associate-+l+99.3%
distribute-rgt1-in99.3%
*-rgt-identity99.3%
distribute-lft-out99.3%
+-commutative99.3%
associate-*r/99.3%
associate-*r/99.3%
Simplified99.3%
Taylor expanded in alpha around 0 67.7%
Taylor expanded in beta around 0 66.9%
*-commutative66.9%
Simplified66.9%
if 3.5 < beta Initial program 76.7%
associate-/l/72.1%
associate-+l+72.1%
+-commutative72.1%
associate-+r+72.1%
associate-+l+72.1%
distribute-rgt1-in72.1%
*-rgt-identity72.1%
distribute-lft-out72.1%
+-commutative72.1%
associate-*r/83.2%
associate-*r/76.4%
Simplified76.4%
Taylor expanded in beta around inf 68.2%
unpow268.2%
Simplified68.2%
Final simplification67.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.9) (* 0.16666666666666666 (/ (+ 1.0 alpha) (+ alpha 2.0))) (/ 1.0 (/ beta (/ (+ 1.0 alpha) beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.9) {
tmp = 0.16666666666666666 * ((1.0 + alpha) / (alpha + 2.0));
} else {
tmp = 1.0 / (beta / ((1.0 + alpha) / beta));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.9d0) then
tmp = 0.16666666666666666d0 * ((1.0d0 + alpha) / (alpha + 2.0d0))
else
tmp = 1.0d0 / (beta / ((1.0d0 + alpha) / beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.9) {
tmp = 0.16666666666666666 * ((1.0 + alpha) / (alpha + 2.0));
} else {
tmp = 1.0 / (beta / ((1.0 + alpha) / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.9: tmp = 0.16666666666666666 * ((1.0 + alpha) / (alpha + 2.0)) else: tmp = 1.0 / (beta / ((1.0 + alpha) / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.9) tmp = Float64(0.16666666666666666 * Float64(Float64(1.0 + alpha) / Float64(alpha + 2.0))); else tmp = Float64(1.0 / Float64(beta / Float64(Float64(1.0 + alpha) / beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.9)
tmp = 0.16666666666666666 * ((1.0 + alpha) / (alpha + 2.0));
else
tmp = 1.0 / (beta / ((1.0 + alpha) / beta));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.9], N[(0.16666666666666666 * N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(beta / N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.9:\\
\;\;\;\;0.16666666666666666 \cdot \frac{1 + \alpha}{\alpha + 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\beta}{\frac{1 + \alpha}{\beta}}}\\
\end{array}
\end{array}
if beta < 3.89999999999999991Initial program 99.9%
associate-/l/99.3%
associate-+l+99.3%
+-commutative99.3%
associate-+r+99.3%
associate-+l+99.3%
distribute-rgt1-in99.3%
*-rgt-identity99.3%
distribute-lft-out99.3%
+-commutative99.3%
associate-*r/99.3%
associate-*r/99.3%
Simplified99.3%
Taylor expanded in alpha around 0 67.7%
Taylor expanded in beta around 0 66.9%
*-commutative66.9%
Simplified66.9%
if 3.89999999999999991 < beta Initial program 76.7%
associate-/l/72.1%
associate-+l+72.1%
+-commutative72.1%
associate-+r+72.1%
associate-+l+72.1%
distribute-rgt1-in72.1%
*-rgt-identity72.1%
distribute-lft-out72.1%
+-commutative72.1%
associate-*r/83.2%
associate-*r/76.4%
Simplified76.4%
Taylor expanded in beta around inf 68.2%
unpow268.2%
Simplified68.2%
clear-num68.2%
inv-pow68.2%
Applied egg-rr68.2%
unpow-168.2%
associate-/l*68.8%
Simplified68.8%
Final simplification67.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.6) (/ (+ 0.16666666666666666 (* alpha 0.16666666666666666)) (+ alpha 2.0)) (/ 1.0 (/ beta (/ (+ 1.0 alpha) beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.6) {
tmp = (0.16666666666666666 + (alpha * 0.16666666666666666)) / (alpha + 2.0);
} else {
tmp = 1.0 / (beta / ((1.0 + alpha) / beta));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.6d0) then
tmp = (0.16666666666666666d0 + (alpha * 0.16666666666666666d0)) / (alpha + 2.0d0)
else
tmp = 1.0d0 / (beta / ((1.0d0 + alpha) / beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.6) {
tmp = (0.16666666666666666 + (alpha * 0.16666666666666666)) / (alpha + 2.0);
} else {
tmp = 1.0 / (beta / ((1.0 + alpha) / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.6: tmp = (0.16666666666666666 + (alpha * 0.16666666666666666)) / (alpha + 2.0) else: tmp = 1.0 / (beta / ((1.0 + alpha) / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.6) tmp = Float64(Float64(0.16666666666666666 + Float64(alpha * 0.16666666666666666)) / Float64(alpha + 2.0)); else tmp = Float64(1.0 / Float64(beta / Float64(Float64(1.0 + alpha) / beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.6)
tmp = (0.16666666666666666 + (alpha * 0.16666666666666666)) / (alpha + 2.0);
else
tmp = 1.0 / (beta / ((1.0 + alpha) / beta));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.6], N[(N[(0.16666666666666666 + N[(alpha * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(beta / N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.6:\\
\;\;\;\;\frac{0.16666666666666666 + \alpha \cdot 0.16666666666666666}{\alpha + 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\beta}{\frac{1 + \alpha}{\beta}}}\\
\end{array}
\end{array}
if beta < 3.60000000000000009Initial program 99.9%
associate-/l/99.3%
associate-+l+99.3%
+-commutative99.3%
associate-+r+99.3%
associate-+l+99.3%
distribute-rgt1-in99.3%
*-rgt-identity99.3%
distribute-lft-out99.3%
+-commutative99.3%
associate-*r/99.3%
associate-*r/99.3%
Simplified99.3%
Taylor expanded in alpha around 0 67.7%
Taylor expanded in beta around 0 67.7%
+-commutative67.7%
unpow267.7%
distribute-rgt-out67.7%
Simplified67.7%
Taylor expanded in beta around 0 66.9%
associate-*r/66.9%
distribute-lft-in66.9%
metadata-eval66.9%
+-commutative66.9%
Simplified66.9%
if 3.60000000000000009 < beta Initial program 76.7%
associate-/l/72.1%
associate-+l+72.1%
+-commutative72.1%
associate-+r+72.1%
associate-+l+72.1%
distribute-rgt1-in72.1%
*-rgt-identity72.1%
distribute-lft-out72.1%
+-commutative72.1%
associate-*r/83.2%
associate-*r/76.4%
Simplified76.4%
Taylor expanded in beta around inf 68.2%
unpow268.2%
Simplified68.2%
clear-num68.2%
inv-pow68.2%
Applied egg-rr68.2%
unpow-168.2%
associate-/l*68.8%
Simplified68.8%
Final simplification67.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= alpha 7.8e-7) (/ 1.0 (* beta beta)) (/ alpha (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (alpha <= 7.8e-7) {
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 (alpha <= 7.8d-7) 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 (alpha <= 7.8e-7) {
tmp = 1.0 / (beta * beta);
} else {
tmp = alpha / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if alpha <= 7.8e-7: 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 (alpha <= 7.8e-7) tmp = Float64(1.0 / Float64(beta * beta)); else tmp = Float64(alpha / Float64(beta * beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (alpha <= 7.8e-7)
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[alpha, 7.8e-7], N[(1.0 / N[(beta * beta), $MachinePrecision]), $MachinePrecision], N[(alpha / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\alpha \leq 7.8 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{\beta \cdot \beta}\\
\mathbf{else}:\\
\;\;\;\;\frac{\alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if alpha < 7.80000000000000049e-7Initial program 99.9%
associate-/l/99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+r+99.5%
associate-+l+99.5%
distribute-rgt1-in99.5%
*-rgt-identity99.5%
distribute-lft-out99.5%
+-commutative99.5%
associate-*r/99.5%
associate-*r/96.1%
Simplified96.1%
Taylor expanded in beta around inf 28.9%
unpow228.9%
Simplified28.9%
Taylor expanded in alpha around 0 28.6%
unpow228.6%
Simplified28.6%
if 7.80000000000000049e-7 < alpha Initial program 79.9%
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-*r/85.2%
associate-*r/85.2%
Simplified85.2%
Taylor expanded in beta around inf 15.1%
unpow215.1%
Simplified15.1%
Taylor expanded in alpha around inf 14.8%
unpow214.8%
Simplified14.8%
Final simplification23.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ (+ 1.0 alpha) (* beta beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
return (1.0 + alpha) / (beta * beta);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = (1.0d0 + alpha) / (beta * beta)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return (1.0 + alpha) / (beta * beta);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return (1.0 + alpha) / (beta * beta)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(1.0 + alpha) / Float64(beta * beta)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = (1.0 + alpha) / (beta * beta);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta * beta), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{1 + \alpha}{\beta \cdot \beta}
\end{array}
Initial program 92.5%
associate-/l/90.7%
associate-+l+90.7%
+-commutative90.7%
associate-+r+90.7%
associate-+l+90.7%
distribute-rgt1-in90.7%
*-rgt-identity90.7%
distribute-lft-out90.7%
+-commutative90.7%
associate-*r/94.2%
associate-*r/92.1%
Simplified92.1%
Taylor expanded in beta around inf 23.8%
unpow223.8%
Simplified23.8%
Final simplification23.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 1.0 (* beta beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
return 1.0 / (beta * beta);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 1.0d0 / (beta * beta)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 1.0 / (beta * beta);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 1.0 / (beta * beta)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(1.0 / Float64(beta * beta)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 1.0 / (beta * beta);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(1.0 / N[(beta * beta), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{1}{\beta \cdot \beta}
\end{array}
Initial program 92.5%
associate-/l/90.7%
associate-+l+90.7%
+-commutative90.7%
associate-+r+90.7%
associate-+l+90.7%
distribute-rgt1-in90.7%
*-rgt-identity90.7%
distribute-lft-out90.7%
+-commutative90.7%
associate-*r/94.2%
associate-*r/92.1%
Simplified92.1%
Taylor expanded in beta around inf 23.8%
unpow223.8%
Simplified23.8%
Taylor expanded in alpha around 0 23.0%
unpow223.0%
Simplified23.0%
Final simplification23.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ -1.0 beta))
assert(alpha < beta);
double code(double alpha, double beta) {
return -1.0 / beta;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = (-1.0d0) / beta
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return -1.0 / beta;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return -1.0 / beta
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(-1.0 / beta) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = -1.0 / beta;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(-1.0 / beta), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{-1}{\beta}
\end{array}
Initial program 92.5%
associate-/l/90.7%
associate-/l/82.8%
associate-+l+82.8%
+-commutative82.8%
associate-+r+82.8%
associate-+l+82.8%
distribute-rgt1-in82.8%
*-rgt-identity82.8%
distribute-lft-out82.8%
+-commutative82.8%
times-frac94.2%
Simplified94.2%
Taylor expanded in beta around inf 27.4%
associate-*r/27.4%
distribute-lft-in27.4%
metadata-eval27.4%
mul-1-neg27.4%
unsub-neg27.4%
Simplified27.4%
Taylor expanded in alpha around inf 3.5%
Final simplification3.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.16666666666666666 beta))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.16666666666666666 / beta;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.16666666666666666d0 / beta
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.16666666666666666 / beta;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.16666666666666666 / beta
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.16666666666666666 / beta) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.16666666666666666 / beta;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.16666666666666666 / beta), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.16666666666666666}{\beta}
\end{array}
Initial program 92.5%
associate-/l/90.7%
associate-+l+90.7%
+-commutative90.7%
associate-+r+90.7%
associate-+l+90.7%
distribute-rgt1-in90.7%
*-rgt-identity90.7%
distribute-lft-out90.7%
+-commutative90.7%
associate-*r/94.2%
associate-*r/92.1%
Simplified92.1%
associate-*r/94.2%
+-commutative94.2%
Applied egg-rr94.2%
*-commutative94.2%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in beta around inf 24.2%
Taylor expanded in alpha around 0 21.1%
Taylor expanded in beta around 0 3.9%
Final simplification3.9%
herbie shell --seed 2023218
(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)))