
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t_0}}{t_0}}{t_0 + 1}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t_0}}{t_0}}{t_0 + 1}
\end{array}
\end{array}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ 2.0 (+ beta alpha))) (t_1 (+ alpha (+ beta 2.0))))
(if (<= beta 5e+45)
(* (/ (+ 1.0 alpha) t_1) (/ (+ 1.0 beta) (* t_1 (+ alpha (+ beta 3.0)))))
(* (/ beta t_0) (/ (/ (+ 1.0 alpha) (+ 3.0 (+ beta alpha))) t_0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = 2.0 + (beta + alpha);
double t_1 = alpha + (beta + 2.0);
double tmp;
if (beta <= 5e+45) {
tmp = ((1.0 + alpha) / t_1) * ((1.0 + beta) / (t_1 * (alpha + (beta + 3.0))));
} else {
tmp = (beta / t_0) * (((1.0 + alpha) / (3.0 + (beta + alpha))) / 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 = 2.0d0 + (beta + alpha)
t_1 = alpha + (beta + 2.0d0)
if (beta <= 5d+45) then
tmp = ((1.0d0 + alpha) / t_1) * ((1.0d0 + beta) / (t_1 * (alpha + (beta + 3.0d0))))
else
tmp = (beta / t_0) * (((1.0d0 + alpha) / (3.0d0 + (beta + alpha))) / t_0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = 2.0 + (beta + alpha);
double t_1 = alpha + (beta + 2.0);
double tmp;
if (beta <= 5e+45) {
tmp = ((1.0 + alpha) / t_1) * ((1.0 + beta) / (t_1 * (alpha + (beta + 3.0))));
} else {
tmp = (beta / t_0) * (((1.0 + alpha) / (3.0 + (beta + alpha))) / t_0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = 2.0 + (beta + alpha) t_1 = alpha + (beta + 2.0) tmp = 0 if beta <= 5e+45: tmp = ((1.0 + alpha) / t_1) * ((1.0 + beta) / (t_1 * (alpha + (beta + 3.0)))) else: tmp = (beta / t_0) * (((1.0 + alpha) / (3.0 + (beta + alpha))) / t_0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(2.0 + Float64(beta + alpha)) t_1 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 5e+45) tmp = Float64(Float64(Float64(1.0 + alpha) / t_1) * Float64(Float64(1.0 + beta) / Float64(t_1 * Float64(alpha + Float64(beta + 3.0))))); else tmp = Float64(Float64(beta / t_0) * Float64(Float64(Float64(1.0 + alpha) / Float64(3.0 + Float64(beta + alpha))) / t_0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = 2.0 + (beta + alpha);
t_1 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 5e+45)
tmp = ((1.0 + alpha) / t_1) * ((1.0 + beta) / (t_1 * (alpha + (beta + 3.0))));
else
tmp = (beta / t_0) * (((1.0 + alpha) / (3.0 + (beta + alpha))) / 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[(2.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 5e+45], N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(N[(1.0 + beta), $MachinePrecision] / N[(t$95$1 * N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(beta / t$95$0), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(3.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := 2 + \left(\beta + \alpha\right)\\
t_1 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 5 \cdot 10^{+45}:\\
\;\;\;\;\frac{1 + \alpha}{t_1} \cdot \frac{1 + \beta}{t_1 \cdot \left(\alpha + \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\beta}{t_0} \cdot \frac{\frac{1 + \alpha}{3 + \left(\beta + \alpha\right)}}{t_0}\\
\end{array}
\end{array}
if beta < 5e45Initial program 99.8%
Simplified99.0%
if 5e45 < beta Initial program 85.4%
Simplified63.5%
Taylor expanded in beta around inf 63.5%
times-frac86.9%
associate-+r+86.9%
+-commutative86.9%
+-commutative86.9%
*-commutative86.9%
associate-+r+86.9%
+-commutative86.9%
associate-+r+86.9%
+-commutative86.9%
+-commutative86.9%
Applied egg-rr86.9%
+-commutative86.9%
associate-/r*99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
Final simplification99.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ 2.0 (+ beta alpha))))
(if (<= beta 8200000000000.0)
(/ (+ 1.0 beta) (* (+ beta 3.0) (+ 4.0 (* beta (+ beta 4.0)))))
(* (/ beta t_0) (/ (/ (+ 1.0 alpha) (+ 3.0 (+ beta alpha))) t_0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = 2.0 + (beta + alpha);
double tmp;
if (beta <= 8200000000000.0) {
tmp = (1.0 + beta) / ((beta + 3.0) * (4.0 + (beta * (beta + 4.0))));
} else {
tmp = (beta / t_0) * (((1.0 + alpha) / (3.0 + (beta + alpha))) / 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 = 2.0d0 + (beta + alpha)
if (beta <= 8200000000000.0d0) then
tmp = (1.0d0 + beta) / ((beta + 3.0d0) * (4.0d0 + (beta * (beta + 4.0d0))))
else
tmp = (beta / t_0) * (((1.0d0 + alpha) / (3.0d0 + (beta + alpha))) / t_0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = 2.0 + (beta + alpha);
double tmp;
if (beta <= 8200000000000.0) {
tmp = (1.0 + beta) / ((beta + 3.0) * (4.0 + (beta * (beta + 4.0))));
} else {
tmp = (beta / t_0) * (((1.0 + alpha) / (3.0 + (beta + alpha))) / t_0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = 2.0 + (beta + alpha) tmp = 0 if beta <= 8200000000000.0: tmp = (1.0 + beta) / ((beta + 3.0) * (4.0 + (beta * (beta + 4.0)))) else: tmp = (beta / t_0) * (((1.0 + alpha) / (3.0 + (beta + alpha))) / t_0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(2.0 + Float64(beta + alpha)) tmp = 0.0 if (beta <= 8200000000000.0) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 3.0) * Float64(4.0 + Float64(beta * Float64(beta + 4.0))))); else tmp = Float64(Float64(beta / t_0) * Float64(Float64(Float64(1.0 + alpha) / Float64(3.0 + Float64(beta + alpha))) / t_0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = 2.0 + (beta + alpha);
tmp = 0.0;
if (beta <= 8200000000000.0)
tmp = (1.0 + beta) / ((beta + 3.0) * (4.0 + (beta * (beta + 4.0))));
else
tmp = (beta / t_0) * (((1.0 + alpha) / (3.0 + (beta + alpha))) / 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[(2.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 8200000000000.0], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(4.0 + N[(beta * N[(beta + 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(beta / t$95$0), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(3.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := 2 + \left(\beta + \alpha\right)\\
\mathbf{if}\;\beta \leq 8200000000000:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 3\right) \cdot \left(4 + \beta \cdot \left(\beta + 4\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\beta}{t_0} \cdot \frac{\frac{1 + \alpha}{3 + \left(\beta + \alpha\right)}}{t_0}\\
\end{array}
\end{array}
if beta < 8.2e12Initial program 99.8%
Simplified99.2%
Taylor expanded in alpha around 0 61.3%
Taylor expanded in beta around 0 61.3%
+-commutative61.3%
unpow261.3%
distribute-rgt-out61.3%
Simplified61.3%
if 8.2e12 < beta Initial program 86.5%
Simplified66.0%
Taylor expanded in beta around inf 66.0%
times-frac87.6%
associate-+r+87.6%
+-commutative87.6%
+-commutative87.6%
*-commutative87.6%
associate-+r+87.6%
+-commutative87.6%
associate-+r+87.6%
+-commutative87.6%
+-commutative87.6%
Applied egg-rr87.6%
+-commutative87.6%
associate-/r*99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Final simplification74.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ alpha (+ beta 2.0)))) (* (/ (/ (+ 1.0 beta) t_0) (+ alpha (+ beta 3.0))) (/ (+ 1.0 alpha) t_0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return (((1.0 + beta) / t_0) / (alpha + (beta + 3.0))) * ((1.0 + alpha) / t_0);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = alpha + (beta + 2.0d0)
code = (((1.0d0 + beta) / t_0) / (alpha + (beta + 3.0d0))) * ((1.0d0 + alpha) / t_0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return (((1.0 + beta) / t_0) / (alpha + (beta + 3.0))) * ((1.0 + alpha) / t_0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return (((1.0 + beta) / t_0) / (alpha + (beta + 3.0))) * ((1.0 + alpha) / t_0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) return Float64(Float64(Float64(Float64(1.0 + beta) / t_0) / Float64(alpha + Float64(beta + 3.0))) * Float64(Float64(1.0 + alpha) / t_0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = (((1.0 + beta) / t_0) / (alpha + (beta + 3.0))) * ((1.0 + alpha) / t_0);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\frac{\frac{1 + \beta}{t_0}}{\alpha + \left(\beta + 3\right)} \cdot \frac{1 + \alpha}{t_0}
\end{array}
\end{array}
Initial program 95.2%
Simplified95.1%
clear-num95.1%
associate-+r+95.1%
*-commutative95.1%
frac-times90.8%
*-un-lft-identity90.8%
+-commutative90.8%
*-commutative90.8%
associate-+r+90.8%
Applied egg-rr90.8%
associate-/r*95.2%
associate-/l*93.4%
associate-*l/95.1%
*-commutative95.1%
times-frac99.7%
associate-/r*95.1%
*-commutative95.1%
associate-/r*99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Final simplification99.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 4.8)
(*
(/ (+ 1.0 alpha) (+ alpha (+ beta 2.0)))
(+ 0.16666666666666666 (* alpha -0.1388888888888889)))
(/ (/ (+ 1.0 alpha) beta) (+ 3.0 (+ beta alpha)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.8) {
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) * (0.16666666666666666 + (alpha * -0.1388888888888889));
} else {
tmp = ((1.0 + alpha) / beta) / (3.0 + (beta + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 4.8d0) then
tmp = ((1.0d0 + alpha) / (alpha + (beta + 2.0d0))) * (0.16666666666666666d0 + (alpha * (-0.1388888888888889d0)))
else
tmp = ((1.0d0 + alpha) / beta) / (3.0d0 + (beta + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 4.8) {
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) * (0.16666666666666666 + (alpha * -0.1388888888888889));
} else {
tmp = ((1.0 + alpha) / beta) / (3.0 + (beta + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.8: tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) * (0.16666666666666666 + (alpha * -0.1388888888888889)) else: tmp = ((1.0 + alpha) / beta) / (3.0 + (beta + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.8) tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 2.0))) * Float64(0.16666666666666666 + Float64(alpha * -0.1388888888888889))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(3.0 + Float64(beta + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 4.8)
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) * (0.16666666666666666 + (alpha * -0.1388888888888889));
else
tmp = ((1.0 + alpha) / beta) / (3.0 + (beta + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 4.8], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.16666666666666666 + N[(alpha * -0.1388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(3.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4.8:\\
\;\;\;\;\frac{1 + \alpha}{\alpha + \left(\beta + 2\right)} \cdot \left(0.16666666666666666 + \alpha \cdot -0.1388888888888889\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{3 + \left(\beta + \alpha\right)}\\
\end{array}
\end{array}
if beta < 4.79999999999999982Initial program 99.8%
Simplified99.2%
Taylor expanded in beta around 0 97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in alpha around 0 59.4%
*-commutative59.4%
Simplified59.4%
if 4.79999999999999982 < beta Initial program 86.9%
Taylor expanded in beta around -inf 81.8%
expm1-log1p-u81.8%
expm1-udef50.6%
mul-1-neg50.6%
*-commutative50.6%
fma-neg50.6%
metadata-eval50.6%
metadata-eval50.6%
associate-+l+50.6%
metadata-eval50.6%
+-commutative50.6%
Applied egg-rr50.6%
expm1-def81.8%
expm1-log1p81.8%
distribute-neg-frac81.8%
fma-udef81.8%
distribute-lft1-in81.8%
+-commutative81.8%
*-commutative81.8%
distribute-lft-in81.8%
metadata-eval81.8%
neg-mul-181.8%
unsub-neg81.8%
+-commutative81.8%
+-commutative81.8%
Simplified81.8%
expm1-log1p-u81.8%
expm1-udef50.6%
associate-/l/50.6%
+-commutative50.6%
Applied egg-rr50.6%
expm1-def76.8%
expm1-log1p76.8%
associate-/r*81.8%
sub-neg81.8%
metadata-eval81.8%
distribute-neg-in81.8%
remove-double-neg81.8%
*-rgt-identity81.8%
associate-*r/81.8%
remove-double-neg81.8%
distribute-neg-in81.8%
metadata-eval81.8%
sub-neg81.8%
associate-*l/81.8%
associate-*r/81.8%
Simplified81.8%
Final simplification67.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 8.2e+16) (/ (+ 1.0 beta) (* (+ beta 3.0) (+ 4.0 (* beta (+ beta 4.0))))) (/ (/ (+ 1.0 alpha) beta) (+ 2.0 (+ beta alpha)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 8.2e+16) {
tmp = (1.0 + beta) / ((beta + 3.0) * (4.0 + (beta * (beta + 4.0))));
} else {
tmp = ((1.0 + alpha) / beta) / (2.0 + (beta + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 8.2d+16) then
tmp = (1.0d0 + beta) / ((beta + 3.0d0) * (4.0d0 + (beta * (beta + 4.0d0))))
else
tmp = ((1.0d0 + alpha) / beta) / (2.0d0 + (beta + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 8.2e+16) {
tmp = (1.0 + beta) / ((beta + 3.0) * (4.0 + (beta * (beta + 4.0))));
} else {
tmp = ((1.0 + alpha) / beta) / (2.0 + (beta + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 8.2e+16: tmp = (1.0 + beta) / ((beta + 3.0) * (4.0 + (beta * (beta + 4.0)))) else: tmp = ((1.0 + alpha) / beta) / (2.0 + (beta + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 8.2e+16) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 3.0) * Float64(4.0 + Float64(beta * Float64(beta + 4.0))))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(2.0 + Float64(beta + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 8.2e+16)
tmp = (1.0 + beta) / ((beta + 3.0) * (4.0 + (beta * (beta + 4.0))));
else
tmp = ((1.0 + alpha) / beta) / (2.0 + (beta + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 8.2e+16], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(4.0 + N[(beta * N[(beta + 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(2.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 8.2 \cdot 10^{+16}:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 3\right) \cdot \left(4 + \beta \cdot \left(\beta + 4\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{2 + \left(\beta + \alpha\right)}\\
\end{array}
\end{array}
if beta < 8.2e16Initial program 99.8%
Simplified99.2%
Taylor expanded in alpha around 0 60.9%
Taylor expanded in beta around 0 60.9%
+-commutative60.9%
unpow260.9%
distribute-rgt-out60.9%
Simplified60.9%
if 8.2e16 < beta Initial program 86.4%
Simplified87.3%
Taylor expanded in beta around inf 84.2%
associate-*l/84.2%
+-commutative84.2%
associate-+r+84.2%
+-commutative84.2%
+-commutative84.2%
Applied egg-rr84.2%
associate-*r/84.2%
*-rgt-identity84.2%
+-commutative84.2%
Simplified84.2%
Final simplification69.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.4e+15) (/ (+ 1.0 beta) (* (+ beta 3.0) (+ 4.0 (* beta (+ beta 4.0))))) (/ (/ (+ 1.0 alpha) (+ 2.0 (+ beta alpha))) (+ 3.0 (+ beta alpha)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.4e+15) {
tmp = (1.0 + beta) / ((beta + 3.0) * (4.0 + (beta * (beta + 4.0))));
} else {
tmp = ((1.0 + alpha) / (2.0 + (beta + alpha))) / (3.0 + (beta + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.4d+15) then
tmp = (1.0d0 + beta) / ((beta + 3.0d0) * (4.0d0 + (beta * (beta + 4.0d0))))
else
tmp = ((1.0d0 + alpha) / (2.0d0 + (beta + alpha))) / (3.0d0 + (beta + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.4e+15) {
tmp = (1.0 + beta) / ((beta + 3.0) * (4.0 + (beta * (beta + 4.0))));
} else {
tmp = ((1.0 + alpha) / (2.0 + (beta + alpha))) / (3.0 + (beta + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.4e+15: tmp = (1.0 + beta) / ((beta + 3.0) * (4.0 + (beta * (beta + 4.0)))) else: tmp = ((1.0 + alpha) / (2.0 + (beta + alpha))) / (3.0 + (beta + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.4e+15) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 3.0) * Float64(4.0 + Float64(beta * Float64(beta + 4.0))))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(2.0 + Float64(beta + alpha))) / Float64(3.0 + Float64(beta + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.4e+15)
tmp = (1.0 + beta) / ((beta + 3.0) * (4.0 + (beta * (beta + 4.0))));
else
tmp = ((1.0 + alpha) / (2.0 + (beta + alpha))) / (3.0 + (beta + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.4e+15], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(4.0 + N[(beta * N[(beta + 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(2.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.4 \cdot 10^{+15}:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 3\right) \cdot \left(4 + \beta \cdot \left(\beta + 4\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{2 + \left(\beta + \alpha\right)}}{3 + \left(\beta + \alpha\right)}\\
\end{array}
\end{array}
if beta < 3.4e15Initial program 99.8%
Simplified99.2%
Taylor expanded in alpha around 0 61.3%
Taylor expanded in beta around 0 61.3%
+-commutative61.3%
unpow261.3%
distribute-rgt-out61.3%
Simplified61.3%
if 3.4e15 < beta Initial program 86.5%
associate-/l/82.7%
+-commutative82.7%
+-commutative82.7%
associate-+r+82.7%
*-commutative82.7%
metadata-eval82.7%
associate-+l+82.7%
metadata-eval82.7%
associate-+l+82.7%
metadata-eval82.7%
metadata-eval82.7%
associate-+l+82.7%
Simplified82.7%
Taylor expanded in beta around -inf 82.2%
times-frac83.6%
+-commutative83.6%
+-commutative83.6%
*-commutative83.6%
fma-neg83.6%
metadata-eval83.6%
associate-+r+83.6%
+-commutative83.6%
associate-+r+83.6%
Applied egg-rr83.6%
associate-*l/83.7%
mul-1-neg83.7%
metadata-eval83.7%
fma-neg83.7%
*-commutative83.7%
distribute-frac-neg83.7%
*-commutative83.7%
fma-neg83.7%
metadata-eval83.7%
fma-udef83.7%
*-commutative83.7%
mul-1-neg83.7%
metadata-eval83.7%
distribute-neg-in83.7%
+-commutative83.7%
remove-double-neg83.7%
associate-+l+83.7%
+-commutative83.7%
Simplified83.7%
Final simplification69.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.5) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ (/ (+ 1.0 alpha) beta) (+ 2.0 (+ beta alpha)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) / (2.0 + (beta + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.5d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = ((1.0d0 + alpha) / beta) / (2.0d0 + (beta + alpha))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) / (2.0 + (beta + alpha));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.5: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = ((1.0 + alpha) / beta) / (2.0 + (beta + alpha)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.5) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(2.0 + Float64(beta + alpha))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.5)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = ((1.0 + alpha) / beta) / (2.0 + (beta + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.5], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(2.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.5:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{2 + \left(\beta + \alpha\right)}\\
\end{array}
\end{array}
if beta < 2.5Initial program 99.8%
Simplified99.2%
Taylor expanded in alpha around 0 61.2%
Taylor expanded in beta around 0 60.4%
*-commutative60.4%
Simplified60.4%
if 2.5 < beta Initial program 86.9%
Simplified87.9%
Taylor expanded in beta around inf 81.8%
associate-*l/81.8%
+-commutative81.8%
associate-+r+81.8%
+-commutative81.8%
+-commutative81.8%
Applied egg-rr81.8%
associate-*r/81.8%
*-rgt-identity81.8%
+-commutative81.8%
Simplified81.8%
Final simplification68.1%
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 alpha) beta) (+ 3.0 (+ beta alpha)))))
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 + alpha) / beta) / (3.0 + (beta + alpha));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.45d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = ((1.0d0 + alpha) / beta) / (3.0d0 + (beta + alpha))
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 + alpha) / beta) / (3.0 + (beta + alpha));
}
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 + alpha) / beta) / (3.0 + (beta + alpha)) 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(Float64(1.0 + alpha) / beta) / Float64(3.0 + Float64(beta + alpha))); 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 + alpha) / beta) / (3.0 + (beta + alpha));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.45], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(3.0 + N[(beta + alpha), $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{\frac{1 + \alpha}{\beta}}{3 + \left(\beta + \alpha\right)}\\
\end{array}
\end{array}
if beta < 2.4500000000000002Initial program 99.8%
Simplified99.2%
Taylor expanded in alpha around 0 61.2%
Taylor expanded in beta around 0 60.4%
*-commutative60.4%
Simplified60.4%
if 2.4500000000000002 < beta Initial program 86.9%
Taylor expanded in beta around -inf 81.8%
expm1-log1p-u81.8%
expm1-udef50.6%
mul-1-neg50.6%
*-commutative50.6%
fma-neg50.6%
metadata-eval50.6%
metadata-eval50.6%
associate-+l+50.6%
metadata-eval50.6%
+-commutative50.6%
Applied egg-rr50.6%
expm1-def81.8%
expm1-log1p81.8%
distribute-neg-frac81.8%
fma-udef81.8%
distribute-lft1-in81.8%
+-commutative81.8%
*-commutative81.8%
distribute-lft-in81.8%
metadata-eval81.8%
neg-mul-181.8%
unsub-neg81.8%
+-commutative81.8%
+-commutative81.8%
Simplified81.8%
expm1-log1p-u81.8%
expm1-udef50.6%
associate-/l/50.6%
+-commutative50.6%
Applied egg-rr50.6%
expm1-def76.8%
expm1-log1p76.8%
associate-/r*81.8%
sub-neg81.8%
metadata-eval81.8%
distribute-neg-in81.8%
remove-double-neg81.8%
*-rgt-identity81.8%
associate-*r/81.8%
remove-double-neg81.8%
distribute-neg-in81.8%
metadata-eval81.8%
sub-neg81.8%
associate-*l/81.8%
associate-*r/81.8%
Simplified81.8%
Final simplification68.1%
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)) (* (/ (+ 1.0 alpha) beta) (/ 1.0 beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.8) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) * (1.0 / beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.8d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = ((1.0d0 + alpha) / beta) * (1.0d0 / 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 = ((1.0 + alpha) / beta) * (1.0 / 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 = ((1.0 + alpha) / beta) * (1.0 / 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(1.0 + alpha) / beta) * Float64(1.0 / beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.8)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = ((1.0 + alpha) / beta) * (1.0 / beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.8], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] * N[(1.0 / beta), $MachinePrecision]), $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{1 + \alpha}{\beta} \cdot \frac{1}{\beta}\\
\end{array}
\end{array}
if beta < 2.7999999999999998Initial program 99.8%
Simplified99.2%
Taylor expanded in alpha around 0 61.2%
Taylor expanded in beta around 0 60.4%
*-commutative60.4%
Simplified60.4%
if 2.7999999999999998 < beta Initial program 86.9%
Simplified87.9%
Taylor expanded in beta around inf 81.8%
Taylor expanded in beta around inf 81.6%
Final simplification68.0%
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%
Simplified99.2%
Taylor expanded in alpha around 0 61.2%
Taylor expanded in beta around 0 60.4%
*-commutative60.4%
Simplified60.4%
if 2.4500000000000002 < beta Initial program 86.9%
Taylor expanded in beta around -inf 81.8%
Taylor expanded in alpha around 0 69.7%
Final simplification63.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(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%
Simplified99.2%
Taylor expanded in alpha around 0 61.2%
Taylor expanded in beta around 0 60.4%
*-commutative60.4%
Simplified60.4%
if 2.4500000000000002 < beta Initial program 86.9%
Taylor expanded in beta around -inf 81.8%
expm1-log1p-u81.8%
expm1-udef50.6%
mul-1-neg50.6%
*-commutative50.6%
fma-neg50.6%
metadata-eval50.6%
metadata-eval50.6%
associate-+l+50.6%
metadata-eval50.6%
+-commutative50.6%
Applied egg-rr50.6%
expm1-def81.8%
expm1-log1p81.8%
distribute-neg-frac81.8%
fma-udef81.8%
distribute-lft1-in81.8%
+-commutative81.8%
*-commutative81.8%
distribute-lft-in81.8%
metadata-eval81.8%
neg-mul-181.8%
unsub-neg81.8%
+-commutative81.8%
+-commutative81.8%
Simplified81.8%
Taylor expanded in alpha around 0 69.7%
associate-/r*70.9%
Simplified70.9%
Final simplification64.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.95) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ 1.0 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.95) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = 1.0 / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.95d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = 1.0d0 / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.95) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = 1.0 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.95: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = 1.0 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.95) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(1.0 / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.95)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = 1.0 / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.95], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(1.0 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.95:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta}\\
\end{array}
\end{array}
if beta < 2.9500000000000002Initial program 99.8%
Simplified99.2%
Taylor expanded in alpha around 0 61.2%
Taylor expanded in beta around 0 60.4%
*-commutative60.4%
Simplified60.4%
if 2.9500000000000002 < beta Initial program 86.9%
Taylor expanded in beta around -inf 81.8%
expm1-log1p-u81.8%
expm1-udef50.6%
mul-1-neg50.6%
*-commutative50.6%
fma-neg50.6%
metadata-eval50.6%
metadata-eval50.6%
associate-+l+50.6%
metadata-eval50.6%
+-commutative50.6%
Applied egg-rr50.6%
expm1-def81.8%
expm1-log1p81.8%
distribute-neg-frac81.8%
fma-udef81.8%
distribute-lft1-in81.8%
+-commutative81.8%
*-commutative81.8%
distribute-lft-in81.8%
metadata-eval81.8%
neg-mul-181.8%
unsub-neg81.8%
+-commutative81.8%
+-commutative81.8%
Simplified81.8%
expm1-log1p-u81.8%
expm1-udef50.6%
associate-/l/50.6%
+-commutative50.6%
Applied egg-rr50.6%
expm1-def76.8%
expm1-log1p76.8%
associate-/r*81.8%
sub-neg81.8%
metadata-eval81.8%
distribute-neg-in81.8%
remove-double-neg81.8%
*-rgt-identity81.8%
associate-*r/81.8%
remove-double-neg81.8%
distribute-neg-in81.8%
metadata-eval81.8%
sub-neg81.8%
associate-*l/81.8%
associate-*r/81.8%
Simplified81.8%
Taylor expanded in alpha around inf 7.0%
Final simplification41.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 12.0) 0.08333333333333333 (/ 1.0 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 12.0) {
tmp = 0.08333333333333333;
} else {
tmp = 1.0 / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 12.0d0) then
tmp = 0.08333333333333333d0
else
tmp = 1.0d0 / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 12.0) {
tmp = 0.08333333333333333;
} else {
tmp = 1.0 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 12.0: tmp = 0.08333333333333333 else: tmp = 1.0 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 12.0) tmp = 0.08333333333333333; else tmp = Float64(1.0 / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 12.0)
tmp = 0.08333333333333333;
else
tmp = 1.0 / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 12.0], 0.08333333333333333, N[(1.0 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 12:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta}\\
\end{array}
\end{array}
if beta < 12Initial program 99.8%
Simplified99.2%
Taylor expanded in alpha around 0 61.2%
Taylor expanded in beta around 0 59.9%
if 12 < beta Initial program 86.9%
Taylor expanded in beta around -inf 81.8%
expm1-log1p-u81.8%
expm1-udef50.6%
mul-1-neg50.6%
*-commutative50.6%
fma-neg50.6%
metadata-eval50.6%
metadata-eval50.6%
associate-+l+50.6%
metadata-eval50.6%
+-commutative50.6%
Applied egg-rr50.6%
expm1-def81.8%
expm1-log1p81.8%
distribute-neg-frac81.8%
fma-udef81.8%
distribute-lft1-in81.8%
+-commutative81.8%
*-commutative81.8%
distribute-lft-in81.8%
metadata-eval81.8%
neg-mul-181.8%
unsub-neg81.8%
+-commutative81.8%
+-commutative81.8%
Simplified81.8%
expm1-log1p-u81.8%
expm1-udef50.6%
associate-/l/50.6%
+-commutative50.6%
Applied egg-rr50.6%
expm1-def76.8%
expm1-log1p76.8%
associate-/r*81.8%
sub-neg81.8%
metadata-eval81.8%
distribute-neg-in81.8%
remove-double-neg81.8%
*-rgt-identity81.8%
associate-*r/81.8%
remove-double-neg81.8%
distribute-neg-in81.8%
metadata-eval81.8%
sub-neg81.8%
associate-*l/81.8%
associate-*r/81.8%
Simplified81.8%
Taylor expanded in alpha around inf 7.0%
Final simplification40.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.16666666666666666 (+ beta 2.0)))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.16666666666666666 / (beta + 2.0);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.16666666666666666d0 / (beta + 2.0d0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.16666666666666666 / (beta + 2.0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.16666666666666666 / (beta + 2.0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.16666666666666666 / Float64(beta + 2.0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.16666666666666666 / (beta + 2.0);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.16666666666666666 / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.16666666666666666}{\beta + 2}
\end{array}
Initial program 95.2%
Simplified95.1%
Taylor expanded in beta around 0 67.8%
+-commutative67.8%
Simplified67.8%
Taylor expanded in alpha around 0 40.9%
Final simplification40.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 0.08333333333333333)
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.08333333333333333;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.08333333333333333d0
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.08333333333333333;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.08333333333333333
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return 0.08333333333333333 end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.08333333333333333;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := 0.08333333333333333
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
0.08333333333333333
\end{array}
Initial program 95.2%
Simplified95.1%
Taylor expanded in alpha around 0 61.3%
Taylor expanded in beta around 0 39.8%
Final simplification39.8%
herbie shell --seed 2023336
(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)))