
(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 18 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 (+ 2.0 beta)))) (* (/ (/ (+ 1.0 alpha) t_0) t_0) (/ (+ 1.0 beta) (+ (+ alpha beta) 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (2.0 + beta);
return (((1.0 + alpha) / t_0) / t_0) * ((1.0 + beta) / ((alpha + beta) + 3.0));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = alpha + (2.0d0 + beta)
code = (((1.0d0 + alpha) / t_0) / t_0) * ((1.0d0 + beta) / ((alpha + beta) + 3.0d0))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (2.0 + beta);
return (((1.0 + alpha) / t_0) / t_0) * ((1.0 + beta) / ((alpha + beta) + 3.0));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (2.0 + beta) return (((1.0 + alpha) / t_0) / t_0) * ((1.0 + beta) / ((alpha + beta) + 3.0))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(2.0 + beta)) return Float64(Float64(Float64(Float64(1.0 + alpha) / t_0) / t_0) * Float64(Float64(1.0 + beta) / Float64(Float64(alpha + beta) + 3.0))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (2.0 + beta);
tmp = (((1.0 + alpha) / t_0) / t_0) * ((1.0 + beta) / ((alpha + beta) + 3.0));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(2.0 + beta), $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[(N[(alpha + beta), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(2 + \beta\right)\\
\frac{\frac{1 + \alpha}{t_0}}{t_0} \cdot \frac{1 + \beta}{\left(\alpha + \beta\right) + 3}
\end{array}
\end{array}
Initial program 92.1%
associate-/l/91.0%
associate-/r*83.8%
+-commutative83.8%
associate-+r+83.8%
+-commutative83.8%
associate-+r+83.8%
associate-+r+83.8%
distribute-rgt1-in83.8%
+-commutative83.8%
*-commutative83.8%
distribute-rgt1-in83.8%
+-commutative83.8%
times-frac96.4%
Simplified96.4%
expm1-log1p-u96.4%
expm1-udef74.9%
*-commutative74.9%
+-commutative74.9%
Applied egg-rr74.9%
expm1-def96.4%
expm1-log1p96.4%
*-commutative96.4%
associate-*r/96.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 165000000.0)
(/ (/ (+ 1.0 beta) (* (+ beta 3.0) (+ 2.0 beta))) (+ beta (+ alpha 2.0)))
(*
(/ (+ 1.0 alpha) (+ alpha (+ 2.0 beta)))
(- (/ 1.0 beta) (/ (* 2.0 (+ alpha 2.0)) (* beta beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 165000000.0) {
tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (beta + (alpha + 2.0));
} else {
tmp = ((1.0 + alpha) / (alpha + (2.0 + beta))) * ((1.0 / beta) - ((2.0 * (alpha + 2.0)) / (beta * beta)));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 165000000.0d0) then
tmp = ((1.0d0 + beta) / ((beta + 3.0d0) * (2.0d0 + beta))) / (beta + (alpha + 2.0d0))
else
tmp = ((1.0d0 + alpha) / (alpha + (2.0d0 + beta))) * ((1.0d0 / beta) - ((2.0d0 * (alpha + 2.0d0)) / (beta * beta)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 165000000.0) {
tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (beta + (alpha + 2.0));
} else {
tmp = ((1.0 + alpha) / (alpha + (2.0 + beta))) * ((1.0 / beta) - ((2.0 * (alpha + 2.0)) / (beta * beta)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 165000000.0: tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (beta + (alpha + 2.0)) else: tmp = ((1.0 + alpha) / (alpha + (2.0 + beta))) * ((1.0 / beta) - ((2.0 * (alpha + 2.0)) / (beta * beta))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 165000000.0) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(Float64(beta + 3.0) * Float64(2.0 + beta))) / Float64(beta + Float64(alpha + 2.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(2.0 + beta))) * Float64(Float64(1.0 / beta) - Float64(Float64(2.0 * Float64(alpha + 2.0)) / Float64(beta * beta)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 165000000.0)
tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (beta + (alpha + 2.0));
else
tmp = ((1.0 + alpha) / (alpha + (2.0 + beta))) * ((1.0 / beta) - ((2.0 * (alpha + 2.0)) / (beta * beta)));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 165000000.0], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / beta), $MachinePrecision] - N[(N[(2.0 * N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision] / N[(beta * beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 165000000:\\
\;\;\;\;\frac{\frac{1 + \beta}{\left(\beta + 3\right) \cdot \left(2 + \beta\right)}}{\beta + \left(\alpha + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\alpha + \left(2 + \beta\right)} \cdot \left(\frac{1}{\beta} - \frac{2 \cdot \left(\alpha + 2\right)}{\beta \cdot \beta}\right)\\
\end{array}
\end{array}
if beta < 1.65e8Initial program 99.8%
associate-/l/99.4%
associate-/r*93.1%
+-commutative93.1%
associate-+r+93.1%
+-commutative93.1%
associate-+r+93.1%
associate-+r+93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
times-frac99.4%
Simplified99.4%
expm1-log1p-u99.4%
expm1-udef83.6%
*-commutative83.6%
+-commutative83.6%
Applied egg-rr83.6%
expm1-def99.4%
expm1-log1p99.4%
*-commutative99.4%
associate-*r/99.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
Applied egg-rr99.8%
Taylor expanded in alpha around 0 71.4%
if 1.65e8 < beta Initial program 75.5%
associate-/l/72.8%
associate-/r*63.5%
+-commutative63.5%
associate-+r+63.5%
+-commutative63.5%
associate-+r+63.5%
associate-+r+63.5%
distribute-rgt1-in63.5%
+-commutative63.5%
*-commutative63.5%
distribute-rgt1-in63.5%
+-commutative63.5%
times-frac89.8%
Simplified89.8%
Taylor expanded in beta around inf 83.1%
+-commutative83.1%
mul-1-neg83.1%
unsub-neg83.1%
metadata-eval83.1%
distribute-lft-in83.1%
unpow283.1%
Simplified83.1%
Final simplification75.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ 2.0 beta))))
(if (<= beta 2100000000.0)
(/ (/ (+ 1.0 beta) (* (+ beta 3.0) (+ 2.0 beta))) (+ beta (+ alpha 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 + (2.0 + beta);
double tmp;
if (beta <= 2100000000.0) {
tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (beta + (alpha + 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 + (2.0d0 + beta)
if (beta <= 2100000000.0d0) then
tmp = ((1.0d0 + beta) / ((beta + 3.0d0) * (2.0d0 + beta))) / (beta + (alpha + 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 + (2.0 + beta);
double tmp;
if (beta <= 2100000000.0) {
tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (beta + (alpha + 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 + (2.0 + beta) tmp = 0 if beta <= 2100000000.0: tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (beta + (alpha + 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(2.0 + beta)) tmp = 0.0 if (beta <= 2100000000.0) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(Float64(beta + 3.0) * Float64(2.0 + beta))) / Float64(beta + Float64(alpha + 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 + (2.0 + beta);
tmp = 0.0;
if (beta <= 2100000000.0)
tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (beta + (alpha + 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[(2.0 + beta), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 2100000000.0], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $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(2 + \beta\right)\\
\mathbf{if}\;\beta \leq 2100000000:\\
\;\;\;\;\frac{\frac{1 + \beta}{\left(\beta + 3\right) \cdot \left(2 + \beta\right)}}{\beta + \left(\alpha + 2\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 < 2.1e9Initial program 99.8%
associate-/l/99.4%
associate-/r*93.1%
+-commutative93.1%
associate-+r+93.1%
+-commutative93.1%
associate-+r+93.1%
associate-+r+93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
times-frac99.4%
Simplified99.4%
expm1-log1p-u99.4%
expm1-udef83.6%
*-commutative83.6%
+-commutative83.6%
Applied egg-rr83.6%
expm1-def99.4%
expm1-log1p99.4%
*-commutative99.4%
associate-*r/99.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
Applied egg-rr99.8%
Taylor expanded in alpha around 0 71.4%
if 2.1e9 < beta Initial program 75.5%
associate-/l/72.8%
associate-/r*63.5%
+-commutative63.5%
associate-+r+63.5%
+-commutative63.5%
associate-+r+63.5%
associate-+r+63.5%
distribute-rgt1-in63.5%
+-commutative63.5%
*-commutative63.5%
distribute-rgt1-in63.5%
+-commutative63.5%
times-frac89.8%
Simplified89.8%
expm1-log1p-u89.8%
expm1-udef56.0%
*-commutative56.0%
+-commutative56.0%
Applied egg-rr56.0%
expm1-def89.8%
expm1-log1p89.8%
*-commutative89.8%
associate-*r/90.0%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 83.2%
mul-1-neg83.2%
unsub-neg83.2%
Simplified83.2%
Final simplification75.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ beta (+ alpha 2.0)))) (* (/ (+ 1.0 alpha) t_0) (/ (/ (+ 1.0 beta) (+ beta (+ alpha 3.0))) t_0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = beta + (alpha + 2.0);
return ((1.0 + alpha) / t_0) * (((1.0 + beta) / (beta + (alpha + 3.0))) / 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 = beta + (alpha + 2.0d0)
code = ((1.0d0 + alpha) / t_0) * (((1.0d0 + beta) / (beta + (alpha + 3.0d0))) / t_0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = beta + (alpha + 2.0);
return ((1.0 + alpha) / t_0) * (((1.0 + beta) / (beta + (alpha + 3.0))) / t_0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = beta + (alpha + 2.0) return ((1.0 + alpha) / t_0) * (((1.0 + beta) / (beta + (alpha + 3.0))) / t_0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(beta + Float64(alpha + 2.0)) return Float64(Float64(Float64(1.0 + alpha) / t_0) * Float64(Float64(Float64(1.0 + beta) / Float64(beta + Float64(alpha + 3.0))) / t_0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = beta + (alpha + 2.0);
tmp = ((1.0 + alpha) / t_0) * (((1.0 + beta) / (beta + (alpha + 3.0))) / 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[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \beta + \left(\alpha + 2\right)\\
\frac{1 + \alpha}{t_0} \cdot \frac{\frac{1 + \beta}{\beta + \left(\alpha + 3\right)}}{t_0}
\end{array}
\end{array}
Initial program 92.1%
associate-/l/91.0%
associate-/r*83.8%
+-commutative83.8%
associate-+r+83.8%
+-commutative83.8%
associate-+r+83.8%
associate-+r+83.8%
distribute-rgt1-in83.8%
+-commutative83.8%
*-commutative83.8%
distribute-rgt1-in83.8%
+-commutative83.8%
times-frac96.4%
Simplified96.4%
expm1-log1p-u96.4%
expm1-udef74.9%
*-commutative74.9%
+-commutative74.9%
Applied egg-rr74.9%
expm1-def96.4%
expm1-log1p96.4%
*-commutative96.4%
associate-*r/96.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
expm1-log1p-u99.8%
expm1-udef74.9%
associate-/l/74.9%
associate-+r+74.9%
associate-+r+74.9%
+-commutative74.9%
associate-+r+74.9%
Applied egg-rr74.9%
expm1-def96.4%
expm1-log1p96.4%
associate-*l/96.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 2e+15)
(/ (/ (+ 1.0 beta) (* (+ beta 3.0) (+ 2.0 beta))) (+ beta (+ alpha 2.0)))
(*
(/ (+ 1.0 beta) (+ (+ alpha beta) 3.0))
(/ (/ (+ 1.0 alpha) beta) (+ alpha (+ 2.0 beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2e+15) {
tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (beta + (alpha + 2.0));
} else {
tmp = ((1.0 + beta) / ((alpha + beta) + 3.0)) * (((1.0 + alpha) / beta) / (alpha + (2.0 + beta)));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2d+15) then
tmp = ((1.0d0 + beta) / ((beta + 3.0d0) * (2.0d0 + beta))) / (beta + (alpha + 2.0d0))
else
tmp = ((1.0d0 + beta) / ((alpha + beta) + 3.0d0)) * (((1.0d0 + alpha) / beta) / (alpha + (2.0d0 + beta)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2e+15) {
tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (beta + (alpha + 2.0));
} else {
tmp = ((1.0 + beta) / ((alpha + beta) + 3.0)) * (((1.0 + alpha) / beta) / (alpha + (2.0 + beta)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2e+15: tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (beta + (alpha + 2.0)) else: tmp = ((1.0 + beta) / ((alpha + beta) + 3.0)) * (((1.0 + alpha) / beta) / (alpha + (2.0 + beta))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2e+15) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(Float64(beta + 3.0) * Float64(2.0 + beta))) / Float64(beta + Float64(alpha + 2.0))); else tmp = Float64(Float64(Float64(1.0 + beta) / Float64(Float64(alpha + beta) + 3.0)) * Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(2.0 + beta)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2e+15)
tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (beta + (alpha + 2.0));
else
tmp = ((1.0 + beta) / ((alpha + beta) + 3.0)) * (((1.0 + alpha) / beta) / (alpha + (2.0 + beta)));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2e+15], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(alpha + beta), $MachinePrecision] + 3.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\left(\beta + 3\right) \cdot \left(2 + \beta\right)}}{\beta + \left(\alpha + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \beta}{\left(\alpha + \beta\right) + 3} \cdot \frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(2 + \beta\right)}\\
\end{array}
\end{array}
if beta < 2e15Initial program 99.8%
associate-/l/99.4%
associate-/r*93.1%
+-commutative93.1%
associate-+r+93.1%
+-commutative93.1%
associate-+r+93.1%
associate-+r+93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
times-frac99.4%
Simplified99.4%
expm1-log1p-u99.4%
expm1-udef83.6%
*-commutative83.6%
+-commutative83.6%
Applied egg-rr83.6%
expm1-def99.4%
expm1-log1p99.4%
*-commutative99.4%
associate-*r/99.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
Applied egg-rr99.8%
Taylor expanded in alpha around 0 71.4%
if 2e15 < beta Initial program 75.5%
associate-/l/72.8%
associate-/r*63.5%
+-commutative63.5%
associate-+r+63.5%
+-commutative63.5%
associate-+r+63.5%
associate-+r+63.5%
distribute-rgt1-in63.5%
+-commutative63.5%
*-commutative63.5%
distribute-rgt1-in63.5%
+-commutative63.5%
times-frac89.8%
Simplified89.8%
expm1-log1p-u89.8%
expm1-udef56.0%
*-commutative56.0%
+-commutative56.0%
Applied egg-rr56.0%
expm1-def89.8%
expm1-log1p89.8%
*-commutative89.8%
associate-*r/90.0%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 83.4%
Final simplification75.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.95e+15) (/ (/ (+ 1.0 beta) (* (+ beta 3.0) (+ 2.0 beta))) (+ beta (+ alpha 2.0))) (/ (/ (- alpha -1.0) beta) (+ 1.0 (+ 2.0 (+ alpha beta))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.95e+15) {
tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (beta + (alpha + 2.0));
} else {
tmp = ((alpha - -1.0) / beta) / (1.0 + (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 <= 1.95d+15) then
tmp = ((1.0d0 + beta) / ((beta + 3.0d0) * (2.0d0 + beta))) / (beta + (alpha + 2.0d0))
else
tmp = ((alpha - (-1.0d0)) / beta) / (1.0d0 + (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 <= 1.95e+15) {
tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (beta + (alpha + 2.0));
} else {
tmp = ((alpha - -1.0) / beta) / (1.0 + (2.0 + (alpha + beta)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.95e+15: tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (beta + (alpha + 2.0)) else: tmp = ((alpha - -1.0) / beta) / (1.0 + (2.0 + (alpha + beta))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.95e+15) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(Float64(beta + 3.0) * Float64(2.0 + beta))) / Float64(beta + Float64(alpha + 2.0))); else tmp = Float64(Float64(Float64(alpha - -1.0) / beta) / Float64(1.0 + 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 <= 1.95e+15)
tmp = ((1.0 + beta) / ((beta + 3.0) * (2.0 + beta))) / (beta + (alpha + 2.0));
else
tmp = ((alpha - -1.0) / beta) / (1.0 + (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, 1.95e+15], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / beta), $MachinePrecision] / N[(1.0 + 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 1.95 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\left(\beta + 3\right) \cdot \left(2 + \beta\right)}}{\beta + \left(\alpha + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{\beta}}{1 + \left(2 + \left(\alpha + \beta\right)\right)}\\
\end{array}
\end{array}
if beta < 1.95e15Initial program 99.8%
associate-/l/99.4%
associate-/r*93.1%
+-commutative93.1%
associate-+r+93.1%
+-commutative93.1%
associate-+r+93.1%
associate-+r+93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
*-commutative93.1%
distribute-rgt1-in93.1%
+-commutative93.1%
times-frac99.4%
Simplified99.4%
expm1-log1p-u99.4%
expm1-udef83.6%
*-commutative83.6%
+-commutative83.6%
Applied egg-rr83.6%
expm1-def99.4%
expm1-log1p99.4%
*-commutative99.4%
associate-*r/99.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
Applied egg-rr99.8%
Taylor expanded in alpha around 0 71.4%
if 1.95e15 < beta Initial program 75.5%
Taylor expanded in beta around -inf 83.0%
associate-*r/83.0%
mul-1-neg83.0%
sub-neg83.0%
mul-1-neg83.0%
distribute-neg-in83.0%
+-commutative83.0%
mul-1-neg83.0%
distribute-lft-in83.0%
metadata-eval83.0%
mul-1-neg83.0%
unsub-neg83.0%
Simplified83.0%
Final simplification75.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 5.2)
(*
(/ (+ 1.0 alpha) (+ alpha (+ 2.0 beta)))
(+ 0.16666666666666666 (* alpha -0.1388888888888889)))
(/ (/ (+ 1.0 alpha) beta) (+ beta (+ alpha 2.0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 5.2) {
tmp = ((1.0 + alpha) / (alpha + (2.0 + beta))) * (0.16666666666666666 + (alpha * -0.1388888888888889));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 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 <= 5.2d0) then
tmp = ((1.0d0 + alpha) / (alpha + (2.0d0 + beta))) * (0.16666666666666666d0 + (alpha * (-0.1388888888888889d0)))
else
tmp = ((1.0d0 + alpha) / beta) / (beta + (alpha + 2.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 5.2) {
tmp = ((1.0 + alpha) / (alpha + (2.0 + beta))) * (0.16666666666666666 + (alpha * -0.1388888888888889));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 5.2: tmp = ((1.0 + alpha) / (alpha + (2.0 + beta))) * (0.16666666666666666 + (alpha * -0.1388888888888889)) else: tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 5.2) tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(2.0 + beta))) * Float64(0.16666666666666666 + Float64(alpha * -0.1388888888888889))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(beta + Float64(alpha + 2.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 5.2)
tmp = ((1.0 + alpha) / (alpha + (2.0 + beta))) * (0.16666666666666666 + (alpha * -0.1388888888888889));
else
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 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, 5.2], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.16666666666666666 + N[(alpha * -0.1388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 5.2:\\
\;\;\;\;\frac{1 + \alpha}{\alpha + \left(2 + \beta\right)} \cdot \left(0.16666666666666666 + \alpha \cdot -0.1388888888888889\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + \left(\alpha + 2\right)}\\
\end{array}
\end{array}
if beta < 5.20000000000000018Initial program 99.9%
associate-/l/99.4%
associate-/r*93.0%
+-commutative93.0%
associate-+r+93.0%
+-commutative93.0%
associate-+r+93.0%
associate-+r+93.0%
distribute-rgt1-in93.0%
+-commutative93.0%
*-commutative93.0%
distribute-rgt1-in93.0%
+-commutative93.0%
times-frac99.4%
Simplified99.4%
Taylor expanded in beta around 0 97.8%
associate-/r*98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in alpha around 0 68.8%
*-commutative68.8%
Simplified68.8%
if 5.20000000000000018 < beta Initial program 76.6%
associate-/l/74.1%
associate-/r*65.2%
+-commutative65.2%
associate-+r+65.2%
+-commutative65.2%
associate-+r+65.2%
associate-+r+65.2%
distribute-rgt1-in65.2%
+-commutative65.2%
*-commutative65.2%
distribute-rgt1-in65.2%
+-commutative65.2%
times-frac90.3%
Simplified90.3%
expm1-log1p-u90.3%
expm1-udef55.5%
*-commutative55.5%
+-commutative55.5%
Applied egg-rr55.5%
expm1-def90.3%
expm1-log1p90.3%
*-commutative90.3%
associate-*r/90.4%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
Simplified99.7%
associate-*l/99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
Applied egg-rr99.7%
Taylor expanded in beta around inf 81.1%
Final simplification72.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.05e+15) (/ (/ (+ 1.0 beta) (+ 2.0 beta)) (* (+ beta 3.0) (+ 2.0 beta))) (/ (/ (+ 1.0 alpha) beta) (+ beta (+ alpha 2.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.05e+15) {
tmp = ((1.0 + beta) / (2.0 + beta)) / ((beta + 3.0) * (2.0 + beta));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 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.05d+15) then
tmp = ((1.0d0 + beta) / (2.0d0 + beta)) / ((beta + 3.0d0) * (2.0d0 + beta))
else
tmp = ((1.0d0 + alpha) / beta) / (beta + (alpha + 2.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.05e+15) {
tmp = ((1.0 + beta) / (2.0 + beta)) / ((beta + 3.0) * (2.0 + beta));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.05e+15: tmp = ((1.0 + beta) / (2.0 + beta)) / ((beta + 3.0) * (2.0 + beta)) else: tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.05e+15) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(2.0 + beta)) / Float64(Float64(beta + 3.0) * Float64(2.0 + beta))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(beta + Float64(alpha + 2.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.05e+15)
tmp = ((1.0 + beta) / (2.0 + beta)) / ((beta + 3.0) * (2.0 + beta));
else
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 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.05e+15], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.05 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{1 + \beta}{2 + \beta}}{\left(\beta + 3\right) \cdot \left(2 + \beta\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + \left(\alpha + 2\right)}\\
\end{array}
\end{array}
if beta < 2.05e15Initial program 99.8%
associate-/l/99.4%
associate-+l+99.4%
+-commutative99.4%
*-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in alpha around 0 86.8%
Taylor expanded in alpha around 0 70.5%
if 2.05e15 < beta Initial program 75.5%
associate-/l/72.8%
associate-/r*63.5%
+-commutative63.5%
associate-+r+63.5%
+-commutative63.5%
associate-+r+63.5%
associate-+r+63.5%
distribute-rgt1-in63.5%
+-commutative63.5%
*-commutative63.5%
distribute-rgt1-in63.5%
+-commutative63.5%
times-frac89.8%
Simplified89.8%
expm1-log1p-u89.8%
expm1-udef56.0%
*-commutative56.0%
+-commutative56.0%
Applied egg-rr56.0%
expm1-def89.8%
expm1-log1p89.8%
*-commutative89.8%
associate-*r/90.0%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
Simplified99.7%
associate-*l/99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
Applied egg-rr99.7%
Taylor expanded in beta around inf 83.0%
Final simplification74.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.95e+15) (/ (/ (+ 1.0 beta) (+ 2.0 beta)) (* (+ beta 3.0) (+ 2.0 beta))) (/ (/ (- alpha -1.0) beta) (+ 1.0 (+ 2.0 (+ alpha beta))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.95e+15) {
tmp = ((1.0 + beta) / (2.0 + beta)) / ((beta + 3.0) * (2.0 + beta));
} else {
tmp = ((alpha - -1.0) / beta) / (1.0 + (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 <= 1.95d+15) then
tmp = ((1.0d0 + beta) / (2.0d0 + beta)) / ((beta + 3.0d0) * (2.0d0 + beta))
else
tmp = ((alpha - (-1.0d0)) / beta) / (1.0d0 + (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 <= 1.95e+15) {
tmp = ((1.0 + beta) / (2.0 + beta)) / ((beta + 3.0) * (2.0 + beta));
} else {
tmp = ((alpha - -1.0) / beta) / (1.0 + (2.0 + (alpha + beta)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.95e+15: tmp = ((1.0 + beta) / (2.0 + beta)) / ((beta + 3.0) * (2.0 + beta)) else: tmp = ((alpha - -1.0) / beta) / (1.0 + (2.0 + (alpha + beta))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.95e+15) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(2.0 + beta)) / Float64(Float64(beta + 3.0) * Float64(2.0 + beta))); else tmp = Float64(Float64(Float64(alpha - -1.0) / beta) / Float64(1.0 + 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 <= 1.95e+15)
tmp = ((1.0 + beta) / (2.0 + beta)) / ((beta + 3.0) * (2.0 + beta));
else
tmp = ((alpha - -1.0) / beta) / (1.0 + (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, 1.95e+15], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / beta), $MachinePrecision] / N[(1.0 + 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 1.95 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{1 + \beta}{2 + \beta}}{\left(\beta + 3\right) \cdot \left(2 + \beta\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{\beta}}{1 + \left(2 + \left(\alpha + \beta\right)\right)}\\
\end{array}
\end{array}
if beta < 1.95e15Initial program 99.8%
associate-/l/99.4%
associate-+l+99.4%
+-commutative99.4%
*-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in alpha around 0 86.8%
Taylor expanded in alpha around 0 70.5%
if 1.95e15 < beta Initial program 75.5%
Taylor expanded in beta around -inf 83.0%
associate-*r/83.0%
mul-1-neg83.0%
sub-neg83.0%
mul-1-neg83.0%
distribute-neg-in83.0%
+-commutative83.0%
mul-1-neg83.0%
distribute-lft-in83.0%
metadata-eval83.0%
mul-1-neg83.0%
unsub-neg83.0%
Simplified83.0%
Final simplification74.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 2.4)
(*
(+ 0.16666666666666666 (* alpha -0.1388888888888889))
(/ (+ 1.0 alpha) (+ alpha 2.0)))
(/ (/ (+ 1.0 alpha) beta) (+ beta (+ alpha 2.0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.4) {
tmp = (0.16666666666666666 + (alpha * -0.1388888888888889)) * ((1.0 + alpha) / (alpha + 2.0));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 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.4d0) then
tmp = (0.16666666666666666d0 + (alpha * (-0.1388888888888889d0))) * ((1.0d0 + alpha) / (alpha + 2.0d0))
else
tmp = ((1.0d0 + alpha) / beta) / (beta + (alpha + 2.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.4) {
tmp = (0.16666666666666666 + (alpha * -0.1388888888888889)) * ((1.0 + alpha) / (alpha + 2.0));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.4: tmp = (0.16666666666666666 + (alpha * -0.1388888888888889)) * ((1.0 + alpha) / (alpha + 2.0)) else: tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.4) tmp = Float64(Float64(0.16666666666666666 + Float64(alpha * -0.1388888888888889)) * Float64(Float64(1.0 + alpha) / Float64(alpha + 2.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(beta + Float64(alpha + 2.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.4)
tmp = (0.16666666666666666 + (alpha * -0.1388888888888889)) * ((1.0 + alpha) / (alpha + 2.0));
else
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 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.4], N[(N[(0.16666666666666666 + N[(alpha * -0.1388888888888889), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.4:\\
\;\;\;\;\left(0.16666666666666666 + \alpha \cdot -0.1388888888888889\right) \cdot \frac{1 + \alpha}{\alpha + 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + \left(\alpha + 2\right)}\\
\end{array}
\end{array}
if beta < 2.39999999999999991Initial program 99.9%
associate-/l/99.4%
associate-/r*93.0%
+-commutative93.0%
associate-+r+93.0%
+-commutative93.0%
associate-+r+93.0%
associate-+r+93.0%
distribute-rgt1-in93.0%
+-commutative93.0%
*-commutative93.0%
distribute-rgt1-in93.0%
+-commutative93.0%
times-frac99.4%
Simplified99.4%
Taylor expanded in beta around 0 97.8%
associate-/r*98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in alpha around 0 68.8%
*-commutative68.8%
Simplified68.8%
Taylor expanded in beta around 0 68.7%
if 2.39999999999999991 < beta Initial program 76.6%
associate-/l/74.1%
associate-/r*65.2%
+-commutative65.2%
associate-+r+65.2%
+-commutative65.2%
associate-+r+65.2%
associate-+r+65.2%
distribute-rgt1-in65.2%
+-commutative65.2%
*-commutative65.2%
distribute-rgt1-in65.2%
+-commutative65.2%
times-frac90.3%
Simplified90.3%
expm1-log1p-u90.3%
expm1-udef55.5%
*-commutative55.5%
+-commutative55.5%
Applied egg-rr55.5%
expm1-def90.3%
expm1-log1p90.3%
*-commutative90.3%
associate-*r/90.4%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
Simplified99.7%
associate-*l/99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
Applied egg-rr99.7%
Taylor expanded in beta around inf 81.1%
Final simplification72.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 6.0) (/ 0.16666666666666666 (+ 2.0 beta)) (/ (/ (+ 1.0 alpha) beta) (+ beta (+ alpha 2.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 6.0) {
tmp = 0.16666666666666666 / (2.0 + beta);
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 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 <= 6.0d0) then
tmp = 0.16666666666666666d0 / (2.0d0 + beta)
else
tmp = ((1.0d0 + alpha) / beta) / (beta + (alpha + 2.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 6.0) {
tmp = 0.16666666666666666 / (2.0 + beta);
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 6.0: tmp = 0.16666666666666666 / (2.0 + beta) else: tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 6.0) tmp = Float64(0.16666666666666666 / Float64(2.0 + beta)); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(beta + Float64(alpha + 2.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 6.0)
tmp = 0.16666666666666666 / (2.0 + beta);
else
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 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, 6.0], N[(0.16666666666666666 / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 6:\\
\;\;\;\;\frac{0.16666666666666666}{2 + \beta}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + \left(\alpha + 2\right)}\\
\end{array}
\end{array}
if beta < 6Initial program 99.9%
associate-/l/99.4%
associate-/r*93.0%
+-commutative93.0%
associate-+r+93.0%
+-commutative93.0%
associate-+r+93.0%
associate-+r+93.0%
distribute-rgt1-in93.0%
+-commutative93.0%
*-commutative93.0%
distribute-rgt1-in93.0%
+-commutative93.0%
times-frac99.4%
Simplified99.4%
Taylor expanded in beta around 0 97.8%
associate-/r*98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in alpha around 0 68.5%
if 6 < beta Initial program 76.6%
associate-/l/74.1%
associate-/r*65.2%
+-commutative65.2%
associate-+r+65.2%
+-commutative65.2%
associate-+r+65.2%
associate-+r+65.2%
distribute-rgt1-in65.2%
+-commutative65.2%
*-commutative65.2%
distribute-rgt1-in65.2%
+-commutative65.2%
times-frac90.3%
Simplified90.3%
expm1-log1p-u90.3%
expm1-udef55.5%
*-commutative55.5%
+-commutative55.5%
Applied egg-rr55.5%
expm1-def90.3%
expm1-log1p90.3%
*-commutative90.3%
associate-*r/90.4%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
Simplified99.7%
associate-*l/99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
Applied egg-rr99.7%
Taylor expanded in beta around inf 81.1%
Final simplification72.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 8.0) (/ 0.16666666666666666 (+ 2.0 beta)) (/ 1.0 (/ beta (/ (+ 1.0 alpha) beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 8.0) {
tmp = 0.16666666666666666 / (2.0 + beta);
} else {
tmp = 1.0 / (beta / ((1.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 <= 8.0d0) then
tmp = 0.16666666666666666d0 / (2.0d0 + beta)
else
tmp = 1.0d0 / (beta / ((1.0d0 + alpha) / beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 8.0) {
tmp = 0.16666666666666666 / (2.0 + beta);
} else {
tmp = 1.0 / (beta / ((1.0 + alpha) / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 8.0: tmp = 0.16666666666666666 / (2.0 + beta) else: tmp = 1.0 / (beta / ((1.0 + alpha) / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 8.0) tmp = Float64(0.16666666666666666 / Float64(2.0 + beta)); else tmp = Float64(1.0 / Float64(beta / Float64(Float64(1.0 + alpha) / beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 8.0)
tmp = 0.16666666666666666 / (2.0 + beta);
else
tmp = 1.0 / (beta / ((1.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, 8.0], N[(0.16666666666666666 / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(beta / N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 8:\\
\;\;\;\;\frac{0.16666666666666666}{2 + \beta}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\beta}{\frac{1 + \alpha}{\beta}}}\\
\end{array}
\end{array}
if beta < 8Initial program 99.9%
associate-/l/99.4%
associate-/r*93.0%
+-commutative93.0%
associate-+r+93.0%
+-commutative93.0%
associate-+r+93.0%
associate-+r+93.0%
distribute-rgt1-in93.0%
+-commutative93.0%
*-commutative93.0%
distribute-rgt1-in93.0%
+-commutative93.0%
times-frac99.4%
Simplified99.4%
Taylor expanded in beta around 0 97.8%
associate-/r*98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in alpha around 0 68.5%
if 8 < beta Initial program 76.6%
associate-/l/74.1%
associate-/r*65.2%
+-commutative65.2%
associate-+r+65.2%
+-commutative65.2%
associate-+r+65.2%
associate-+r+65.2%
distribute-rgt1-in65.2%
+-commutative65.2%
*-commutative65.2%
distribute-rgt1-in65.2%
+-commutative65.2%
times-frac90.3%
Simplified90.3%
Taylor expanded in beta around inf 78.2%
unpow278.2%
Simplified78.2%
clear-num78.2%
inv-pow78.2%
Applied egg-rr78.2%
unpow-178.2%
associate-/l*80.1%
Simplified80.1%
Final simplification72.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 7.6) (/ 0.16666666666666666 (+ 2.0 beta)) (/ (+ 1.0 alpha) (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 7.6) {
tmp = 0.16666666666666666 / (2.0 + beta);
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 7.6d0) then
tmp = 0.16666666666666666d0 / (2.0d0 + beta)
else
tmp = (1.0d0 + alpha) / (beta * beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 7.6) {
tmp = 0.16666666666666666 / (2.0 + beta);
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 7.6: tmp = 0.16666666666666666 / (2.0 + beta) else: tmp = (1.0 + alpha) / (beta * beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 7.6) tmp = Float64(0.16666666666666666 / Float64(2.0 + beta)); else tmp = Float64(Float64(1.0 + alpha) / Float64(beta * beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 7.6)
tmp = 0.16666666666666666 / (2.0 + beta);
else
tmp = (1.0 + alpha) / (beta * beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 7.6], N[(0.16666666666666666 / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 7.6:\\
\;\;\;\;\frac{0.16666666666666666}{2 + \beta}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 7.5999999999999996Initial program 99.9%
associate-/l/99.4%
associate-/r*93.0%
+-commutative93.0%
associate-+r+93.0%
+-commutative93.0%
associate-+r+93.0%
associate-+r+93.0%
distribute-rgt1-in93.0%
+-commutative93.0%
*-commutative93.0%
distribute-rgt1-in93.0%
+-commutative93.0%
times-frac99.4%
Simplified99.4%
Taylor expanded in beta around 0 97.8%
associate-/r*98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in alpha around 0 68.5%
if 7.5999999999999996 < beta Initial program 76.6%
associate-/l/74.1%
associate-/r*65.2%
+-commutative65.2%
associate-+r+65.2%
+-commutative65.2%
associate-+r+65.2%
associate-+r+65.2%
distribute-rgt1-in65.2%
+-commutative65.2%
*-commutative65.2%
distribute-rgt1-in65.2%
+-commutative65.2%
times-frac90.3%
Simplified90.3%
Taylor expanded in beta around inf 78.2%
unpow278.2%
Simplified78.2%
Final simplification71.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.6) (+ (* beta -0.041666666666666664) 0.08333333333333333) (/ 0.16666666666666666 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.6) {
tmp = (beta * -0.041666666666666664) + 0.08333333333333333;
} else {
tmp = 0.16666666666666666 / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.6d0) then
tmp = (beta * (-0.041666666666666664d0)) + 0.08333333333333333d0
else
tmp = 0.16666666666666666d0 / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.6) {
tmp = (beta * -0.041666666666666664) + 0.08333333333333333;
} else {
tmp = 0.16666666666666666 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.6: tmp = (beta * -0.041666666666666664) + 0.08333333333333333 else: tmp = 0.16666666666666666 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.6) tmp = Float64(Float64(beta * -0.041666666666666664) + 0.08333333333333333); else tmp = Float64(0.16666666666666666 / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.6)
tmp = (beta * -0.041666666666666664) + 0.08333333333333333;
else
tmp = 0.16666666666666666 / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.6], N[(N[(beta * -0.041666666666666664), $MachinePrecision] + 0.08333333333333333), $MachinePrecision], N[(0.16666666666666666 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.6:\\
\;\;\;\;\beta \cdot -0.041666666666666664 + 0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{0.16666666666666666}{\beta}\\
\end{array}
\end{array}
if beta < 1.6000000000000001Initial program 99.9%
associate-/l/99.4%
associate-/r*93.0%
+-commutative93.0%
associate-+r+93.0%
+-commutative93.0%
associate-+r+93.0%
associate-+r+93.0%
distribute-rgt1-in93.0%
+-commutative93.0%
*-commutative93.0%
distribute-rgt1-in93.0%
+-commutative93.0%
times-frac99.4%
Simplified99.4%
Taylor expanded in beta around 0 97.8%
associate-/r*98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in alpha around 0 68.5%
Taylor expanded in beta around 0 68.5%
if 1.6000000000000001 < beta Initial program 76.6%
associate-/l/74.1%
associate-/r*65.2%
+-commutative65.2%
associate-+r+65.2%
+-commutative65.2%
associate-+r+65.2%
associate-+r+65.2%
distribute-rgt1-in65.2%
+-commutative65.2%
*-commutative65.2%
distribute-rgt1-in65.2%
+-commutative65.2%
times-frac90.3%
Simplified90.3%
Taylor expanded in beta around 0 24.3%
associate-/r*24.3%
+-commutative24.3%
Simplified24.3%
Taylor expanded in alpha around 0 7.5%
Taylor expanded in beta around inf 7.5%
Final simplification48.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 7.6) (/ 0.16666666666666666 (+ 2.0 beta)) (/ 1.0 (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 7.6) {
tmp = 0.16666666666666666 / (2.0 + beta);
} else {
tmp = 1.0 / (beta * beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 7.6d0) then
tmp = 0.16666666666666666d0 / (2.0d0 + beta)
else
tmp = 1.0d0 / (beta * beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 7.6) {
tmp = 0.16666666666666666 / (2.0 + beta);
} else {
tmp = 1.0 / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 7.6: tmp = 0.16666666666666666 / (2.0 + beta) else: tmp = 1.0 / (beta * beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 7.6) tmp = Float64(0.16666666666666666 / Float64(2.0 + beta)); else tmp = Float64(1.0 / Float64(beta * beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 7.6)
tmp = 0.16666666666666666 / (2.0 + beta);
else
tmp = 1.0 / (beta * beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 7.6], N[(0.16666666666666666 / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 7.6:\\
\;\;\;\;\frac{0.16666666666666666}{2 + \beta}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 7.5999999999999996Initial program 99.9%
associate-/l/99.4%
associate-/r*93.0%
+-commutative93.0%
associate-+r+93.0%
+-commutative93.0%
associate-+r+93.0%
associate-+r+93.0%
distribute-rgt1-in93.0%
+-commutative93.0%
*-commutative93.0%
distribute-rgt1-in93.0%
+-commutative93.0%
times-frac99.4%
Simplified99.4%
Taylor expanded in beta around 0 97.8%
associate-/r*98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in alpha around 0 68.5%
if 7.5999999999999996 < beta Initial program 76.6%
associate-/l/74.1%
associate-/r*65.2%
+-commutative65.2%
associate-+r+65.2%
+-commutative65.2%
associate-+r+65.2%
associate-+r+65.2%
distribute-rgt1-in65.2%
+-commutative65.2%
*-commutative65.2%
distribute-rgt1-in65.2%
+-commutative65.2%
times-frac90.3%
Simplified90.3%
Taylor expanded in beta around inf 78.2%
unpow278.2%
Simplified78.2%
Taylor expanded in alpha around 0 73.0%
unpow273.0%
Simplified73.0%
Final simplification70.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.0) 0.08333333333333333 (/ 0.16666666666666666 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.0) {
tmp = 0.08333333333333333;
} else {
tmp = 0.16666666666666666 / 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.0d0) then
tmp = 0.08333333333333333d0
else
tmp = 0.16666666666666666d0 / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.0) {
tmp = 0.08333333333333333;
} else {
tmp = 0.16666666666666666 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.0: tmp = 0.08333333333333333 else: tmp = 0.16666666666666666 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.0) tmp = 0.08333333333333333; else tmp = Float64(0.16666666666666666 / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.0)
tmp = 0.08333333333333333;
else
tmp = 0.16666666666666666 / 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.0], 0.08333333333333333, N[(0.16666666666666666 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{0.16666666666666666}{\beta}\\
\end{array}
\end{array}
if beta < 2Initial program 99.9%
associate-/l/99.4%
associate-/r*93.0%
+-commutative93.0%
associate-+r+93.0%
+-commutative93.0%
associate-+r+93.0%
associate-+r+93.0%
distribute-rgt1-in93.0%
+-commutative93.0%
*-commutative93.0%
distribute-rgt1-in93.0%
+-commutative93.0%
times-frac99.4%
Simplified99.4%
Taylor expanded in beta around 0 97.8%
associate-/r*98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in alpha around 0 68.5%
Taylor expanded in beta around 0 68.5%
if 2 < beta Initial program 76.6%
associate-/l/74.1%
associate-/r*65.2%
+-commutative65.2%
associate-+r+65.2%
+-commutative65.2%
associate-+r+65.2%
associate-+r+65.2%
distribute-rgt1-in65.2%
+-commutative65.2%
*-commutative65.2%
distribute-rgt1-in65.2%
+-commutative65.2%
times-frac90.3%
Simplified90.3%
Taylor expanded in beta around 0 24.3%
associate-/r*24.3%
+-commutative24.3%
Simplified24.3%
Taylor expanded in alpha around 0 7.5%
Taylor expanded in beta around inf 7.5%
Final simplification48.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.16666666666666666 (+ 2.0 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.16666666666666666 / (2.0 + beta);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.16666666666666666d0 / (2.0d0 + beta)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.16666666666666666 / (2.0 + beta);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.16666666666666666 / (2.0 + beta)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.16666666666666666 / Float64(2.0 + beta)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.16666666666666666 / (2.0 + beta);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.16666666666666666 / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.16666666666666666}{2 + \beta}
\end{array}
Initial program 92.1%
associate-/l/91.0%
associate-/r*83.8%
+-commutative83.8%
associate-+r+83.8%
+-commutative83.8%
associate-+r+83.8%
associate-+r+83.8%
distribute-rgt1-in83.8%
+-commutative83.8%
*-commutative83.8%
distribute-rgt1-in83.8%
+-commutative83.8%
times-frac96.4%
Simplified96.4%
Taylor expanded in beta around 0 73.4%
associate-/r*73.7%
+-commutative73.7%
Simplified73.7%
Taylor expanded in alpha around 0 48.3%
Final simplification48.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 0.08333333333333333)
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.08333333333333333;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.08333333333333333d0
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.08333333333333333;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.08333333333333333
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return 0.08333333333333333 end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.08333333333333333;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := 0.08333333333333333
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
0.08333333333333333
\end{array}
Initial program 92.1%
associate-/l/91.0%
associate-/r*83.8%
+-commutative83.8%
associate-+r+83.8%
+-commutative83.8%
associate-+r+83.8%
associate-+r+83.8%
distribute-rgt1-in83.8%
+-commutative83.8%
*-commutative83.8%
distribute-rgt1-in83.8%
+-commutative83.8%
times-frac96.4%
Simplified96.4%
Taylor expanded in beta around 0 73.4%
associate-/r*73.7%
+-commutative73.7%
Simplified73.7%
Taylor expanded in alpha around 0 48.3%
Taylor expanded in beta around 0 47.1%
Final simplification47.1%
herbie shell --seed 2023268
(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)))