
(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 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t\_0}}{t\_0}}{t\_0 + 1}
\end{array}
\end{array}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))))
(*
(/ (* (+ 1.0 alpha) (/ 1.0 t_0)) t_0)
(/ (+ 1.0 beta) (+ alpha (+ beta 3.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return (((1.0 + alpha) * (1.0 / t_0)) / t_0) * ((1.0 + beta) / (alpha + (beta + 3.0)));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = alpha + (beta + 2.0d0)
code = (((1.0d0 + alpha) * (1.0d0 / t_0)) / t_0) * ((1.0d0 + beta) / (alpha + (beta + 3.0d0)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return (((1.0 + alpha) * (1.0 / t_0)) / t_0) * ((1.0 + beta) / (alpha + (beta + 3.0)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return (((1.0 + alpha) * (1.0 / t_0)) / t_0) * ((1.0 + beta) / (alpha + (beta + 3.0)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) return Float64(Float64(Float64(Float64(1.0 + alpha) * Float64(1.0 / t_0)) / t_0) * Float64(Float64(1.0 + beta) / Float64(alpha + Float64(beta + 3.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 / t_0)) / t_0) * ((1.0 + beta) / (alpha + (beta + 3.0)));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(1.0 + beta), $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 := \alpha + \left(\beta + 2\right)\\
\frac{\left(1 + \alpha\right) \cdot \frac{1}{t\_0}}{t\_0} \cdot \frac{1 + \beta}{\alpha + \left(\beta + 3\right)}
\end{array}
\end{array}
Initial program 96.0%
Simplified88.9%
times-frac97.4%
+-commutative97.4%
Applied egg-rr97.4%
associate-*r/97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
div-inv99.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 4.5e+15)
(/ 1.0 (* t_0 (* (+ beta 2.0) (/ (+ beta 3.0) (+ 1.0 beta)))))
(*
(/ (* (+ 1.0 alpha) (/ 1.0 t_0)) t_0)
(/ (+ 1.0 beta) (+ alpha beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 4.5e+15) {
tmp = 1.0 / (t_0 * ((beta + 2.0) * ((beta + 3.0) / (1.0 + beta))));
} else {
tmp = (((1.0 + alpha) * (1.0 / t_0)) / t_0) * ((1.0 + beta) / (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 = alpha + (beta + 2.0d0)
if (beta <= 4.5d+15) then
tmp = 1.0d0 / (t_0 * ((beta + 2.0d0) * ((beta + 3.0d0) / (1.0d0 + beta))))
else
tmp = (((1.0d0 + alpha) * (1.0d0 / t_0)) / t_0) * ((1.0d0 + beta) / (alpha + 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 <= 4.5e+15) {
tmp = 1.0 / (t_0 * ((beta + 2.0) * ((beta + 3.0) / (1.0 + beta))));
} else {
tmp = (((1.0 + alpha) * (1.0 / t_0)) / t_0) * ((1.0 + beta) / (alpha + beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 4.5e+15: tmp = 1.0 / (t_0 * ((beta + 2.0) * ((beta + 3.0) / (1.0 + beta)))) else: tmp = (((1.0 + alpha) * (1.0 / t_0)) / t_0) * ((1.0 + beta) / (alpha + 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 <= 4.5e+15) tmp = Float64(1.0 / Float64(t_0 * Float64(Float64(beta + 2.0) * Float64(Float64(beta + 3.0) / Float64(1.0 + beta))))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) * Float64(1.0 / t_0)) / t_0) * Float64(Float64(1.0 + beta) / Float64(alpha + 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 <= 4.5e+15)
tmp = 1.0 / (t_0 * ((beta + 2.0) * ((beta + 3.0) / (1.0 + beta))));
else
tmp = (((1.0 + alpha) * (1.0 / t_0)) / t_0) * ((1.0 + beta) / (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 + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 4.5e+15], N[(1.0 / N[(t$95$0 * N[(N[(beta + 2.0), $MachinePrecision] * N[(N[(beta + 3.0), $MachinePrecision] / N[(1.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(1.0 + beta), $MachinePrecision] / N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;\frac{1}{t\_0 \cdot \left(\left(\beta + 2\right) \cdot \frac{\beta + 3}{1 + \beta}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + \alpha\right) \cdot \frac{1}{t\_0}}{t\_0} \cdot \frac{1 + \beta}{\alpha + \beta}\\
\end{array}
\end{array}
if beta < 4.5e15Initial program 99.8%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
metadata-eval99.8%
Simplified96.7%
associate-+r+96.7%
fma-undefine96.7%
*-commutative96.7%
associate-+l+96.7%
+-commutative96.7%
associate-+l+96.7%
*-commutative96.7%
associate-*r*96.7%
associate-+r+96.7%
+-commutative96.7%
associate-/l/99.8%
clear-num99.8%
inv-pow99.8%
Applied egg-rr99.8%
unpow-199.8%
associate-/l*99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in alpha around 0 63.7%
associate-/l*63.7%
+-commutative63.7%
+-commutative63.7%
Simplified63.7%
if 4.5e15 < beta Initial program 87.8%
Simplified72.3%
times-frac92.3%
+-commutative92.3%
Applied egg-rr92.3%
associate-*r/92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
Simplified92.3%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in beta around inf 99.8%
Final simplification75.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))))
(if (<= beta 1.25e+16)
(/ 1.0 (* t_0 (* (+ beta 2.0) (/ (+ beta 3.0) (+ 1.0 beta)))))
(*
(/ (+ 1.0 beta) (+ alpha (+ beta 3.0)))
(/ (/ (+ 1.0 alpha) beta) t_0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 1.25e+16) {
tmp = 1.0 / (t_0 * ((beta + 2.0) * ((beta + 3.0) / (1.0 + beta))));
} else {
tmp = ((1.0 + beta) / (alpha + (beta + 3.0))) * (((1.0 + alpha) / beta) / t_0);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 1.25d+16) then
tmp = 1.0d0 / (t_0 * ((beta + 2.0d0) * ((beta + 3.0d0) / (1.0d0 + beta))))
else
tmp = ((1.0d0 + beta) / (alpha + (beta + 3.0d0))) * (((1.0d0 + alpha) / beta) / t_0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 1.25e+16) {
tmp = 1.0 / (t_0 * ((beta + 2.0) * ((beta + 3.0) / (1.0 + beta))));
} else {
tmp = ((1.0 + beta) / (alpha + (beta + 3.0))) * (((1.0 + alpha) / beta) / t_0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 1.25e+16: tmp = 1.0 / (t_0 * ((beta + 2.0) * ((beta + 3.0) / (1.0 + beta)))) else: tmp = ((1.0 + beta) / (alpha + (beta + 3.0))) * (((1.0 + alpha) / beta) / t_0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 1.25e+16) tmp = Float64(1.0 / Float64(t_0 * Float64(Float64(beta + 2.0) * Float64(Float64(beta + 3.0) / Float64(1.0 + beta))))); else tmp = Float64(Float64(Float64(1.0 + beta) / Float64(alpha + Float64(beta + 3.0))) * Float64(Float64(Float64(1.0 + alpha) / beta) / t_0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 1.25e+16)
tmp = 1.0 / (t_0 * ((beta + 2.0) * ((beta + 3.0) / (1.0 + beta))));
else
tmp = ((1.0 + beta) / (alpha + (beta + 3.0))) * (((1.0 + alpha) / beta) / t_0);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 1.25e+16], N[(1.0 / N[(t$95$0 * N[(N[(beta + 2.0), $MachinePrecision] * N[(N[(beta + 3.0), $MachinePrecision] / N[(1.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 1.25 \cdot 10^{+16}:\\
\;\;\;\;\frac{1}{t\_0 \cdot \left(\left(\beta + 2\right) \cdot \frac{\beta + 3}{1 + \beta}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \beta}{\alpha + \left(\beta + 3\right)} \cdot \frac{\frac{1 + \alpha}{\beta}}{t\_0}\\
\end{array}
\end{array}
if beta < 1.25e16Initial program 99.8%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
metadata-eval99.8%
Simplified96.7%
associate-+r+96.7%
fma-undefine96.7%
*-commutative96.7%
associate-+l+96.7%
+-commutative96.7%
associate-+l+96.7%
*-commutative96.7%
associate-*r*96.7%
associate-+r+96.7%
+-commutative96.7%
associate-/l/99.8%
clear-num99.8%
inv-pow99.8%
Applied egg-rr99.8%
unpow-199.8%
associate-/l*99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in alpha around 0 63.7%
associate-/l*63.7%
+-commutative63.7%
+-commutative63.7%
Simplified63.7%
if 1.25e16 < beta Initial program 87.8%
Simplified72.3%
times-frac92.3%
+-commutative92.3%
Applied egg-rr92.3%
associate-*r/92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
Simplified92.3%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in beta around inf 89.7%
Final simplification72.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)))) (* (/ (+ 1.0 beta) (+ alpha (+ beta 3.0))) (/ (/ (+ 1.0 alpha) t_0) t_0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((1.0 + beta) / (alpha + (beta + 3.0))) * (((1.0 + alpha) / t_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) / (alpha + (beta + 3.0d0))) * (((1.0d0 + alpha) / t_0) / 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) / (alpha + (beta + 3.0))) * (((1.0 + alpha) / t_0) / t_0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return ((1.0 + beta) / (alpha + (beta + 3.0))) * (((1.0 + alpha) / t_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 + beta) / Float64(alpha + Float64(beta + 3.0))) * Float64(Float64(Float64(1.0 + alpha) / t_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) / (alpha + (beta + 3.0))) * (((1.0 + alpha) / t_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 + beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\frac{1 + \beta}{\alpha + \left(\beta + 3\right)} \cdot \frac{\frac{1 + \alpha}{t\_0}}{t\_0}
\end{array}
\end{array}
Initial program 96.0%
Simplified88.9%
times-frac97.4%
+-commutative97.4%
Applied egg-rr97.4%
associate-*r/97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.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 (+ 2.0 (+ alpha beta)))) (* (/ (+ 1.0 alpha) t_0) (/ (/ (+ 1.0 beta) (+ 3.0 (+ alpha beta))) t_0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = 2.0 + (alpha + beta);
return ((1.0 + alpha) / t_0) * (((1.0 + beta) / (3.0 + (alpha + beta))) / 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 = 2.0d0 + (alpha + beta)
code = ((1.0d0 + alpha) / t_0) * (((1.0d0 + beta) / (3.0d0 + (alpha + beta))) / t_0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = 2.0 + (alpha + beta);
return ((1.0 + alpha) / t_0) * (((1.0 + beta) / (3.0 + (alpha + beta))) / t_0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = 2.0 + (alpha + beta) return ((1.0 + alpha) / t_0) * (((1.0 + beta) / (3.0 + (alpha + beta))) / t_0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(2.0 + Float64(alpha + beta)) return Float64(Float64(Float64(1.0 + alpha) / t_0) * Float64(Float64(Float64(1.0 + beta) / Float64(3.0 + Float64(alpha + beta))) / t_0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = 2.0 + (alpha + beta);
tmp = ((1.0 + alpha) / t_0) * (((1.0 + beta) / (3.0 + (alpha + beta))) / 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[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(3.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := 2 + \left(\alpha + \beta\right)\\
\frac{1 + \alpha}{t\_0} \cdot \frac{\frac{1 + \beta}{3 + \left(\alpha + \beta\right)}}{t\_0}
\end{array}
\end{array}
Initial program 96.0%
Simplified88.9%
times-frac97.4%
+-commutative97.4%
Applied egg-rr97.4%
associate-*r/97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-*l/99.8%
Applied egg-rr99.8%
associate-/l*99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 1.42e+17)
(/
1.0
(* (+ alpha (+ beta 2.0)) (* (+ beta 2.0) (/ (+ beta 3.0) (+ 1.0 beta)))))
(/ (+ (/ 1.0 beta) (/ alpha beta)) (+ 1.0 (+ 2.0 (+ alpha beta))))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.42e+17) {
tmp = 1.0 / ((alpha + (beta + 2.0)) * ((beta + 2.0) * ((beta + 3.0) / (1.0 + beta))));
} else {
tmp = ((1.0 / beta) + (alpha / beta)) / (1.0 + (2.0 + (alpha + beta)));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.42d+17) then
tmp = 1.0d0 / ((alpha + (beta + 2.0d0)) * ((beta + 2.0d0) * ((beta + 3.0d0) / (1.0d0 + beta))))
else
tmp = ((1.0d0 / beta) + (alpha / beta)) / (1.0d0 + (2.0d0 + (alpha + beta)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.42e+17) {
tmp = 1.0 / ((alpha + (beta + 2.0)) * ((beta + 2.0) * ((beta + 3.0) / (1.0 + beta))));
} else {
tmp = ((1.0 / beta) + (alpha / beta)) / (1.0 + (2.0 + (alpha + beta)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.42e+17: tmp = 1.0 / ((alpha + (beta + 2.0)) * ((beta + 2.0) * ((beta + 3.0) / (1.0 + beta)))) else: tmp = ((1.0 / beta) + (alpha / beta)) / (1.0 + (2.0 + (alpha + beta))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.42e+17) tmp = Float64(1.0 / Float64(Float64(alpha + Float64(beta + 2.0)) * Float64(Float64(beta + 2.0) * Float64(Float64(beta + 3.0) / Float64(1.0 + beta))))); else tmp = Float64(Float64(Float64(1.0 / beta) + Float64(alpha / beta)) / Float64(1.0 + Float64(2.0 + Float64(alpha + beta)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.42e+17)
tmp = 1.0 / ((alpha + (beta + 2.0)) * ((beta + 2.0) * ((beta + 3.0) / (1.0 + beta))));
else
tmp = ((1.0 / beta) + (alpha / beta)) / (1.0 + (2.0 + (alpha + beta)));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.42e+17], N[(1.0 / N[(N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(beta + 2.0), $MachinePrecision] * N[(N[(beta + 3.0), $MachinePrecision] / N[(1.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / beta), $MachinePrecision] + N[(alpha / beta), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.42 \cdot 10^{+17}:\\
\;\;\;\;\frac{1}{\left(\alpha + \left(\beta + 2\right)\right) \cdot \left(\left(\beta + 2\right) \cdot \frac{\beta + 3}{1 + \beta}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta} + \frac{\alpha}{\beta}}{1 + \left(2 + \left(\alpha + \beta\right)\right)}\\
\end{array}
\end{array}
if beta < 1.42e17Initial program 99.8%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
metadata-eval99.8%
Simplified96.7%
associate-+r+96.7%
fma-undefine96.7%
*-commutative96.7%
associate-+l+96.7%
+-commutative96.7%
associate-+l+96.7%
*-commutative96.7%
associate-*r*96.7%
associate-+r+96.7%
+-commutative96.7%
associate-/l/99.8%
clear-num99.8%
inv-pow99.8%
Applied egg-rr99.8%
unpow-199.8%
associate-/l*99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in alpha around 0 63.7%
associate-/l*63.7%
+-commutative63.7%
+-commutative63.7%
Simplified63.7%
if 1.42e17 < beta Initial program 87.8%
Taylor expanded in beta around inf 89.5%
Taylor expanded in alpha around 0 89.5%
Final simplification72.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.35e+17) (/ (/ (+ 1.0 beta) (+ beta 2.0)) (* (+ beta 2.0) (+ beta 3.0))) (/ (+ (/ 1.0 beta) (/ alpha beta)) (+ 1.0 (+ 2.0 (+ alpha beta))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.35e+17) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 / beta) + (alpha / beta)) / (1.0 + (2.0 + (alpha + beta)));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.35d+17) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = ((1.0d0 / beta) + (alpha / beta)) / (1.0d0 + (2.0d0 + (alpha + beta)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.35e+17) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 / beta) + (alpha / beta)) / (1.0 + (2.0 + (alpha + beta)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.35e+17: tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)) else: tmp = ((1.0 / beta) + (alpha / beta)) / (1.0 + (2.0 + (alpha + beta))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.35e+17) 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 / beta) + Float64(alpha / beta)) / Float64(1.0 + Float64(2.0 + Float64(alpha + beta)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.35e+17)
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
else
tmp = ((1.0 / beta) + (alpha / beta)) / (1.0 + (2.0 + (alpha + beta)));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.35e+17], 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 / beta), $MachinePrecision] + N[(alpha / beta), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.35 \cdot 10^{+17}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\beta + 2}}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta} + \frac{\alpha}{\beta}}{1 + \left(2 + \left(\alpha + \beta\right)\right)}\\
\end{array}
\end{array}
if beta < 1.35e17Initial program 99.8%
Simplified96.7%
times-frac99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 83.8%
+-commutative83.8%
Simplified83.8%
Taylor expanded in alpha around 0 62.7%
+-commutative62.7%
*-commutative62.7%
+-commutative62.7%
Simplified62.7%
if 1.35e17 < beta Initial program 87.8%
Taylor expanded in beta around inf 89.5%
Taylor expanded in alpha around 0 89.5%
Final simplification71.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 9e+15) (/ (/ (+ 1.0 beta) (+ beta 2.0)) (* (+ beta 2.0) (+ beta 3.0))) (/ (* (+ 1.0 alpha) (/ 1.0 beta)) (+ 3.0 (+ alpha beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 9e+15) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) * (1.0 / beta)) / (3.0 + (alpha + beta));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 9d+15) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = ((1.0d0 + alpha) * (1.0d0 / beta)) / (3.0d0 + (alpha + beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 9e+15) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) * (1.0 / beta)) / (3.0 + (alpha + beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 9e+15: tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)) else: tmp = ((1.0 + alpha) * (1.0 / beta)) / (3.0 + (alpha + beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 9e+15) 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) * Float64(1.0 / beta)) / Float64(3.0 + Float64(alpha + beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 9e+15)
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
else
tmp = ((1.0 + alpha) * (1.0 / beta)) / (3.0 + (alpha + beta));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 9e+15], 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] * N[(1.0 / beta), $MachinePrecision]), $MachinePrecision] / N[(3.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 9 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\beta + 2}}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + \alpha\right) \cdot \frac{1}{\beta}}{3 + \left(\alpha + \beta\right)}\\
\end{array}
\end{array}
if beta < 9e15Initial program 99.8%
Simplified96.7%
times-frac99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 83.8%
+-commutative83.8%
Simplified83.8%
Taylor expanded in alpha around 0 62.7%
+-commutative62.7%
*-commutative62.7%
+-commutative62.7%
Simplified62.7%
if 9e15 < beta Initial program 87.8%
Taylor expanded in beta around inf 89.5%
clear-num89.5%
inv-pow89.5%
Applied egg-rr89.5%
unpow-189.5%
Simplified89.5%
div-inv89.4%
metadata-eval89.4%
associate-+l+89.4%
metadata-eval89.4%
associate-+r+89.4%
associate-/r/89.4%
Applied egg-rr89.4%
associate-*r/89.5%
*-commutative89.5%
*-lft-identity89.5%
*-commutative89.5%
associate-+r+89.5%
+-commutative89.5%
+-commutative89.5%
Simplified89.5%
Final simplification71.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.0) (/ 0.5 (* (+ alpha 2.0) (+ alpha 3.0))) (/ (* (+ 1.0 alpha) (/ 1.0 beta)) (+ 3.0 (+ alpha beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.0) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = ((1.0 + alpha) * (1.0 / beta)) / (3.0 + (alpha + beta));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.0d0) then
tmp = 0.5d0 / ((alpha + 2.0d0) * (alpha + 3.0d0))
else
tmp = ((1.0d0 + alpha) * (1.0d0 / beta)) / (3.0d0 + (alpha + beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.0) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = ((1.0 + alpha) * (1.0 / beta)) / (3.0 + (alpha + beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.0: tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0)) else: tmp = ((1.0 + alpha) * (1.0 / beta)) / (3.0 + (alpha + beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.0) tmp = Float64(0.5 / Float64(Float64(alpha + 2.0) * Float64(alpha + 3.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) * Float64(1.0 / beta)) / Float64(3.0 + Float64(alpha + beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.0)
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
else
tmp = ((1.0 + alpha) * (1.0 / beta)) / (3.0 + (alpha + beta));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.0], N[(0.5 / N[(N[(alpha + 2.0), $MachinePrecision] * N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] * N[(1.0 / beta), $MachinePrecision]), $MachinePrecision] / N[(3.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3:\\
\;\;\;\;\frac{0.5}{\left(\alpha + 2\right) \cdot \left(\alpha + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + \alpha\right) \cdot \frac{1}{\beta}}{3 + \left(\alpha + \beta\right)}\\
\end{array}
\end{array}
if beta < 3Initial program 99.8%
Simplified96.6%
times-frac99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 84.1%
+-commutative84.1%
Simplified84.1%
Taylor expanded in beta around 0 83.5%
if 3 < beta Initial program 88.2%
Taylor expanded in beta around inf 87.5%
clear-num87.5%
inv-pow87.5%
Applied egg-rr87.5%
unpow-187.5%
Simplified87.5%
div-inv87.5%
metadata-eval87.5%
associate-+l+87.5%
metadata-eval87.5%
associate-+r+87.5%
associate-/r/87.5%
Applied egg-rr87.5%
associate-*r/87.5%
*-commutative87.5%
*-lft-identity87.5%
*-commutative87.5%
associate-+r+87.5%
+-commutative87.5%
+-commutative87.5%
Simplified87.5%
Final simplification84.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 2.3)
(/ 0.5 (* (+ alpha 2.0) (+ alpha 3.0)))
(if (<= beta 1.35e+154)
(/ 1.0 (* beta (+ beta 3.0)))
(/ (/ alpha beta) (+ 1.0 beta)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.3) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else if (beta <= 1.35e+154) {
tmp = 1.0 / (beta * (beta + 3.0));
} else {
tmp = (alpha / beta) / (1.0 + beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.3d0) then
tmp = 0.5d0 / ((alpha + 2.0d0) * (alpha + 3.0d0))
else if (beta <= 1.35d+154) then
tmp = 1.0d0 / (beta * (beta + 3.0d0))
else
tmp = (alpha / beta) / (1.0d0 + beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.3) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else if (beta <= 1.35e+154) {
tmp = 1.0 / (beta * (beta + 3.0));
} else {
tmp = (alpha / beta) / (1.0 + beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.3: tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0)) elif beta <= 1.35e+154: tmp = 1.0 / (beta * (beta + 3.0)) else: tmp = (alpha / beta) / (1.0 + beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.3) tmp = Float64(0.5 / Float64(Float64(alpha + 2.0) * Float64(alpha + 3.0))); elseif (beta <= 1.35e+154) tmp = Float64(1.0 / Float64(beta * Float64(beta + 3.0))); else tmp = Float64(Float64(alpha / beta) / Float64(1.0 + beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.3)
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
elseif (beta <= 1.35e+154)
tmp = 1.0 / (beta * (beta + 3.0));
else
tmp = (alpha / beta) / (1.0 + beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.3], N[(0.5 / N[(N[(alpha + 2.0), $MachinePrecision] * N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[beta, 1.35e+154], N[(1.0 / N[(beta * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(alpha / beta), $MachinePrecision] / N[(1.0 + beta), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.3:\\
\;\;\;\;\frac{0.5}{\left(\alpha + 2\right) \cdot \left(\alpha + 3\right)}\\
\mathbf{elif}\;\beta \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{\beta \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha}{\beta}}{1 + \beta}\\
\end{array}
\end{array}
if beta < 2.2999999999999998Initial program 99.8%
Simplified96.6%
times-frac99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 84.1%
+-commutative84.1%
Simplified84.1%
Taylor expanded in beta around 0 83.5%
if 2.2999999999999998 < beta < 1.35000000000000003e154Initial program 94.2%
Taylor expanded in beta around inf 74.1%
Taylor expanded in alpha around 0 66.9%
+-commutative66.9%
Simplified66.9%
if 1.35000000000000003e154 < beta Initial program 83.6%
Taylor expanded in beta around inf 97.9%
Taylor expanded in alpha around inf 97.2%
Taylor expanded in beta around inf 97.2%
Final simplification83.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.3) (/ 0.5 (* (+ alpha 2.0) (+ alpha 3.0))) (/ (+ (/ 1.0 beta) (/ alpha beta)) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.3) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = ((1.0 / beta) + (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 <= 2.3d0) then
tmp = 0.5d0 / ((alpha + 2.0d0) * (alpha + 3.0d0))
else
tmp = ((1.0d0 / beta) + (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 <= 2.3) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = ((1.0 / beta) + (alpha / beta)) / (beta + 3.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.3: tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0)) else: tmp = ((1.0 / beta) + (alpha / beta)) / (beta + 3.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.3) tmp = Float64(0.5 / Float64(Float64(alpha + 2.0) * Float64(alpha + 3.0))); else tmp = Float64(Float64(Float64(1.0 / beta) + Float64(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 <= 2.3)
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
else
tmp = ((1.0 / beta) + (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, 2.3], N[(0.5 / N[(N[(alpha + 2.0), $MachinePrecision] * N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / beta), $MachinePrecision] + N[(alpha / beta), $MachinePrecision]), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.3:\\
\;\;\;\;\frac{0.5}{\left(\alpha + 2\right) \cdot \left(\alpha + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta} + \frac{\alpha}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 2.2999999999999998Initial program 99.8%
Simplified96.6%
times-frac99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 84.1%
+-commutative84.1%
Simplified84.1%
Taylor expanded in beta around 0 83.5%
if 2.2999999999999998 < beta Initial program 88.2%
Taylor expanded in beta around inf 87.5%
clear-num87.5%
inv-pow87.5%
Applied egg-rr87.5%
unpow-187.5%
Simplified87.5%
Taylor expanded in alpha around 0 87.4%
+-commutative87.4%
Simplified87.4%
Taylor expanded in alpha around 0 87.4%
Final simplification84.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.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 <= 3.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 <= 3.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 <= 3.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 <= 3.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 <= 3.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 <= 3.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, 3.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 3.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 < 3.60000000000000009Initial program 99.8%
Simplified96.6%
times-frac99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 84.1%
+-commutative84.1%
Simplified84.1%
Taylor expanded in beta around 0 83.5%
if 3.60000000000000009 < beta Initial program 88.2%
Taylor expanded in beta around inf 87.5%
Taylor expanded in alpha around 0 87.4%
+-commutative87.4%
Simplified87.4%
Final simplification84.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.8) (/ 0.5 (* (+ alpha 2.0) (+ alpha 3.0))) (/ (/ 1.0 (/ beta (+ 1.0 alpha))) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.8) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = (1.0 / (beta / (1.0 + alpha))) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.8d0) then
tmp = 0.5d0 / ((alpha + 2.0d0) * (alpha + 3.0d0))
else
tmp = (1.0d0 / (beta / (1.0d0 + alpha))) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.8) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = (1.0 / (beta / (1.0 + alpha))) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.8: tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0)) else: tmp = (1.0 / (beta / (1.0 + alpha))) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.8) tmp = Float64(0.5 / Float64(Float64(alpha + 2.0) * Float64(alpha + 3.0))); else tmp = Float64(Float64(1.0 / Float64(beta / Float64(1.0 + alpha))) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.8)
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
else
tmp = (1.0 / (beta / (1.0 + alpha))) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.8], N[(0.5 / N[(N[(alpha + 2.0), $MachinePrecision] * N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(beta / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.8:\\
\;\;\;\;\frac{0.5}{\left(\alpha + 2\right) \cdot \left(\alpha + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\frac{\beta}{1 + \alpha}}}{\beta}\\
\end{array}
\end{array}
if beta < 3.7999999999999998Initial program 99.8%
Simplified96.6%
times-frac99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 84.1%
+-commutative84.1%
Simplified84.1%
Taylor expanded in beta around 0 83.5%
if 3.7999999999999998 < beta Initial program 88.2%
Taylor expanded in beta around inf 87.5%
clear-num87.5%
inv-pow87.5%
Applied egg-rr87.5%
unpow-187.5%
Simplified87.5%
Taylor expanded in alpha around 0 87.4%
+-commutative87.4%
Simplified87.4%
Taylor expanded in beta around inf 87.4%
Final simplification84.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.9) (/ 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 <= 3.9) {
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 <= 3.9d0) 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 <= 3.9) {
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 <= 3.9: 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 <= 3.9) 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 <= 3.9)
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, 3.9], 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 3.9:\\
\;\;\;\;\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 < 3.89999999999999991Initial program 99.8%
Simplified96.6%
times-frac99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 84.1%
+-commutative84.1%
Simplified84.1%
Taylor expanded in beta around 0 83.5%
if 3.89999999999999991 < beta Initial program 88.2%
Taylor expanded in beta around inf 87.5%
clear-num86.9%
inv-pow86.9%
metadata-eval86.9%
associate-+l+86.9%
metadata-eval86.9%
associate-+r+86.9%
Applied egg-rr86.9%
unpow-186.9%
associate-/r/86.9%
associate-+r+86.9%
+-commutative86.9%
+-commutative86.9%
Simplified86.9%
Taylor expanded in beta around inf 86.8%
Final simplification84.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= alpha 1.0) (/ (/ 1.0 beta) (+ beta 3.0)) (/ (/ alpha beta) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (alpha <= 1.0) {
tmp = (1.0 / beta) / (beta + 3.0);
} else {
tmp = (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 (alpha <= 1.0d0) then
tmp = (1.0d0 / beta) / (beta + 3.0d0)
else
tmp = (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 (alpha <= 1.0) {
tmp = (1.0 / beta) / (beta + 3.0);
} else {
tmp = (alpha / beta) / (beta + 3.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if alpha <= 1.0: tmp = (1.0 / beta) / (beta + 3.0) else: tmp = (alpha / beta) / (beta + 3.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (alpha <= 1.0) tmp = Float64(Float64(1.0 / beta) / Float64(beta + 3.0)); else tmp = Float64(Float64(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 (alpha <= 1.0)
tmp = (1.0 / beta) / (beta + 3.0);
else
tmp = (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[alpha, 1.0], N[(N[(1.0 / beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(alpha / beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\alpha \leq 1:\\
\;\;\;\;\frac{\frac{1}{\beta}}{\beta + 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if alpha < 1Initial program 99.9%
Taylor expanded in beta around inf 37.6%
clear-num37.3%
inv-pow37.3%
metadata-eval37.3%
associate-+l+37.3%
metadata-eval37.3%
associate-+r+37.3%
Applied egg-rr37.3%
unpow-137.3%
associate-/r/37.3%
associate-+r+37.3%
+-commutative37.3%
+-commutative37.3%
Simplified37.3%
Taylor expanded in alpha around 0 36.8%
associate-/r*37.0%
+-commutative37.0%
Simplified37.0%
if 1 < alpha Initial program 88.5%
Taylor expanded in beta around inf 18.1%
clear-num18.1%
inv-pow18.1%
Applied egg-rr18.1%
unpow-118.1%
Simplified18.1%
Taylor expanded in alpha around 0 17.8%
+-commutative17.8%
Simplified17.8%
Taylor expanded in alpha around inf 17.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= alpha 1.1) (/ (/ 1.0 beta) (+ beta 3.0)) (/ (/ alpha beta) (+ 1.0 beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (alpha <= 1.1) {
tmp = (1.0 / beta) / (beta + 3.0);
} else {
tmp = (alpha / beta) / (1.0 + beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (alpha <= 1.1d0) then
tmp = (1.0d0 / beta) / (beta + 3.0d0)
else
tmp = (alpha / beta) / (1.0d0 + beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (alpha <= 1.1) {
tmp = (1.0 / beta) / (beta + 3.0);
} else {
tmp = (alpha / beta) / (1.0 + beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if alpha <= 1.1: tmp = (1.0 / beta) / (beta + 3.0) else: tmp = (alpha / beta) / (1.0 + beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (alpha <= 1.1) tmp = Float64(Float64(1.0 / beta) / Float64(beta + 3.0)); else tmp = Float64(Float64(alpha / beta) / Float64(1.0 + beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (alpha <= 1.1)
tmp = (1.0 / beta) / (beta + 3.0);
else
tmp = (alpha / beta) / (1.0 + beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[alpha, 1.1], N[(N[(1.0 / beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(alpha / beta), $MachinePrecision] / N[(1.0 + beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\alpha \leq 1.1:\\
\;\;\;\;\frac{\frac{1}{\beta}}{\beta + 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha}{\beta}}{1 + \beta}\\
\end{array}
\end{array}
if alpha < 1.1000000000000001Initial program 99.9%
Taylor expanded in beta around inf 37.6%
clear-num37.3%
inv-pow37.3%
metadata-eval37.3%
associate-+l+37.3%
metadata-eval37.3%
associate-+r+37.3%
Applied egg-rr37.3%
unpow-137.3%
associate-/r/37.3%
associate-+r+37.3%
+-commutative37.3%
+-commutative37.3%
Simplified37.3%
Taylor expanded in alpha around 0 36.8%
associate-/r*37.0%
+-commutative37.0%
Simplified37.0%
if 1.1000000000000001 < alpha Initial program 88.5%
Taylor expanded in beta around inf 18.1%
Taylor expanded in alpha around inf 18.0%
Taylor expanded in beta around inf 17.7%
Final simplification30.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= alpha 1.0) (/ (/ 1.0 beta) (+ beta 3.0)) (/ alpha (* beta (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (alpha <= 1.0) {
tmp = (1.0 / beta) / (beta + 3.0);
} else {
tmp = 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 (alpha <= 1.0d0) then
tmp = (1.0d0 / beta) / (beta + 3.0d0)
else
tmp = 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 (alpha <= 1.0) {
tmp = (1.0 / beta) / (beta + 3.0);
} else {
tmp = alpha / (beta * (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if alpha <= 1.0: tmp = (1.0 / beta) / (beta + 3.0) else: tmp = alpha / (beta * (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (alpha <= 1.0) tmp = Float64(Float64(1.0 / beta) / Float64(beta + 3.0)); else tmp = Float64(alpha / 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 (alpha <= 1.0)
tmp = (1.0 / beta) / (beta + 3.0);
else
tmp = 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[alpha, 1.0], N[(N[(1.0 / beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision], N[(alpha / N[(beta * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\alpha \leq 1:\\
\;\;\;\;\frac{\frac{1}{\beta}}{\beta + 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\alpha}{\beta \cdot \left(\beta + 3\right)}\\
\end{array}
\end{array}
if alpha < 1Initial program 99.9%
Taylor expanded in beta around inf 37.6%
clear-num37.3%
inv-pow37.3%
metadata-eval37.3%
associate-+l+37.3%
metadata-eval37.3%
associate-+r+37.3%
Applied egg-rr37.3%
unpow-137.3%
associate-/r/37.3%
associate-+r+37.3%
+-commutative37.3%
+-commutative37.3%
Simplified37.3%
Taylor expanded in alpha around 0 36.8%
associate-/r*37.0%
+-commutative37.0%
Simplified37.0%
if 1 < alpha Initial program 88.5%
Taylor expanded in beta around inf 18.1%
clear-num18.1%
inv-pow18.1%
Applied egg-rr18.1%
unpow-118.1%
Simplified18.1%
Taylor expanded in alpha around 0 17.8%
+-commutative17.8%
Simplified17.8%
Taylor expanded in alpha around inf 13.3%
+-commutative13.3%
Simplified13.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (* beta (+ beta 3.0)))) (if (<= alpha 1.0) (/ 1.0 t_0) (/ alpha t_0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = beta * (beta + 3.0);
double tmp;
if (alpha <= 1.0) {
tmp = 1.0 / t_0;
} else {
tmp = alpha / t_0;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = beta * (beta + 3.0d0)
if (alpha <= 1.0d0) then
tmp = 1.0d0 / t_0
else
tmp = alpha / t_0
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = beta * (beta + 3.0);
double tmp;
if (alpha <= 1.0) {
tmp = 1.0 / t_0;
} else {
tmp = alpha / t_0;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = beta * (beta + 3.0) tmp = 0 if alpha <= 1.0: tmp = 1.0 / t_0 else: tmp = alpha / t_0 return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(beta * Float64(beta + 3.0)) tmp = 0.0 if (alpha <= 1.0) tmp = Float64(1.0 / t_0); else tmp = Float64(alpha / t_0); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = beta * (beta + 3.0);
tmp = 0.0;
if (alpha <= 1.0)
tmp = 1.0 / t_0;
else
tmp = alpha / t_0;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(beta * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[alpha, 1.0], N[(1.0 / t$95$0), $MachinePrecision], N[(alpha / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \beta \cdot \left(\beta + 3\right)\\
\mathbf{if}\;\alpha \leq 1:\\
\;\;\;\;\frac{1}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\alpha}{t\_0}\\
\end{array}
\end{array}
if alpha < 1Initial program 99.9%
Taylor expanded in beta around inf 37.6%
Taylor expanded in alpha around 0 36.8%
+-commutative36.8%
Simplified36.8%
if 1 < alpha Initial program 88.5%
Taylor expanded in beta around inf 18.1%
clear-num18.1%
inv-pow18.1%
Applied egg-rr18.1%
unpow-118.1%
Simplified18.1%
Taylor expanded in alpha around 0 17.8%
+-commutative17.8%
Simplified17.8%
Taylor expanded in alpha around inf 13.3%
+-commutative13.3%
Simplified13.3%
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 96.0%
Taylor expanded in beta around inf 30.9%
Taylor expanded in alpha around 0 28.3%
+-commutative28.3%
Simplified28.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 1.0 (* beta beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
return 1.0 / (beta * 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 = 1.0d0 / (beta * beta)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 1.0 / (beta * beta);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 1.0 / (beta * beta)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(1.0 / Float64(beta * beta)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 1.0 / (beta * beta);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(1.0 / N[(beta * beta), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{1}{\beta \cdot \beta}
\end{array}
Initial program 96.0%
Taylor expanded in beta around inf 30.9%
clear-num30.6%
inv-pow30.6%
metadata-eval30.6%
associate-+l+30.6%
metadata-eval30.6%
associate-+r+30.6%
Applied egg-rr30.6%
unpow-130.6%
associate-/r/30.7%
associate-+r+30.7%
+-commutative30.7%
+-commutative30.7%
Simplified30.7%
Taylor expanded in alpha around 0 28.3%
+-commutative28.3%
Simplified28.3%
Taylor expanded in beta around inf 28.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.3333333333333333 beta))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.3333333333333333 / 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.3333333333333333d0 / beta
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.3333333333333333 / beta;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.3333333333333333 / beta
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.3333333333333333 / beta) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.3333333333333333 / beta;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.3333333333333333 / beta), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.3333333333333333}{\beta}
\end{array}
Initial program 96.0%
Taylor expanded in beta around inf 30.9%
clear-num30.6%
inv-pow30.6%
metadata-eval30.6%
associate-+l+30.6%
metadata-eval30.6%
associate-+r+30.6%
Applied egg-rr30.6%
unpow-130.6%
associate-/r/30.7%
associate-+r+30.7%
+-commutative30.7%
+-commutative30.7%
Simplified30.7%
Taylor expanded in alpha around 0 28.3%
+-commutative28.3%
Simplified28.3%
Taylor expanded in beta around 0 4.2%
herbie shell --seed 2024181
(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)))