
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t\_0}}{t\_0}}{t\_0 + 1}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t\_0}}{t\_0}}{t\_0 + 1}
\end{array}
\end{array}
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4e+48) (/ (/ (+ 1.0 beta) (+ beta 2.0)) (* (+ beta 2.0) (+ beta 3.0))) (/ (* (+ alpha 1.0) (/ 1.0 beta)) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4e+48) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((alpha + 1.0) * (1.0 / beta)) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 4d+48) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = ((alpha + 1.0d0) * (1.0d0 / beta)) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 4e+48) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((alpha + 1.0) * (1.0 / beta)) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4e+48: tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)) else: tmp = ((alpha + 1.0) * (1.0 / beta)) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4e+48) 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(alpha + 1.0) * Float64(1.0 / beta)) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 4e+48)
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
else
tmp = ((alpha + 1.0) * (1.0 / beta)) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 4e+48], 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[(alpha + 1.0), $MachinePrecision] * N[(1.0 / beta), $MachinePrecision]), $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 \cdot 10^{+48}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\beta + 2}}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\alpha + 1\right) \cdot \frac{1}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 4.00000000000000018e48Initial program 99.3%
Simplified94.4%
times-frac99.0%
+-commutative99.0%
Applied egg-rr99.0%
Taylor expanded in alpha around 0 71.2%
associate-/r*71.2%
+-commutative71.2%
+-commutative71.2%
Simplified71.2%
Taylor expanded in alpha around 0 71.3%
+-commutative71.3%
Simplified71.3%
frac-times71.3%
*-un-lft-identity71.3%
Applied egg-rr71.3%
if 4.00000000000000018e48 < beta Initial program 74.8%
Taylor expanded in beta around inf 85.1%
div-inv84.9%
+-commutative84.9%
metadata-eval84.9%
associate-+l+84.9%
metadata-eval84.9%
associate-+r+84.9%
Applied egg-rr84.9%
associate-*r/85.1%
*-commutative85.1%
*-lft-identity85.1%
+-commutative85.1%
+-commutative85.1%
+-commutative85.1%
+-commutative85.1%
Simplified85.1%
div-inv85.0%
+-commutative85.0%
Applied egg-rr85.0%
Final simplification75.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (* (/ (+ alpha 1.0) (+ alpha (+ beta 2.0))) (/ (/ (+ 1.0 beta) (+ beta 2.0)) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
return ((alpha + 1.0) / (alpha + (beta + 2.0))) * (((1.0 + beta) / (beta + 2.0)) / (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
code = ((alpha + 1.0d0) / (alpha + (beta + 2.0d0))) * (((1.0d0 + beta) / (beta + 2.0d0)) / (beta + 3.0d0))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return ((alpha + 1.0) / (alpha + (beta + 2.0))) * (((1.0 + beta) / (beta + 2.0)) / (beta + 3.0));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return ((alpha + 1.0) / (alpha + (beta + 2.0))) * (((1.0 + beta) / (beta + 2.0)) / (beta + 3.0))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(Float64(alpha + 1.0) / Float64(alpha + Float64(beta + 2.0))) * Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) / Float64(beta + 3.0))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = ((alpha + 1.0) / (alpha + (beta + 2.0))) * (((1.0 + beta) / (beta + 2.0)) / (beta + 3.0));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(N[(N[(alpha + 1.0), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{\alpha + 1}{\alpha + \left(\beta + 2\right)} \cdot \frac{\frac{1 + \beta}{\beta + 2}}{\beta + 3}
\end{array}
Initial program 92.5%
Simplified81.3%
times-frac95.3%
+-commutative95.3%
Applied egg-rr95.3%
Taylor expanded in alpha around 0 74.1%
associate-/r*75.0%
+-commutative75.0%
+-commutative75.0%
Simplified75.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2e+16) (/ (/ (+ 1.0 beta) (* (+ beta 2.0) (+ beta 3.0))) (+ beta 2.0)) (/ (* (+ alpha 1.0) (/ 1.0 beta)) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2e+16) {
tmp = ((1.0 + beta) / ((beta + 2.0) * (beta + 3.0))) / (beta + 2.0);
} else {
tmp = ((alpha + 1.0) * (1.0 / beta)) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2d+16) then
tmp = ((1.0d0 + beta) / ((beta + 2.0d0) * (beta + 3.0d0))) / (beta + 2.0d0)
else
tmp = ((alpha + 1.0d0) * (1.0d0 / beta)) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2e+16) {
tmp = ((1.0 + beta) / ((beta + 2.0) * (beta + 3.0))) / (beta + 2.0);
} else {
tmp = ((alpha + 1.0) * (1.0 / beta)) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2e+16: tmp = ((1.0 + beta) / ((beta + 2.0) * (beta + 3.0))) / (beta + 2.0) else: tmp = ((alpha + 1.0) * (1.0 / beta)) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2e+16) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(beta + 3.0))) / Float64(beta + 2.0)); else tmp = Float64(Float64(Float64(alpha + 1.0) * Float64(1.0 / beta)) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2e+16)
tmp = ((1.0 + beta) / ((beta + 2.0) * (beta + 3.0))) / (beta + 2.0);
else
tmp = ((alpha + 1.0) * (1.0 / beta)) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2e+16], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha + 1.0), $MachinePrecision] * N[(1.0 / beta), $MachinePrecision]), $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 \cdot 10^{+16}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}}{\beta + 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\alpha + 1\right) \cdot \frac{1}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 2e16Initial program 99.8%
Simplified94.7%
times-frac98.9%
+-commutative98.9%
Applied egg-rr98.9%
Taylor expanded in alpha around 0 71.9%
associate-/r*71.9%
+-commutative71.9%
+-commutative71.9%
Simplified71.9%
Taylor expanded in alpha around 0 72.0%
+-commutative72.0%
Simplified72.0%
associate-*l/72.0%
*-un-lft-identity72.0%
associate-/l/71.9%
Applied egg-rr71.9%
if 2e16 < beta Initial program 76.4%
Taylor expanded in beta around inf 82.0%
div-inv81.7%
+-commutative81.7%
metadata-eval81.7%
associate-+l+81.7%
metadata-eval81.7%
associate-+r+81.7%
Applied egg-rr81.7%
associate-*r/82.0%
*-commutative82.0%
*-lft-identity82.0%
+-commutative82.0%
+-commutative82.0%
+-commutative82.0%
+-commutative82.0%
Simplified82.0%
div-inv81.9%
+-commutative81.9%
Applied egg-rr81.9%
Final simplification75.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.0) (/ (+ 0.5 (* alpha 0.25)) (* (+ 3.0 (+ alpha beta)) (+ alpha 2.0))) (/ (* (+ alpha 1.0) (/ 1.0 beta)) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.0) {
tmp = (0.5 + (alpha * 0.25)) / ((3.0 + (alpha + beta)) * (alpha + 2.0));
} else {
tmp = ((alpha + 1.0) * (1.0 / beta)) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 4.0d0) then
tmp = (0.5d0 + (alpha * 0.25d0)) / ((3.0d0 + (alpha + beta)) * (alpha + 2.0d0))
else
tmp = ((alpha + 1.0d0) * (1.0d0 / beta)) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 4.0) {
tmp = (0.5 + (alpha * 0.25)) / ((3.0 + (alpha + beta)) * (alpha + 2.0));
} else {
tmp = ((alpha + 1.0) * (1.0 / beta)) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.0: tmp = (0.5 + (alpha * 0.25)) / ((3.0 + (alpha + beta)) * (alpha + 2.0)) else: tmp = ((alpha + 1.0) * (1.0 / beta)) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.0) tmp = Float64(Float64(0.5 + Float64(alpha * 0.25)) / Float64(Float64(3.0 + Float64(alpha + beta)) * Float64(alpha + 2.0))); else tmp = Float64(Float64(Float64(alpha + 1.0) * Float64(1.0 / beta)) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 4.0)
tmp = (0.5 + (alpha * 0.25)) / ((3.0 + (alpha + beta)) * (alpha + 2.0));
else
tmp = ((alpha + 1.0) * (1.0 / beta)) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 4.0], N[(N[(0.5 + N[(alpha * 0.25), $MachinePrecision]), $MachinePrecision] / N[(N[(3.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision] * N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha + 1.0), $MachinePrecision] * N[(1.0 / beta), $MachinePrecision]), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4:\\
\;\;\;\;\frac{0.5 + \alpha \cdot 0.25}{\left(3 + \left(\alpha + \beta\right)\right) \cdot \left(\alpha + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\alpha + 1\right) \cdot \frac{1}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 4Initial program 99.8%
associate-/l/98.9%
+-commutative98.9%
associate-+l+98.9%
*-commutative98.9%
metadata-eval98.9%
associate-+l+98.9%
metadata-eval98.9%
+-commutative98.9%
+-commutative98.9%
+-commutative98.9%
metadata-eval98.9%
metadata-eval98.9%
associate-+l+98.9%
Simplified98.9%
Taylor expanded in beta around 0 95.5%
Taylor expanded in beta around 0 96.9%
Taylor expanded in alpha around 0 84.1%
*-commutative84.1%
Simplified84.1%
if 4 < beta Initial program 76.7%
Taylor expanded in beta around inf 82.1%
div-inv81.9%
+-commutative81.9%
metadata-eval81.9%
associate-+l+81.9%
metadata-eval81.9%
associate-+r+81.9%
Applied egg-rr81.9%
associate-*r/82.1%
*-commutative82.1%
*-lft-identity82.1%
+-commutative82.1%
+-commutative82.1%
+-commutative82.1%
+-commutative82.1%
Simplified82.1%
div-inv82.1%
+-commutative82.1%
Applied egg-rr82.1%
Final simplification83.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 1.7)
(+
0.08333333333333333
(*
beta
(-
(* beta (- (* beta 0.024691358024691357) 0.011574074074074073))
0.027777777777777776)))
(/ (* (+ alpha 1.0) (/ 1.0 beta)) (+ alpha (+ beta 3.0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.7) {
tmp = 0.08333333333333333 + (beta * ((beta * ((beta * 0.024691358024691357) - 0.011574074074074073)) - 0.027777777777777776));
} else {
tmp = ((alpha + 1.0) * (1.0 / beta)) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.7d0) then
tmp = 0.08333333333333333d0 + (beta * ((beta * ((beta * 0.024691358024691357d0) - 0.011574074074074073d0)) - 0.027777777777777776d0))
else
tmp = ((alpha + 1.0d0) * (1.0d0 / beta)) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.7) {
tmp = 0.08333333333333333 + (beta * ((beta * ((beta * 0.024691358024691357) - 0.011574074074074073)) - 0.027777777777777776));
} else {
tmp = ((alpha + 1.0) * (1.0 / beta)) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.7: tmp = 0.08333333333333333 + (beta * ((beta * ((beta * 0.024691358024691357) - 0.011574074074074073)) - 0.027777777777777776)) else: tmp = ((alpha + 1.0) * (1.0 / beta)) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.7) tmp = Float64(0.08333333333333333 + Float64(beta * Float64(Float64(beta * Float64(Float64(beta * 0.024691358024691357) - 0.011574074074074073)) - 0.027777777777777776))); else tmp = Float64(Float64(Float64(alpha + 1.0) * Float64(1.0 / beta)) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.7)
tmp = 0.08333333333333333 + (beta * ((beta * ((beta * 0.024691358024691357) - 0.011574074074074073)) - 0.027777777777777776));
else
tmp = ((alpha + 1.0) * (1.0 / beta)) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.7], N[(0.08333333333333333 + N[(beta * N[(N[(beta * N[(N[(beta * 0.024691358024691357), $MachinePrecision] - 0.011574074074074073), $MachinePrecision]), $MachinePrecision] - 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha + 1.0), $MachinePrecision] * N[(1.0 / beta), $MachinePrecision]), $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 1.7:\\
\;\;\;\;0.08333333333333333 + \beta \cdot \left(\beta \cdot \left(\beta \cdot 0.024691358024691357 - 0.011574074074074073\right) - 0.027777777777777776\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\alpha + 1\right) \cdot \frac{1}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 1.69999999999999996Initial program 99.8%
Simplified94.7%
times-frac98.9%
+-commutative98.9%
Applied egg-rr98.9%
Taylor expanded in alpha around 0 71.8%
associate-/r*71.8%
+-commutative71.8%
+-commutative71.8%
Simplified71.8%
Taylor expanded in alpha around 0 71.8%
+-commutative71.8%
Simplified71.8%
Taylor expanded in beta around 0 71.0%
if 1.69999999999999996 < beta Initial program 76.7%
Taylor expanded in beta around inf 82.1%
div-inv81.9%
+-commutative81.9%
metadata-eval81.9%
associate-+l+81.9%
metadata-eval81.9%
associate-+r+81.9%
Applied egg-rr81.9%
associate-*r/82.1%
*-commutative82.1%
*-lft-identity82.1%
+-commutative82.1%
+-commutative82.1%
+-commutative82.1%
+-commutative82.1%
Simplified82.1%
div-inv82.1%
+-commutative82.1%
Applied egg-rr82.1%
Final simplification74.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 1.7)
(+
0.08333333333333333
(*
beta
(-
(* beta (- (* beta 0.024691358024691357) 0.011574074074074073))
0.027777777777777776)))
(/ (/ (+ alpha 1.0) beta) (+ alpha (+ beta 3.0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.7) {
tmp = 0.08333333333333333 + (beta * ((beta * ((beta * 0.024691358024691357) - 0.011574074074074073)) - 0.027777777777777776));
} else {
tmp = ((alpha + 1.0) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.7d0) then
tmp = 0.08333333333333333d0 + (beta * ((beta * ((beta * 0.024691358024691357d0) - 0.011574074074074073d0)) - 0.027777777777777776d0))
else
tmp = ((alpha + 1.0d0) / beta) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.7) {
tmp = 0.08333333333333333 + (beta * ((beta * ((beta * 0.024691358024691357) - 0.011574074074074073)) - 0.027777777777777776));
} else {
tmp = ((alpha + 1.0) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.7: tmp = 0.08333333333333333 + (beta * ((beta * ((beta * 0.024691358024691357) - 0.011574074074074073)) - 0.027777777777777776)) else: tmp = ((alpha + 1.0) / beta) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.7) tmp = Float64(0.08333333333333333 + Float64(beta * Float64(Float64(beta * Float64(Float64(beta * 0.024691358024691357) - 0.011574074074074073)) - 0.027777777777777776))); else tmp = Float64(Float64(Float64(alpha + 1.0) / beta) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.7)
tmp = 0.08333333333333333 + (beta * ((beta * ((beta * 0.024691358024691357) - 0.011574074074074073)) - 0.027777777777777776));
else
tmp = ((alpha + 1.0) / beta) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.7], N[(0.08333333333333333 + N[(beta * N[(N[(beta * N[(N[(beta * 0.024691358024691357), $MachinePrecision] - 0.011574074074074073), $MachinePrecision]), $MachinePrecision] - 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha + 1.0), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.7:\\
\;\;\;\;0.08333333333333333 + \beta \cdot \left(\beta \cdot \left(\beta \cdot 0.024691358024691357 - 0.011574074074074073\right) - 0.027777777777777776\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha + 1}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 1.69999999999999996Initial program 99.8%
Simplified94.7%
times-frac98.9%
+-commutative98.9%
Applied egg-rr98.9%
Taylor expanded in alpha around 0 71.8%
associate-/r*71.8%
+-commutative71.8%
+-commutative71.8%
Simplified71.8%
Taylor expanded in alpha around 0 71.8%
+-commutative71.8%
Simplified71.8%
Taylor expanded in beta around 0 71.0%
if 1.69999999999999996 < beta Initial program 76.7%
Taylor expanded in beta around inf 82.1%
div-inv81.9%
+-commutative81.9%
metadata-eval81.9%
associate-+l+81.9%
metadata-eval81.9%
associate-+r+81.9%
Applied egg-rr81.9%
associate-*r/82.1%
*-commutative82.1%
*-lft-identity82.1%
+-commutative82.1%
+-commutative82.1%
+-commutative82.1%
+-commutative82.1%
Simplified82.1%
Final simplification74.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 1.55)
(+
0.08333333333333333
(* beta (- (* beta -0.011574074074074073) 0.027777777777777776)))
(/ (/ (+ alpha 1.0) beta) (+ alpha (+ beta 3.0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.55) {
tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776));
} else {
tmp = ((alpha + 1.0) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.55d0) then
tmp = 0.08333333333333333d0 + (beta * ((beta * (-0.011574074074074073d0)) - 0.027777777777777776d0))
else
tmp = ((alpha + 1.0d0) / beta) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.55) {
tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776));
} else {
tmp = ((alpha + 1.0) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.55: tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776)) else: tmp = ((alpha + 1.0) / beta) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.55) tmp = Float64(0.08333333333333333 + Float64(beta * Float64(Float64(beta * -0.011574074074074073) - 0.027777777777777776))); else tmp = Float64(Float64(Float64(alpha + 1.0) / beta) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.55)
tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776));
else
tmp = ((alpha + 1.0) / beta) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.55], N[(0.08333333333333333 + N[(beta * N[(N[(beta * -0.011574074074074073), $MachinePrecision] - 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha + 1.0), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.55:\\
\;\;\;\;0.08333333333333333 + \beta \cdot \left(\beta \cdot -0.011574074074074073 - 0.027777777777777776\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha + 1}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 1.55000000000000004Initial program 99.8%
Simplified94.7%
times-frac98.9%
+-commutative98.9%
Applied egg-rr98.9%
Taylor expanded in alpha around 0 71.8%
associate-/r*71.8%
+-commutative71.8%
+-commutative71.8%
Simplified71.8%
Taylor expanded in alpha around 0 71.8%
+-commutative71.8%
Simplified71.8%
Taylor expanded in beta around 0 70.9%
if 1.55000000000000004 < beta Initial program 76.7%
Taylor expanded in beta around inf 82.1%
div-inv81.9%
+-commutative81.9%
metadata-eval81.9%
associate-+l+81.9%
metadata-eval81.9%
associate-+r+81.9%
Applied egg-rr81.9%
associate-*r/82.1%
*-commutative82.1%
*-lft-identity82.1%
+-commutative82.1%
+-commutative82.1%
+-commutative82.1%
+-commutative82.1%
Simplified82.1%
Final simplification74.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 1.55)
(+
0.08333333333333333
(* beta (- (* beta -0.011574074074074073) 0.027777777777777776)))
(/ (/ (+ alpha 1.0) beta) (+ beta 3.0))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.55) {
tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776));
} else {
tmp = ((alpha + 1.0) / beta) / (beta + 3.0);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.55d0) then
tmp = 0.08333333333333333d0 + (beta * ((beta * (-0.011574074074074073d0)) - 0.027777777777777776d0))
else
tmp = ((alpha + 1.0d0) / beta) / (beta + 3.0d0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.55) {
tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776));
} else {
tmp = ((alpha + 1.0) / beta) / (beta + 3.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.55: tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776)) else: tmp = ((alpha + 1.0) / beta) / (beta + 3.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.55) tmp = Float64(0.08333333333333333 + Float64(beta * Float64(Float64(beta * -0.011574074074074073) - 0.027777777777777776))); else tmp = Float64(Float64(Float64(alpha + 1.0) / beta) / Float64(beta + 3.0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.55)
tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776));
else
tmp = ((alpha + 1.0) / beta) / (beta + 3.0);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.55], N[(0.08333333333333333 + N[(beta * N[(N[(beta * -0.011574074074074073), $MachinePrecision] - 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha + 1.0), $MachinePrecision] / beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.55:\\
\;\;\;\;0.08333333333333333 + \beta \cdot \left(\beta \cdot -0.011574074074074073 - 0.027777777777777776\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha + 1}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 1.55000000000000004Initial program 99.8%
Simplified94.7%
times-frac98.9%
+-commutative98.9%
Applied egg-rr98.9%
Taylor expanded in alpha around 0 71.8%
associate-/r*71.8%
+-commutative71.8%
+-commutative71.8%
Simplified71.8%
Taylor expanded in alpha around 0 71.8%
+-commutative71.8%
Simplified71.8%
Taylor expanded in beta around 0 70.9%
if 1.55000000000000004 < beta Initial program 76.7%
Taylor expanded in beta around inf 82.1%
Taylor expanded in alpha around 0 81.9%
+-commutative81.9%
Simplified81.9%
Final simplification74.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 1.66)
(+
0.08333333333333333
(* beta (- (* beta -0.011574074074074073) 0.027777777777777776)))
(/ (/ (+ alpha 1.0) beta) beta)))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.66) {
tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776));
} else {
tmp = ((alpha + 1.0) / beta) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.66d0) then
tmp = 0.08333333333333333d0 + (beta * ((beta * (-0.011574074074074073d0)) - 0.027777777777777776d0))
else
tmp = ((alpha + 1.0d0) / beta) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.66) {
tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776));
} else {
tmp = ((alpha + 1.0) / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.66: tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776)) else: tmp = ((alpha + 1.0) / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.66) tmp = Float64(0.08333333333333333 + Float64(beta * Float64(Float64(beta * -0.011574074074074073) - 0.027777777777777776))); else tmp = Float64(Float64(Float64(alpha + 1.0) / beta) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.66)
tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776));
else
tmp = ((alpha + 1.0) / beta) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.66], N[(0.08333333333333333 + N[(beta * N[(N[(beta * -0.011574074074074073), $MachinePrecision] - 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha + 1.0), $MachinePrecision] / beta), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.66:\\
\;\;\;\;0.08333333333333333 + \beta \cdot \left(\beta \cdot -0.011574074074074073 - 0.027777777777777776\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha + 1}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 1.65999999999999992Initial program 99.8%
Simplified94.7%
times-frac98.9%
+-commutative98.9%
Applied egg-rr98.9%
Taylor expanded in alpha around 0 71.8%
associate-/r*71.8%
+-commutative71.8%
+-commutative71.8%
Simplified71.8%
Taylor expanded in alpha around 0 71.8%
+-commutative71.8%
Simplified71.8%
Taylor expanded in beta around 0 70.9%
if 1.65999999999999992 < beta Initial program 76.7%
Taylor expanded in beta around inf 82.1%
div-inv81.9%
+-commutative81.9%
metadata-eval81.9%
associate-+l+81.9%
metadata-eval81.9%
associate-+r+81.9%
Applied egg-rr81.9%
associate-*r/82.1%
*-commutative82.1%
*-lft-identity82.1%
+-commutative82.1%
+-commutative82.1%
+-commutative82.1%
+-commutative82.1%
Simplified82.1%
Taylor expanded in beta around inf 81.9%
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.8) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ (/ (+ alpha 1.0) beta) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.8) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((alpha + 1.0) / beta) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.8d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = ((alpha + 1.0d0) / beta) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.8) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((alpha + 1.0) / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.8: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = ((alpha + 1.0) / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.8) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(Float64(Float64(alpha + 1.0) / beta) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.8)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = ((alpha + 1.0) / beta) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.8], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha + 1.0), $MachinePrecision] / beta), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.8:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha + 1}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 2.7999999999999998Initial program 99.8%
associate-/l/98.9%
+-commutative98.9%
associate-+l+98.9%
*-commutative98.9%
metadata-eval98.9%
associate-+l+98.9%
metadata-eval98.9%
+-commutative98.9%
+-commutative98.9%
+-commutative98.9%
metadata-eval98.9%
metadata-eval98.9%
associate-+l+98.9%
Simplified98.9%
Taylor expanded in beta around 0 95.5%
Taylor expanded in beta around 0 96.9%
Taylor expanded in alpha around 0 70.5%
+-commutative70.5%
Simplified70.5%
Taylor expanded in beta around 0 70.6%
*-commutative70.6%
Simplified70.6%
if 2.7999999999999998 < beta Initial program 76.7%
Taylor expanded in beta around inf 82.1%
div-inv81.9%
+-commutative81.9%
metadata-eval81.9%
associate-+l+81.9%
metadata-eval81.9%
associate-+r+81.9%
Applied egg-rr81.9%
associate-*r/82.1%
*-commutative82.1%
*-lft-identity82.1%
+-commutative82.1%
+-commutative82.1%
+-commutative82.1%
+-commutative82.1%
Simplified82.1%
Taylor expanded in beta around inf 81.9%
Final simplification74.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.45) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ (/ 1.0 beta) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.45) {
tmp = 0.08333333333333333 + (beta * -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.45d0) then
tmp = 0.08333333333333333d0 + (beta * (-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.45) {
tmp = 0.08333333333333333 + (beta * -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.45: tmp = 0.08333333333333333 + (beta * -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.45) tmp = Float64(0.08333333333333333 + Float64(beta * -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.45)
tmp = 0.08333333333333333 + (beta * -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.45], N[(0.08333333333333333 + N[(beta * -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.45:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 2.4500000000000002Initial program 99.8%
associate-/l/98.9%
+-commutative98.9%
associate-+l+98.9%
*-commutative98.9%
metadata-eval98.9%
associate-+l+98.9%
metadata-eval98.9%
+-commutative98.9%
+-commutative98.9%
+-commutative98.9%
metadata-eval98.9%
metadata-eval98.9%
associate-+l+98.9%
Simplified98.9%
Taylor expanded in beta around 0 95.5%
Taylor expanded in beta around 0 96.9%
Taylor expanded in alpha around 0 70.5%
+-commutative70.5%
Simplified70.5%
Taylor expanded in beta around 0 70.6%
*-commutative70.6%
Simplified70.6%
if 2.4500000000000002 < beta Initial program 76.7%
Taylor expanded in beta around inf 82.1%
Taylor expanded in alpha around 0 73.5%
associate-/r*72.7%
+-commutative72.7%
Simplified72.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.45) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ 1.0 (* beta (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.45) {
tmp = 0.08333333333333333 + (beta * -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.45d0) then
tmp = 0.08333333333333333d0 + (beta * (-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.45) {
tmp = 0.08333333333333333 + (beta * -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.45: tmp = 0.08333333333333333 + (beta * -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.45) tmp = Float64(0.08333333333333333 + Float64(beta * -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 <= 2.45)
tmp = 0.08333333333333333 + (beta * -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.45], N[(0.08333333333333333 + N[(beta * -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 2.45:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 2.4500000000000002Initial program 99.8%
associate-/l/98.9%
+-commutative98.9%
associate-+l+98.9%
*-commutative98.9%
metadata-eval98.9%
associate-+l+98.9%
metadata-eval98.9%
+-commutative98.9%
+-commutative98.9%
+-commutative98.9%
metadata-eval98.9%
metadata-eval98.9%
associate-+l+98.9%
Simplified98.9%
Taylor expanded in beta around 0 95.5%
Taylor expanded in beta around 0 96.9%
Taylor expanded in alpha around 0 70.5%
+-commutative70.5%
Simplified70.5%
Taylor expanded in beta around 0 70.6%
*-commutative70.6%
Simplified70.6%
if 2.4500000000000002 < beta Initial program 76.7%
Taylor expanded in beta around inf 82.1%
Taylor expanded in alpha around 0 73.5%
Final simplification71.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.65) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ 0.25 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.65) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = 0.25 / 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.65d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = 0.25d0 / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.65) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = 0.25 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.65: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = 0.25 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.65) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(0.25 / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.65)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = 0.25 / 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.65], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(0.25 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.65:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{\beta}\\
\end{array}
\end{array}
if beta < 2.64999999999999991Initial program 99.8%
associate-/l/98.9%
+-commutative98.9%
associate-+l+98.9%
*-commutative98.9%
metadata-eval98.9%
associate-+l+98.9%
metadata-eval98.9%
+-commutative98.9%
+-commutative98.9%
+-commutative98.9%
metadata-eval98.9%
metadata-eval98.9%
associate-+l+98.9%
Simplified98.9%
Taylor expanded in beta around 0 95.5%
Taylor expanded in beta around 0 96.9%
Taylor expanded in alpha around 0 70.5%
+-commutative70.5%
Simplified70.5%
Taylor expanded in beta around 0 70.6%
*-commutative70.6%
Simplified70.6%
if 2.64999999999999991 < beta Initial program 76.7%
associate-/l/72.8%
+-commutative72.8%
associate-+l+72.8%
*-commutative72.8%
metadata-eval72.8%
associate-+l+72.8%
metadata-eval72.8%
+-commutative72.8%
+-commutative72.8%
+-commutative72.8%
metadata-eval72.8%
metadata-eval72.8%
associate-+l+72.8%
Simplified72.8%
Taylor expanded in beta around 0 49.7%
Taylor expanded in beta around 0 22.2%
Taylor expanded in alpha around 0 6.7%
+-commutative6.7%
Simplified6.7%
Taylor expanded in beta around inf 6.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.25 (+ beta 3.0)))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.25 / (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
code = 0.25d0 / (beta + 3.0d0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.25 / (beta + 3.0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.25 / (beta + 3.0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.25 / Float64(beta + 3.0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.25 / (beta + 3.0);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.25 / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.25}{\beta + 3}
\end{array}
Initial program 92.5%
associate-/l/90.7%
+-commutative90.7%
associate-+l+90.7%
*-commutative90.7%
metadata-eval90.7%
associate-+l+90.7%
metadata-eval90.7%
+-commutative90.7%
+-commutative90.7%
+-commutative90.7%
metadata-eval90.7%
metadata-eval90.7%
associate-+l+90.7%
Simplified90.7%
Taylor expanded in beta around 0 81.0%
Taylor expanded in beta around 0 73.3%
Taylor expanded in alpha around 0 50.3%
+-commutative50.3%
Simplified50.3%
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 92.5%
associate-/l/90.7%
+-commutative90.7%
associate-+l+90.7%
*-commutative90.7%
metadata-eval90.7%
associate-+l+90.7%
metadata-eval90.7%
+-commutative90.7%
+-commutative90.7%
+-commutative90.7%
metadata-eval90.7%
metadata-eval90.7%
associate-+l+90.7%
Simplified90.7%
Taylor expanded in beta around 0 81.0%
Taylor expanded in beta around 0 73.3%
Taylor expanded in alpha around 0 50.3%
+-commutative50.3%
Simplified50.3%
Taylor expanded in beta around 0 48.5%
herbie shell --seed 2024157
(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)))