
(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 12 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) (+ 3.0 (+ alpha beta))))))
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) / (3.0 + (alpha + 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
real(8) :: t_0
t_0 = alpha + (beta + 2.0d0)
code = (((1.0d0 + alpha) / t_0) / t_0) * ((1.0d0 + beta) / (3.0d0 + (alpha + beta)))
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) / (3.0 + (alpha + beta)));
}
[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) / (3.0 + (alpha + beta)))
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(3.0 + Float64(alpha + beta)))) 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) / (3.0 + (alpha + beta)));
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[(3.0 + N[(alpha + beta), $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}{3 + \left(\alpha + \beta\right)}
\end{array}
\end{array}
Initial program 94.9%
Simplified84.6%
times-frac95.8%
+-commutative95.8%
Applied egg-rr95.8%
associate-*r/95.8%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Final simplification99.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))) (t_1 (/ (+ 1.0 alpha) t_0)))
(if (<= beta 1e+25)
(* t_1 (/ (+ 1.0 beta) (* t_0 (+ alpha (+ beta 3.0)))))
(* (/ t_1 t_0) (- 1.0 (/ (+ alpha 2.0) beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double t_1 = (1.0 + alpha) / t_0;
double tmp;
if (beta <= 1e+25) {
tmp = t_1 * ((1.0 + beta) / (t_0 * (alpha + (beta + 3.0))));
} else {
tmp = (t_1 / t_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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
t_1 = (1.0d0 + alpha) / t_0
if (beta <= 1d+25) then
tmp = t_1 * ((1.0d0 + beta) / (t_0 * (alpha + (beta + 3.0d0))))
else
tmp = (t_1 / t_0) * (1.0d0 - ((alpha + 2.0d0) / beta))
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 t_1 = (1.0 + alpha) / t_0;
double tmp;
if (beta <= 1e+25) {
tmp = t_1 * ((1.0 + beta) / (t_0 * (alpha + (beta + 3.0))));
} else {
tmp = (t_1 / t_0) * (1.0 - ((alpha + 2.0) / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) t_1 = (1.0 + alpha) / t_0 tmp = 0 if beta <= 1e+25: tmp = t_1 * ((1.0 + beta) / (t_0 * (alpha + (beta + 3.0)))) else: tmp = (t_1 / t_0) * (1.0 - ((alpha + 2.0) / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) t_1 = Float64(Float64(1.0 + alpha) / t_0) tmp = 0.0 if (beta <= 1e+25) tmp = Float64(t_1 * Float64(Float64(1.0 + beta) / Float64(t_0 * Float64(alpha + Float64(beta + 3.0))))); else tmp = Float64(Float64(t_1 / t_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)
t_0 = alpha + (beta + 2.0);
t_1 = (1.0 + alpha) / t_0;
tmp = 0.0;
if (beta <= 1e+25)
tmp = t_1 * ((1.0 + beta) / (t_0 * (alpha + (beta + 3.0))));
else
tmp = (t_1 / t_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_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[beta, 1e+25], N[(t$95$1 * N[(N[(1.0 + beta), $MachinePrecision] / N[(t$95$0 * N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 / t$95$0), $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}
t_0 := \alpha + \left(\beta + 2\right)\\
t_1 := \frac{1 + \alpha}{t\_0}\\
\mathbf{if}\;\beta \leq 10^{+25}:\\
\;\;\;\;t\_1 \cdot \frac{1 + \beta}{t\_0 \cdot \left(\alpha + \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{t\_0} \cdot \left(1 - \frac{\alpha + 2}{\beta}\right)\\
\end{array}
\end{array}
if beta < 1.00000000000000009e25Initial program 99.9%
Simplified94.1%
times-frac99.4%
+-commutative99.4%
Applied egg-rr99.4%
if 1.00000000000000009e25 < beta Initial program 84.0%
Simplified64.1%
times-frac87.9%
+-commutative87.9%
Applied egg-rr87.9%
associate-*r/88.1%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in beta around inf 89.6%
mul-1-neg89.6%
unsub-neg89.6%
Simplified89.6%
Final simplification96.3%
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 102000000000.0)
(/ (+ 1.0 beta) (* t_0 (* (+ beta 3.0) (+ beta 2.0))))
(* (/ (/ (+ 1.0 alpha) t_0) t_0) (- 1.0 (/ (+ alpha 2.0) beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 102000000000.0) {
tmp = (1.0 + beta) / (t_0 * ((beta + 3.0) * (beta + 2.0)));
} else {
tmp = (((1.0 + alpha) / t_0) / t_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) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 102000000000.0d0) then
tmp = (1.0d0 + beta) / (t_0 * ((beta + 3.0d0) * (beta + 2.0d0)))
else
tmp = (((1.0d0 + alpha) / t_0) / t_0) * (1.0d0 - ((alpha + 2.0d0) / beta))
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 <= 102000000000.0) {
tmp = (1.0 + beta) / (t_0 * ((beta + 3.0) * (beta + 2.0)));
} else {
tmp = (((1.0 + alpha) / t_0) / t_0) * (1.0 - ((alpha + 2.0) / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 102000000000.0: tmp = (1.0 + beta) / (t_0 * ((beta + 3.0) * (beta + 2.0))) else: tmp = (((1.0 + alpha) / t_0) / t_0) * (1.0 - ((alpha + 2.0) / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 102000000000.0) tmp = Float64(Float64(1.0 + beta) / Float64(t_0 * Float64(Float64(beta + 3.0) * Float64(beta + 2.0)))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / t_0) / t_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)
t_0 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 102000000000.0)
tmp = (1.0 + beta) / (t_0 * ((beta + 3.0) * (beta + 2.0)));
else
tmp = (((1.0 + alpha) / t_0) / t_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_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 102000000000.0], N[(N[(1.0 + beta), $MachinePrecision] / N[(t$95$0 * N[(N[(beta + 3.0), $MachinePrecision] * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $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}
t_0 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 102000000000:\\
\;\;\;\;\frac{1 + \beta}{t\_0 \cdot \left(\left(\beta + 3\right) \cdot \left(\beta + 2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t\_0}}{t\_0} \cdot \left(1 - \frac{\alpha + 2}{\beta}\right)\\
\end{array}
\end{array}
if beta < 1.02e11Initial program 99.9%
Simplified94.4%
Taylor expanded in alpha around 0 85.7%
Taylor expanded in alpha around 0 70.9%
+-commutative70.9%
+-commutative70.9%
Simplified70.9%
if 1.02e11 < beta Initial program 84.9%
Simplified65.1%
times-frac87.6%
+-commutative87.6%
Applied egg-rr87.6%
associate-*r/87.7%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in beta around inf 85.7%
mul-1-neg85.7%
unsub-neg85.7%
Simplified85.7%
Final simplification75.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))))
(if (<= beta 5.2e+15)
(/ (+ 1.0 beta) (* t_0 (* (+ beta 3.0) (+ beta 2.0))))
(*
(/ (+ 1.0 beta) (+ 3.0 (+ alpha beta)))
(/ (/ (+ 1.0 alpha) beta) t_0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 5.2e+15) {
tmp = (1.0 + beta) / (t_0 * ((beta + 3.0) * (beta + 2.0)));
} else {
tmp = ((1.0 + beta) / (3.0 + (alpha + beta))) * (((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 + 2.0d0)
if (beta <= 5.2d+15) then
tmp = (1.0d0 + beta) / (t_0 * ((beta + 3.0d0) * (beta + 2.0d0)))
else
tmp = ((1.0d0 + beta) / (3.0d0 + (alpha + beta))) * (((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 + 2.0);
double tmp;
if (beta <= 5.2e+15) {
tmp = (1.0 + beta) / (t_0 * ((beta + 3.0) * (beta + 2.0)));
} else {
tmp = ((1.0 + beta) / (3.0 + (alpha + beta))) * (((1.0 + alpha) / beta) / t_0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 5.2e+15: tmp = (1.0 + beta) / (t_0 * ((beta + 3.0) * (beta + 2.0))) else: tmp = ((1.0 + beta) / (3.0 + (alpha + beta))) * (((1.0 + alpha) / beta) / t_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 <= 5.2e+15) tmp = Float64(Float64(1.0 + beta) / Float64(t_0 * Float64(Float64(beta + 3.0) * Float64(beta + 2.0)))); else tmp = Float64(Float64(Float64(1.0 + beta) / Float64(3.0 + Float64(alpha + beta))) * 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 + 2.0);
tmp = 0.0;
if (beta <= 5.2e+15)
tmp = (1.0 + beta) / (t_0 * ((beta + 3.0) * (beta + 2.0)));
else
tmp = ((1.0 + beta) / (3.0 + (alpha + beta))) * (((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 + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 5.2e+15], N[(N[(1.0 + beta), $MachinePrecision] / N[(t$95$0 * N[(N[(beta + 3.0), $MachinePrecision] * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(3.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 5.2 \cdot 10^{+15}:\\
\;\;\;\;\frac{1 + \beta}{t\_0 \cdot \left(\left(\beta + 3\right) \cdot \left(\beta + 2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \beta}{3 + \left(\alpha + \beta\right)} \cdot \frac{\frac{1 + \alpha}{\beta}}{t\_0}\\
\end{array}
\end{array}
if beta < 5.2e15Initial program 99.9%
Simplified94.5%
Taylor expanded in alpha around 0 85.3%
Taylor expanded in alpha around 0 70.7%
+-commutative70.7%
+-commutative70.7%
Simplified70.7%
if 5.2e15 < beta Initial program 84.6%
Simplified64.3%
times-frac87.3%
+-commutative87.3%
Applied egg-rr87.3%
associate-*r/87.4%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in beta around inf 86.7%
Final simplification75.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 5e+15) (/ (+ 1.0 beta) (* (+ alpha (+ beta 2.0)) (* (+ beta 3.0) (+ beta 2.0)))) (/ (/ (+ 1.0 alpha) beta) (+ 2.0 (+ alpha beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 5e+15) {
tmp = (1.0 + beta) / ((alpha + (beta + 2.0)) * ((beta + 3.0) * (beta + 2.0)));
} else {
tmp = ((1.0 + alpha) / beta) / (2.0 + (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 <= 5d+15) then
tmp = (1.0d0 + beta) / ((alpha + (beta + 2.0d0)) * ((beta + 3.0d0) * (beta + 2.0d0)))
else
tmp = ((1.0d0 + alpha) / beta) / (2.0d0 + (alpha + beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 5e+15) {
tmp = (1.0 + beta) / ((alpha + (beta + 2.0)) * ((beta + 3.0) * (beta + 2.0)));
} else {
tmp = ((1.0 + alpha) / beta) / (2.0 + (alpha + beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 5e+15: tmp = (1.0 + beta) / ((alpha + (beta + 2.0)) * ((beta + 3.0) * (beta + 2.0))) else: tmp = ((1.0 + alpha) / beta) / (2.0 + (alpha + beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 5e+15) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(alpha + Float64(beta + 2.0)) * Float64(Float64(beta + 3.0) * Float64(beta + 2.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(2.0 + Float64(alpha + beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 5e+15)
tmp = (1.0 + beta) / ((alpha + (beta + 2.0)) * ((beta + 3.0) * (beta + 2.0)));
else
tmp = ((1.0 + alpha) / beta) / (2.0 + (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, 5e+15], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(beta + 3.0), $MachinePrecision] * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 5 \cdot 10^{+15}:\\
\;\;\;\;\frac{1 + \beta}{\left(\alpha + \left(\beta + 2\right)\right) \cdot \left(\left(\beta + 3\right) \cdot \left(\beta + 2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{2 + \left(\alpha + \beta\right)}\\
\end{array}
\end{array}
if beta < 5e15Initial program 99.9%
Simplified94.5%
Taylor expanded in alpha around 0 85.3%
Taylor expanded in alpha around 0 70.7%
+-commutative70.7%
+-commutative70.7%
Simplified70.7%
if 5e15 < beta Initial program 84.6%
Simplified64.3%
times-frac87.3%
+-commutative87.3%
Applied egg-rr87.3%
Taylor expanded in beta around inf 86.0%
associate-*l/86.2%
+-commutative86.2%
+-commutative86.2%
+-commutative86.2%
associate-+l+86.2%
Applied egg-rr86.2%
associate-*r/86.2%
*-rgt-identity86.2%
+-commutative86.2%
Simplified86.2%
Final simplification75.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.6) 0.08333333333333333 (/ (+ 1.0 alpha) (* beta (+ 2.0 (+ alpha beta))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = 0.08333333333333333;
} else {
tmp = (1.0 + alpha) / (beta * (2.0 + (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 <= 2.6d0) then
tmp = 0.08333333333333333d0
else
tmp = (1.0d0 + alpha) / (beta * (2.0d0 + (alpha + beta)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = 0.08333333333333333;
} else {
tmp = (1.0 + alpha) / (beta * (2.0 + (alpha + beta)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.6: tmp = 0.08333333333333333 else: tmp = (1.0 + alpha) / (beta * (2.0 + (alpha + beta))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.6) tmp = 0.08333333333333333; else tmp = Float64(Float64(1.0 + alpha) / Float64(beta * Float64(2.0 + Float64(alpha + beta)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.6)
tmp = 0.08333333333333333;
else
tmp = (1.0 + alpha) / (beta * (2.0 + (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, 2.6], 0.08333333333333333, N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta * N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.6:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta \cdot \left(2 + \left(\alpha + \beta\right)\right)}\\
\end{array}
\end{array}
if beta < 2.60000000000000009Initial program 99.9%
Simplified94.4%
times-frac99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.9%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in alpha around 0 87.3%
Taylor expanded in beta around 0 85.6%
+-commutative85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in alpha around 0 68.1%
if 2.60000000000000009 < beta Initial program 85.1%
Simplified65.5%
times-frac87.7%
+-commutative87.7%
Applied egg-rr87.7%
Taylor expanded in beta around inf 84.0%
un-div-inv84.2%
+-commutative84.2%
+-commutative84.2%
+-commutative84.2%
associate-+l+84.2%
Applied egg-rr84.2%
associate-/l/80.4%
+-commutative80.4%
Simplified80.4%
Final simplification72.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.6) 0.08333333333333333 (/ (/ (+ 1.0 alpha) beta) (+ 2.0 (+ alpha beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = 0.08333333333333333;
} else {
tmp = ((1.0 + alpha) / beta) / (2.0 + (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 <= 2.6d0) then
tmp = 0.08333333333333333d0
else
tmp = ((1.0d0 + alpha) / beta) / (2.0d0 + (alpha + beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = 0.08333333333333333;
} else {
tmp = ((1.0 + alpha) / beta) / (2.0 + (alpha + beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.6: tmp = 0.08333333333333333 else: tmp = ((1.0 + alpha) / beta) / (2.0 + (alpha + beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.6) tmp = 0.08333333333333333; else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(2.0 + Float64(alpha + beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.6)
tmp = 0.08333333333333333;
else
tmp = ((1.0 + alpha) / beta) / (2.0 + (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, 2.6], 0.08333333333333333, N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.6:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{2 + \left(\alpha + \beta\right)}\\
\end{array}
\end{array}
if beta < 2.60000000000000009Initial program 99.9%
Simplified94.4%
times-frac99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.9%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in alpha around 0 87.3%
Taylor expanded in beta around 0 85.6%
+-commutative85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in alpha around 0 68.1%
if 2.60000000000000009 < beta Initial program 85.1%
Simplified65.5%
times-frac87.7%
+-commutative87.7%
Applied egg-rr87.7%
Taylor expanded in beta around inf 84.0%
associate-*l/84.2%
+-commutative84.2%
+-commutative84.2%
+-commutative84.2%
associate-+l+84.2%
Applied egg-rr84.2%
associate-*r/84.2%
*-rgt-identity84.2%
+-commutative84.2%
Simplified84.2%
Final simplification73.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.0) 0.08333333333333333 (/ (/ 1.0 (+ beta 2.0)) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.0) {
tmp = 0.08333333333333333;
} else {
tmp = (1.0 / (beta + 2.0)) / (beta + 3.0);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.0d0) then
tmp = 0.08333333333333333d0
else
tmp = (1.0d0 / (beta + 2.0d0)) / (beta + 3.0d0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.0) {
tmp = 0.08333333333333333;
} else {
tmp = (1.0 / (beta + 2.0)) / (beta + 3.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.0: tmp = 0.08333333333333333 else: tmp = (1.0 / (beta + 2.0)) / (beta + 3.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.0) tmp = 0.08333333333333333; else tmp = Float64(Float64(1.0 / Float64(beta + 2.0)) / Float64(beta + 3.0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.0)
tmp = 0.08333333333333333;
else
tmp = (1.0 / (beta + 2.0)) / (beta + 3.0);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.0], 0.08333333333333333, N[(N[(1.0 / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta + 2}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 1Initial program 99.9%
Simplified94.4%
times-frac99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.9%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in alpha around 0 87.3%
Taylor expanded in beta around 0 85.6%
+-commutative85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in alpha around 0 68.1%
if 1 < beta Initial program 85.1%
associate-/l/80.4%
+-commutative80.4%
associate-+l+80.4%
*-commutative80.4%
metadata-eval80.4%
associate-+l+80.4%
metadata-eval80.4%
associate-+l+80.4%
metadata-eval80.4%
metadata-eval80.4%
associate-+l+80.4%
Simplified80.4%
Taylor expanded in beta around -inf 84.0%
mul-1-neg84.0%
sub-neg84.0%
mul-1-neg84.0%
distribute-neg-in84.0%
+-commutative84.0%
mul-1-neg84.0%
distribute-lft-in84.0%
metadata-eval84.0%
mul-1-neg84.0%
unsub-neg84.0%
Simplified84.0%
Taylor expanded in alpha around 0 71.7%
associate-/r*73.0%
+-commutative73.0%
Simplified73.0%
Final simplification69.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.6) 0.08333333333333333 (/ 1.0 (* beta (+ beta 2.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = 0.08333333333333333;
} else {
tmp = 1.0 / (beta * (beta + 2.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.6d0) then
tmp = 0.08333333333333333d0
else
tmp = 1.0d0 / (beta * (beta + 2.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = 0.08333333333333333;
} else {
tmp = 1.0 / (beta * (beta + 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.6: tmp = 0.08333333333333333 else: tmp = 1.0 / (beta * (beta + 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.6) tmp = 0.08333333333333333; else tmp = Float64(1.0 / Float64(beta * Float64(beta + 2.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.6)
tmp = 0.08333333333333333;
else
tmp = 1.0 / (beta * (beta + 2.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.6], 0.08333333333333333, N[(1.0 / N[(beta * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.6:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \left(\beta + 2\right)}\\
\end{array}
\end{array}
if beta < 2.60000000000000009Initial program 99.9%
Simplified94.4%
times-frac99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.9%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in alpha around 0 87.3%
Taylor expanded in beta around 0 85.6%
+-commutative85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in alpha around 0 68.1%
if 2.60000000000000009 < beta Initial program 85.1%
Simplified65.5%
times-frac87.7%
+-commutative87.7%
Applied egg-rr87.7%
Taylor expanded in beta around inf 84.0%
Taylor expanded in alpha around 0 71.6%
Final simplification69.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.6) 0.08333333333333333 (/ (/ 1.0 beta) (+ beta 2.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = 0.08333333333333333;
} else {
tmp = (1.0 / beta) / (beta + 2.0);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.6d0) then
tmp = 0.08333333333333333d0
else
tmp = (1.0d0 / beta) / (beta + 2.0d0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = 0.08333333333333333;
} else {
tmp = (1.0 / beta) / (beta + 2.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.6: tmp = 0.08333333333333333 else: tmp = (1.0 / beta) / (beta + 2.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.6) tmp = 0.08333333333333333; else tmp = Float64(Float64(1.0 / beta) / Float64(beta + 2.0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.6)
tmp = 0.08333333333333333;
else
tmp = (1.0 / beta) / (beta + 2.0);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.6], 0.08333333333333333, N[(N[(1.0 / beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.6:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta}}{\beta + 2}\\
\end{array}
\end{array}
if beta < 2.60000000000000009Initial program 99.9%
Simplified94.4%
times-frac99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.9%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in alpha around 0 87.3%
Taylor expanded in beta around 0 85.6%
+-commutative85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in alpha around 0 68.1%
if 2.60000000000000009 < beta Initial program 85.1%
Simplified65.5%
times-frac87.7%
+-commutative87.7%
Applied egg-rr87.7%
Taylor expanded in beta around inf 84.0%
Taylor expanded in alpha around 0 71.6%
associate-/r*72.9%
Simplified72.9%
Final simplification69.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 12.0) 0.08333333333333333 (/ 1.0 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 12.0) {
tmp = 0.08333333333333333;
} else {
tmp = 1.0 / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 12.0d0) then
tmp = 0.08333333333333333d0
else
tmp = 1.0d0 / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 12.0) {
tmp = 0.08333333333333333;
} else {
tmp = 1.0 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 12.0: tmp = 0.08333333333333333 else: tmp = 1.0 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 12.0) tmp = 0.08333333333333333; else tmp = Float64(1.0 / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 12.0)
tmp = 0.08333333333333333;
else
tmp = 1.0 / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 12.0], 0.08333333333333333, N[(1.0 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 12:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta}\\
\end{array}
\end{array}
if beta < 12Initial program 99.9%
Simplified94.4%
times-frac99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.9%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in alpha around 0 87.3%
Taylor expanded in beta around 0 85.6%
+-commutative85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in alpha around 0 68.1%
if 12 < beta Initial program 85.1%
Simplified65.5%
times-frac87.7%
+-commutative87.7%
Applied egg-rr87.7%
Taylor expanded in beta around inf 84.0%
Taylor expanded in alpha around inf 7.1%
Final simplification47.4%
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 94.9%
Simplified84.6%
times-frac95.8%
+-commutative95.8%
Applied egg-rr95.8%
associate-*r/95.8%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in alpha around 0 84.4%
Taylor expanded in beta around 0 60.7%
+-commutative60.7%
+-commutative60.7%
Simplified60.7%
Taylor expanded in alpha around 0 46.3%
Final simplification46.3%
herbie shell --seed 2024039
(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)))