
(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 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t\_0}}{t\_0}}{t\_0 + 1}
\end{array}
\end{array}
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ alpha (+ beta 2.0)))) (/ (/ (* (+ 1.0 beta) (/ (+ 1.0 alpha) t_0)) (+ alpha (+ beta 3.0))) t_0)))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return (((1.0 + beta) * ((1.0 + alpha) / t_0)) / (alpha + (beta + 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 = alpha + (beta + 2.0d0)
code = (((1.0d0 + beta) * ((1.0d0 + alpha) / t_0)) / (alpha + (beta + 3.0d0))) / t_0
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return (((1.0 + beta) * ((1.0 + alpha) / t_0)) / (alpha + (beta + 3.0))) / t_0;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return (((1.0 + beta) * ((1.0 + alpha) / t_0)) / (alpha + (beta + 3.0))) / t_0
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) return Float64(Float64(Float64(Float64(1.0 + beta) * Float64(Float64(1.0 + alpha) / t_0)) / Float64(alpha + Float64(beta + 3.0))) / t_0) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = (((1.0 + beta) * ((1.0 + alpha) / t_0)) / (alpha + (beta + 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[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(1.0 + beta), $MachinePrecision] * N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\frac{\frac{\left(1 + \beta\right) \cdot \frac{1 + \alpha}{t\_0}}{\alpha + \left(\beta + 3\right)}}{t\_0}
\end{array}
\end{array}
Initial program 95.1%
Simplified83.8%
times-frac96.7%
+-commutative96.7%
Applied egg-rr96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
associate-+r+96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
associate-*r/96.8%
+-commutative96.8%
+-commutative96.8%
*-commutative96.8%
+-commutative96.8%
+-commutative96.8%
associate-+r+96.7%
Applied egg-rr96.7%
associate-/r*99.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
(let* ((t_0 (+ alpha (+ beta 2.0))))
(if (<= beta 1.35e+154)
(* (/ (+ 1.0 alpha) t_0) (/ (+ 1.0 beta) (* t_0 (+ 3.0 (+ beta alpha)))))
(/ (/ (* (+ 1.0 beta) (/ alpha t_0)) (+ alpha (+ beta 3.0))) t_0))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 1.35e+154) {
tmp = ((1.0 + alpha) / t_0) * ((1.0 + beta) / (t_0 * (3.0 + (beta + alpha))));
} else {
tmp = (((1.0 + beta) * (alpha / t_0)) / (alpha + (beta + 3.0))) / t_0;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 1.35d+154) then
tmp = ((1.0d0 + alpha) / t_0) * ((1.0d0 + beta) / (t_0 * (3.0d0 + (beta + alpha))))
else
tmp = (((1.0d0 + beta) * (alpha / t_0)) / (alpha + (beta + 3.0d0))) / t_0
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 1.35e+154) {
tmp = ((1.0 + alpha) / t_0) * ((1.0 + beta) / (t_0 * (3.0 + (beta + alpha))));
} else {
tmp = (((1.0 + beta) * (alpha / t_0)) / (alpha + (beta + 3.0))) / t_0;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 1.35e+154: tmp = ((1.0 + alpha) / t_0) * ((1.0 + beta) / (t_0 * (3.0 + (beta + alpha)))) else: tmp = (((1.0 + beta) * (alpha / t_0)) / (alpha + (beta + 3.0))) / t_0 return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 1.35e+154) tmp = Float64(Float64(Float64(1.0 + alpha) / t_0) * Float64(Float64(1.0 + beta) / Float64(t_0 * Float64(3.0 + Float64(beta + alpha))))); else tmp = Float64(Float64(Float64(Float64(1.0 + beta) * Float64(alpha / t_0)) / Float64(alpha + Float64(beta + 3.0))) / t_0); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 1.35e+154)
tmp = ((1.0 + alpha) / t_0) * ((1.0 + beta) / (t_0 * (3.0 + (beta + alpha))));
else
tmp = (((1.0 + beta) * (alpha / t_0)) / (alpha + (beta + 3.0))) / t_0;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 1.35e+154], N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(1.0 + beta), $MachinePrecision] / N[(t$95$0 * N[(3.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + beta), $MachinePrecision] * N[(alpha / t$95$0), $MachinePrecision]), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{1 + \alpha}{t\_0} \cdot \frac{1 + \beta}{t\_0 \cdot \left(3 + \left(\beta + \alpha\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(1 + \beta\right) \cdot \frac{\alpha}{t\_0}}{\alpha + \left(\beta + 3\right)}}{t\_0}\\
\end{array}
\end{array}
if beta < 1.35000000000000003e154Initial program 98.4%
Simplified85.9%
times-frac98.9%
+-commutative98.9%
Applied egg-rr98.9%
+-commutative98.9%
+-commutative98.9%
+-commutative98.9%
+-commutative98.9%
+-commutative98.9%
+-commutative98.9%
+-commutative98.9%
associate-+r+98.9%
+-commutative98.9%
+-commutative98.9%
Simplified98.9%
if 1.35000000000000003e154 < beta Initial program 75.4%
Simplified71.1%
times-frac83.5%
+-commutative83.5%
Applied egg-rr83.5%
+-commutative83.5%
+-commutative83.5%
+-commutative83.5%
+-commutative83.5%
+-commutative83.5%
+-commutative83.5%
+-commutative83.5%
associate-+r+83.5%
+-commutative83.5%
+-commutative83.5%
Simplified83.5%
associate-*r/83.5%
+-commutative83.5%
+-commutative83.5%
*-commutative83.5%
+-commutative83.5%
+-commutative83.5%
associate-+r+83.5%
Applied egg-rr83.5%
associate-/r*99.8%
*-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around inf 98.5%
Final simplification98.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 2.0))))
(if (<= alpha 2.3e+54)
(* (/ (+ 1.0 alpha) t_0) (/ (+ 1.0 beta) (* (+ beta 2.0) (+ beta 3.0))))
(/ (/ (* (+ 1.0 beta) (/ alpha t_0)) (+ alpha (+ beta 3.0))) t_0))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (alpha <= 2.3e+54) {
tmp = ((1.0 + alpha) / t_0) * ((1.0 + beta) / ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = (((1.0 + beta) * (alpha / t_0)) / (alpha + (beta + 3.0))) / t_0;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (alpha <= 2.3d+54) then
tmp = ((1.0d0 + alpha) / t_0) * ((1.0d0 + beta) / ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = (((1.0d0 + beta) * (alpha / t_0)) / (alpha + (beta + 3.0d0))) / t_0
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (alpha <= 2.3e+54) {
tmp = ((1.0 + alpha) / t_0) * ((1.0 + beta) / ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = (((1.0 + beta) * (alpha / t_0)) / (alpha + (beta + 3.0))) / t_0;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if alpha <= 2.3e+54: tmp = ((1.0 + alpha) / t_0) * ((1.0 + beta) / ((beta + 2.0) * (beta + 3.0))) else: tmp = (((1.0 + beta) * (alpha / t_0)) / (alpha + (beta + 3.0))) / t_0 return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (alpha <= 2.3e+54) tmp = Float64(Float64(Float64(1.0 + alpha) / t_0) * Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(Float64(1.0 + beta) * Float64(alpha / t_0)) / Float64(alpha + Float64(beta + 3.0))) / t_0); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = 0.0;
if (alpha <= 2.3e+54)
tmp = ((1.0 + alpha) / t_0) * ((1.0 + beta) / ((beta + 2.0) * (beta + 3.0)));
else
tmp = (((1.0 + beta) * (alpha / t_0)) / (alpha + (beta + 3.0))) / t_0;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[alpha, 2.3e+54], N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + beta), $MachinePrecision] * N[(alpha / t$95$0), $MachinePrecision]), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\alpha \leq 2.3 \cdot 10^{+54}:\\
\;\;\;\;\frac{1 + \alpha}{t\_0} \cdot \frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(1 + \beta\right) \cdot \frac{\alpha}{t\_0}}{\alpha + \left(\beta + 3\right)}}{t\_0}\\
\end{array}
\end{array}
if alpha < 2.29999999999999994e54Initial program 99.2%
Simplified89.8%
times-frac99.5%
+-commutative99.5%
Applied egg-rr99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in alpha around 0 93.7%
+-commutative93.7%
*-commutative93.7%
+-commutative93.7%
Simplified93.7%
if 2.29999999999999994e54 < alpha Initial program 83.9%
Simplified67.3%
times-frac89.0%
+-commutative89.0%
Applied egg-rr89.0%
+-commutative89.0%
+-commutative89.0%
+-commutative89.0%
+-commutative89.0%
+-commutative89.0%
+-commutative89.0%
+-commutative89.0%
associate-+r+89.0%
+-commutative89.0%
+-commutative89.0%
Simplified89.0%
associate-*r/89.0%
+-commutative89.0%
+-commutative89.0%
*-commutative89.0%
+-commutative89.0%
+-commutative89.0%
associate-+r+89.0%
Applied egg-rr89.0%
associate-/r*99.7%
*-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in alpha around inf 99.7%
Final simplification95.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 230000000.0)
(/
(/ (+ 1.0 beta) (+ beta 2.0))
(* (+ 3.0 (+ beta alpha)) (* beta (+ 1.0 (/ 2.0 beta)))))
(*
(/ (+ 1.0 alpha) (+ alpha (+ beta 2.0)))
(/ (- 1.0 (/ (+ 4.0 (* alpha 2.0)) beta)) beta))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 230000000.0) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((3.0 + (beta + alpha)) * (beta * (1.0 + (2.0 / beta))));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) * ((1.0 - ((4.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 <= 230000000.0d0) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) / ((3.0d0 + (beta + alpha)) * (beta * (1.0d0 + (2.0d0 / beta))))
else
tmp = ((1.0d0 + alpha) / (alpha + (beta + 2.0d0))) * ((1.0d0 - ((4.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 <= 230000000.0) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((3.0 + (beta + alpha)) * (beta * (1.0 + (2.0 / beta))));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) * ((1.0 - ((4.0 + (alpha * 2.0)) / beta)) / beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 230000000.0: tmp = ((1.0 + beta) / (beta + 2.0)) / ((3.0 + (beta + alpha)) * (beta * (1.0 + (2.0 / beta)))) else: tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) * ((1.0 - ((4.0 + (alpha * 2.0)) / beta)) / beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 230000000.0) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) / Float64(Float64(3.0 + Float64(beta + alpha)) * Float64(beta * Float64(1.0 + Float64(2.0 / beta))))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 2.0))) * Float64(Float64(1.0 - Float64(Float64(4.0 + Float64(alpha * 2.0)) / beta)) / beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 230000000.0)
tmp = ((1.0 + beta) / (beta + 2.0)) / ((3.0 + (beta + alpha)) * (beta * (1.0 + (2.0 / beta))));
else
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) * ((1.0 - ((4.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, 230000000.0], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(3.0 + N[(beta + alpha), $MachinePrecision]), $MachinePrecision] * N[(beta * N[(1.0 + N[(2.0 / beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - N[(N[(4.0 + N[(alpha * 2.0), $MachinePrecision]), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 230000000:\\
\;\;\;\;\frac{\frac{1 + \beta}{\beta + 2}}{\left(3 + \left(\beta + \alpha\right)\right) \cdot \left(\beta \cdot \left(1 + \frac{2}{\beta}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\alpha + \left(\beta + 2\right)} \cdot \frac{1 - \frac{4 + \alpha \cdot 2}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 2.3e8Initial program 99.8%
associate-/l/99.8%
+-commutative99.8%
associate-+l+99.8%
*-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
metadata-eval99.8%
metadata-eval99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in alpha around 0 85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in beta around inf 85.2%
associate-*r/85.2%
metadata-eval85.2%
Simplified85.2%
Taylor expanded in alpha around 0 68.5%
associate-*r/68.5%
metadata-eval68.5%
Simplified68.5%
if 2.3e8 < beta Initial program 87.1%
Simplified62.1%
times-frac91.4%
+-commutative91.4%
Applied egg-rr91.4%
+-commutative91.4%
+-commutative91.4%
+-commutative91.4%
+-commutative91.4%
+-commutative91.4%
+-commutative91.4%
+-commutative91.4%
associate-+r+91.4%
+-commutative91.4%
+-commutative91.4%
Simplified91.4%
Taylor expanded in beta around inf 83.8%
mul-1-neg83.8%
unsub-neg83.8%
Simplified83.8%
Final simplification74.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))))
(if (<= beta 67000000000.0)
(/ (* (+ 1.0 beta) (/ (/ 1.0 (+ beta 2.0)) (+ beta 3.0))) t_0)
(*
(/ (+ 1.0 alpha) t_0)
(/ (- 1.0 (/ (+ 4.0 (* alpha 2.0)) beta)) beta)))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 67000000000.0) {
tmp = ((1.0 + beta) * ((1.0 / (beta + 2.0)) / (beta + 3.0))) / t_0;
} else {
tmp = ((1.0 + alpha) / t_0) * ((1.0 - ((4.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) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 67000000000.0d0) then
tmp = ((1.0d0 + beta) * ((1.0d0 / (beta + 2.0d0)) / (beta + 3.0d0))) / t_0
else
tmp = ((1.0d0 + alpha) / t_0) * ((1.0d0 - ((4.0d0 + (alpha * 2.0d0)) / beta)) / beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 67000000000.0) {
tmp = ((1.0 + beta) * ((1.0 / (beta + 2.0)) / (beta + 3.0))) / t_0;
} else {
tmp = ((1.0 + alpha) / t_0) * ((1.0 - ((4.0 + (alpha * 2.0)) / beta)) / beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 67000000000.0: tmp = ((1.0 + beta) * ((1.0 / (beta + 2.0)) / (beta + 3.0))) / t_0 else: tmp = ((1.0 + alpha) / t_0) * ((1.0 - ((4.0 + (alpha * 2.0)) / beta)) / beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 67000000000.0) tmp = Float64(Float64(Float64(1.0 + beta) * Float64(Float64(1.0 / Float64(beta + 2.0)) / Float64(beta + 3.0))) / t_0); else tmp = Float64(Float64(Float64(1.0 + alpha) / t_0) * Float64(Float64(1.0 - Float64(Float64(4.0 + Float64(alpha * 2.0)) / beta)) / beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 67000000000.0)
tmp = ((1.0 + beta) * ((1.0 / (beta + 2.0)) / (beta + 3.0))) / t_0;
else
tmp = ((1.0 + alpha) / t_0) * ((1.0 - ((4.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_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 67000000000.0], N[(N[(N[(1.0 + beta), $MachinePrecision] * N[(N[(1.0 / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(1.0 - N[(N[(4.0 + N[(alpha * 2.0), $MachinePrecision]), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 67000000000:\\
\;\;\;\;\frac{\left(1 + \beta\right) \cdot \frac{\frac{1}{\beta + 2}}{\beta + 3}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{t\_0} \cdot \frac{1 - \frac{4 + \alpha \cdot 2}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 6.7e10Initial program 99.8%
Simplified96.4%
times-frac99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
Applied egg-rr99.8%
associate-/r*99.8%
*-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.8%
associate-+l+99.8%
Applied egg-rr99.8%
associate-*l*99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
Simplified99.8%
Taylor expanded in alpha around 0 68.1%
associate-/r*68.1%
Simplified68.1%
if 6.7e10 < beta Initial program 87.1%
Simplified62.1%
times-frac91.4%
+-commutative91.4%
Applied egg-rr91.4%
+-commutative91.4%
+-commutative91.4%
+-commutative91.4%
+-commutative91.4%
+-commutative91.4%
+-commutative91.4%
+-commutative91.4%
associate-+r+91.4%
+-commutative91.4%
+-commutative91.4%
Simplified91.4%
Taylor expanded in beta around inf 83.8%
mul-1-neg83.8%
unsub-neg83.8%
Simplified83.8%
Final simplification73.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ alpha (+ beta 2.0)))) (/ (* (+ 1.0 alpha) (/ (/ (+ 1.0 beta) t_0) (+ alpha (+ beta 3.0)))) t_0)))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((1.0 + alpha) * (((1.0 + beta) / t_0) / (alpha + (beta + 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 = alpha + (beta + 2.0d0)
code = ((1.0d0 + alpha) * (((1.0d0 + beta) / t_0) / (alpha + (beta + 3.0d0)))) / t_0
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((1.0 + alpha) * (((1.0 + beta) / t_0) / (alpha + (beta + 3.0)))) / t_0;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return ((1.0 + alpha) * (((1.0 + beta) / t_0) / (alpha + (beta + 3.0)))) / t_0
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) return Float64(Float64(Float64(1.0 + alpha) * Float64(Float64(Float64(1.0 + beta) / t_0) / Float64(alpha + Float64(beta + 3.0)))) / t_0) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = ((1.0 + alpha) * (((1.0 + beta) / t_0) / (alpha + (beta + 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[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(1.0 + alpha), $MachinePrecision] * N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\frac{\left(1 + \alpha\right) \cdot \frac{\frac{1 + \beta}{t\_0}}{\alpha + \left(\beta + 3\right)}}{t\_0}
\end{array}
\end{array}
Initial program 95.1%
Simplified83.8%
times-frac96.7%
+-commutative96.7%
Applied egg-rr96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
associate-+r+96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
associate-*l/96.8%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Applied egg-rr99.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 2.0))))
(if (<= beta 8e+14)
(/ (* (+ 1.0 beta) (/ (/ 1.0 (+ beta 2.0)) (+ beta 3.0))) t_0)
(/ (/ (+ 1.0 alpha) (+ alpha (+ beta 3.0))) t_0))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 8e+14) {
tmp = ((1.0 + beta) * ((1.0 / (beta + 2.0)) / (beta + 3.0))) / t_0;
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / t_0;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 8d+14) then
tmp = ((1.0d0 + beta) * ((1.0d0 / (beta + 2.0d0)) / (beta + 3.0d0))) / t_0
else
tmp = ((1.0d0 + alpha) / (alpha + (beta + 3.0d0))) / t_0
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 8e+14) {
tmp = ((1.0 + beta) * ((1.0 / (beta + 2.0)) / (beta + 3.0))) / t_0;
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / t_0;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 8e+14: tmp = ((1.0 + beta) * ((1.0 / (beta + 2.0)) / (beta + 3.0))) / t_0 else: tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / t_0 return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 8e+14) tmp = Float64(Float64(Float64(1.0 + beta) * Float64(Float64(1.0 / Float64(beta + 2.0)) / Float64(beta + 3.0))) / t_0); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 3.0))) / t_0); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 8e+14)
tmp = ((1.0 + beta) * ((1.0 / (beta + 2.0)) / (beta + 3.0))) / t_0;
else
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / t_0;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 8e+14], N[(N[(N[(1.0 + beta), $MachinePrecision] * N[(N[(1.0 / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 8 \cdot 10^{+14}:\\
\;\;\;\;\frac{\left(1 + \beta\right) \cdot \frac{\frac{1}{\beta + 2}}{\beta + 3}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(\beta + 3\right)}}{t\_0}\\
\end{array}
\end{array}
if beta < 8e14Initial program 99.8%
Simplified96.4%
times-frac99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
Applied egg-rr99.8%
associate-/r*99.8%
*-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.8%
associate-+l+99.8%
Applied egg-rr99.8%
associate-*l*99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.9%
Simplified99.9%
Taylor expanded in alpha around 0 68.3%
associate-/r*68.3%
Simplified68.3%
if 8e14 < beta Initial program 87.0%
Simplified61.7%
times-frac91.3%
+-commutative91.3%
Applied egg-rr91.3%
+-commutative91.3%
+-commutative91.3%
+-commutative91.3%
+-commutative91.3%
+-commutative91.3%
+-commutative91.3%
+-commutative91.3%
associate-+r+91.3%
+-commutative91.3%
+-commutative91.3%
Simplified91.3%
associate-*r/91.4%
+-commutative91.4%
+-commutative91.4%
*-commutative91.4%
+-commutative91.4%
+-commutative91.4%
associate-+r+91.4%
Applied egg-rr91.4%
associate-/r*99.6%
*-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in beta around inf 84.2%
Final simplification74.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))))
(if (<= beta 4.15e+15)
(/ (/ (+ 1.0 beta) (* (+ beta 2.0) (+ beta 3.0))) t_0)
(/ (/ (+ 1.0 alpha) (+ alpha (+ beta 3.0))) t_0))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 4.15e+15) {
tmp = ((1.0 + beta) / ((beta + 2.0) * (beta + 3.0))) / t_0;
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / t_0;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 4.15d+15) then
tmp = ((1.0d0 + beta) / ((beta + 2.0d0) * (beta + 3.0d0))) / t_0
else
tmp = ((1.0d0 + alpha) / (alpha + (beta + 3.0d0))) / t_0
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 4.15e+15) {
tmp = ((1.0 + beta) / ((beta + 2.0) * (beta + 3.0))) / t_0;
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / t_0;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 4.15e+15: tmp = ((1.0 + beta) / ((beta + 2.0) * (beta + 3.0))) / t_0 else: tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / t_0 return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 4.15e+15) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(beta + 3.0))) / t_0); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 3.0))) / t_0); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 4.15e+15)
tmp = ((1.0 + beta) / ((beta + 2.0) * (beta + 3.0))) / t_0;
else
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / t_0;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 4.15e+15], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 4.15 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(\beta + 3\right)}}{t\_0}\\
\end{array}
\end{array}
if beta < 4.15e15Initial program 99.8%
Simplified96.4%
times-frac99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
Applied egg-rr99.8%
associate-/r*99.8%
*-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 67.9%
if 4.15e15 < beta Initial program 86.8%
Simplified61.3%
times-frac91.2%
+-commutative91.2%
Applied egg-rr91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
associate-+r+91.2%
+-commutative91.2%
+-commutative91.2%
Simplified91.2%
associate-*r/91.3%
+-commutative91.3%
+-commutative91.3%
*-commutative91.3%
+-commutative91.3%
+-commutative91.3%
associate-+r+91.3%
Applied egg-rr91.3%
associate-/r*99.6%
*-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in beta around inf 85.0%
Final simplification74.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.2e+15) (/ (+ 1.0 beta) (* (+ beta 2.0) (* (+ beta 2.0) (+ beta 3.0)))) (/ (/ (+ 1.0 alpha) (+ alpha (+ beta 3.0))) (+ alpha (+ beta 2.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.2e+15) {
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / (alpha + (beta + 2.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.2d+15) then
tmp = (1.0d0 + beta) / ((beta + 2.0d0) * ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = ((1.0d0 + alpha) / (alpha + (beta + 3.0d0))) / (alpha + (beta + 2.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.2e+15) {
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / (alpha + (beta + 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.2e+15: tmp = (1.0 + beta) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0))) else: tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / (alpha + (beta + 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.2e+15) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 3.0))) / Float64(alpha + Float64(beta + 2.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.2e+15)
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0)));
else
tmp = ((1.0 + alpha) / (alpha + (beta + 3.0))) / (alpha + (beta + 2.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.2e+15], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.2 \cdot 10^{+15}:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(\left(\beta + 2\right) \cdot \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(\beta + 3\right)}}{\alpha + \left(\beta + 2\right)}\\
\end{array}
\end{array}
if beta < 2.2e15Initial program 99.8%
associate-/l/99.8%
+-commutative99.8%
associate-+l+99.8%
*-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
metadata-eval99.8%
metadata-eval99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in alpha around 0 85.5%
+-commutative85.5%
Simplified85.5%
add-exp-log85.5%
associate-/l/85.5%
log-div85.5%
log1p-define85.5%
associate-+r+85.5%
Applied egg-rr85.5%
exp-diff85.5%
log1p-undefine85.5%
rem-exp-log85.5%
rem-exp-log85.5%
*-commutative85.5%
*-commutative85.5%
+-commutative85.5%
+-commutative85.5%
+-commutative85.5%
Simplified85.5%
Taylor expanded in alpha around 0 66.9%
if 2.2e15 < beta Initial program 86.8%
Simplified61.3%
times-frac91.2%
+-commutative91.2%
Applied egg-rr91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
associate-+r+91.2%
+-commutative91.2%
+-commutative91.2%
Simplified91.2%
associate-*r/91.3%
+-commutative91.3%
+-commutative91.3%
*-commutative91.3%
+-commutative91.3%
+-commutative91.3%
associate-+r+91.3%
Applied egg-rr91.3%
associate-/r*99.6%
*-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in beta around inf 85.0%
Final simplification73.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 5.7e+15) (/ (+ 1.0 beta) (* (+ beta 2.0) (* (+ beta 2.0) (+ beta 3.0)))) (/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 5.7e+15) {
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 5.7d+15) then
tmp = (1.0d0 + beta) / ((beta + 2.0d0) * ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = ((1.0d0 + alpha) / beta) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 5.7e+15) {
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 5.7e+15: tmp = (1.0 + beta) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0))) else: tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 5.7e+15) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 5.7e+15)
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0)));
else
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 5.7e+15], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 5.7 \cdot 10^{+15}:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(\left(\beta + 2\right) \cdot \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 5.7e15Initial program 99.8%
associate-/l/99.8%
+-commutative99.8%
associate-+l+99.8%
*-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
metadata-eval99.8%
metadata-eval99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in alpha around 0 85.5%
+-commutative85.5%
Simplified85.5%
add-exp-log85.5%
associate-/l/85.5%
log-div85.5%
log1p-define85.5%
associate-+r+85.5%
Applied egg-rr85.5%
exp-diff85.5%
log1p-undefine85.5%
rem-exp-log85.5%
rem-exp-log85.5%
*-commutative85.5%
*-commutative85.5%
+-commutative85.5%
+-commutative85.5%
+-commutative85.5%
Simplified85.5%
Taylor expanded in alpha around 0 66.9%
if 5.7e15 < beta Initial program 86.8%
Taylor expanded in beta around inf 84.5%
div-inv84.4%
metadata-eval84.4%
associate-+l+84.4%
metadata-eval84.4%
associate-+r+84.4%
Applied egg-rr84.4%
associate-*r/84.5%
*-rgt-identity84.5%
+-commutative84.5%
+-commutative84.5%
+-commutative84.5%
Simplified84.5%
Final simplification73.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.4) (/ (+ 0.5 (* beta 0.25)) (* (+ alpha (+ beta 2.0)) (+ beta 3.0))) (/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.4) {
tmp = (0.5 + (beta * 0.25)) / ((alpha + (beta + 2.0)) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 4.4d0) then
tmp = (0.5d0 + (beta * 0.25d0)) / ((alpha + (beta + 2.0d0)) * (beta + 3.0d0))
else
tmp = ((1.0d0 + alpha) / beta) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 4.4) {
tmp = (0.5 + (beta * 0.25)) / ((alpha + (beta + 2.0)) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.4: tmp = (0.5 + (beta * 0.25)) / ((alpha + (beta + 2.0)) * (beta + 3.0)) else: tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.4) tmp = Float64(Float64(0.5 + Float64(beta * 0.25)) / Float64(Float64(alpha + Float64(beta + 2.0)) * Float64(beta + 3.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 4.4)
tmp = (0.5 + (beta * 0.25)) / ((alpha + (beta + 2.0)) * (beta + 3.0));
else
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 4.4], N[(N[(0.5 + N[(beta * 0.25), $MachinePrecision]), $MachinePrecision] / N[(N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4.4:\\
\;\;\;\;\frac{0.5 + \beta \cdot 0.25}{\left(\alpha + \left(\beta + 2\right)\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 4.4000000000000004Initial program 99.8%
associate-/l/99.8%
+-commutative99.8%
associate-+l+99.8%
*-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
metadata-eval99.8%
metadata-eval99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in alpha around 0 85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in beta around 0 84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in alpha around 0 67.1%
if 4.4000000000000004 < beta Initial program 87.1%
Taylor expanded in beta around inf 83.7%
div-inv83.6%
metadata-eval83.6%
associate-+l+83.6%
metadata-eval83.6%
associate-+r+83.6%
Applied egg-rr83.6%
associate-*r/83.7%
*-rgt-identity83.7%
+-commutative83.7%
+-commutative83.7%
+-commutative83.7%
Simplified83.7%
Final simplification73.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.0) (/ (+ 0.5 (* beta 0.25)) (* (+ beta 2.0) (+ beta 3.0))) (/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.0) {
tmp = (0.5 + (beta * 0.25)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 4.0d0) then
tmp = (0.5d0 + (beta * 0.25d0)) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = ((1.0d0 + alpha) / beta) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 4.0) {
tmp = (0.5 + (beta * 0.25)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.0: tmp = (0.5 + (beta * 0.25)) / ((beta + 2.0) * (beta + 3.0)) else: tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.0) tmp = Float64(Float64(0.5 + Float64(beta * 0.25)) / Float64(Float64(beta + 2.0) * Float64(beta + 3.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 4.0)
tmp = (0.5 + (beta * 0.25)) / ((beta + 2.0) * (beta + 3.0));
else
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 4.0], N[(N[(0.5 + N[(beta * 0.25), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4:\\
\;\;\;\;\frac{0.5 + \beta \cdot 0.25}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 4Initial program 99.8%
associate-/l/99.8%
+-commutative99.8%
associate-+l+99.8%
*-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
metadata-eval99.8%
metadata-eval99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in alpha around 0 85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in beta around 0 84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in alpha around 0 66.1%
if 4 < beta Initial program 87.1%
Taylor expanded in beta around inf 83.7%
div-inv83.6%
metadata-eval83.6%
associate-+l+83.6%
metadata-eval83.6%
associate-+r+83.6%
Applied egg-rr83.6%
associate-*r/83.7%
*-rgt-identity83.7%
+-commutative83.7%
+-commutative83.7%
+-commutative83.7%
Simplified83.7%
Final simplification72.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 7.6) (/ 0.5 (* (+ alpha 2.0) (+ alpha 3.0))) (/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 7.6) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 7.6d0) then
tmp = 0.5d0 / ((alpha + 2.0d0) * (alpha + 3.0d0))
else
tmp = ((1.0d0 + alpha) / beta) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 7.6) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 7.6: tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0)) else: tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 7.6) tmp = Float64(0.5 / Float64(Float64(alpha + 2.0) * Float64(alpha + 3.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 7.6)
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
else
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 7.6], N[(0.5 / N[(N[(alpha + 2.0), $MachinePrecision] * N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 7.6:\\
\;\;\;\;\frac{0.5}{\left(\alpha + 2\right) \cdot \left(\alpha + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 7.5999999999999996Initial program 99.8%
associate-/l/99.8%
+-commutative99.8%
associate-+l+99.8%
*-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
metadata-eval99.8%
metadata-eval99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in alpha around 0 85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in beta around 0 83.6%
if 7.5999999999999996 < beta Initial program 87.1%
Taylor expanded in beta around inf 83.7%
div-inv83.6%
metadata-eval83.6%
associate-+l+83.6%
metadata-eval83.6%
associate-+r+83.6%
Applied egg-rr83.6%
associate-*r/83.7%
*-rgt-identity83.7%
+-commutative83.7%
+-commutative83.7%
+-commutative83.7%
Simplified83.7%
Final simplification83.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 8.6) (/ 0.5 (* (+ alpha 2.0) (+ alpha 3.0))) (/ (/ (+ 1.0 alpha) beta) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 8.6) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + 3.0);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 8.6d0) then
tmp = 0.5d0 / ((alpha + 2.0d0) * (alpha + 3.0d0))
else
tmp = ((1.0d0 + alpha) / beta) / (beta + 3.0d0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 8.6) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + 3.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 8.6: tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0)) else: tmp = ((1.0 + alpha) / beta) / (beta + 3.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 8.6) tmp = Float64(0.5 / Float64(Float64(alpha + 2.0) * Float64(alpha + 3.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(beta + 3.0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 8.6)
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
else
tmp = ((1.0 + alpha) / beta) / (beta + 3.0);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 8.6], N[(0.5 / N[(N[(alpha + 2.0), $MachinePrecision] * N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 8.6:\\
\;\;\;\;\frac{0.5}{\left(\alpha + 2\right) \cdot \left(\alpha + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 8.59999999999999964Initial program 99.8%
associate-/l/99.8%
+-commutative99.8%
associate-+l+99.8%
*-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
metadata-eval99.8%
metadata-eval99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in alpha around 0 85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in beta around 0 83.6%
if 8.59999999999999964 < beta Initial program 87.1%
Taylor expanded in beta around inf 83.7%
Taylor expanded in alpha around 0 83.5%
+-commutative83.5%
Simplified83.5%
Final simplification83.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 7.6) (/ 0.5 (* (+ alpha 2.0) (+ alpha 3.0))) (/ 1.0 (* beta (/ beta (+ 1.0 alpha))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 7.6) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = 1.0 / (beta * (beta / (1.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 <= 7.6d0) then
tmp = 0.5d0 / ((alpha + 2.0d0) * (alpha + 3.0d0))
else
tmp = 1.0d0 / (beta * (beta / (1.0d0 + alpha)))
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.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = 1.0 / (beta * (beta / (1.0 + alpha)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 7.6: tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0)) else: tmp = 1.0 / (beta * (beta / (1.0 + alpha))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 7.6) tmp = Float64(0.5 / Float64(Float64(alpha + 2.0) * Float64(alpha + 3.0))); else tmp = Float64(1.0 / Float64(beta * Float64(beta / Float64(1.0 + alpha)))); 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.5 / ((alpha + 2.0) * (alpha + 3.0));
else
tmp = 1.0 / (beta * (beta / (1.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, 7.6], N[(0.5 / N[(N[(alpha + 2.0), $MachinePrecision] * N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(beta * N[(beta / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 7.6:\\
\;\;\;\;\frac{0.5}{\left(\alpha + 2\right) \cdot \left(\alpha + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \frac{\beta}{1 + \alpha}}\\
\end{array}
\end{array}
if beta < 7.5999999999999996Initial program 99.8%
associate-/l/99.8%
+-commutative99.8%
associate-+l+99.8%
*-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
metadata-eval99.8%
metadata-eval99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in alpha around 0 85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in beta around 0 83.6%
if 7.5999999999999996 < beta Initial program 87.1%
Taylor expanded in beta around inf 83.7%
clear-num83.2%
inv-pow83.2%
metadata-eval83.2%
associate-+l+83.2%
metadata-eval83.2%
associate-+r+83.2%
Applied egg-rr83.2%
unpow-183.2%
associate-/r/83.3%
+-commutative83.3%
+-commutative83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in beta around inf 83.1%
Final simplification83.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.4) (/ 0.5 (* (+ alpha 2.0) (+ alpha 3.0))) (/ (/ 1.0 beta) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.4) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = (1.0 / beta) / (beta + 3.0);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.4d0) then
tmp = 0.5d0 / ((alpha + 2.0d0) * (alpha + 3.0d0))
else
tmp = (1.0d0 / beta) / (beta + 3.0d0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.4) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = (1.0 / beta) / (beta + 3.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.4: tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0)) else: tmp = (1.0 / beta) / (beta + 3.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.4) tmp = Float64(0.5 / Float64(Float64(alpha + 2.0) * Float64(alpha + 3.0))); else tmp = Float64(Float64(1.0 / beta) / Float64(beta + 3.0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.4)
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
else
tmp = (1.0 / beta) / (beta + 3.0);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.4], N[(0.5 / N[(N[(alpha + 2.0), $MachinePrecision] * N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.4:\\
\;\;\;\;\frac{0.5}{\left(\alpha + 2\right) \cdot \left(\alpha + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 3.39999999999999991Initial program 99.8%
associate-/l/99.8%
+-commutative99.8%
associate-+l+99.8%
*-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
metadata-eval99.8%
metadata-eval99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in alpha around 0 85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in beta around 0 83.6%
if 3.39999999999999991 < beta Initial program 87.1%
Taylor expanded in beta around inf 83.7%
clear-num83.2%
inv-pow83.2%
metadata-eval83.2%
associate-+l+83.2%
metadata-eval83.2%
associate-+r+83.2%
Applied egg-rr83.2%
unpow-183.2%
associate-/r/83.3%
+-commutative83.3%
+-commutative83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in alpha around 0 76.1%
associate-/r*76.4%
Simplified76.4%
Final simplification80.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ (/ 1.0 beta) (+ beta 3.0)))
assert(alpha < beta);
double code(double alpha, double beta) {
return (1.0 / beta) / (beta + 3.0);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = (1.0d0 / beta) / (beta + 3.0d0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return (1.0 / beta) / (beta + 3.0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return (1.0 / beta) / (beta + 3.0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(1.0 / beta) / Float64(beta + 3.0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = (1.0 / beta) / (beta + 3.0);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(N[(1.0 / beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{\frac{1}{\beta}}{\beta + 3}
\end{array}
Initial program 95.1%
Taylor expanded in beta around inf 32.7%
clear-num32.5%
inv-pow32.5%
metadata-eval32.5%
associate-+l+32.5%
metadata-eval32.5%
associate-+r+32.5%
Applied egg-rr32.5%
unpow-132.5%
associate-/r/32.6%
+-commutative32.6%
+-commutative32.6%
+-commutative32.6%
Simplified32.6%
Taylor expanded in alpha around 0 29.9%
associate-/r*30.1%
Simplified30.1%
Final simplification30.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 1.0 (* beta (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
return 1.0 / (beta * (beta + 3.0));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 1.0d0 / (beta * (beta + 3.0d0))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 1.0 / (beta * (beta + 3.0));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 1.0 / (beta * (beta + 3.0))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(1.0 / Float64(beta * Float64(beta + 3.0))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 1.0 / (beta * (beta + 3.0));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(1.0 / N[(beta * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{1}{\beta \cdot \left(\beta + 3\right)}
\end{array}
Initial program 95.1%
Taylor expanded in beta around inf 32.7%
Taylor expanded in alpha around 0 29.9%
+-commutative29.9%
Simplified29.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 1.0 (/ beta 0.25)))
assert(alpha < beta);
double code(double alpha, double beta) {
return 1.0 / (beta / 0.25);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 1.0d0 / (beta / 0.25d0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 1.0 / (beta / 0.25);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 1.0 / (beta / 0.25)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(1.0 / Float64(beta / 0.25)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 1.0 / (beta / 0.25);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(1.0 / N[(beta / 0.25), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{1}{\frac{\beta}{0.25}}
\end{array}
Initial program 95.1%
associate-/l/94.2%
+-commutative94.2%
associate-+l+94.2%
*-commutative94.2%
metadata-eval94.2%
associate-+l+94.2%
metadata-eval94.2%
+-commutative94.2%
+-commutative94.2%
+-commutative94.2%
metadata-eval94.2%
metadata-eval94.2%
associate-+l+94.2%
Simplified94.2%
Taylor expanded in alpha around 0 84.6%
+-commutative84.6%
Simplified84.6%
Taylor expanded in beta around 0 69.3%
*-commutative69.3%
Simplified69.3%
Taylor expanded in beta around inf 4.4%
clear-num4.4%
inv-pow4.4%
Applied egg-rr4.4%
unpow-14.4%
Simplified4.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.25 beta))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.25 / 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.25d0 / beta
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.25 / beta;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.25 / beta
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.25 / beta) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.25 / beta;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.25 / beta), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.25}{\beta}
\end{array}
Initial program 95.1%
associate-/l/94.2%
+-commutative94.2%
associate-+l+94.2%
*-commutative94.2%
metadata-eval94.2%
associate-+l+94.2%
metadata-eval94.2%
+-commutative94.2%
+-commutative94.2%
+-commutative94.2%
metadata-eval94.2%
metadata-eval94.2%
associate-+l+94.2%
Simplified94.2%
Taylor expanded in alpha around 0 84.6%
+-commutative84.6%
Simplified84.6%
Taylor expanded in beta around 0 69.3%
*-commutative69.3%
Simplified69.3%
Taylor expanded in beta around inf 4.4%
herbie shell --seed 2024150
(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)))