
(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 (+ (+ beta 2.0) alpha))) (* (/ (+ 1.0 beta) t_0) (/ (/ (+ 1.0 alpha) t_0) (+ alpha (+ beta 3.0))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = (beta + 2.0) + alpha;
return ((1.0 + beta) / t_0) * (((1.0 + alpha) / t_0) / (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 = (beta + 2.0d0) + alpha
code = ((1.0d0 + beta) / t_0) * (((1.0d0 + alpha) / t_0) / (alpha + (beta + 3.0d0)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = (beta + 2.0) + alpha;
return ((1.0 + beta) / t_0) * (((1.0 + alpha) / t_0) / (alpha + (beta + 3.0)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = (beta + 2.0) + alpha return ((1.0 + beta) / t_0) * (((1.0 + alpha) / t_0) / (alpha + (beta + 3.0)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(Float64(beta + 2.0) + alpha) return Float64(Float64(Float64(1.0 + beta) / t_0) * Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(alpha + Float64(beta + 3.0)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = (beta + 2.0) + alpha;
tmp = ((1.0 + beta) / t_0) * (((1.0 + alpha) / t_0) / (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[(N[(beta + 2.0), $MachinePrecision] + alpha), $MachinePrecision]}, N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \left(\beta + 2\right) + \alpha\\
\frac{1 + \beta}{t_0} \cdot \frac{\frac{1 + \alpha}{t_0}}{\alpha + \left(\beta + 3\right)}
\end{array}
\end{array}
Initial program 92.6%
associate-/l/91.6%
associate-+l+91.6%
+-commutative91.6%
associate-+r+91.6%
associate-+l+91.6%
distribute-rgt1-in91.6%
*-rgt-identity91.6%
distribute-lft-out91.6%
+-commutative91.6%
associate-*l/97.2%
*-commutative97.2%
associate-*r/92.2%
Simplified92.2%
associate-*r/97.2%
+-commutative97.2%
Applied egg-rr97.2%
+-commutative97.2%
*-commutative97.2%
+-commutative97.2%
associate-*r/97.1%
associate-/r*99.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
(let* ((t_0 (+ alpha (+ beta 3.0))) (t_1 (+ (+ beta 2.0) alpha)))
(if (<= beta 27500000000.0)
(* (+ 1.0 alpha) (/ (/ (+ 1.0 beta) t_1) (* t_0 t_1)))
(* (/ (/ (+ 1.0 alpha) t_1) t_0) (+ 1.0 (/ (- -1.0 alpha) beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 3.0);
double t_1 = (beta + 2.0) + alpha;
double tmp;
if (beta <= 27500000000.0) {
tmp = (1.0 + alpha) * (((1.0 + beta) / t_1) / (t_0 * t_1));
} else {
tmp = (((1.0 + alpha) / t_1) / t_0) * (1.0 + ((-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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = alpha + (beta + 3.0d0)
t_1 = (beta + 2.0d0) + alpha
if (beta <= 27500000000.0d0) then
tmp = (1.0d0 + alpha) * (((1.0d0 + beta) / t_1) / (t_0 * t_1))
else
tmp = (((1.0d0 + alpha) / t_1) / t_0) * (1.0d0 + (((-1.0d0) - alpha) / beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 3.0);
double t_1 = (beta + 2.0) + alpha;
double tmp;
if (beta <= 27500000000.0) {
tmp = (1.0 + alpha) * (((1.0 + beta) / t_1) / (t_0 * t_1));
} else {
tmp = (((1.0 + alpha) / t_1) / t_0) * (1.0 + ((-1.0 - alpha) / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 3.0) t_1 = (beta + 2.0) + alpha tmp = 0 if beta <= 27500000000.0: tmp = (1.0 + alpha) * (((1.0 + beta) / t_1) / (t_0 * t_1)) else: tmp = (((1.0 + alpha) / t_1) / t_0) * (1.0 + ((-1.0 - alpha) / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 3.0)) t_1 = Float64(Float64(beta + 2.0) + alpha) tmp = 0.0 if (beta <= 27500000000.0) tmp = Float64(Float64(1.0 + alpha) * Float64(Float64(Float64(1.0 + beta) / t_1) / Float64(t_0 * t_1))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / t_1) / t_0) * Float64(1.0 + Float64(Float64(-1.0 - alpha) / beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 3.0);
t_1 = (beta + 2.0) + alpha;
tmp = 0.0;
if (beta <= 27500000000.0)
tmp = (1.0 + alpha) * (((1.0 + beta) / t_1) / (t_0 * t_1));
else
tmp = (((1.0 + alpha) / t_1) / t_0) * (1.0 + ((-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_] := Block[{t$95$0 = N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(beta + 2.0), $MachinePrecision] + alpha), $MachinePrecision]}, If[LessEqual[beta, 27500000000.0], N[(N[(1.0 + alpha), $MachinePrecision] * N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$1), $MachinePrecision] / N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(1.0 + N[(N[(-1.0 - alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 3\right)\\
t_1 := \left(\beta + 2\right) + \alpha\\
\mathbf{if}\;\beta \leq 27500000000:\\
\;\;\;\;\left(1 + \alpha\right) \cdot \frac{\frac{1 + \beta}{t_1}}{t_0 \cdot t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_1}}{t_0} \cdot \left(1 + \frac{-1 - \alpha}{\beta}\right)\\
\end{array}
\end{array}
if beta < 2.75e10Initial program 99.9%
associate-/l/99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
distribute-rgt1-in99.9%
*-rgt-identity99.9%
distribute-lft-out99.9%
+-commutative99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.2%
Simplified93.2%
if 2.75e10 < beta Initial program 75.5%
associate-/l/72.3%
associate-+l+72.3%
+-commutative72.3%
associate-+r+72.3%
associate-+l+72.3%
distribute-rgt1-in72.3%
*-rgt-identity72.3%
distribute-lft-out72.3%
+-commutative72.3%
associate-*l/91.0%
*-commutative91.0%
associate-*r/89.7%
Simplified89.7%
associate-*r/91.0%
+-commutative91.0%
Applied egg-rr91.0%
+-commutative91.0%
*-commutative91.0%
+-commutative91.0%
associate-*r/91.0%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in beta around inf 74.9%
associate-*r/74.9%
distribute-lft-in74.9%
metadata-eval74.9%
neg-mul-174.9%
unsub-neg74.9%
Simplified74.9%
Final simplification87.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ (+ beta 2.0) alpha)))
(if (<= beta 18000000000.0)
(/ (* (+ 1.0 beta) (/ (/ 1.0 (+ beta 3.0)) (+ beta 2.0))) t_0)
(*
(/ (/ (+ 1.0 alpha) t_0) (+ alpha (+ beta 3.0)))
(+ 1.0 (/ (- -1.0 alpha) beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = (beta + 2.0) + alpha;
double tmp;
if (beta <= 18000000000.0) {
tmp = ((1.0 + beta) * ((1.0 / (beta + 3.0)) / (beta + 2.0))) / t_0;
} else {
tmp = (((1.0 + alpha) / t_0) / (alpha + (beta + 3.0))) * (1.0 + ((-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) :: t_0
real(8) :: tmp
t_0 = (beta + 2.0d0) + alpha
if (beta <= 18000000000.0d0) then
tmp = ((1.0d0 + beta) * ((1.0d0 / (beta + 3.0d0)) / (beta + 2.0d0))) / t_0
else
tmp = (((1.0d0 + alpha) / t_0) / (alpha + (beta + 3.0d0))) * (1.0d0 + (((-1.0d0) - alpha) / beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = (beta + 2.0) + alpha;
double tmp;
if (beta <= 18000000000.0) {
tmp = ((1.0 + beta) * ((1.0 / (beta + 3.0)) / (beta + 2.0))) / t_0;
} else {
tmp = (((1.0 + alpha) / t_0) / (alpha + (beta + 3.0))) * (1.0 + ((-1.0 - alpha) / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = (beta + 2.0) + alpha tmp = 0 if beta <= 18000000000.0: tmp = ((1.0 + beta) * ((1.0 / (beta + 3.0)) / (beta + 2.0))) / t_0 else: tmp = (((1.0 + alpha) / t_0) / (alpha + (beta + 3.0))) * (1.0 + ((-1.0 - alpha) / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(Float64(beta + 2.0) + alpha) tmp = 0.0 if (beta <= 18000000000.0) tmp = Float64(Float64(Float64(1.0 + beta) * Float64(Float64(1.0 / Float64(beta + 3.0)) / Float64(beta + 2.0))) / t_0); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(alpha + Float64(beta + 3.0))) * Float64(1.0 + Float64(Float64(-1.0 - alpha) / beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = (beta + 2.0) + alpha;
tmp = 0.0;
if (beta <= 18000000000.0)
tmp = ((1.0 + beta) * ((1.0 / (beta + 3.0)) / (beta + 2.0))) / t_0;
else
tmp = (((1.0 + alpha) / t_0) / (alpha + (beta + 3.0))) * (1.0 + ((-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_] := Block[{t$95$0 = N[(N[(beta + 2.0), $MachinePrecision] + alpha), $MachinePrecision]}, If[LessEqual[beta, 18000000000.0], N[(N[(N[(1.0 + beta), $MachinePrecision] * N[(N[(1.0 / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(-1.0 - alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \left(\beta + 2\right) + \alpha\\
\mathbf{if}\;\beta \leq 18000000000:\\
\;\;\;\;\frac{\left(1 + \beta\right) \cdot \frac{\frac{1}{\beta + 3}}{\beta + 2}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0}}{\alpha + \left(\beta + 3\right)} \cdot \left(1 + \frac{-1 - \alpha}{\beta}\right)\\
\end{array}
\end{array}
if beta < 1.8e10Initial program 99.9%
associate-/l/99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
distribute-rgt1-in99.9%
*-rgt-identity99.9%
distribute-lft-out99.9%
+-commutative99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.2%
Simplified93.2%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
associate-*l/99.9%
associate-/l/99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in alpha around 0 64.6%
associate-/r*64.6%
+-commutative64.6%
+-commutative64.6%
Simplified64.6%
if 1.8e10 < beta Initial program 75.5%
associate-/l/72.3%
associate-+l+72.3%
+-commutative72.3%
associate-+r+72.3%
associate-+l+72.3%
distribute-rgt1-in72.3%
*-rgt-identity72.3%
distribute-lft-out72.3%
+-commutative72.3%
associate-*l/91.0%
*-commutative91.0%
associate-*r/89.7%
Simplified89.7%
associate-*r/91.0%
+-commutative91.0%
Applied egg-rr91.0%
+-commutative91.0%
*-commutative91.0%
+-commutative91.0%
associate-*r/91.0%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in beta around inf 74.9%
associate-*r/74.9%
distribute-lft-in74.9%
metadata-eval74.9%
neg-mul-174.9%
unsub-neg74.9%
Simplified74.9%
Final simplification67.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ (+ beta 2.0) alpha)))
(if (<= beta 4.2e+15)
(/ (/ (+ 1.0 beta) t_0) (* (+ beta 2.0) (+ beta 3.0)))
(*
(/ (/ (+ 1.0 alpha) t_0) (+ alpha (+ beta 3.0)))
(- 1.0 (/ alpha beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = (beta + 2.0) + alpha;
double tmp;
if (beta <= 4.2e+15) {
tmp = ((1.0 + beta) / t_0) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = (((1.0 + alpha) / t_0) / (alpha + (beta + 3.0))) * (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) :: t_0
real(8) :: tmp
t_0 = (beta + 2.0d0) + alpha
if (beta <= 4.2d+15) then
tmp = ((1.0d0 + beta) / t_0) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = (((1.0d0 + alpha) / t_0) / (alpha + (beta + 3.0d0))) * (1.0d0 - (alpha / beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = (beta + 2.0) + alpha;
double tmp;
if (beta <= 4.2e+15) {
tmp = ((1.0 + beta) / t_0) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = (((1.0 + alpha) / t_0) / (alpha + (beta + 3.0))) * (1.0 - (alpha / beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = (beta + 2.0) + alpha tmp = 0 if beta <= 4.2e+15: tmp = ((1.0 + beta) / t_0) / ((beta + 2.0) * (beta + 3.0)) else: tmp = (((1.0 + alpha) / t_0) / (alpha + (beta + 3.0))) * (1.0 - (alpha / beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(Float64(beta + 2.0) + alpha) tmp = 0.0 if (beta <= 4.2e+15) tmp = Float64(Float64(Float64(1.0 + beta) / t_0) / Float64(Float64(beta + 2.0) * Float64(beta + 3.0))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(alpha + Float64(beta + 3.0))) * Float64(1.0 - Float64(alpha / beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = (beta + 2.0) + alpha;
tmp = 0.0;
if (beta <= 4.2e+15)
tmp = ((1.0 + beta) / t_0) / ((beta + 2.0) * (beta + 3.0));
else
tmp = (((1.0 + alpha) / t_0) / (alpha + (beta + 3.0))) * (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_] := Block[{t$95$0 = N[(N[(beta + 2.0), $MachinePrecision] + alpha), $MachinePrecision]}, If[LessEqual[beta, 4.2e+15], N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(alpha / beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \left(\beta + 2\right) + \alpha\\
\mathbf{if}\;\beta \leq 4.2 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{1 + \beta}{t_0}}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0}}{\alpha + \left(\beta + 3\right)} \cdot \left(1 - \frac{\alpha}{\beta}\right)\\
\end{array}
\end{array}
if beta < 4.2e15Initial program 99.9%
associate-/l/99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
distribute-rgt1-in99.9%
*-rgt-identity99.9%
distribute-lft-out99.9%
+-commutative99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.3%
Simplified93.3%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
associate-*r/99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-/l*99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in alpha around 0 64.7%
if 4.2e15 < beta Initial program 74.5%
associate-/l/71.2%
associate-+l+71.2%
+-commutative71.2%
associate-+r+71.2%
associate-+l+71.2%
distribute-rgt1-in71.2%
*-rgt-identity71.2%
distribute-lft-out71.2%
+-commutative71.2%
associate-*l/90.6%
*-commutative90.6%
associate-*r/89.3%
Simplified89.3%
associate-*r/90.6%
+-commutative90.6%
Applied egg-rr90.6%
+-commutative90.6%
*-commutative90.6%
+-commutative90.6%
associate-*r/90.6%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in beta around inf 75.2%
associate-*r/75.2%
distribute-lft-in75.2%
metadata-eval75.2%
neg-mul-175.2%
unsub-neg75.2%
Simplified75.2%
Taylor expanded in alpha around inf 75.2%
associate-*r/75.2%
mul-1-neg75.2%
Simplified75.2%
Final simplification67.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 4.8e+15)
(/ (/ (+ 1.0 beta) (+ (+ beta 2.0) alpha)) (* (+ beta 2.0) (+ beta 3.0)))
(*
(+ 1.0 (/ (- -1.0 alpha) beta))
(/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 3.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.8e+15) {
tmp = ((1.0 + beta) / ((beta + 2.0) + alpha)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / beta) / (alpha + (beta + 3.0)));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 4.8d+15) then
tmp = ((1.0d0 + beta) / ((beta + 2.0d0) + alpha)) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = (1.0d0 + (((-1.0d0) - alpha) / beta)) * (((1.0d0 + alpha) / beta) / (alpha + (beta + 3.0d0)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 4.8e+15) {
tmp = ((1.0 + beta) / ((beta + 2.0) + alpha)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / beta) / (alpha + (beta + 3.0)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.8e+15: tmp = ((1.0 + beta) / ((beta + 2.0) + alpha)) / ((beta + 2.0) * (beta + 3.0)) else: tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / beta) / (alpha + (beta + 3.0))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.8e+15) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) + alpha)) / Float64(Float64(beta + 2.0) * Float64(beta + 3.0))); else tmp = Float64(Float64(1.0 + Float64(Float64(-1.0 - alpha) / beta)) * Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 3.0)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 4.8e+15)
tmp = ((1.0 + beta) / ((beta + 2.0) + alpha)) / ((beta + 2.0) * (beta + 3.0));
else
tmp = (1.0 + ((-1.0 - alpha) / beta)) * (((1.0 + alpha) / beta) / (alpha + (beta + 3.0)));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 4.8e+15], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] + alpha), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(-1.0 - alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4.8 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\left(\beta + 2\right) + \alpha}}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{-1 - \alpha}{\beta}\right) \cdot \frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 4.8e15Initial program 99.9%
associate-/l/99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
distribute-rgt1-in99.9%
*-rgt-identity99.9%
distribute-lft-out99.9%
+-commutative99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.3%
Simplified93.3%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
associate-*r/99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-/l*99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in alpha around 0 64.7%
if 4.8e15 < beta Initial program 74.5%
associate-/l/71.2%
associate-+l+71.2%
+-commutative71.2%
associate-+r+71.2%
associate-+l+71.2%
distribute-rgt1-in71.2%
*-rgt-identity71.2%
distribute-lft-out71.2%
+-commutative71.2%
associate-*l/90.6%
*-commutative90.6%
associate-*r/89.3%
Simplified89.3%
associate-*r/90.6%
+-commutative90.6%
Applied egg-rr90.6%
+-commutative90.6%
*-commutative90.6%
+-commutative90.6%
associate-*r/90.6%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in beta around inf 75.2%
associate-*r/75.2%
distribute-lft-in75.2%
metadata-eval75.2%
neg-mul-175.2%
unsub-neg75.2%
Simplified75.2%
Taylor expanded in beta around inf 75.0%
Final simplification67.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ (+ beta 2.0) alpha)))
(if (<= beta 8.5e+19)
(/ (/ (+ 1.0 beta) t_0) (* (+ beta 2.0) (+ beta 3.0)))
(/ (/ (+ 1.0 alpha) beta) t_0))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = (beta + 2.0) + alpha;
double tmp;
if (beta <= 8.5e+19) {
tmp = ((1.0 + beta) / t_0) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / t_0;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = (beta + 2.0d0) + alpha
if (beta <= 8.5d+19) then
tmp = ((1.0d0 + beta) / t_0) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = ((1.0d0 + alpha) / beta) / t_0
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = (beta + 2.0) + alpha;
double tmp;
if (beta <= 8.5e+19) {
tmp = ((1.0 + beta) / t_0) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / t_0;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = (beta + 2.0) + alpha tmp = 0 if beta <= 8.5e+19: tmp = ((1.0 + beta) / t_0) / ((beta + 2.0) * (beta + 3.0)) else: tmp = ((1.0 + alpha) / beta) / t_0 return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(Float64(beta + 2.0) + alpha) tmp = 0.0 if (beta <= 8.5e+19) tmp = Float64(Float64(Float64(1.0 + beta) / t_0) / Float64(Float64(beta + 2.0) * Float64(beta + 3.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / t_0); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = (beta + 2.0) + alpha;
tmp = 0.0;
if (beta <= 8.5e+19)
tmp = ((1.0 + beta) / t_0) / ((beta + 2.0) * (beta + 3.0));
else
tmp = ((1.0 + alpha) / beta) / t_0;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(beta + 2.0), $MachinePrecision] + alpha), $MachinePrecision]}, If[LessEqual[beta, 8.5e+19], N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \left(\beta + 2\right) + \alpha\\
\mathbf{if}\;\beta \leq 8.5 \cdot 10^{+19}:\\
\;\;\;\;\frac{\frac{1 + \beta}{t_0}}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{t_0}\\
\end{array}
\end{array}
if beta < 8.5e19Initial program 99.9%
associate-/l/99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
distribute-rgt1-in99.9%
*-rgt-identity99.9%
distribute-lft-out99.9%
+-commutative99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.3%
Simplified93.3%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
associate-*r/99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-/l*99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in alpha around 0 64.7%
if 8.5e19 < beta Initial program 74.5%
associate-/l/71.2%
associate-+l+71.2%
+-commutative71.2%
associate-+r+71.2%
associate-+l+71.2%
distribute-rgt1-in71.2%
*-rgt-identity71.2%
distribute-lft-out71.2%
+-commutative71.2%
associate-*l/90.6%
*-commutative90.6%
associate-*r/89.3%
Simplified89.3%
associate-*r/90.6%
+-commutative90.6%
Applied egg-rr90.6%
+-commutative90.6%
*-commutative90.6%
+-commutative90.6%
associate-*r/90.6%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
associate-*l/99.8%
associate-/l/90.6%
+-commutative90.6%
+-commutative90.6%
Applied egg-rr90.6%
Taylor expanded in beta around inf 75.8%
Final simplification67.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1e+16) (/ (/ (+ 1.0 beta) (* (+ beta 2.0) (+ beta 3.0))) (+ beta 2.0)) (/ (/ (+ 1.0 alpha) beta) (+ (+ beta 2.0) alpha))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1e+16) {
tmp = ((1.0 + beta) / ((beta + 2.0) * (beta + 3.0))) / (beta + 2.0);
} else {
tmp = ((1.0 + alpha) / beta) / ((beta + 2.0) + alpha);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1d+16) then
tmp = ((1.0d0 + beta) / ((beta + 2.0d0) * (beta + 3.0d0))) / (beta + 2.0d0)
else
tmp = ((1.0d0 + alpha) / beta) / ((beta + 2.0d0) + alpha)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1e+16) {
tmp = ((1.0 + beta) / ((beta + 2.0) * (beta + 3.0))) / (beta + 2.0);
} else {
tmp = ((1.0 + alpha) / beta) / ((beta + 2.0) + alpha);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1e+16: tmp = ((1.0 + beta) / ((beta + 2.0) * (beta + 3.0))) / (beta + 2.0) else: tmp = ((1.0 + alpha) / beta) / ((beta + 2.0) + alpha) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1e+16) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(beta + 3.0))) / Float64(beta + 2.0)); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(Float64(beta + 2.0) + alpha)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1e+16)
tmp = ((1.0 + beta) / ((beta + 2.0) * (beta + 3.0))) / (beta + 2.0);
else
tmp = ((1.0 + alpha) / beta) / ((beta + 2.0) + alpha);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1e+16], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] + alpha), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 10^{+16}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}}{\beta + 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\left(\beta + 2\right) + \alpha}\\
\end{array}
\end{array}
if beta < 1e16Initial program 99.9%
associate-/l/99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
distribute-rgt1-in99.9%
*-rgt-identity99.9%
distribute-lft-out99.9%
+-commutative99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.3%
Simplified93.3%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 64.7%
Taylor expanded in alpha around 0 63.5%
associate-*l/63.5%
+-commutative63.5%
Applied egg-rr63.5%
associate-*r/63.5%
*-rgt-identity63.5%
+-commutative63.5%
+-commutative63.5%
+-commutative63.5%
Simplified63.5%
if 1e16 < beta Initial program 74.5%
associate-/l/71.2%
associate-+l+71.2%
+-commutative71.2%
associate-+r+71.2%
associate-+l+71.2%
distribute-rgt1-in71.2%
*-rgt-identity71.2%
distribute-lft-out71.2%
+-commutative71.2%
associate-*l/90.6%
*-commutative90.6%
associate-*r/89.3%
Simplified89.3%
associate-*r/90.6%
+-commutative90.6%
Applied egg-rr90.6%
+-commutative90.6%
*-commutative90.6%
+-commutative90.6%
associate-*r/90.6%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
associate-*l/99.8%
associate-/l/90.6%
+-commutative90.6%
+-commutative90.6%
Applied egg-rr90.6%
Taylor expanded in beta around inf 75.8%
Final simplification67.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 6e+19) (/ (/ (+ 1.0 beta) (+ beta 2.0)) (* (+ beta 2.0) (+ beta 3.0))) (/ (/ (+ 1.0 alpha) beta) (+ (+ beta 2.0) alpha))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 6e+19) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / ((beta + 2.0) + alpha);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 6d+19) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = ((1.0d0 + alpha) / beta) / ((beta + 2.0d0) + alpha)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 6e+19) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / ((beta + 2.0) + alpha);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 6e+19: tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)) else: tmp = ((1.0 + alpha) / beta) / ((beta + 2.0) + alpha) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 6e+19) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) / Float64(Float64(beta + 2.0) * Float64(beta + 3.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(Float64(beta + 2.0) + alpha)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 6e+19)
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
else
tmp = ((1.0 + alpha) / beta) / ((beta + 2.0) + alpha);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 6e+19], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] + alpha), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 6 \cdot 10^{+19}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\beta + 2}}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\left(\beta + 2\right) + \alpha}\\
\end{array}
\end{array}
if beta < 6e19Initial program 99.9%
associate-/l/99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
distribute-rgt1-in99.9%
*-rgt-identity99.9%
distribute-lft-out99.9%
+-commutative99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.3%
Simplified93.3%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 64.7%
Taylor expanded in alpha around 0 63.5%
un-div-inv63.5%
+-commutative63.5%
Applied egg-rr63.5%
if 6e19 < beta Initial program 74.5%
associate-/l/71.2%
associate-+l+71.2%
+-commutative71.2%
associate-+r+71.2%
associate-+l+71.2%
distribute-rgt1-in71.2%
*-rgt-identity71.2%
distribute-lft-out71.2%
+-commutative71.2%
associate-*l/90.6%
*-commutative90.6%
associate-*r/89.3%
Simplified89.3%
associate-*r/90.6%
+-commutative90.6%
Applied egg-rr90.6%
+-commutative90.6%
*-commutative90.6%
+-commutative90.6%
associate-*r/90.6%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
associate-*l/99.8%
associate-/l/90.6%
+-commutative90.6%
+-commutative90.6%
Applied egg-rr90.6%
Taylor expanded in beta around inf 75.8%
Final simplification67.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.55) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ (/ (+ 1.0 alpha) beta) (+ (+ beta 2.0) alpha))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.55) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) / ((beta + 2.0) + alpha);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.55d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = ((1.0d0 + alpha) / beta) / ((beta + 2.0d0) + alpha)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.55) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) / ((beta + 2.0) + alpha);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.55: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = ((1.0 + alpha) / beta) / ((beta + 2.0) + alpha) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.55) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(Float64(beta + 2.0) + alpha)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.55)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = ((1.0 + alpha) / beta) / ((beta + 2.0) + alpha);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.55], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] + alpha), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.55:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\left(\beta + 2\right) + \alpha}\\
\end{array}
\end{array}
if beta < 2.5499999999999998Initial program 99.9%
associate-/l/99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
distribute-rgt1-in99.9%
*-rgt-identity99.9%
distribute-lft-out99.9%
+-commutative99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.1%
Simplified93.1%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 64.2%
Taylor expanded in alpha around 0 63.1%
Taylor expanded in beta around 0 62.5%
*-commutative62.5%
Simplified62.5%
if 2.5499999999999998 < beta Initial program 76.1%
associate-/l/73.0%
associate-+l+73.0%
+-commutative73.0%
associate-+r+73.0%
associate-+l+73.0%
distribute-rgt1-in73.0%
*-rgt-identity73.0%
distribute-lft-out73.0%
+-commutative73.0%
associate-*l/91.2%
*-commutative91.2%
associate-*r/90.0%
Simplified90.0%
associate-*r/91.2%
+-commutative91.2%
Applied egg-rr91.2%
+-commutative91.2%
*-commutative91.2%
+-commutative91.2%
associate-*r/91.2%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
associate-*l/99.8%
associate-/l/91.1%
+-commutative91.1%
+-commutative91.1%
Applied egg-rr91.1%
Taylor expanded in beta around inf 74.5%
Final simplification66.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.5) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ (/ (- alpha -1.0) beta) (+ beta (+ alpha 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((alpha - -1.0) / beta) / (beta + (alpha + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.5d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = ((alpha - (-1.0d0)) / beta) / (beta + (alpha + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((alpha - -1.0) / beta) / (beta + (alpha + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.5: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = ((alpha - -1.0) / beta) / (beta + (alpha + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.5) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(Float64(Float64(alpha - -1.0) / beta) / Float64(beta + Float64(alpha + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.5)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = ((alpha - -1.0) / beta) / (beta + (alpha + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.5], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / beta), $MachinePrecision] / N[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.5:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{\beta}}{\beta + \left(\alpha + 3\right)}\\
\end{array}
\end{array}
if beta < 2.5Initial program 99.9%
associate-/l/99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
distribute-rgt1-in99.9%
*-rgt-identity99.9%
distribute-lft-out99.9%
+-commutative99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.1%
Simplified93.1%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 64.2%
Taylor expanded in alpha around 0 63.1%
Taylor expanded in beta around 0 62.5%
*-commutative62.5%
Simplified62.5%
if 2.5 < beta Initial program 76.1%
Taylor expanded in beta around -inf 74.5%
expm1-log1p-u74.5%
expm1-udef60.1%
mul-1-neg60.1%
fma-neg60.1%
metadata-eval60.1%
metadata-eval60.1%
associate-+l+60.1%
metadata-eval60.1%
associate-+r+60.1%
Applied egg-rr60.1%
expm1-def74.5%
expm1-log1p74.5%
distribute-frac-neg74.5%
fma-udef74.5%
neg-mul-174.5%
metadata-eval74.5%
distribute-neg-in74.5%
+-commutative74.5%
mul-1-neg74.5%
distribute-lft-in74.5%
metadata-eval74.5%
neg-mul-174.5%
unsub-neg74.5%
+-commutative74.5%
associate-+r+74.5%
Simplified74.5%
Final simplification66.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.5) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ 1.0 (* beta (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = 1.0 / (beta * (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.5d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = 1.0d0 / (beta * (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = 1.0 / (beta * (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.5: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = 1.0 / (beta * (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.5) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(1.0 / Float64(beta * Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.5)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = 1.0 / (beta * (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.5], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(beta * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.5:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 2.5Initial program 99.9%
associate-/l/99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
distribute-rgt1-in99.9%
*-rgt-identity99.9%
distribute-lft-out99.9%
+-commutative99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.1%
Simplified93.1%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 64.2%
Taylor expanded in alpha around 0 63.1%
Taylor expanded in beta around 0 62.5%
*-commutative62.5%
Simplified62.5%
if 2.5 < beta Initial program 76.1%
Taylor expanded in beta around -inf 74.5%
Taylor expanded in alpha around 0 74.0%
Final simplification66.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.8) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ (+ 1.0 alpha) (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.8) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.8d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = (1.0d0 + alpha) / (beta * beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.8) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.8: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = (1.0 + alpha) / (beta * beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.8) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(Float64(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 <= 2.8)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
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, 2.8], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $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 2.8:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 2.7999999999999998Initial program 99.9%
associate-/l/99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
distribute-rgt1-in99.9%
*-rgt-identity99.9%
distribute-lft-out99.9%
+-commutative99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.1%
Simplified93.1%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 64.2%
Taylor expanded in alpha around 0 63.1%
Taylor expanded in beta around 0 62.5%
*-commutative62.5%
Simplified62.5%
if 2.7999999999999998 < beta Initial program 76.1%
associate-/l/73.0%
associate-+l+73.0%
+-commutative73.0%
associate-+r+73.0%
associate-+l+73.0%
distribute-rgt1-in73.0%
*-rgt-identity73.0%
distribute-lft-out73.0%
+-commutative73.0%
associate-*l/91.2%
*-commutative91.2%
associate-*r/90.0%
Simplified90.0%
associate-*r/91.2%
+-commutative91.2%
Applied egg-rr91.2%
+-commutative91.2%
*-commutative91.2%
+-commutative91.2%
associate-*r/91.2%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-/l*99.4%
+-commutative99.4%
+-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in beta around inf 77.4%
unpow277.4%
Simplified77.4%
Final simplification67.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.85) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ (/ (- alpha -1.0) beta) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.85) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((alpha - -1.0) / beta) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.85d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = ((alpha - (-1.0d0)) / beta) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.85) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((alpha - -1.0) / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.85: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = ((alpha - -1.0) / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.85) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(Float64(Float64(alpha - -1.0) / beta) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.85)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = ((alpha - -1.0) / beta) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.85], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / beta), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.85:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 2.85000000000000009Initial program 99.9%
associate-/l/99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
distribute-rgt1-in99.9%
*-rgt-identity99.9%
distribute-lft-out99.9%
+-commutative99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.1%
Simplified93.1%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 64.2%
Taylor expanded in alpha around 0 63.1%
Taylor expanded in beta around 0 62.5%
*-commutative62.5%
Simplified62.5%
if 2.85000000000000009 < beta Initial program 76.1%
Taylor expanded in beta around -inf 74.5%
Taylor expanded in beta around inf 74.1%
*-un-lft-identity74.1%
mul-1-neg74.1%
fma-neg74.1%
metadata-eval74.1%
Applied egg-rr74.1%
*-lft-identity74.1%
metadata-eval74.1%
fma-neg74.1%
distribute-neg-frac74.1%
sub-neg74.1%
mul-1-neg74.1%
distribute-neg-in74.1%
+-commutative74.1%
mul-1-neg74.1%
distribute-lft-in74.1%
metadata-eval74.1%
mul-1-neg74.1%
sub-neg74.1%
Simplified74.1%
Final simplification66.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.8) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ (/ (- -1.0) beta) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.8) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = (-(-1.0) / beta) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.8d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = (-(-1.0d0) / beta) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.8) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = (-(-1.0) / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.8: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = (-(-1.0) / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.8) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(Float64(Float64(-(-1.0)) / beta) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.8)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = (-(-1.0) / beta) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.8], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[((--1.0) / beta), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.8:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{--1}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 2.7999999999999998Initial program 99.9%
associate-/l/99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
distribute-rgt1-in99.9%
*-rgt-identity99.9%
distribute-lft-out99.9%
+-commutative99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.1%
Simplified93.1%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 64.2%
Taylor expanded in alpha around 0 63.1%
Taylor expanded in beta around 0 62.5%
*-commutative62.5%
Simplified62.5%
if 2.7999999999999998 < beta Initial program 76.1%
Taylor expanded in beta around -inf 74.5%
Taylor expanded in beta around inf 74.1%
Taylor expanded in alpha around 0 74.4%
Final simplification66.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.9) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ 1.0 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.9) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = 1.0 / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.9d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = 1.0d0 / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.9) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = 1.0 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.9: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = 1.0 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.9) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(1.0 / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.9)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = 1.0 / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.9], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(1.0 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.9:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta}\\
\end{array}
\end{array}
if beta < 2.89999999999999991Initial program 99.9%
associate-/l/99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
distribute-rgt1-in99.9%
*-rgt-identity99.9%
distribute-lft-out99.9%
+-commutative99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.1%
Simplified93.1%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 64.2%
Taylor expanded in alpha around 0 63.1%
Taylor expanded in beta around 0 62.5%
*-commutative62.5%
Simplified62.5%
if 2.89999999999999991 < beta Initial program 76.1%
Taylor expanded in beta around -inf 74.5%
Taylor expanded in alpha around inf 6.7%
Final simplification45.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.8) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ 1.0 (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.8) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = 1.0 / (beta * beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.8d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = 1.0d0 / (beta * beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.8) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = 1.0 / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.8: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = 1.0 / (beta * beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.8) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(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 <= 2.8)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
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, 2.8], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $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 2.8:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 2.7999999999999998Initial program 99.9%
associate-/l/99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
distribute-rgt1-in99.9%
*-rgt-identity99.9%
distribute-lft-out99.9%
+-commutative99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.1%
Simplified93.1%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 64.2%
Taylor expanded in alpha around 0 63.1%
Taylor expanded in beta around 0 62.5%
*-commutative62.5%
Simplified62.5%
if 2.7999999999999998 < beta Initial program 76.1%
associate-/l/73.0%
associate-/r*68.3%
associate-+l+68.3%
+-commutative68.3%
associate-+r+68.3%
associate-+l+68.3%
distribute-rgt1-in68.3%
*-rgt-identity68.3%
distribute-lft-out68.3%
*-commutative68.3%
metadata-eval68.3%
associate-+l+68.3%
+-commutative68.3%
Simplified68.3%
Taylor expanded in alpha around 0 80.3%
Taylor expanded in beta around inf 73.9%
unpow273.9%
Simplified73.9%
Final simplification66.0%
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%
associate-/l/99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
distribute-rgt1-in99.9%
*-rgt-identity99.9%
distribute-lft-out99.9%
+-commutative99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*r/93.1%
Simplified93.1%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-*r/99.8%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 64.2%
Taylor expanded in beta around 0 63.5%
+-commutative63.5%
Simplified63.5%
Taylor expanded in alpha around 0 62.3%
if 12 < beta Initial program 76.1%
Taylor expanded in beta around -inf 74.5%
Taylor expanded in alpha around inf 6.7%
Final simplification45.2%
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.6%
associate-/l/91.6%
associate-+l+91.6%
+-commutative91.6%
associate-+r+91.6%
associate-+l+91.6%
distribute-rgt1-in91.6%
*-rgt-identity91.6%
distribute-lft-out91.6%
+-commutative91.6%
associate-*l/97.2%
*-commutative97.2%
associate-*r/92.2%
Simplified92.2%
associate-*r/97.2%
+-commutative97.2%
Applied egg-rr97.2%
+-commutative97.2%
*-commutative97.2%
+-commutative97.2%
associate-*r/97.1%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 69.2%
Taylor expanded in beta around 0 45.6%
+-commutative45.6%
Simplified45.6%
Taylor expanded in alpha around 0 44.3%
Final simplification44.3%
herbie shell --seed 2023189
(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)))