
(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 (+ 2.0 (+ beta alpha))))
(/
(/ (* (+ 1.0 beta) (/ (+ 1.0 alpha) t_0)) t_0)
(+ 1.0 (+ alpha (+ beta 2.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = 2.0 + (beta + alpha);
return (((1.0 + beta) * ((1.0 + alpha) / t_0)) / t_0) / (1.0 + (alpha + (beta + 2.0)));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = 2.0d0 + (beta + alpha)
code = (((1.0d0 + beta) * ((1.0d0 + alpha) / t_0)) / t_0) / (1.0d0 + (alpha + (beta + 2.0d0)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = 2.0 + (beta + alpha);
return (((1.0 + beta) * ((1.0 + alpha) / t_0)) / t_0) / (1.0 + (alpha + (beta + 2.0)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = 2.0 + (beta + alpha) return (((1.0 + beta) * ((1.0 + alpha) / t_0)) / t_0) / (1.0 + (alpha + (beta + 2.0)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(2.0 + Float64(beta + alpha)) return Float64(Float64(Float64(Float64(1.0 + beta) * Float64(Float64(1.0 + alpha) / t_0)) / t_0) / Float64(1.0 + Float64(alpha + Float64(beta + 2.0)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = 2.0 + (beta + alpha);
tmp = (((1.0 + beta) * ((1.0 + alpha) / t_0)) / t_0) / (1.0 + (alpha + (beta + 2.0)));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(2.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(1.0 + beta), $MachinePrecision] * N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(1.0 + N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := 2 + \left(\beta + \alpha\right)\\
\frac{\frac{\left(1 + \beta\right) \cdot \frac{1 + \alpha}{t\_0}}{t\_0}}{1 + \left(\alpha + \left(\beta + 2\right)\right)}
\end{array}
\end{array}
Initial program 95.3%
div-inv95.2%
+-commutative95.2%
*-commutative95.2%
associate-+r+95.2%
+-commutative95.2%
distribute-rgt1-in95.2%
fma-define95.2%
metadata-eval95.2%
associate-+r+95.2%
metadata-eval95.2%
associate-+r+95.2%
Applied egg-rr95.2%
associate-*l/95.3%
associate-*r/95.3%
*-rgt-identity95.3%
+-commutative95.3%
fma-undefine95.3%
+-commutative95.3%
*-commutative95.3%
+-commutative95.3%
associate-+r+95.3%
distribute-lft1-in95.3%
+-commutative95.3%
+-commutative95.3%
associate-+r+95.3%
+-commutative95.3%
+-commutative95.3%
associate-+r+95.3%
+-commutative95.3%
+-commutative95.3%
Simplified95.3%
associate-/l*99.9%
Applied egg-rr99.9%
metadata-eval99.9%
associate-+r+99.9%
add-sqr-sqrt60.8%
fma-define60.8%
Applied egg-rr60.8%
fma-undefine60.8%
rem-square-sqrt99.9%
+-commutative99.9%
Simplified99.9%
Final simplification99.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ alpha (+ beta 2.0)))) (* (/ (/ (+ 1.0 alpha) t_0) (+ alpha (+ beta 3.0))) (/ (+ 1.0 beta) t_0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return (((1.0 + alpha) / t_0) / (alpha + (beta + 3.0))) * ((1.0 + beta) / 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 + alpha) / t_0) / (alpha + (beta + 3.0d0))) * ((1.0d0 + beta) / 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 + alpha) / t_0) / (alpha + (beta + 3.0))) * ((1.0 + beta) / t_0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return (((1.0 + alpha) / t_0) / (alpha + (beta + 3.0))) * ((1.0 + beta) / t_0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) return Float64(Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(alpha + Float64(beta + 3.0))) * Float64(Float64(1.0 + beta) / t_0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = (((1.0 + alpha) / t_0) / (alpha + (beta + 3.0))) * ((1.0 + beta) / 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[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + beta), $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{\frac{1 + \alpha}{t\_0}}{\alpha + \left(\beta + 3\right)} \cdot \frac{1 + \beta}{t\_0}
\end{array}
\end{array}
Initial program 95.3%
div-inv95.2%
+-commutative95.2%
*-commutative95.2%
associate-+r+95.2%
+-commutative95.2%
distribute-rgt1-in95.2%
fma-define95.2%
metadata-eval95.2%
associate-+r+95.2%
metadata-eval95.2%
associate-+r+95.2%
Applied egg-rr95.2%
associate-*l/95.3%
associate-*r/95.3%
*-rgt-identity95.3%
+-commutative95.3%
fma-undefine95.3%
+-commutative95.3%
*-commutative95.3%
+-commutative95.3%
associate-+r+95.3%
distribute-lft1-in95.3%
+-commutative95.3%
+-commutative95.3%
associate-+r+95.3%
+-commutative95.3%
+-commutative95.3%
associate-+r+95.3%
+-commutative95.3%
+-commutative95.3%
Simplified95.3%
associate-/l*99.9%
Applied egg-rr99.9%
metadata-eval99.9%
associate-+l+99.9%
metadata-eval99.9%
associate-/l/98.6%
*-commutative98.6%
+-commutative98.6%
+-commutative98.6%
metadata-eval98.6%
times-frac99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 1.05e+16)
(*
(/ 1.0 (+ alpha (+ beta 3.0)))
(/ (/ (+ 1.0 beta) (+ beta 2.0)) (+ beta 2.0)))
(/
(/ (+ 1.0 alpha) (+ 2.0 (+ beta alpha)))
(+ 1.0 (+ alpha (+ beta 2.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.05e+16) {
tmp = (1.0 / (alpha + (beta + 3.0))) * (((1.0 + beta) / (beta + 2.0)) / (beta + 2.0));
} else {
tmp = ((1.0 + alpha) / (2.0 + (beta + alpha))) / (1.0 + (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.05d+16) then
tmp = (1.0d0 / (alpha + (beta + 3.0d0))) * (((1.0d0 + beta) / (beta + 2.0d0)) / (beta + 2.0d0))
else
tmp = ((1.0d0 + alpha) / (2.0d0 + (beta + alpha))) / (1.0d0 + (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.05e+16) {
tmp = (1.0 / (alpha + (beta + 3.0))) * (((1.0 + beta) / (beta + 2.0)) / (beta + 2.0));
} else {
tmp = ((1.0 + alpha) / (2.0 + (beta + alpha))) / (1.0 + (alpha + (beta + 2.0)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.05e+16: tmp = (1.0 / (alpha + (beta + 3.0))) * (((1.0 + beta) / (beta + 2.0)) / (beta + 2.0)) else: tmp = ((1.0 + alpha) / (2.0 + (beta + alpha))) / (1.0 + (alpha + (beta + 2.0))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.05e+16) tmp = Float64(Float64(1.0 / Float64(alpha + Float64(beta + 3.0))) * Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) / Float64(beta + 2.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(2.0 + Float64(beta + alpha))) / Float64(1.0 + 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.05e+16)
tmp = (1.0 / (alpha + (beta + 3.0))) * (((1.0 + beta) / (beta + 2.0)) / (beta + 2.0));
else
tmp = ((1.0 + alpha) / (2.0 + (beta + alpha))) / (1.0 + (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.05e+16], N[(N[(1.0 / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(2.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + 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.05 \cdot 10^{+16}:\\
\;\;\;\;\frac{1}{\alpha + \left(\beta + 3\right)} \cdot \frac{\frac{1 + \beta}{\beta + 2}}{\beta + 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{2 + \left(\beta + \alpha\right)}}{1 + \left(\alpha + \left(\beta + 2\right)\right)}\\
\end{array}
\end{array}
if beta < 1.05e16Initial program 99.9%
associate-/l/99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in alpha around 0 85.0%
+-commutative85.0%
Simplified85.0%
Taylor expanded in alpha around 0 69.4%
+-commutative69.4%
Simplified69.4%
*-un-lft-identity69.4%
times-frac69.4%
associate-+l+69.4%
Applied egg-rr69.4%
if 1.05e16 < beta Initial program 86.2%
div-inv86.2%
+-commutative86.2%
*-commutative86.2%
associate-+r+86.2%
+-commutative86.2%
distribute-rgt1-in86.2%
fma-define86.2%
metadata-eval86.2%
associate-+r+86.2%
metadata-eval86.2%
associate-+r+86.2%
Applied egg-rr86.2%
associate-*l/86.2%
associate-*r/86.2%
*-rgt-identity86.2%
+-commutative86.2%
fma-undefine86.2%
+-commutative86.2%
*-commutative86.2%
+-commutative86.2%
associate-+r+86.2%
distribute-lft1-in86.2%
+-commutative86.2%
+-commutative86.2%
associate-+r+86.2%
+-commutative86.2%
+-commutative86.2%
associate-+r+86.2%
+-commutative86.2%
+-commutative86.2%
Simplified86.2%
associate-/l*99.8%
Applied egg-rr99.8%
metadata-eval99.8%
associate-+r+99.8%
add-sqr-sqrt59.6%
fma-define59.6%
Applied egg-rr59.6%
fma-undefine59.6%
rem-square-sqrt99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in beta around inf 87.3%
Final simplification75.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 4e+52)
(/ (/ (+ 1.0 beta) (+ beta 2.0)) (* (+ beta 2.0) (+ 3.0 (+ beta alpha))))
(/
(/ (+ 1.0 alpha) (+ 2.0 (+ beta alpha)))
(+ 1.0 (+ alpha (+ beta 2.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4e+52) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (3.0 + (beta + alpha)));
} else {
tmp = ((1.0 + alpha) / (2.0 + (beta + alpha))) / (1.0 + (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 <= 4d+52) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) / ((beta + 2.0d0) * (3.0d0 + (beta + alpha)))
else
tmp = ((1.0d0 + alpha) / (2.0d0 + (beta + alpha))) / (1.0d0 + (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 <= 4e+52) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (3.0 + (beta + alpha)));
} else {
tmp = ((1.0 + alpha) / (2.0 + (beta + alpha))) / (1.0 + (alpha + (beta + 2.0)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4e+52: tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (3.0 + (beta + alpha))) else: tmp = ((1.0 + alpha) / (2.0 + (beta + alpha))) / (1.0 + (alpha + (beta + 2.0))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4e+52) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) / Float64(Float64(beta + 2.0) * Float64(3.0 + Float64(beta + alpha)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(2.0 + Float64(beta + alpha))) / Float64(1.0 + 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 <= 4e+52)
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (3.0 + (beta + alpha)));
else
tmp = ((1.0 + alpha) / (2.0 + (beta + alpha))) / (1.0 + (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, 4e+52], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(3.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(2.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + 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 4 \cdot 10^{+52}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\beta + 2}}{\left(\beta + 2\right) \cdot \left(3 + \left(\beta + \alpha\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{2 + \left(\beta + \alpha\right)}}{1 + \left(\alpha + \left(\beta + 2\right)\right)}\\
\end{array}
\end{array}
if beta < 4e52Initial program 99.9%
associate-/l/99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in alpha around 0 86.0%
+-commutative86.0%
Simplified86.0%
Taylor expanded in alpha around 0 70.3%
+-commutative70.3%
Simplified70.3%
if 4e52 < beta Initial program 84.1%
div-inv84.1%
+-commutative84.1%
*-commutative84.1%
associate-+r+84.1%
+-commutative84.1%
distribute-rgt1-in84.1%
fma-define84.1%
metadata-eval84.1%
associate-+r+84.1%
metadata-eval84.1%
associate-+r+84.1%
Applied egg-rr84.1%
associate-*l/84.1%
associate-*r/84.1%
*-rgt-identity84.1%
+-commutative84.1%
fma-undefine84.1%
+-commutative84.1%
*-commutative84.1%
+-commutative84.1%
associate-+r+84.1%
distribute-lft1-in84.1%
+-commutative84.1%
+-commutative84.1%
associate-+r+84.1%
+-commutative84.1%
+-commutative84.1%
associate-+r+84.1%
+-commutative84.1%
+-commutative84.1%
Simplified84.1%
associate-/l*99.9%
Applied egg-rr99.9%
metadata-eval99.9%
associate-+r+99.9%
add-sqr-sqrt63.9%
fma-define63.9%
Applied egg-rr63.9%
fma-undefine63.9%
rem-square-sqrt99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in beta around inf 87.8%
Final simplification75.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 3.6e+52)
(/ (/ (+ 1.0 beta) (+ beta 2.0)) (* (+ beta 2.0) (+ beta 3.0)))
(/
(/ (+ 1.0 alpha) (+ 2.0 (+ beta alpha)))
(+ 1.0 (+ alpha (+ beta 2.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.6e+52) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / (2.0 + (beta + alpha))) / (1.0 + (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 <= 3.6d+52) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = ((1.0d0 + alpha) / (2.0d0 + (beta + alpha))) / (1.0d0 + (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 <= 3.6e+52) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / (2.0 + (beta + alpha))) / (1.0 + (alpha + (beta + 2.0)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.6e+52: tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)) else: tmp = ((1.0 + alpha) / (2.0 + (beta + alpha))) / (1.0 + (alpha + (beta + 2.0))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.6e+52) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) / Float64(Float64(beta + 2.0) * Float64(beta + 3.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(2.0 + Float64(beta + alpha))) / Float64(1.0 + 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 <= 3.6e+52)
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
else
tmp = ((1.0 + alpha) / (2.0 + (beta + alpha))) / (1.0 + (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, 3.6e+52], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(2.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + 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 3.6 \cdot 10^{+52}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\beta + 2}}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{2 + \left(\beta + \alpha\right)}}{1 + \left(\alpha + \left(\beta + 2\right)\right)}\\
\end{array}
\end{array}
if beta < 3.6e52Initial program 99.9%
associate-/l/99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in alpha around 0 86.0%
+-commutative86.0%
Simplified86.0%
Taylor expanded in alpha around 0 68.4%
+-commutative68.4%
Simplified68.4%
if 3.6e52 < beta Initial program 84.1%
div-inv84.1%
+-commutative84.1%
*-commutative84.1%
associate-+r+84.1%
+-commutative84.1%
distribute-rgt1-in84.1%
fma-define84.1%
metadata-eval84.1%
associate-+r+84.1%
metadata-eval84.1%
associate-+r+84.1%
Applied egg-rr84.1%
associate-*l/84.1%
associate-*r/84.1%
*-rgt-identity84.1%
+-commutative84.1%
fma-undefine84.1%
+-commutative84.1%
*-commutative84.1%
+-commutative84.1%
associate-+r+84.1%
distribute-lft1-in84.1%
+-commutative84.1%
+-commutative84.1%
associate-+r+84.1%
+-commutative84.1%
+-commutative84.1%
associate-+r+84.1%
+-commutative84.1%
+-commutative84.1%
Simplified84.1%
associate-/l*99.9%
Applied egg-rr99.9%
metadata-eval99.9%
associate-+r+99.9%
add-sqr-sqrt63.9%
fma-define63.9%
Applied egg-rr63.9%
fma-undefine63.9%
rem-square-sqrt99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in beta around inf 87.8%
Final simplification74.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.3e+52) (/ (/ (+ 1.0 beta) (+ beta 2.0)) (* (+ beta 2.0) (+ beta 3.0))) (/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.3e+52) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.3d+52) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = ((1.0d0 + alpha) / beta) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.3e+52) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.3e+52: tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)) else: tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.3e+52) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) / Float64(Float64(beta + 2.0) * Float64(beta + 3.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.3e+52)
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
else
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.3e+52], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.3 \cdot 10^{+52}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\beta + 2}}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 3.3e52Initial program 99.9%
associate-/l/99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in alpha around 0 86.0%
+-commutative86.0%
Simplified86.0%
Taylor expanded in alpha around 0 68.4%
+-commutative68.4%
Simplified68.4%
if 3.3e52 < beta Initial program 84.1%
Taylor expanded in beta around inf 87.3%
Taylor expanded in alpha around 0 87.3%
+-commutative87.3%
+-commutative87.3%
+-commutative87.3%
associate-+r+87.3%
Simplified87.3%
Final simplification73.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.2) (/ (+ 0.5 (* beta 0.25)) (* (+ beta 2.0) (+ 3.0 (+ beta alpha)))) (/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.2) {
tmp = (0.5 + (beta * 0.25)) / ((beta + 2.0) * (3.0 + (beta + alpha)));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 4.2d0) then
tmp = (0.5d0 + (beta * 0.25d0)) / ((beta + 2.0d0) * (3.0d0 + (beta + alpha)))
else
tmp = ((1.0d0 + alpha) / beta) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 4.2) {
tmp = (0.5 + (beta * 0.25)) / ((beta + 2.0) * (3.0 + (beta + alpha)));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.2: tmp = (0.5 + (beta * 0.25)) / ((beta + 2.0) * (3.0 + (beta + alpha))) else: tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.2) tmp = Float64(Float64(0.5 + Float64(beta * 0.25)) / Float64(Float64(beta + 2.0) * Float64(3.0 + Float64(beta + alpha)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 4.2)
tmp = (0.5 + (beta * 0.25)) / ((beta + 2.0) * (3.0 + (beta + alpha)));
else
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 4.2], N[(N[(0.5 + N[(beta * 0.25), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(3.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4.2:\\
\;\;\;\;\frac{0.5 + \beta \cdot 0.25}{\left(\beta + 2\right) \cdot \left(3 + \left(\beta + \alpha\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 4.20000000000000018Initial program 99.9%
associate-/l/99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in alpha around 0 84.8%
+-commutative84.8%
Simplified84.8%
Taylor expanded in alpha around 0 69.0%
+-commutative69.0%
Simplified69.0%
Taylor expanded in beta around 0 68.1%
*-commutative68.1%
Simplified68.1%
if 4.20000000000000018 < beta Initial program 86.5%
Taylor expanded in beta around inf 86.3%
Taylor expanded in alpha around 0 86.3%
+-commutative86.3%
+-commutative86.3%
+-commutative86.3%
associate-+r+86.3%
Simplified86.3%
Final simplification74.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.1) (+ 0.08333333333333333 (* alpha -0.027777777777777776)) (/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.1) {
tmp = 0.08333333333333333 + (alpha * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.1d0) then
tmp = 0.08333333333333333d0 + (alpha * (-0.027777777777777776d0))
else
tmp = ((1.0d0 + alpha) / beta) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.1) {
tmp = 0.08333333333333333 + (alpha * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.1: tmp = 0.08333333333333333 + (alpha * -0.027777777777777776) else: tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.1) tmp = Float64(0.08333333333333333 + Float64(alpha * -0.027777777777777776)); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.1)
tmp = 0.08333333333333333 + (alpha * -0.027777777777777776);
else
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.1], N[(0.08333333333333333 + N[(alpha * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.1:\\
\;\;\;\;0.08333333333333333 + \alpha \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 2.10000000000000009Initial program 99.9%
associate-/l/99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in alpha around 0 84.8%
+-commutative84.8%
Simplified84.8%
Taylor expanded in alpha around 0 69.0%
+-commutative69.0%
Simplified69.0%
Taylor expanded in beta around 0 67.7%
+-commutative67.7%
Simplified67.7%
Taylor expanded in alpha around 0 65.8%
*-commutative65.8%
Simplified65.8%
if 2.10000000000000009 < beta Initial program 86.5%
Taylor expanded in beta around inf 86.3%
Taylor expanded in alpha around 0 86.3%
+-commutative86.3%
+-commutative86.3%
+-commutative86.3%
associate-+r+86.3%
Simplified86.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.3) (+ 0.08333333333333333 (* alpha -0.027777777777777776)) (/ (/ (+ 1.0 alpha) beta) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.3) {
tmp = 0.08333333333333333 + (alpha * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) / (beta + 3.0);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.3d0) then
tmp = 0.08333333333333333d0 + (alpha * (-0.027777777777777776d0))
else
tmp = ((1.0d0 + alpha) / beta) / (beta + 3.0d0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.3) {
tmp = 0.08333333333333333 + (alpha * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) / (beta + 3.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.3: tmp = 0.08333333333333333 + (alpha * -0.027777777777777776) else: tmp = ((1.0 + alpha) / beta) / (beta + 3.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.3) tmp = Float64(0.08333333333333333 + Float64(alpha * -0.027777777777777776)); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(beta + 3.0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.3)
tmp = 0.08333333333333333 + (alpha * -0.027777777777777776);
else
tmp = ((1.0 + alpha) / beta) / (beta + 3.0);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.3], N[(0.08333333333333333 + N[(alpha * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.3:\\
\;\;\;\;0.08333333333333333 + \alpha \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 2.2999999999999998Initial program 99.9%
associate-/l/99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in alpha around 0 84.8%
+-commutative84.8%
Simplified84.8%
Taylor expanded in alpha around 0 69.0%
+-commutative69.0%
Simplified69.0%
Taylor expanded in beta around 0 67.7%
+-commutative67.7%
Simplified67.7%
Taylor expanded in alpha around 0 65.8%
*-commutative65.8%
Simplified65.8%
if 2.2999999999999998 < beta Initial program 86.5%
Taylor expanded in beta around inf 86.3%
Taylor expanded in alpha around 0 86.1%
+-commutative86.1%
Simplified86.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.3) (+ 0.08333333333333333 (* alpha -0.027777777777777776)) (/ (/ (+ 1.0 alpha) beta) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.3) {
tmp = 0.08333333333333333 + (alpha * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.3d0) then
tmp = 0.08333333333333333d0 + (alpha * (-0.027777777777777776d0))
else
tmp = ((1.0d0 + alpha) / beta) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.3) {
tmp = 0.08333333333333333 + (alpha * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.3: tmp = 0.08333333333333333 + (alpha * -0.027777777777777776) else: tmp = ((1.0 + alpha) / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.3) tmp = Float64(0.08333333333333333 + Float64(alpha * -0.027777777777777776)); 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.3)
tmp = 0.08333333333333333 + (alpha * -0.027777777777777776);
else
tmp = ((1.0 + alpha) / beta) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.3], N[(0.08333333333333333 + N[(alpha * -0.027777777777777776), $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 3.3:\\
\;\;\;\;0.08333333333333333 + \alpha \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 3.2999999999999998Initial program 99.9%
associate-/l/99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in alpha around 0 84.8%
+-commutative84.8%
Simplified84.8%
Taylor expanded in alpha around 0 69.0%
+-commutative69.0%
Simplified69.0%
Taylor expanded in beta around 0 67.7%
+-commutative67.7%
Simplified67.7%
Taylor expanded in alpha around 0 65.8%
*-commutative65.8%
Simplified65.8%
if 3.2999999999999998 < beta Initial program 86.5%
Taylor expanded in beta around inf 86.3%
Taylor expanded in alpha around inf 79.1%
+-commutative79.1%
associate-*r/79.1%
metadata-eval79.1%
Simplified79.1%
Taylor expanded in beta around inf 86.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.1) (+ 0.08333333333333333 (* alpha -0.027777777777777776)) (/ (/ 1.0 beta) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.1) {
tmp = 0.08333333333333333 + (alpha * -0.027777777777777776);
} else {
tmp = (1.0 / beta) / (beta + 3.0);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.1d0) then
tmp = 0.08333333333333333d0 + (alpha * (-0.027777777777777776d0))
else
tmp = (1.0d0 / beta) / (beta + 3.0d0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.1) {
tmp = 0.08333333333333333 + (alpha * -0.027777777777777776);
} else {
tmp = (1.0 / beta) / (beta + 3.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.1: tmp = 0.08333333333333333 + (alpha * -0.027777777777777776) else: tmp = (1.0 / beta) / (beta + 3.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.1) tmp = Float64(0.08333333333333333 + Float64(alpha * -0.027777777777777776)); else tmp = Float64(Float64(1.0 / beta) / Float64(beta + 3.0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.1)
tmp = 0.08333333333333333 + (alpha * -0.027777777777777776);
else
tmp = (1.0 / beta) / (beta + 3.0);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.1], N[(0.08333333333333333 + N[(alpha * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.1:\\
\;\;\;\;0.08333333333333333 + \alpha \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 2.10000000000000009Initial program 99.9%
associate-/l/99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in alpha around 0 84.8%
+-commutative84.8%
Simplified84.8%
Taylor expanded in alpha around 0 69.0%
+-commutative69.0%
Simplified69.0%
Taylor expanded in beta around 0 67.7%
+-commutative67.7%
Simplified67.7%
Taylor expanded in alpha around 0 65.8%
*-commutative65.8%
Simplified65.8%
if 2.10000000000000009 < beta Initial program 86.5%
Taylor expanded in beta around inf 86.3%
Taylor expanded in alpha around 0 86.3%
+-commutative86.3%
+-commutative86.3%
+-commutative86.3%
associate-+r+86.3%
Simplified86.3%
Taylor expanded in alpha around 0 83.2%
associate-/r*84.1%
Simplified84.1%
Final simplification72.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.9) (+ 0.08333333333333333 (* alpha -0.027777777777777776)) (/ 1.0 (* beta (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.9) {
tmp = 0.08333333333333333 + (alpha * -0.027777777777777776);
} else {
tmp = 1.0 / (beta * (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.9d0) then
tmp = 0.08333333333333333d0 + (alpha * (-0.027777777777777776d0))
else
tmp = 1.0d0 / (beta * (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.9) {
tmp = 0.08333333333333333 + (alpha * -0.027777777777777776);
} else {
tmp = 1.0 / (beta * (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.9: tmp = 0.08333333333333333 + (alpha * -0.027777777777777776) else: tmp = 1.0 / (beta * (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.9) tmp = Float64(0.08333333333333333 + Float64(alpha * -0.027777777777777776)); else tmp = Float64(1.0 / Float64(beta * Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.9)
tmp = 0.08333333333333333 + (alpha * -0.027777777777777776);
else
tmp = 1.0 / (beta * (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.9], N[(0.08333333333333333 + N[(alpha * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(beta * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.9:\\
\;\;\;\;0.08333333333333333 + \alpha \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 1.8999999999999999Initial program 99.9%
associate-/l/99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in alpha around 0 84.8%
+-commutative84.8%
Simplified84.8%
Taylor expanded in alpha around 0 69.0%
+-commutative69.0%
Simplified69.0%
Taylor expanded in beta around 0 67.7%
+-commutative67.7%
Simplified67.7%
Taylor expanded in alpha around 0 65.8%
*-commutative65.8%
Simplified65.8%
if 1.8999999999999999 < beta Initial program 86.5%
Taylor expanded in beta around inf 86.3%
Taylor expanded in alpha around 0 83.2%
+-commutative83.2%
Simplified83.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 11.8) (+ 0.08333333333333333 (* alpha -0.027777777777777776)) (/ 1.0 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 11.8) {
tmp = 0.08333333333333333 + (alpha * -0.027777777777777776);
} else {
tmp = 1.0 / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 11.8d0) then
tmp = 0.08333333333333333d0 + (alpha * (-0.027777777777777776d0))
else
tmp = 1.0d0 / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 11.8) {
tmp = 0.08333333333333333 + (alpha * -0.027777777777777776);
} else {
tmp = 1.0 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 11.8: tmp = 0.08333333333333333 + (alpha * -0.027777777777777776) else: tmp = 1.0 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 11.8) tmp = Float64(0.08333333333333333 + Float64(alpha * -0.027777777777777776)); else tmp = Float64(1.0 / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 11.8)
tmp = 0.08333333333333333 + (alpha * -0.027777777777777776);
else
tmp = 1.0 / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 11.8], N[(0.08333333333333333 + N[(alpha * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(1.0 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 11.8:\\
\;\;\;\;0.08333333333333333 + \alpha \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta}\\
\end{array}
\end{array}
if beta < 11.800000000000001Initial program 99.9%
associate-/l/99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in alpha around 0 84.8%
+-commutative84.8%
Simplified84.8%
Taylor expanded in alpha around 0 69.0%
+-commutative69.0%
Simplified69.0%
Taylor expanded in beta around 0 67.7%
+-commutative67.7%
Simplified67.7%
Taylor expanded in alpha around 0 65.8%
*-commutative65.8%
Simplified65.8%
if 11.800000000000001 < beta Initial program 86.5%
Taylor expanded in beta around inf 86.3%
Taylor expanded in alpha around inf 6.8%
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%
associate-/l/99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in alpha around 0 84.8%
+-commutative84.8%
Simplified84.8%
Taylor expanded in alpha around 0 69.0%
+-commutative69.0%
Simplified69.0%
Taylor expanded in beta around 0 67.7%
+-commutative67.7%
Simplified67.7%
Taylor expanded in alpha around 0 65.7%
if 12 < beta Initial program 86.5%
Taylor expanded in beta around inf 86.3%
Taylor expanded in alpha around inf 6.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.25 (+ alpha 3.0)))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.25 / (alpha + 3.0);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.25d0 / (alpha + 3.0d0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.25 / (alpha + 3.0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.25 / (alpha + 3.0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.25 / Float64(alpha + 3.0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.25 / (alpha + 3.0);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.25 / N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.25}{\alpha + 3}
\end{array}
Initial program 95.3%
associate-/l/94.6%
+-commutative94.6%
associate-+l+94.6%
*-commutative94.6%
metadata-eval94.6%
associate-+l+94.6%
metadata-eval94.6%
associate-+l+94.6%
metadata-eval94.6%
metadata-eval94.6%
associate-+l+94.6%
Simplified94.6%
Taylor expanded in alpha around 0 86.7%
+-commutative86.7%
Simplified86.7%
Taylor expanded in alpha around 0 75.3%
+-commutative75.3%
Simplified75.3%
Taylor expanded in beta around 0 45.9%
+-commutative45.9%
Simplified45.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 0.08333333333333333)
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.08333333333333333;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.08333333333333333d0
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.08333333333333333;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.08333333333333333
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return 0.08333333333333333 end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.08333333333333333;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := 0.08333333333333333
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
0.08333333333333333
\end{array}
Initial program 95.3%
associate-/l/94.6%
+-commutative94.6%
associate-+l+94.6%
*-commutative94.6%
metadata-eval94.6%
associate-+l+94.6%
metadata-eval94.6%
associate-+l+94.6%
metadata-eval94.6%
metadata-eval94.6%
associate-+l+94.6%
Simplified94.6%
Taylor expanded in alpha around 0 86.7%
+-commutative86.7%
Simplified86.7%
Taylor expanded in alpha around 0 75.3%
+-commutative75.3%
Simplified75.3%
Taylor expanded in beta around 0 45.9%
+-commutative45.9%
Simplified45.9%
Taylor expanded in alpha around 0 44.2%
herbie shell --seed 2024108
(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)))