
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t\_0}}{t\_0}}{t\_0 + 1}
\end{array}
\end{array}
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ alpha (+ beta 2.0)))) (* (/ (/ (+ 1.0 alpha) t_0) t_0) (/ (+ 1.0 beta) (+ alpha (+ beta 3.0))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return (((1.0 + alpha) / t_0) / t_0) * ((1.0 + beta) / (alpha + (beta + 3.0)));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = alpha + (beta + 2.0d0)
code = (((1.0d0 + alpha) / t_0) / t_0) * ((1.0d0 + beta) / (alpha + (beta + 3.0d0)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return (((1.0 + alpha) / t_0) / t_0) * ((1.0 + beta) / (alpha + (beta + 3.0)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return (((1.0 + alpha) / t_0) / t_0) * ((1.0 + beta) / (alpha + (beta + 3.0)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) return Float64(Float64(Float64(Float64(1.0 + alpha) / t_0) / t_0) * Float64(Float64(1.0 + beta) / Float64(alpha + Float64(beta + 3.0)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = (((1.0 + alpha) / t_0) / t_0) * ((1.0 + beta) / (alpha + (beta + 3.0)));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(1.0 + beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $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}}{t\_0} \cdot \frac{1 + \beta}{\alpha + \left(\beta + 3\right)}
\end{array}
\end{array}
Initial program 93.3%
Simplified82.8%
times-frac95.2%
+-commutative95.2%
Applied egg-rr95.2%
associate-*r/95.3%
+-commutative95.3%
+-commutative95.3%
+-commutative95.3%
+-commutative95.3%
+-commutative95.3%
+-commutative95.3%
+-commutative95.3%
+-commutative95.3%
+-commutative95.3%
+-commutative95.3%
Simplified95.3%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 3.0))) (t_1 (+ alpha (+ beta 2.0))))
(if (<= beta 3.1e+16)
(* (+ 1.0 alpha) (/ (/ (+ 1.0 beta) (* t_1 t_1)) t_0))
(* (/ (/ (+ 1.0 alpha) t_1) t_1) (/ beta t_0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 3.0);
double t_1 = alpha + (beta + 2.0);
double tmp;
if (beta <= 3.1e+16) {
tmp = (1.0 + alpha) * (((1.0 + beta) / (t_1 * t_1)) / t_0);
} else {
tmp = (((1.0 + alpha) / t_1) / t_1) * (beta / t_0);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = alpha + (beta + 3.0d0)
t_1 = alpha + (beta + 2.0d0)
if (beta <= 3.1d+16) then
tmp = (1.0d0 + alpha) * (((1.0d0 + beta) / (t_1 * t_1)) / t_0)
else
tmp = (((1.0d0 + alpha) / t_1) / t_1) * (beta / t_0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 3.0);
double t_1 = alpha + (beta + 2.0);
double tmp;
if (beta <= 3.1e+16) {
tmp = (1.0 + alpha) * (((1.0 + beta) / (t_1 * t_1)) / t_0);
} else {
tmp = (((1.0 + alpha) / t_1) / t_1) * (beta / t_0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 3.0) t_1 = alpha + (beta + 2.0) tmp = 0 if beta <= 3.1e+16: tmp = (1.0 + alpha) * (((1.0 + beta) / (t_1 * t_1)) / t_0) else: tmp = (((1.0 + alpha) / t_1) / t_1) * (beta / t_0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 3.0)) t_1 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 3.1e+16) tmp = Float64(Float64(1.0 + alpha) * Float64(Float64(Float64(1.0 + beta) / Float64(t_1 * t_1)) / t_0)); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / t_1) / t_1) * Float64(beta / t_0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 3.0);
t_1 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 3.1e+16)
tmp = (1.0 + alpha) * (((1.0 + beta) / (t_1 * t_1)) / t_0);
else
tmp = (((1.0 + alpha) / t_1) / t_1) * (beta / t_0);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 3.1e+16], N[(N[(1.0 + alpha), $MachinePrecision] * N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$1), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(beta / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 3\right)\\
t_1 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 3.1 \cdot 10^{+16}:\\
\;\;\;\;\left(1 + \alpha\right) \cdot \frac{\frac{1 + \beta}{t\_1 \cdot t\_1}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t\_1}}{t\_1} \cdot \frac{\beta}{t\_0}\\
\end{array}
\end{array}
if beta < 3.1e16Initial program 99.8%
Simplified93.7%
*-un-lft-identity93.7%
associate-/l*93.7%
+-commutative93.7%
associate-+r+93.7%
associate-*r*93.7%
pow293.7%
associate-+r+93.7%
Applied egg-rr93.7%
*-lft-identity93.7%
+-commutative93.7%
associate-/r*94.5%
+-commutative94.5%
+-commutative94.5%
+-commutative94.5%
+-commutative94.5%
+-commutative94.5%
+-commutative94.5%
Simplified94.5%
unpow294.5%
+-commutative94.5%
+-commutative94.5%
Applied egg-rr94.5%
if 3.1e16 < beta Initial program 80.1%
Simplified61.0%
times-frac86.3%
+-commutative86.3%
Applied egg-rr86.3%
associate-*r/86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
Simplified86.5%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in beta around inf 99.7%
Final simplification96.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))))
(if (<= beta 1.3e+19)
(/ (/ (+ 1.0 beta) (+ beta 2.0)) (* (+ beta 2.0) (+ beta 3.0)))
(* (/ (/ (+ 1.0 alpha) t_0) t_0) (/ beta (+ alpha (+ beta 3.0)))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 1.3e+19) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = (((1.0 + alpha) / t_0) / t_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) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 1.3d+19) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = (((1.0d0 + alpha) / t_0) / t_0) * (beta / (alpha + (beta + 3.0d0)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 1.3e+19) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = (((1.0 + alpha) / t_0) / t_0) * (beta / (alpha + (beta + 3.0)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 1.3e+19: tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)) else: tmp = (((1.0 + alpha) / t_0) / t_0) * (beta / (alpha + (beta + 3.0))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 1.3e+19) 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(Float64(1.0 + alpha) / t_0) / t_0) * Float64(beta / Float64(alpha + Float64(beta + 3.0)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 1.3e+19)
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
else
tmp = (((1.0 + alpha) / t_0) / t_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_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 1.3e+19], 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[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(beta / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 1.3 \cdot 10^{+19}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\beta + 2}}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t\_0}}{t\_0} \cdot \frac{\beta}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 1.3e19Initial program 99.8%
Simplified93.7%
times-frac99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in alpha around 0 83.0%
+-commutative83.0%
Simplified83.0%
Taylor expanded in alpha around 0 58.7%
+-commutative58.7%
+-commutative58.7%
Simplified58.7%
if 1.3e19 < beta Initial program 80.1%
Simplified61.0%
times-frac86.3%
+-commutative86.3%
Applied egg-rr86.3%
associate-*r/86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
Simplified86.5%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in beta around inf 99.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 9.8e+14)
(/ (/ (+ 1.0 beta) (+ beta 2.0)) (* (+ beta 2.0) (+ beta 3.0)))
(*
(/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 2.0)))
(- 1.0 (/ (+ alpha 2.0) beta)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 9.8e+14) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = (((1.0 + alpha) / beta) / (alpha + (beta + 2.0))) * (1.0 - ((alpha + 2.0) / beta));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 9.8d+14) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = (((1.0d0 + alpha) / beta) / (alpha + (beta + 2.0d0))) * (1.0d0 - ((alpha + 2.0d0) / beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 9.8e+14) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = (((1.0 + alpha) / beta) / (alpha + (beta + 2.0))) * (1.0 - ((alpha + 2.0) / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 9.8e+14: tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)) else: tmp = (((1.0 + alpha) / beta) / (alpha + (beta + 2.0))) * (1.0 - ((alpha + 2.0) / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 9.8e+14) 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(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 2.0))) * Float64(1.0 - Float64(Float64(alpha + 2.0) / beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 9.8e+14)
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
else
tmp = (((1.0 + alpha) / beta) / (alpha + (beta + 2.0))) * (1.0 - ((alpha + 2.0) / beta));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 9.8e+14], 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[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(alpha + 2.0), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 9.8 \cdot 10^{+14}:\\
\;\;\;\;\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 + 2\right)} \cdot \left(1 - \frac{\alpha + 2}{\beta}\right)\\
\end{array}
\end{array}
if beta < 9.8e14Initial program 99.8%
Simplified93.7%
times-frac99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in alpha around 0 82.9%
+-commutative82.9%
Simplified82.9%
Taylor expanded in alpha around 0 58.5%
+-commutative58.5%
+-commutative58.5%
Simplified58.5%
if 9.8e14 < beta Initial program 80.3%
Simplified61.4%
times-frac86.5%
+-commutative86.5%
Applied egg-rr86.5%
associate-*r/86.7%
+-commutative86.7%
+-commutative86.7%
+-commutative86.7%
+-commutative86.7%
+-commutative86.7%
+-commutative86.7%
+-commutative86.7%
+-commutative86.7%
+-commutative86.7%
+-commutative86.7%
Simplified86.7%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in beta around inf 80.5%
Taylor expanded in beta around inf 79.4%
associate-*r/79.4%
mul-1-neg79.4%
Simplified79.4%
Final simplification65.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 1.8e+16)
(/ (/ (+ 1.0 beta) (+ beta 2.0)) (* (+ beta 2.0) (+ beta 3.0)))
(*
(/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 2.0)))
(/ (+ 1.0 beta) (+ alpha beta)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.8e+16) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = (((1.0 + alpha) / beta) / (alpha + (beta + 2.0))) * ((1.0 + beta) / (alpha + beta));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.8d+16) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = (((1.0d0 + alpha) / beta) / (alpha + (beta + 2.0d0))) * ((1.0d0 + beta) / (alpha + beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.8e+16) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = (((1.0 + alpha) / beta) / (alpha + (beta + 2.0))) * ((1.0 + beta) / (alpha + beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.8e+16: tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)) else: tmp = (((1.0 + alpha) / beta) / (alpha + (beta + 2.0))) * ((1.0 + beta) / (alpha + beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.8e+16) 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(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 2.0))) * Float64(Float64(1.0 + beta) / Float64(alpha + beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.8e+16)
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
else
tmp = (((1.0 + alpha) / beta) / (alpha + (beta + 2.0))) * ((1.0 + beta) / (alpha + beta));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.8e+16], 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[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + beta), $MachinePrecision] / N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.8 \cdot 10^{+16}:\\
\;\;\;\;\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 + 2\right)} \cdot \frac{1 + \beta}{\alpha + \beta}\\
\end{array}
\end{array}
if beta < 1.8e16Initial program 99.8%
Simplified93.7%
times-frac99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in alpha around 0 83.0%
+-commutative83.0%
Simplified83.0%
Taylor expanded in alpha around 0 58.7%
+-commutative58.7%
+-commutative58.7%
Simplified58.7%
if 1.8e16 < beta Initial program 80.1%
Simplified61.0%
times-frac86.3%
+-commutative86.3%
Applied egg-rr86.3%
associate-*r/86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
Simplified86.5%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in beta around inf 80.3%
Taylor expanded in beta around inf 80.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1e+16) (/ (/ (+ 1.0 beta) (+ beta 2.0)) (* (+ beta 2.0) (+ beta 3.0))) (/ (/ (- -1.0 alpha) beta) (* beta (+ (/ (- -3.0 alpha) beta) -1.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1e+16) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((-1.0 - alpha) / beta) / (beta * (((-3.0 - alpha) / beta) + -1.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 <= 1d+16) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = (((-1.0d0) - alpha) / beta) / (beta * ((((-3.0d0) - alpha) / beta) + (-1.0d0)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1e+16) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((-1.0 - alpha) / beta) / (beta * (((-3.0 - alpha) / beta) + -1.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1e+16: tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)) else: tmp = ((-1.0 - alpha) / beta) / (beta * (((-3.0 - alpha) / beta) + -1.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1e+16) 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(beta * Float64(Float64(Float64(-3.0 - alpha) / beta) + -1.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1e+16)
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
else
tmp = ((-1.0 - alpha) / beta) / (beta * (((-3.0 - alpha) / beta) + -1.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, 1e+16], 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[(beta * N[(N[(N[(-3.0 - alpha), $MachinePrecision] / beta), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 10^{+16}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\beta + 2}}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-1 - \alpha}{\beta}}{\beta \cdot \left(\frac{-3 - \alpha}{\beta} + -1\right)}\\
\end{array}
\end{array}
if beta < 1e16Initial program 99.8%
Simplified93.7%
times-frac99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in alpha around 0 82.9%
+-commutative82.9%
Simplified82.9%
Taylor expanded in alpha around 0 58.5%
+-commutative58.5%
+-commutative58.5%
Simplified58.5%
if 1e16 < beta Initial program 80.3%
Taylor expanded in beta around inf 80.0%
Taylor expanded in beta around -inf 80.0%
associate-*r*80.0%
mul-1-neg80.0%
sub-neg80.0%
associate-*r/80.0%
distribute-lft-in80.0%
metadata-eval80.0%
metadata-eval80.0%
mul-1-neg80.0%
unsub-neg80.0%
metadata-eval80.0%
metadata-eval80.0%
Simplified80.0%
Final simplification65.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 5.4e+15) (/ (/ (+ 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 <= 5.4e+15) {
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 <= 5.4d+15) 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 <= 5.4e+15) {
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 <= 5.4e+15: 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 <= 5.4e+15) 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 <= 5.4e+15)
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, 5.4e+15], 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 5.4 \cdot 10^{+15}:\\
\;\;\;\;\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 < 5.4e15Initial program 99.8%
Simplified93.7%
times-frac99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in alpha around 0 82.9%
+-commutative82.9%
Simplified82.9%
Taylor expanded in alpha around 0 58.5%
+-commutative58.5%
+-commutative58.5%
Simplified58.5%
if 5.4e15 < beta Initial program 80.3%
Taylor expanded in beta around inf 80.0%
Taylor expanded in alpha around 0 80.0%
+-commutative80.0%
associate-+r+80.0%
+-commutative80.0%
+-commutative80.0%
+-commutative80.0%
Simplified80.0%
Final simplification65.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 3.0))))
(if (<= beta 6.1)
(/ 0.5 (* (+ beta 2.0) t_0))
(/ (/ (+ 1.0 alpha) beta) t_0))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 3.0);
double tmp;
if (beta <= 6.1) {
tmp = 0.5 / ((beta + 2.0) * t_0);
} else {
tmp = ((1.0 + alpha) / beta) / t_0;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 3.0d0)
if (beta <= 6.1d0) then
tmp = 0.5d0 / ((beta + 2.0d0) * t_0)
else
tmp = ((1.0d0 + alpha) / beta) / t_0
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 3.0);
double tmp;
if (beta <= 6.1) {
tmp = 0.5 / ((beta + 2.0) * t_0);
} else {
tmp = ((1.0 + alpha) / beta) / t_0;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 3.0) tmp = 0 if beta <= 6.1: tmp = 0.5 / ((beta + 2.0) * t_0) else: tmp = ((1.0 + alpha) / beta) / t_0 return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 3.0)) tmp = 0.0 if (beta <= 6.1) tmp = Float64(0.5 / Float64(Float64(beta + 2.0) * t_0)); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / t_0); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 3.0);
tmp = 0.0;
if (beta <= 6.1)
tmp = 0.5 / ((beta + 2.0) * t_0);
else
tmp = ((1.0 + alpha) / beta) / t_0;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 6.1], N[(0.5 / N[(N[(beta + 2.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 3\right)\\
\mathbf{if}\;\beta \leq 6.1:\\
\;\;\;\;\frac{0.5}{\left(\beta + 2\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{t\_0}\\
\end{array}
\end{array}
if beta < 6.0999999999999996Initial program 99.8%
Simplified94.0%
times-frac99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in alpha around 0 82.9%
+-commutative82.9%
Simplified82.9%
Taylor expanded in beta around 0 80.5%
Taylor expanded in alpha around 0 58.3%
+-commutative58.3%
Simplified58.3%
if 6.0999999999999996 < beta Initial program 81.5%
Taylor expanded in beta around inf 76.1%
Taylor expanded in alpha around 0 76.1%
+-commutative76.1%
associate-+r+76.1%
+-commutative76.1%
+-commutative76.1%
+-commutative76.1%
Simplified76.1%
Final simplification64.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 6.2) (/ 0.5 (* (+ beta 2.0) (+ alpha (+ beta 3.0)))) (/ (/ (+ 1.0 alpha) beta) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 6.2) {
tmp = 0.5 / ((beta + 2.0) * (alpha + (beta + 3.0)));
} 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 <= 6.2d0) then
tmp = 0.5d0 / ((beta + 2.0d0) * (alpha + (beta + 3.0d0)))
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 <= 6.2) {
tmp = 0.5 / ((beta + 2.0) * (alpha + (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + 3.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 6.2: tmp = 0.5 / ((beta + 2.0) * (alpha + (beta + 3.0))) 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 <= 6.2) tmp = Float64(0.5 / Float64(Float64(beta + 2.0) * Float64(alpha + Float64(beta + 3.0)))); 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 <= 6.2)
tmp = 0.5 / ((beta + 2.0) * (alpha + (beta + 3.0)));
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, 6.2], N[(0.5 / N[(N[(beta + 2.0), $MachinePrecision] * N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $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 6.2:\\
\;\;\;\;\frac{0.5}{\left(\beta + 2\right) \cdot \left(\alpha + \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 6.20000000000000018Initial program 99.8%
Simplified94.0%
times-frac99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in alpha around 0 82.9%
+-commutative82.9%
Simplified82.9%
Taylor expanded in beta around 0 80.5%
Taylor expanded in alpha around 0 58.3%
+-commutative58.3%
Simplified58.3%
if 6.20000000000000018 < beta Initial program 81.5%
Taylor expanded in beta around inf 76.1%
Taylor expanded in alpha around 0 75.8%
+-commutative75.8%
Simplified75.8%
Final simplification64.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 32.0) (/ 0.5 (* (+ alpha (+ beta 3.0)) (+ alpha 2.0))) (/ (/ (+ 1.0 alpha) beta) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 32.0) {
tmp = 0.5 / ((alpha + (beta + 3.0)) * (alpha + 2.0));
} 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 <= 32.0d0) then
tmp = 0.5d0 / ((alpha + (beta + 3.0d0)) * (alpha + 2.0d0))
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 <= 32.0) {
tmp = 0.5 / ((alpha + (beta + 3.0)) * (alpha + 2.0));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + 3.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 32.0: tmp = 0.5 / ((alpha + (beta + 3.0)) * (alpha + 2.0)) 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 <= 32.0) tmp = Float64(0.5 / Float64(Float64(alpha + Float64(beta + 3.0)) * Float64(alpha + 2.0))); 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 <= 32.0)
tmp = 0.5 / ((alpha + (beta + 3.0)) * (alpha + 2.0));
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, 32.0], N[(0.5 / N[(N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision] * N[(alpha + 2.0), $MachinePrecision]), $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 32:\\
\;\;\;\;\frac{0.5}{\left(\alpha + \left(\beta + 3\right)\right) \cdot \left(\alpha + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 32Initial program 99.8%
Simplified94.0%
times-frac99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in alpha around 0 82.9%
+-commutative82.9%
Simplified82.9%
Taylor expanded in beta around 0 80.5%
Taylor expanded in beta around 0 81.4%
if 32 < beta Initial program 81.5%
Taylor expanded in beta around inf 76.1%
Taylor expanded in alpha around 0 75.8%
+-commutative75.8%
Simplified75.8%
Final simplification79.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.6) (/ 0.5 (* (+ beta 2.0) (+ beta 3.0))) (/ (/ (+ 1.0 alpha) beta) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.6) {
tmp = 0.5 / ((beta + 2.0) * (beta + 3.0));
} 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 <= 4.6d0) then
tmp = 0.5d0 / ((beta + 2.0d0) * (beta + 3.0d0))
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 <= 4.6) {
tmp = 0.5 / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + 3.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.6: tmp = 0.5 / ((beta + 2.0) * (beta + 3.0)) 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 <= 4.6) tmp = Float64(0.5 / Float64(Float64(beta + 2.0) * Float64(beta + 3.0))); 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 <= 4.6)
tmp = 0.5 / ((beta + 2.0) * (beta + 3.0));
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, 4.6], N[(0.5 / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $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 4.6:\\
\;\;\;\;\frac{0.5}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 4.5999999999999996Initial program 99.8%
Simplified94.0%
times-frac99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in alpha around 0 82.9%
+-commutative82.9%
Simplified82.9%
Taylor expanded in beta around 0 80.5%
Taylor expanded in alpha around 0 56.4%
+-commutative56.4%
+-commutative56.4%
Simplified56.4%
if 4.5999999999999996 < beta Initial program 81.5%
Taylor expanded in beta around inf 76.1%
Taylor expanded in alpha around 0 75.8%
+-commutative75.8%
Simplified75.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.5) (/ 0.5 (* (+ beta 2.0) (+ beta 3.0))) (/ (/ 1.0 beta) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.5) {
tmp = 0.5 / ((beta + 2.0) * (beta + 3.0));
} 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 <= 4.5d0) then
tmp = 0.5d0 / ((beta + 2.0d0) * (beta + 3.0d0))
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 <= 4.5) {
tmp = 0.5 / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = (1.0 / beta) / (beta + 3.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.5: tmp = 0.5 / ((beta + 2.0) * (beta + 3.0)) else: tmp = (1.0 / beta) / (beta + 3.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.5) tmp = Float64(0.5 / Float64(Float64(beta + 2.0) * Float64(beta + 3.0))); 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 <= 4.5)
tmp = 0.5 / ((beta + 2.0) * (beta + 3.0));
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, 4.5], N[(0.5 / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $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 4.5:\\
\;\;\;\;\frac{0.5}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 4.5Initial program 99.8%
Simplified94.0%
times-frac99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in alpha around 0 82.9%
+-commutative82.9%
Simplified82.9%
Taylor expanded in beta around 0 80.5%
Taylor expanded in alpha around 0 56.4%
+-commutative56.4%
+-commutative56.4%
Simplified56.4%
if 4.5 < beta Initial program 81.5%
Taylor expanded in beta around inf 76.1%
div-inv76.0%
metadata-eval76.0%
associate-+l+76.0%
metadata-eval76.0%
associate-+r+76.0%
Applied egg-rr76.0%
Taylor expanded in alpha around inf 76.0%
Taylor expanded in alpha around 0 70.9%
associate-/r*71.4%
+-commutative71.4%
Simplified71.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.7) (/ 0.5 (* (+ alpha 2.0) (+ alpha 3.0))) (/ (/ 1.0 beta) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.7) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} 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.7d0) then
tmp = 0.5d0 / ((alpha + 2.0d0) * (alpha + 3.0d0))
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.7) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = (1.0 / beta) / (beta + 3.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.7: tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0)) 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.7) tmp = Float64(0.5 / Float64(Float64(alpha + 2.0) * Float64(alpha + 3.0))); 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.7)
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
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.7], N[(0.5 / N[(N[(alpha + 2.0), $MachinePrecision] * N[(alpha + 3.0), $MachinePrecision]), $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.7:\\
\;\;\;\;\frac{0.5}{\left(\alpha + 2\right) \cdot \left(\alpha + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 2.7000000000000002Initial program 99.8%
Simplified94.0%
times-frac99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*r/99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in alpha around 0 82.9%
+-commutative82.9%
Simplified82.9%
Taylor expanded in beta around 0 80.6%
if 2.7000000000000002 < beta Initial program 81.5%
Taylor expanded in beta around inf 76.1%
div-inv76.0%
metadata-eval76.0%
associate-+l+76.0%
metadata-eval76.0%
associate-+r+76.0%
Applied egg-rr76.0%
Taylor expanded in alpha around inf 76.0%
Taylor expanded in alpha around 0 70.9%
associate-/r*71.4%
+-commutative71.4%
Simplified71.4%
Final simplification77.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ (/ 1.0 beta) (+ beta 3.0)))
assert(alpha < beta);
double code(double alpha, double beta) {
return (1.0 / beta) / (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 = (1.0d0 / beta) / (beta + 3.0d0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return (1.0 / beta) / (beta + 3.0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return (1.0 / beta) / (beta + 3.0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(1.0 / beta) / Float64(beta + 3.0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = (1.0 / beta) / (beta + 3.0);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(N[(1.0 / beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{\frac{1}{\beta}}{\beta + 3}
\end{array}
Initial program 93.3%
Taylor expanded in beta around inf 29.3%
div-inv29.3%
metadata-eval29.3%
associate-+l+29.3%
metadata-eval29.3%
associate-+r+29.3%
Applied egg-rr29.3%
Taylor expanded in alpha around inf 29.3%
Taylor expanded in alpha around 0 27.5%
associate-/r*27.7%
+-commutative27.7%
Simplified27.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 1.0 (* beta (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
return 1.0 / (beta * (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 = 1.0d0 / (beta * (beta + 3.0d0))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 1.0 / (beta * (beta + 3.0));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 1.0 / (beta * (beta + 3.0))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(1.0 / Float64(beta * Float64(beta + 3.0))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 1.0 / (beta * (beta + 3.0));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(1.0 / N[(beta * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{1}{\beta \cdot \left(\beta + 3\right)}
\end{array}
Initial program 93.3%
Taylor expanded in beta around inf 29.3%
Taylor expanded in alpha around 0 27.5%
+-commutative27.5%
Simplified27.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 1.0 (* beta beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
return 1.0 / (beta * beta);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 1.0d0 / (beta * beta)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 1.0 / (beta * beta);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 1.0 / (beta * beta)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(1.0 / Float64(beta * beta)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 1.0 / (beta * beta);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(1.0 / N[(beta * beta), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{1}{\beta \cdot \beta}
\end{array}
Initial program 93.3%
Taylor expanded in beta around inf 29.3%
Taylor expanded in alpha around 0 27.5%
+-commutative27.5%
Simplified27.5%
Taylor expanded in beta around inf 27.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.3333333333333333 beta))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.3333333333333333 / beta;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.3333333333333333d0 / beta
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.3333333333333333 / beta;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.3333333333333333 / beta
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.3333333333333333 / beta) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.3333333333333333 / beta;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.3333333333333333 / beta), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.3333333333333333}{\beta}
\end{array}
Initial program 93.3%
Taylor expanded in beta around inf 29.3%
Taylor expanded in alpha around 0 27.5%
+-commutative27.5%
Simplified27.5%
Taylor expanded in beta around 0 4.5%
herbie shell --seed 2024123
(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)))