
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t_0}}{t_0}}{t_0 + 1}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t_0}}{t_0}}{t_0 + 1}
\end{array}
\end{array}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ 2.0 beta))))
(/
(/ 1.0 (/ t_0 (/ (+ 1.0 beta) (+ alpha (+ beta 3.0)))))
(/ t_0 (+ 1.0 alpha)))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (2.0 + beta);
return (1.0 / (t_0 / ((1.0 + beta) / (alpha + (beta + 3.0))))) / (t_0 / (1.0 + alpha));
}
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 / (t_0 / ((1.0d0 + beta) / (alpha + (beta + 3.0d0))))) / (t_0 / (1.0d0 + alpha))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (2.0 + beta);
return (1.0 / (t_0 / ((1.0 + beta) / (alpha + (beta + 3.0))))) / (t_0 / (1.0 + alpha));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (2.0 + beta) return (1.0 / (t_0 / ((1.0 + beta) / (alpha + (beta + 3.0))))) / (t_0 / (1.0 + alpha))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(2.0 + beta)) return Float64(Float64(1.0 / Float64(t_0 / Float64(Float64(1.0 + beta) / Float64(alpha + Float64(beta + 3.0))))) / Float64(t_0 / Float64(1.0 + alpha))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (2.0 + beta);
tmp = (1.0 / (t_0 / ((1.0 + beta) / (alpha + (beta + 3.0))))) / (t_0 / (1.0 + alpha));
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[(1.0 / N[(t$95$0 / N[(N[(1.0 + beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 / N[(1.0 + alpha), $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}{\frac{t_0}{\frac{1 + \beta}{\alpha + \left(\beta + 3\right)}}}}{\frac{t_0}{1 + \alpha}}
\end{array}
\end{array}
Initial program 96.0%
Simplified98.5%
*-commutative98.5%
clear-num98.4%
clear-num98.4%
frac-times98.5%
metadata-eval98.5%
+-commutative98.5%
Applied egg-rr98.5%
associate-/r*98.4%
associate-/l*99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Simplified99.5%
Final simplification99.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)))) (/ (/ (+ 1.0 alpha) t_0) (/ t_0 (/ (+ 1.0 beta) (+ alpha (+ beta 3.0)))))))
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) / (alpha + (beta + 3.0))));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = alpha + (2.0d0 + beta)
code = ((1.0d0 + alpha) / t_0) / (t_0 / ((1.0d0 + beta) / (alpha + (beta + 3.0d0))))
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) / (alpha + (beta + 3.0))));
}
[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) / (alpha + (beta + 3.0))))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(2.0 + beta)) return Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(t_0 / Float64(Float64(1.0 + beta) / Float64(alpha + Float64(beta + 3.0))))) 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) / (alpha + (beta + 3.0))));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 / N[(N[(1.0 + beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $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}}{\frac{t_0}{\frac{1 + \beta}{\alpha + \left(\beta + 3\right)}}}
\end{array}
\end{array}
Initial program 96.0%
Simplified98.5%
clear-num98.5%
associate-+r+98.5%
*-commutative98.5%
frac-times94.9%
*-un-lft-identity94.9%
+-commutative94.9%
*-commutative94.9%
associate-+r+94.9%
Applied egg-rr94.9%
associate-/r*98.5%
associate-/l*95.7%
associate-*l/98.5%
*-commutative98.5%
associate-*r/95.7%
associate-*l/98.5%
associate-/l*98.5%
+-commutative98.5%
associate-/l*99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Simplified99.5%
Final simplification99.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 50000000.0)
(/
(/ (+ 1.0 beta) (* (+ beta 3.0) (+ 2.0 beta)))
(+ 2.0 (- beta (* alpha beta))))
(/
(/ (+ 1.0 alpha) (+ alpha (+ 2.0 beta)))
(+ (+ beta 4.0) (* alpha 2.0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 50000000.0) {
tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (2.0 + (beta - (alpha * beta)));
} else {
tmp = ((1.0 + alpha) / (alpha + (2.0 + beta))) / ((beta + 4.0) + (alpha * 2.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 50000000.0d0) then
tmp = ((1.0d0 + beta) / ((beta + 3.0d0) * (2.0d0 + beta))) / (2.0d0 + (beta - (alpha * beta)))
else
tmp = ((1.0d0 + alpha) / (alpha + (2.0d0 + beta))) / ((beta + 4.0d0) + (alpha * 2.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 50000000.0) {
tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (2.0 + (beta - (alpha * beta)));
} else {
tmp = ((1.0 + alpha) / (alpha + (2.0 + beta))) / ((beta + 4.0) + (alpha * 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 50000000.0: tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (2.0 + (beta - (alpha * beta))) else: tmp = ((1.0 + alpha) / (alpha + (2.0 + beta))) / ((beta + 4.0) + (alpha * 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 50000000.0) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(Float64(beta + 3.0) * Float64(2.0 + beta))) / Float64(2.0 + Float64(beta - Float64(alpha * beta)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(2.0 + beta))) / Float64(Float64(beta + 4.0) + Float64(alpha * 2.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 50000000.0)
tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (2.0 + (beta - (alpha * beta)));
else
tmp = ((1.0 + alpha) / (alpha + (2.0 + beta))) / ((beta + 4.0) + (alpha * 2.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 50000000.0], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 + N[(beta - N[(alpha * beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 4.0), $MachinePrecision] + N[(alpha * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 50000000:\\
\;\;\;\;\frac{\frac{1 + \beta}{\left(\beta + 3\right) \cdot \left(2 + \beta\right)}}{2 + \left(\beta - \alpha \cdot \beta\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(2 + \beta\right)}}{\left(\beta + 4\right) + \alpha \cdot 2}\\
\end{array}
\end{array}
if beta < 5e7Initial program 99.9%
Simplified99.5%
*-commutative99.5%
clear-num99.5%
clear-num99.5%
frac-times99.5%
metadata-eval99.5%
+-commutative99.5%
Applied egg-rr99.5%
associate-/r*99.5%
associate-/l*99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in alpha around 0 68.3%
+-commutative68.3%
+-commutative68.3%
Simplified68.3%
Taylor expanded in alpha around 0 68.7%
mul-1-neg68.7%
unsub-neg68.7%
*-commutative68.7%
Simplified68.7%
Taylor expanded in beta around inf 68.6%
if 5e7 < beta Initial program 86.3%
Simplified96.0%
clear-num96.0%
associate-+r+96.0%
*-commutative96.0%
frac-times83.3%
*-un-lft-identity83.3%
+-commutative83.3%
*-commutative83.3%
associate-+r+83.3%
Applied egg-rr83.3%
associate-/r*96.0%
associate-/l*86.1%
associate-*l/96.0%
*-commutative96.0%
associate-*r/86.1%
associate-*l/95.9%
associate-/l*95.9%
+-commutative95.9%
associate-/l*99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 83.5%
associate-+r+83.5%
Simplified83.5%
Final simplification72.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 410000000.0)
(/ (/ (/ (+ 1.0 beta) (+ beta 3.0)) (+ 2.0 beta)) (+ 2.0 beta))
(/
(/ (+ 1.0 alpha) (+ alpha (+ 2.0 beta)))
(+ (+ beta 4.0) (* alpha 2.0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 410000000.0) {
tmp = (((1.0 + beta) / (beta + 3.0)) / (2.0 + beta)) / (2.0 + beta);
} else {
tmp = ((1.0 + alpha) / (alpha + (2.0 + beta))) / ((beta + 4.0) + (alpha * 2.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 410000000.0d0) then
tmp = (((1.0d0 + beta) / (beta + 3.0d0)) / (2.0d0 + beta)) / (2.0d0 + beta)
else
tmp = ((1.0d0 + alpha) / (alpha + (2.0d0 + beta))) / ((beta + 4.0d0) + (alpha * 2.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 410000000.0) {
tmp = (((1.0 + beta) / (beta + 3.0)) / (2.0 + beta)) / (2.0 + beta);
} else {
tmp = ((1.0 + alpha) / (alpha + (2.0 + beta))) / ((beta + 4.0) + (alpha * 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 410000000.0: tmp = (((1.0 + beta) / (beta + 3.0)) / (2.0 + beta)) / (2.0 + beta) else: tmp = ((1.0 + alpha) / (alpha + (2.0 + beta))) / ((beta + 4.0) + (alpha * 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 410000000.0) tmp = Float64(Float64(Float64(Float64(1.0 + beta) / Float64(beta + 3.0)) / Float64(2.0 + beta)) / Float64(2.0 + beta)); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(2.0 + beta))) / Float64(Float64(beta + 4.0) + Float64(alpha * 2.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 410000000.0)
tmp = (((1.0 + beta) / (beta + 3.0)) / (2.0 + beta)) / (2.0 + beta);
else
tmp = ((1.0 + alpha) / (alpha + (2.0 + beta))) / ((beta + 4.0) + (alpha * 2.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 410000000.0], N[(N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision] / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision] / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 4.0), $MachinePrecision] + N[(alpha * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 410000000:\\
\;\;\;\;\frac{\frac{\frac{1 + \beta}{\beta + 3}}{2 + \beta}}{2 + \beta}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(2 + \beta\right)}}{\left(\beta + 4\right) + \alpha \cdot 2}\\
\end{array}
\end{array}
if beta < 4.1e8Initial program 99.9%
Simplified99.5%
*-commutative99.5%
clear-num99.5%
clear-num99.5%
frac-times99.5%
metadata-eval99.5%
+-commutative99.5%
Applied egg-rr99.5%
associate-/r*99.5%
associate-/l*99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in alpha around 0 68.3%
+-commutative68.3%
+-commutative68.3%
Simplified68.3%
*-un-lft-identity68.3%
times-frac68.3%
+-commutative68.3%
Applied egg-rr68.3%
associate-*l/68.3%
+-commutative68.3%
*-lft-identity68.3%
+-commutative68.3%
+-commutative68.3%
Simplified68.3%
Taylor expanded in alpha around 0 68.4%
+-commutative68.4%
Simplified68.4%
if 4.1e8 < beta Initial program 86.3%
Simplified96.0%
clear-num96.0%
associate-+r+96.0%
*-commutative96.0%
frac-times83.3%
*-un-lft-identity83.3%
+-commutative83.3%
*-commutative83.3%
associate-+r+83.3%
Applied egg-rr83.3%
associate-/r*96.0%
associate-/l*86.1%
associate-*l/96.0%
*-commutative96.0%
associate-*r/86.1%
associate-*l/95.9%
associate-/l*95.9%
+-commutative95.9%
associate-/l*99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 83.5%
associate-+r+83.5%
Simplified83.5%
Final simplification72.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (* (/ (+ 1.0 alpha) (+ alpha (+ 2.0 beta))) (/ (+ 1.0 beta) (* (+ beta 3.0) (+ 2.0 beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
return ((1.0 + alpha) / (alpha + (2.0 + beta))) * ((1.0 + beta) / ((beta + 3.0) * (2.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 + alpha) / (alpha + (2.0d0 + beta))) * ((1.0d0 + beta) / ((beta + 3.0d0) * (2.0d0 + beta)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return ((1.0 + alpha) / (alpha + (2.0 + beta))) * ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return ((1.0 + alpha) / (alpha + (2.0 + beta))) * ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(2.0 + beta))) * Float64(Float64(1.0 + beta) / Float64(Float64(beta + 3.0) * Float64(2.0 + beta)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = ((1.0 + alpha) / (alpha + (2.0 + beta))) * ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta)));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{1 + \alpha}{\alpha + \left(2 + \beta\right)} \cdot \frac{1 + \beta}{\left(\beta + 3\right) \cdot \left(2 + \beta\right)}
\end{array}
Initial program 96.0%
Simplified98.5%
Taylor expanded in alpha around 0 72.9%
Final simplification72.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ (/ (/ (+ 1.0 beta) (+ beta 3.0)) (+ 2.0 beta)) (/ (+ alpha (+ 2.0 beta)) (+ 1.0 alpha))))
assert(alpha < beta);
double code(double alpha, double beta) {
return (((1.0 + beta) / (beta + 3.0)) / (2.0 + beta)) / ((alpha + (2.0 + beta)) / (1.0 + alpha));
}
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 + 3.0d0)) / (2.0d0 + beta)) / ((alpha + (2.0d0 + beta)) / (1.0d0 + alpha))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return (((1.0 + beta) / (beta + 3.0)) / (2.0 + beta)) / ((alpha + (2.0 + beta)) / (1.0 + alpha));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return (((1.0 + beta) / (beta + 3.0)) / (2.0 + beta)) / ((alpha + (2.0 + beta)) / (1.0 + alpha))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(Float64(Float64(1.0 + beta) / Float64(beta + 3.0)) / Float64(2.0 + beta)) / Float64(Float64(alpha + Float64(2.0 + beta)) / Float64(1.0 + alpha))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = (((1.0 + beta) / (beta + 3.0)) / (2.0 + beta)) / ((alpha + (2.0 + beta)) / (1.0 + alpha));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision] / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision] / N[(N[(alpha + N[(2.0 + beta), $MachinePrecision]), $MachinePrecision] / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{\frac{\frac{1 + \beta}{\beta + 3}}{2 + \beta}}{\frac{\alpha + \left(2 + \beta\right)}{1 + \alpha}}
\end{array}
Initial program 96.0%
Simplified98.5%
*-commutative98.5%
clear-num98.4%
clear-num98.4%
frac-times98.5%
metadata-eval98.5%
+-commutative98.5%
Applied egg-rr98.5%
associate-/r*98.4%
associate-/l*99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in alpha around 0 72.9%
+-commutative72.9%
+-commutative72.9%
Simplified72.9%
*-un-lft-identity72.9%
times-frac72.5%
+-commutative72.5%
Applied egg-rr72.5%
associate-*l/72.5%
+-commutative72.5%
*-lft-identity72.5%
+-commutative72.5%
+-commutative72.5%
Simplified72.5%
Final simplification72.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.8e+17) (/ (/ (+ 1.0 beta) (* (+ beta 3.0) (+ 2.0 beta))) (+ 2.0 beta)) (/ (/ 1.0 beta) (/ (+ alpha (+ 2.0 beta)) (+ 1.0 alpha)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.8e+17) {
tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (2.0 + beta);
} else {
tmp = (1.0 / beta) / ((alpha + (2.0 + beta)) / (1.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.8d+17) then
tmp = ((1.0d0 + beta) / ((beta + 3.0d0) * (2.0d0 + beta))) / (2.0d0 + beta)
else
tmp = (1.0d0 / beta) / ((alpha + (2.0d0 + beta)) / (1.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.8e+17) {
tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (2.0 + beta);
} else {
tmp = (1.0 / beta) / ((alpha + (2.0 + beta)) / (1.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.8e+17: tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (2.0 + beta) else: tmp = (1.0 / beta) / ((alpha + (2.0 + beta)) / (1.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.8e+17) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(Float64(beta + 3.0) * Float64(2.0 + beta))) / Float64(2.0 + beta)); else tmp = Float64(Float64(1.0 / beta) / Float64(Float64(alpha + Float64(2.0 + beta)) / Float64(1.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.8e+17)
tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (2.0 + beta);
else
tmp = (1.0 / beta) / ((alpha + (2.0 + beta)) / (1.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.8e+17], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / beta), $MachinePrecision] / N[(N[(alpha + N[(2.0 + beta), $MachinePrecision]), $MachinePrecision] / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.8 \cdot 10^{+17}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\left(\beta + 3\right) \cdot \left(2 + \beta\right)}}{2 + \beta}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta}}{\frac{\alpha + \left(2 + \beta\right)}{1 + \alpha}}\\
\end{array}
\end{array}
if beta < 3.8e17Initial program 99.9%
Simplified99.5%
*-commutative99.5%
clear-num99.5%
clear-num99.5%
frac-times99.5%
metadata-eval99.5%
+-commutative99.5%
Applied egg-rr99.5%
associate-/r*99.5%
associate-/l*99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in alpha around 0 68.3%
+-commutative68.3%
+-commutative68.3%
Simplified68.3%
Taylor expanded in alpha around 0 68.4%
+-commutative68.4%
Simplified68.4%
if 3.8e17 < beta Initial program 86.3%
Simplified96.0%
Taylor expanded in beta around inf 82.9%
clear-num82.9%
+-commutative82.9%
+-commutative82.9%
frac-times83.0%
metadata-eval83.0%
Applied egg-rr83.0%
*-commutative83.0%
associate-/r*82.9%
+-commutative82.9%
+-commutative82.9%
Simplified82.9%
Final simplification72.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 5.8e+16) (/ (/ (/ (+ 1.0 beta) (+ beta 3.0)) (+ 2.0 beta)) (+ 2.0 beta)) (/ (/ 1.0 beta) (/ (+ alpha (+ 2.0 beta)) (+ 1.0 alpha)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 5.8e+16) {
tmp = (((1.0 + beta) / (beta + 3.0)) / (2.0 + beta)) / (2.0 + beta);
} else {
tmp = (1.0 / beta) / ((alpha + (2.0 + beta)) / (1.0 + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 5.8d+16) then
tmp = (((1.0d0 + beta) / (beta + 3.0d0)) / (2.0d0 + beta)) / (2.0d0 + beta)
else
tmp = (1.0d0 / beta) / ((alpha + (2.0d0 + beta)) / (1.0d0 + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 5.8e+16) {
tmp = (((1.0 + beta) / (beta + 3.0)) / (2.0 + beta)) / (2.0 + beta);
} else {
tmp = (1.0 / beta) / ((alpha + (2.0 + beta)) / (1.0 + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 5.8e+16: tmp = (((1.0 + beta) / (beta + 3.0)) / (2.0 + beta)) / (2.0 + beta) else: tmp = (1.0 / beta) / ((alpha + (2.0 + beta)) / (1.0 + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 5.8e+16) tmp = Float64(Float64(Float64(Float64(1.0 + beta) / Float64(beta + 3.0)) / Float64(2.0 + beta)) / Float64(2.0 + beta)); else tmp = Float64(Float64(1.0 / beta) / Float64(Float64(alpha + Float64(2.0 + beta)) / Float64(1.0 + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 5.8e+16)
tmp = (((1.0 + beta) / (beta + 3.0)) / (2.0 + beta)) / (2.0 + beta);
else
tmp = (1.0 / beta) / ((alpha + (2.0 + beta)) / (1.0 + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 5.8e+16], N[(N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision] / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision] / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / beta), $MachinePrecision] / N[(N[(alpha + N[(2.0 + beta), $MachinePrecision]), $MachinePrecision] / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 5.8 \cdot 10^{+16}:\\
\;\;\;\;\frac{\frac{\frac{1 + \beta}{\beta + 3}}{2 + \beta}}{2 + \beta}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta}}{\frac{\alpha + \left(2 + \beta\right)}{1 + \alpha}}\\
\end{array}
\end{array}
if beta < 5.8e16Initial program 99.9%
Simplified99.5%
*-commutative99.5%
clear-num99.5%
clear-num99.5%
frac-times99.5%
metadata-eval99.5%
+-commutative99.5%
Applied egg-rr99.5%
associate-/r*99.5%
associate-/l*99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in alpha around 0 68.3%
+-commutative68.3%
+-commutative68.3%
Simplified68.3%
*-un-lft-identity68.3%
times-frac68.3%
+-commutative68.3%
Applied egg-rr68.3%
associate-*l/68.3%
+-commutative68.3%
*-lft-identity68.3%
+-commutative68.3%
+-commutative68.3%
Simplified68.3%
Taylor expanded in alpha around 0 68.4%
+-commutative68.4%
Simplified68.4%
if 5.8e16 < beta Initial program 86.3%
Simplified96.0%
Taylor expanded in beta around inf 82.9%
clear-num82.9%
+-commutative82.9%
+-commutative82.9%
frac-times83.0%
metadata-eval83.0%
Applied egg-rr83.0%
*-commutative83.0%
associate-/r*82.9%
+-commutative82.9%
+-commutative82.9%
Simplified82.9%
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)) (+ 1.0 alpha)))) (if (<= beta 6.0) (/ 0.16666666666666666 t_0) (/ (/ 1.0 beta) t_0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = (alpha + (2.0 + beta)) / (1.0 + alpha);
double tmp;
if (beta <= 6.0) {
tmp = 0.16666666666666666 / t_0;
} else {
tmp = (1.0 / beta) / t_0;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = (alpha + (2.0d0 + beta)) / (1.0d0 + alpha)
if (beta <= 6.0d0) then
tmp = 0.16666666666666666d0 / t_0
else
tmp = (1.0d0 / beta) / t_0
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = (alpha + (2.0 + beta)) / (1.0 + alpha);
double tmp;
if (beta <= 6.0) {
tmp = 0.16666666666666666 / t_0;
} else {
tmp = (1.0 / beta) / t_0;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = (alpha + (2.0 + beta)) / (1.0 + alpha) tmp = 0 if beta <= 6.0: tmp = 0.16666666666666666 / t_0 else: tmp = (1.0 / beta) / t_0 return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(Float64(alpha + Float64(2.0 + beta)) / Float64(1.0 + alpha)) tmp = 0.0 if (beta <= 6.0) tmp = Float64(0.16666666666666666 / t_0); else tmp = Float64(Float64(1.0 / beta) / t_0); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = (alpha + (2.0 + beta)) / (1.0 + alpha);
tmp = 0.0;
if (beta <= 6.0)
tmp = 0.16666666666666666 / t_0;
else
tmp = (1.0 / beta) / t_0;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + N[(2.0 + beta), $MachinePrecision]), $MachinePrecision] / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 6.0], N[(0.16666666666666666 / t$95$0), $MachinePrecision], N[(N[(1.0 / beta), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \frac{\alpha + \left(2 + \beta\right)}{1 + \alpha}\\
\mathbf{if}\;\beta \leq 6:\\
\;\;\;\;\frac{0.16666666666666666}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta}}{t_0}\\
\end{array}
\end{array}
if beta < 6Initial program 99.9%
Simplified99.5%
*-commutative99.5%
clear-num99.5%
clear-num99.5%
frac-times99.5%
metadata-eval99.5%
+-commutative99.5%
Applied egg-rr99.5%
associate-/r*99.5%
associate-/l*99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in alpha around 0 68.3%
+-commutative68.3%
+-commutative68.3%
Simplified68.3%
Taylor expanded in beta around 0 67.8%
if 6 < beta Initial program 86.3%
Simplified96.0%
Taylor expanded in beta around inf 82.9%
clear-num82.9%
+-commutative82.9%
+-commutative82.9%
frac-times83.0%
metadata-eval83.0%
Applied egg-rr83.0%
*-commutative83.0%
associate-/r*82.9%
+-commutative82.9%
+-commutative82.9%
Simplified82.9%
Final simplification72.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 7.5) (/ 0.16666666666666666 (/ (+ alpha (+ 2.0 beta)) (+ 1.0 alpha))) (/ (/ (+ 1.0 alpha) beta) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 7.5) {
tmp = 0.16666666666666666 / ((alpha + (2.0 + beta)) / (1.0 + alpha));
} 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 <= 7.5d0) then
tmp = 0.16666666666666666d0 / ((alpha + (2.0d0 + beta)) / (1.0d0 + alpha))
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 <= 7.5) {
tmp = 0.16666666666666666 / ((alpha + (2.0 + beta)) / (1.0 + alpha));
} else {
tmp = ((1.0 + alpha) / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 7.5: tmp = 0.16666666666666666 / ((alpha + (2.0 + beta)) / (1.0 + alpha)) else: tmp = ((1.0 + alpha) / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 7.5) tmp = Float64(0.16666666666666666 / Float64(Float64(alpha + Float64(2.0 + beta)) / Float64(1.0 + alpha))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 7.5)
tmp = 0.16666666666666666 / ((alpha + (2.0 + beta)) / (1.0 + alpha));
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, 7.5], N[(0.16666666666666666 / N[(N[(alpha + N[(2.0 + beta), $MachinePrecision]), $MachinePrecision] / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 7.5:\\
\;\;\;\;\frac{0.16666666666666666}{\frac{\alpha + \left(2 + \beta\right)}{1 + \alpha}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 7.5Initial program 99.9%
Simplified99.5%
*-commutative99.5%
clear-num99.5%
clear-num99.5%
frac-times99.5%
metadata-eval99.5%
+-commutative99.5%
Applied egg-rr99.5%
associate-/r*99.5%
associate-/l*99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in alpha around 0 68.3%
+-commutative68.3%
+-commutative68.3%
Simplified68.3%
Taylor expanded in beta around 0 67.8%
if 7.5 < beta Initial program 86.3%
Simplified96.0%
Taylor expanded in beta around inf 82.9%
un-div-inv82.9%
+-commutative82.9%
+-commutative82.9%
Applied egg-rr82.9%
Taylor expanded in beta around inf 82.7%
Final simplification72.1%
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 6.0)
(/ 0.16666666666666666 (/ t_0 (+ 1.0 alpha)))
(/ (/ (+ 1.0 alpha) t_0) beta))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (2.0 + beta);
double tmp;
if (beta <= 6.0) {
tmp = 0.16666666666666666 / (t_0 / (1.0 + alpha));
} else {
tmp = ((1.0 + alpha) / t_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 <= 6.0d0) then
tmp = 0.16666666666666666d0 / (t_0 / (1.0d0 + alpha))
else
tmp = ((1.0d0 + alpha) / t_0) / 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 <= 6.0) {
tmp = 0.16666666666666666 / (t_0 / (1.0 + alpha));
} else {
tmp = ((1.0 + alpha) / t_0) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (2.0 + beta) tmp = 0 if beta <= 6.0: tmp = 0.16666666666666666 / (t_0 / (1.0 + alpha)) else: tmp = ((1.0 + alpha) / t_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 <= 6.0) tmp = Float64(0.16666666666666666 / Float64(t_0 / Float64(1.0 + alpha))); else tmp = Float64(Float64(Float64(1.0 + alpha) / t_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 <= 6.0)
tmp = 0.16666666666666666 / (t_0 / (1.0 + alpha));
else
tmp = ((1.0 + alpha) / t_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, 6.0], N[(0.16666666666666666 / N[(t$95$0 / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / beta), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(2 + \beta\right)\\
\mathbf{if}\;\beta \leq 6:\\
\;\;\;\;\frac{0.16666666666666666}{\frac{t_0}{1 + \alpha}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0}}{\beta}\\
\end{array}
\end{array}
if beta < 6Initial program 99.9%
Simplified99.5%
*-commutative99.5%
clear-num99.5%
clear-num99.5%
frac-times99.5%
metadata-eval99.5%
+-commutative99.5%
Applied egg-rr99.5%
associate-/r*99.5%
associate-/l*99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in alpha around 0 68.3%
+-commutative68.3%
+-commutative68.3%
Simplified68.3%
Taylor expanded in beta around 0 67.8%
if 6 < beta Initial program 86.3%
Simplified96.0%
Taylor expanded in beta around inf 82.9%
un-div-inv82.9%
+-commutative82.9%
+-commutative82.9%
Applied egg-rr82.9%
Final simplification72.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.6) 0.08333333333333333 (/ 1.0 (* beta (+ 2.0 beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = 0.08333333333333333;
} else {
tmp = 1.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) :: tmp
if (beta <= 2.6d0) then
tmp = 0.08333333333333333d0
else
tmp = 1.0d0 / (beta * (2.0d0 + beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = 0.08333333333333333;
} else {
tmp = 1.0 / (beta * (2.0 + beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.6: tmp = 0.08333333333333333 else: tmp = 1.0 / (beta * (2.0 + beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.6) tmp = 0.08333333333333333; else tmp = Float64(1.0 / Float64(beta * 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 <= 2.6)
tmp = 0.08333333333333333;
else
tmp = 1.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_] := If[LessEqual[beta, 2.6], 0.08333333333333333, N[(1.0 / N[(beta * N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.6:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \left(2 + \beta\right)}\\
\end{array}
\end{array}
if beta < 2.60000000000000009Initial program 99.9%
Simplified99.5%
*-commutative99.5%
clear-num99.5%
clear-num99.5%
frac-times99.5%
metadata-eval99.5%
+-commutative99.5%
Applied egg-rr99.5%
associate-/r*99.5%
associate-/l*99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in alpha around 0 68.3%
+-commutative68.3%
+-commutative68.3%
Simplified68.3%
Taylor expanded in beta around 0 67.8%
*-commutative67.8%
Simplified67.8%
Taylor expanded in alpha around 0 67.9%
if 2.60000000000000009 < beta Initial program 86.3%
Simplified96.0%
Taylor expanded in beta around inf 82.9%
Taylor expanded in alpha around 0 78.8%
Final simplification71.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.6) 0.08333333333333333 (/ (/ 1.0 beta) (+ 2.0 beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = 0.08333333333333333;
} else {
tmp = (1.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) :: tmp
if (beta <= 2.6d0) then
tmp = 0.08333333333333333d0
else
tmp = (1.0d0 / beta) / (2.0d0 + beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = 0.08333333333333333;
} else {
tmp = (1.0 / beta) / (2.0 + beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.6: tmp = 0.08333333333333333 else: tmp = (1.0 / beta) / (2.0 + beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.6) tmp = 0.08333333333333333; else tmp = Float64(Float64(1.0 / beta) / 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 <= 2.6)
tmp = 0.08333333333333333;
else
tmp = (1.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_] := If[LessEqual[beta, 2.6], 0.08333333333333333, N[(N[(1.0 / beta), $MachinePrecision] / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.6:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta}}{2 + \beta}\\
\end{array}
\end{array}
if beta < 2.60000000000000009Initial program 99.9%
Simplified99.5%
*-commutative99.5%
clear-num99.5%
clear-num99.5%
frac-times99.5%
metadata-eval99.5%
+-commutative99.5%
Applied egg-rr99.5%
associate-/r*99.5%
associate-/l*99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in alpha around 0 68.3%
+-commutative68.3%
+-commutative68.3%
Simplified68.3%
Taylor expanded in beta around 0 67.8%
*-commutative67.8%
Simplified67.8%
Taylor expanded in alpha around 0 67.9%
if 2.60000000000000009 < beta Initial program 86.3%
Simplified96.0%
Taylor expanded in beta around inf 82.9%
Taylor expanded in alpha around 0 78.8%
associate-/r*78.8%
+-commutative78.8%
Simplified78.8%
Final simplification71.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.5) 0.08333333333333333 (/ (/ (+ 1.0 alpha) beta) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.5) {
tmp = 0.08333333333333333;
} 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.08333333333333333d0
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.08333333333333333;
} 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.08333333333333333 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 = 0.08333333333333333; else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.5)
tmp = 0.08333333333333333;
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], 0.08333333333333333, N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.5:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 3.5Initial program 99.9%
Simplified99.5%
*-commutative99.5%
clear-num99.5%
clear-num99.5%
frac-times99.5%
metadata-eval99.5%
+-commutative99.5%
Applied egg-rr99.5%
associate-/r*99.5%
associate-/l*99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in alpha around 0 68.3%
+-commutative68.3%
+-commutative68.3%
Simplified68.3%
Taylor expanded in beta around 0 67.8%
*-commutative67.8%
Simplified67.8%
Taylor expanded in alpha around 0 67.9%
if 3.5 < beta Initial program 86.3%
Simplified96.0%
Taylor expanded in beta around inf 82.9%
un-div-inv82.9%
+-commutative82.9%
+-commutative82.9%
Applied egg-rr82.9%
Taylor expanded in beta around inf 82.7%
Final simplification72.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 12.0) 0.08333333333333333 (/ 1.0 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 12.0) {
tmp = 0.08333333333333333;
} 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 <= 12.0d0) then
tmp = 0.08333333333333333d0
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 <= 12.0) {
tmp = 0.08333333333333333;
} else {
tmp = 1.0 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 12.0: tmp = 0.08333333333333333 else: tmp = 1.0 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 12.0) tmp = 0.08333333333333333; 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 <= 12.0)
tmp = 0.08333333333333333;
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, 12.0], 0.08333333333333333, N[(1.0 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 12:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta}\\
\end{array}
\end{array}
if beta < 12Initial program 99.9%
Simplified99.5%
*-commutative99.5%
clear-num99.5%
clear-num99.5%
frac-times99.5%
metadata-eval99.5%
+-commutative99.5%
Applied egg-rr99.5%
associate-/r*99.5%
associate-/l*99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in alpha around 0 68.3%
+-commutative68.3%
+-commutative68.3%
Simplified68.3%
Taylor expanded in beta around 0 67.8%
*-commutative67.8%
Simplified67.8%
Taylor expanded in alpha around 0 67.9%
if 12 < beta Initial program 86.3%
Simplified96.0%
Taylor expanded in beta around inf 82.9%
un-div-inv82.9%
+-commutative82.9%
+-commutative82.9%
Applied egg-rr82.9%
Taylor expanded in alpha around inf 6.8%
Final simplification50.5%
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 96.0%
Simplified98.5%
*-commutative98.5%
clear-num98.4%
clear-num98.4%
frac-times98.5%
metadata-eval98.5%
+-commutative98.5%
Applied egg-rr98.5%
associate-/r*98.4%
associate-/l*99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in alpha around 0 72.9%
+-commutative72.9%
+-commutative72.9%
Simplified72.9%
Taylor expanded in beta around 0 49.6%
*-commutative49.6%
Simplified49.6%
Taylor expanded in alpha around 0 49.6%
Final simplification49.6%
herbie shell --seed 2024022
(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)))