
(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 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t_0}}{t_0}}{t_0 + 1}
\end{array}
\end{array}
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ alpha (+ beta 2.0)))) (/ (/ (+ 1.0 alpha) t_0) (* (+ alpha (+ beta 3.0)) (/ t_0 (+ 1.0 beta))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((1.0 + alpha) / t_0) / ((alpha + (beta + 3.0)) * (t_0 / (1.0 + beta)));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = alpha + (beta + 2.0d0)
code = ((1.0d0 + alpha) / t_0) / ((alpha + (beta + 3.0d0)) * (t_0 / (1.0d0 + beta)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((1.0 + alpha) / t_0) / ((alpha + (beta + 3.0)) * (t_0 / (1.0 + beta)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return ((1.0 + alpha) / t_0) / ((alpha + (beta + 3.0)) * (t_0 / (1.0 + beta)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) return Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(Float64(alpha + Float64(beta + 3.0)) * Float64(t_0 / Float64(1.0 + beta)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = ((1.0 + alpha) / t_0) / ((alpha + (beta + 3.0)) * (t_0 / (1.0 + beta)));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / N[(1.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\frac{\frac{1 + \alpha}{t_0}}{\left(\alpha + \left(\beta + 3\right)\right) \cdot \frac{t_0}{1 + \beta}}
\end{array}
\end{array}
Initial program 95.2%
Simplified97.2%
*-commutative97.2%
clear-num97.2%
clear-num97.1%
frac-times97.2%
metadata-eval97.2%
+-commutative97.2%
Applied egg-rr97.2%
*-commutative97.2%
associate-/r*97.2%
+-commutative97.2%
associate-/l*99.3%
+-commutative99.3%
+-commutative99.3%
+-commutative99.3%
Simplified99.3%
div-inv99.3%
+-commutative99.3%
clear-num99.3%
+-commutative99.3%
associate-/r/99.3%
+-commutative99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
+-commutative99.4%
+-commutative99.4%
*-commutative99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
Simplified99.4%
Final simplification99.4%
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 14500000.0)
(/ (+ 1.0 beta) (* t_0 (* (+ beta 2.0) (+ beta 3.0))))
(/
(/ (+ 1.0 alpha) t_0)
(* (+ alpha (+ beta 3.0)) (+ 1.0 (/ (- alpha -1.0) beta)))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 14500000.0) {
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / t_0) / ((alpha + (beta + 3.0)) * (1.0 + ((alpha - -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) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 14500000.0d0) then
tmp = (1.0d0 + beta) / (t_0 * ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = ((1.0d0 + alpha) / t_0) / ((alpha + (beta + 3.0d0)) * (1.0d0 + ((alpha - (-1.0d0)) / beta)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 14500000.0) {
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / t_0) / ((alpha + (beta + 3.0)) * (1.0 + ((alpha - -1.0) / beta)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 14500000.0: tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0))) else: tmp = ((1.0 + alpha) / t_0) / ((alpha + (beta + 3.0)) * (1.0 + ((alpha - -1.0) / beta))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 14500000.0) tmp = Float64(Float64(1.0 + beta) / Float64(t_0 * Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(Float64(alpha + Float64(beta + 3.0)) * Float64(1.0 + Float64(Float64(alpha - -1.0) / beta)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 14500000.0)
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
else
tmp = ((1.0 + alpha) / t_0) / ((alpha + (beta + 3.0)) * (1.0 + ((alpha - -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_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 14500000.0], N[(N[(1.0 + beta), $MachinePrecision] / N[(t$95$0 * N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(alpha - -1.0), $MachinePrecision] / beta), $MachinePrecision]), $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 14500000:\\
\;\;\;\;\frac{1 + \beta}{t_0 \cdot \left(\left(\beta + 2\right) \cdot \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0}}{\left(\alpha + \left(\beta + 3\right)\right) \cdot \left(1 + \frac{\alpha - -1}{\beta}\right)}\\
\end{array}
\end{array}
if beta < 1.45e7Initial program 99.8%
Simplified95.8%
Taylor expanded in alpha around 0 81.1%
Taylor expanded in alpha around 0 67.5%
if 1.45e7 < beta Initial program 85.4%
Simplified92.4%
*-commutative92.4%
clear-num92.3%
clear-num92.3%
frac-times92.5%
metadata-eval92.5%
+-commutative92.5%
Applied egg-rr92.5%
*-commutative92.5%
associate-/r*92.4%
+-commutative92.4%
associate-/l*99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
div-inv99.0%
+-commutative99.0%
clear-num99.0%
+-commutative99.0%
associate-/r/99.0%
+-commutative99.0%
Applied egg-rr99.0%
associate-*r/99.1%
*-rgt-identity99.1%
+-commutative99.1%
+-commutative99.1%
*-commutative99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in beta around -inf 99.1%
mul-1-neg99.1%
unsub-neg99.1%
mul-1-neg99.1%
distribute-neg-in99.1%
metadata-eval99.1%
associate-+r+99.1%
metadata-eval99.1%
sub-neg99.1%
Simplified99.1%
Final simplification77.6%
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 24000000.0)
(/ (/ (+ 1.0 (+ alpha beta)) t_0) (* t_0 (+ 3.0 (+ alpha beta))))
(/
(/ (+ 1.0 alpha) t_0)
(* (+ alpha (+ beta 3.0)) (+ 1.0 (/ (- alpha -1.0) beta)))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 24000000.0) {
tmp = ((1.0 + (alpha + beta)) / t_0) / (t_0 * (3.0 + (alpha + beta)));
} else {
tmp = ((1.0 + alpha) / t_0) / ((alpha + (beta + 3.0)) * (1.0 + ((alpha - -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) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 24000000.0d0) then
tmp = ((1.0d0 + (alpha + beta)) / t_0) / (t_0 * (3.0d0 + (alpha + beta)))
else
tmp = ((1.0d0 + alpha) / t_0) / ((alpha + (beta + 3.0d0)) * (1.0d0 + ((alpha - (-1.0d0)) / beta)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 24000000.0) {
tmp = ((1.0 + (alpha + beta)) / t_0) / (t_0 * (3.0 + (alpha + beta)));
} else {
tmp = ((1.0 + alpha) / t_0) / ((alpha + (beta + 3.0)) * (1.0 + ((alpha - -1.0) / beta)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 24000000.0: tmp = ((1.0 + (alpha + beta)) / t_0) / (t_0 * (3.0 + (alpha + beta))) else: tmp = ((1.0 + alpha) / t_0) / ((alpha + (beta + 3.0)) * (1.0 + ((alpha - -1.0) / beta))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 24000000.0) tmp = Float64(Float64(Float64(1.0 + Float64(alpha + beta)) / t_0) / Float64(t_0 * Float64(3.0 + Float64(alpha + beta)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(Float64(alpha + Float64(beta + 3.0)) * Float64(1.0 + Float64(Float64(alpha - -1.0) / beta)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 24000000.0)
tmp = ((1.0 + (alpha + beta)) / t_0) / (t_0 * (3.0 + (alpha + beta)));
else
tmp = ((1.0 + alpha) / t_0) / ((alpha + (beta + 3.0)) * (1.0 + ((alpha - -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_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 24000000.0], N[(N[(N[(1.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 * N[(3.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(alpha - -1.0), $MachinePrecision] / beta), $MachinePrecision]), $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 24000000:\\
\;\;\;\;\frac{\frac{1 + \left(\alpha + \beta\right)}{t_0}}{t_0 \cdot \left(3 + \left(\alpha + \beta\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0}}{\left(\alpha + \left(\beta + 3\right)\right) \cdot \left(1 + \frac{\alpha - -1}{\beta}\right)}\\
\end{array}
\end{array}
if beta < 2.4e7Initial program 99.8%
associate-/l/99.5%
+-commutative99.5%
+-commutative99.5%
associate-+r+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in beta around 0 99.0%
if 2.4e7 < beta Initial program 85.4%
Simplified92.4%
*-commutative92.4%
clear-num92.3%
clear-num92.3%
frac-times92.5%
metadata-eval92.5%
+-commutative92.5%
Applied egg-rr92.5%
*-commutative92.5%
associate-/r*92.4%
+-commutative92.4%
associate-/l*99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
div-inv99.0%
+-commutative99.0%
clear-num99.0%
+-commutative99.0%
associate-/r/99.0%
+-commutative99.0%
Applied egg-rr99.0%
associate-*r/99.1%
*-rgt-identity99.1%
+-commutative99.1%
+-commutative99.1%
*-commutative99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in beta around -inf 99.1%
mul-1-neg99.1%
unsub-neg99.1%
mul-1-neg99.1%
distribute-neg-in99.1%
metadata-eval99.1%
associate-+r+99.1%
metadata-eval99.1%
sub-neg99.1%
Simplified99.1%
Final simplification99.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ alpha (+ beta 2.0)))) (* (/ (+ 1.0 alpha) t_0) (/ (/ (+ 1.0 beta) t_0) (+ alpha (+ beta 3.0))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return ((1.0 + alpha) / t_0) * (((1.0 + beta) / t_0) / (alpha + (beta + 3.0)));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = alpha + (beta + 2.0d0)
code = ((1.0d0 + alpha) / t_0) * (((1.0d0 + beta) / t_0) / (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) / t_0) * (((1.0 + beta) / t_0) / (alpha + (beta + 3.0)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return ((1.0 + alpha) / t_0) * (((1.0 + beta) / t_0) / (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(1.0 + alpha) / t_0) * Float64(Float64(Float64(1.0 + beta) / t_0) / 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) / t_0) * (((1.0 + beta) / t_0) / (alpha + (beta + 3.0)));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\frac{1 + \alpha}{t_0} \cdot \frac{\frac{1 + \beta}{t_0}}{\alpha + \left(\beta + 3\right)}
\end{array}
\end{array}
Initial program 95.2%
Simplified97.2%
clear-num97.2%
associate-+r+97.2%
*-commutative97.2%
frac-times95.1%
*-un-lft-identity95.1%
+-commutative95.1%
*-commutative95.1%
associate-+r+95.1%
Applied egg-rr95.1%
associate-/r*97.2%
associate-/l*94.2%
associate-*l/97.2%
*-commutative97.2%
times-frac99.8%
associate-/r*97.2%
*-commutative97.2%
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 8.4e+15)
(/ (+ 1.0 beta) (* t_0 (* (+ beta 2.0) (+ beta 3.0))))
(/ (/ (- alpha -1.0) t_0) (+ alpha (+ beta 3.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 8.4e+15) {
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((alpha - -1.0) / t_0) / (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) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 8.4d+15) then
tmp = (1.0d0 + beta) / (t_0 * ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = ((alpha - (-1.0d0)) / t_0) / (alpha + (beta + 3.0d0))
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 <= 8.4e+15) {
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((alpha - -1.0) / t_0) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 8.4e+15: tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0))) else: tmp = ((alpha - -1.0) / t_0) / (alpha + (beta + 3.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 <= 8.4e+15) tmp = Float64(Float64(1.0 + beta) / Float64(t_0 * Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(alpha - -1.0) / t_0) / Float64(alpha + Float64(beta + 3.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 <= 8.4e+15)
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
else
tmp = ((alpha - -1.0) / t_0) / (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_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 8.4e+15], N[(N[(1.0 + beta), $MachinePrecision] / N[(t$95$0 * N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(alpha - -1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $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 8.4 \cdot 10^{+15}:\\
\;\;\;\;\frac{1 + \beta}{t_0 \cdot \left(\left(\beta + 2\right) \cdot \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{t_0}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 8.4e15Initial program 99.8%
Simplified95.8%
Taylor expanded in alpha around 0 81.3%
Taylor expanded in alpha around 0 67.9%
if 8.4e15 < beta Initial program 85.1%
associate-/l/82.6%
+-commutative82.6%
+-commutative82.6%
associate-+r+82.6%
*-commutative82.6%
metadata-eval82.6%
associate-+l+82.6%
metadata-eval82.6%
associate-+l+82.6%
metadata-eval82.6%
metadata-eval82.6%
associate-+l+82.6%
Simplified82.6%
Taylor expanded in beta around -inf 86.6%
expm1-log1p-u86.6%
expm1-udef51.0%
mul-1-neg51.0%
*-commutative51.0%
fma-neg51.0%
metadata-eval51.0%
*-commutative51.0%
associate-+r+51.0%
+-commutative51.0%
Applied egg-rr51.0%
expm1-def86.6%
expm1-log1p86.6%
associate-/r*84.1%
Simplified84.1%
Final simplification72.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))))
(if (<= beta 56000000.0)
(/ (+ 1.0 beta) (* t_0 (* (+ beta 2.0) (+ beta 3.0))))
(/ (/ (+ 1.0 alpha) t_0) (+ (+ beta 4.0) (* alpha 2.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 56000000.0) {
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / t_0) / ((beta + 4.0) + (alpha * 2.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 56000000.0d0) then
tmp = (1.0d0 + beta) / (t_0 * ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = ((1.0d0 + alpha) / t_0) / ((beta + 4.0d0) + (alpha * 2.0d0))
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 <= 56000000.0) {
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / t_0) / ((beta + 4.0) + (alpha * 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 56000000.0: tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0))) else: tmp = ((1.0 + alpha) / t_0) / ((beta + 4.0) + (alpha * 2.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 <= 56000000.0) tmp = Float64(Float64(1.0 + beta) / Float64(t_0 * Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(Float64(beta + 4.0) + Float64(alpha * 2.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 <= 56000000.0)
tmp = (1.0 + beta) / (t_0 * ((beta + 2.0) * (beta + 3.0)));
else
tmp = ((1.0 + alpha) / t_0) / ((beta + 4.0) + (alpha * 2.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 56000000.0], N[(N[(1.0 + beta), $MachinePrecision] / N[(t$95$0 * N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(N[(beta + 4.0), $MachinePrecision] + N[(alpha * 2.0), $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 56000000:\\
\;\;\;\;\frac{1 + \beta}{t_0 \cdot \left(\left(\beta + 2\right) \cdot \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_0}}{\left(\beta + 4\right) + \alpha \cdot 2}\\
\end{array}
\end{array}
if beta < 5.6e7Initial program 99.8%
Simplified95.8%
Taylor expanded in alpha around 0 81.1%
Taylor expanded in alpha around 0 67.5%
if 5.6e7 < beta Initial program 85.4%
Simplified92.4%
*-commutative92.4%
clear-num92.3%
clear-num92.3%
frac-times92.5%
metadata-eval92.5%
+-commutative92.5%
Applied egg-rr92.5%
*-commutative92.5%
associate-/r*92.4%
+-commutative92.4%
associate-/l*99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
div-inv99.0%
+-commutative99.0%
clear-num99.0%
+-commutative99.0%
associate-/r/99.0%
+-commutative99.0%
Applied egg-rr99.0%
associate-*r/99.1%
*-rgt-identity99.1%
+-commutative99.1%
+-commutative99.1%
*-commutative99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in beta around inf 84.6%
associate-+r+84.6%
Simplified84.6%
Final simplification73.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 160000000.0) (/ (/ (+ 1.0 beta) (+ beta 2.0)) (* (+ beta 2.0) (+ beta 3.0))) (/ (/ (+ 1.0 alpha) (+ alpha (+ beta 2.0))) (+ beta 4.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 160000000.0) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / (beta + 4.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 <= 160000000.0d0) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = ((1.0d0 + alpha) / (alpha + (beta + 2.0d0))) / (beta + 4.0d0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 160000000.0) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / (beta + 4.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 160000000.0: tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)) else: tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / (beta + 4.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 160000000.0) 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(alpha + Float64(beta + 2.0))) / Float64(beta + 4.0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 160000000.0)
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
else
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / (beta + 4.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, 160000000.0], 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[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 160000000:\\
\;\;\;\;\frac{\frac{1 + \beta}{\beta + 2}}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(\beta + 2\right)}}{\beta + 4}\\
\end{array}
\end{array}
if beta < 1.6e8Initial program 99.8%
Simplified99.4%
associate-*r/99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in alpha around 0 83.0%
+-commutative83.0%
Simplified83.0%
Taylor expanded in alpha around 0 66.6%
if 1.6e8 < beta Initial program 85.4%
Simplified92.4%
*-commutative92.4%
clear-num92.3%
clear-num92.3%
frac-times92.5%
metadata-eval92.5%
+-commutative92.5%
Applied egg-rr92.5%
*-commutative92.5%
associate-/r*92.4%
+-commutative92.4%
associate-/l*99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
div-inv99.0%
+-commutative99.0%
clear-num99.0%
+-commutative99.0%
associate-/r/99.0%
+-commutative99.0%
Applied egg-rr99.0%
associate-*r/99.1%
*-rgt-identity99.1%
+-commutative99.1%
+-commutative99.1%
*-commutative99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in alpha around 0 85.6%
+-commutative85.6%
*-commutative85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in beta around inf 83.9%
+-commutative83.9%
Simplified83.9%
Final simplification72.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 8.4e+15) (/ (/ (+ 1.0 beta) (+ beta 2.0)) (* (+ beta 2.0) (+ beta 3.0))) (/ (/ (- alpha -1.0) (+ alpha (+ beta 2.0))) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 8.4e+15) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((alpha - -1.0) / (alpha + (beta + 2.0))) / (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 <= 8.4d+15) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = ((alpha - (-1.0d0)) / (alpha + (beta + 2.0d0))) / (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 <= 8.4e+15) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((alpha - -1.0) / (alpha + (beta + 2.0))) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 8.4e+15: tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)) else: tmp = ((alpha - -1.0) / (alpha + (beta + 2.0))) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 8.4e+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(alpha - -1.0) / Float64(alpha + Float64(beta + 2.0))) / 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 <= 8.4e+15)
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
else
tmp = ((alpha - -1.0) / (alpha + (beta + 2.0))) / (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, 8.4e+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[(alpha - -1.0), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $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 8.4 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\beta + 2}}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\alpha - -1}{\alpha + \left(\beta + 2\right)}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 8.4e15Initial program 99.8%
Simplified99.4%
associate-*r/99.4%
+-commutative99.4%
Applied egg-rr99.4%
Taylor expanded in alpha around 0 83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in alpha around 0 67.0%
if 8.4e15 < beta Initial program 85.1%
associate-/l/82.6%
+-commutative82.6%
+-commutative82.6%
associate-+r+82.6%
*-commutative82.6%
metadata-eval82.6%
associate-+l+82.6%
metadata-eval82.6%
associate-+l+82.6%
metadata-eval82.6%
metadata-eval82.6%
associate-+l+82.6%
Simplified82.6%
Taylor expanded in beta around -inf 86.6%
expm1-log1p-u86.6%
expm1-udef51.0%
mul-1-neg51.0%
*-commutative51.0%
fma-neg51.0%
metadata-eval51.0%
*-commutative51.0%
associate-+r+51.0%
+-commutative51.0%
Applied egg-rr51.0%
expm1-def86.6%
expm1-log1p86.6%
associate-/r*84.1%
Simplified84.1%
Final simplification72.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.6) (/ (+ 0.5 (* beta 0.25)) (* (+ beta 2.0) (+ beta 3.0))) (/ (/ (+ 1.0 alpha) (+ alpha (+ beta 2.0))) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.6) {
tmp = (0.5 + (beta * 0.25)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 4.6d0) then
tmp = (0.5d0 + (beta * 0.25d0)) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = ((1.0d0 + alpha) / (alpha + (beta + 2.0d0))) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 4.6) {
tmp = (0.5 + (beta * 0.25)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.6: tmp = (0.5 + (beta * 0.25)) / ((beta + 2.0) * (beta + 3.0)) else: tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.6) 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) / Float64(alpha + Float64(beta + 2.0))) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 4.6)
tmp = (0.5 + (beta * 0.25)) / ((beta + 2.0) * (beta + 3.0));
else
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 4.6], 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] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4.6:\\
\;\;\;\;\frac{0.5 + \beta \cdot 0.25}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(\beta + 2\right)}}{\beta}\\
\end{array}
\end{array}
if beta < 4.5999999999999996Initial program 99.8%
Simplified99.5%
associate-*r/99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in alpha around 0 82.9%
+-commutative82.9%
Simplified82.9%
Taylor expanded in beta around 0 82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in alpha around 0 65.8%
if 4.5999999999999996 < beta Initial program 85.6%
Simplified92.5%
Taylor expanded in beta around inf 82.7%
un-div-inv82.8%
+-commutative82.8%
+-commutative82.8%
Applied egg-rr82.8%
Final simplification71.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.25) (/ (+ 0.5 (* beta 0.25)) (* (+ beta 2.0) (+ beta 3.0))) (/ (/ (+ 1.0 alpha) (+ alpha (+ beta 2.0))) (+ beta 4.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.25) {
tmp = (0.5 + (beta * 0.25)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / (beta + 4.0);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.25d0) then
tmp = (0.5d0 + (beta * 0.25d0)) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = ((1.0d0 + alpha) / (alpha + (beta + 2.0d0))) / (beta + 4.0d0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.25) {
tmp = (0.5 + (beta * 0.25)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / (beta + 4.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.25: tmp = (0.5 + (beta * 0.25)) / ((beta + 2.0) * (beta + 3.0)) else: tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / (beta + 4.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.25) 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) / Float64(alpha + Float64(beta + 2.0))) / Float64(beta + 4.0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.25)
tmp = (0.5 + (beta * 0.25)) / ((beta + 2.0) * (beta + 3.0));
else
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / (beta + 4.0);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.25], 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] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(beta + 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.25:\\
\;\;\;\;\frac{0.5 + \beta \cdot 0.25}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(\beta + 2\right)}}{\beta + 4}\\
\end{array}
\end{array}
if beta < 1.25Initial program 99.8%
Simplified99.5%
associate-*r/99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in alpha around 0 82.9%
+-commutative82.9%
Simplified82.9%
Taylor expanded in beta around 0 82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in alpha around 0 65.8%
if 1.25 < beta Initial program 85.6%
Simplified92.5%
*-commutative92.5%
clear-num92.4%
clear-num92.4%
frac-times92.5%
metadata-eval92.5%
+-commutative92.5%
Applied egg-rr92.5%
*-commutative92.5%
associate-/r*92.5%
+-commutative92.5%
associate-/l*99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
div-inv99.0%
+-commutative99.0%
clear-num99.0%
+-commutative99.0%
associate-/r/99.0%
+-commutative99.0%
Applied egg-rr99.0%
associate-*r/99.1%
*-rgt-identity99.1%
+-commutative99.1%
+-commutative99.1%
*-commutative99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in alpha around 0 85.7%
+-commutative85.7%
*-commutative85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in beta around inf 83.5%
+-commutative83.5%
Simplified83.5%
Final simplification71.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.7) (/ 0.5 (* (+ alpha 2.0) (+ alpha 3.0))) (/ (/ (+ 1.0 alpha) (+ alpha (+ beta 2.0))) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.7) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.7d0) then
tmp = 0.5d0 / ((alpha + 2.0d0) * (alpha + 3.0d0))
else
tmp = ((1.0d0 + alpha) / (alpha + (beta + 2.0d0))) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.7) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.7: tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0)) else: tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.7) tmp = Float64(0.5 / Float64(Float64(alpha + 2.0) * Float64(alpha + 3.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 2.0))) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.7)
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
else
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.7], N[(0.5 / N[(N[(alpha + 2.0), $MachinePrecision] * N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.7:\\
\;\;\;\;\frac{0.5}{\left(\alpha + 2\right) \cdot \left(\alpha + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(\beta + 2\right)}}{\beta}\\
\end{array}
\end{array}
if beta < 3.7000000000000002Initial program 99.8%
Simplified99.5%
associate-*r/99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in alpha around 0 82.9%
+-commutative82.9%
Simplified82.9%
Taylor expanded in beta around 0 81.8%
if 3.7000000000000002 < beta Initial program 85.6%
Simplified92.5%
Taylor expanded in beta around inf 82.7%
un-div-inv82.8%
+-commutative82.8%
+-commutative82.8%
Applied egg-rr82.8%
Final simplification82.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 6.4) (/ 1.0 (+ 6.0 (* beta 5.0))) (* (/ (+ 1.0 alpha) beta) (/ 1.0 beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 6.4) {
tmp = 1.0 / (6.0 + (beta * 5.0));
} else {
tmp = ((1.0 + 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 <= 6.4d0) then
tmp = 1.0d0 / (6.0d0 + (beta * 5.0d0))
else
tmp = ((1.0d0 + 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 <= 6.4) {
tmp = 1.0 / (6.0 + (beta * 5.0));
} else {
tmp = ((1.0 + alpha) / beta) * (1.0 / beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 6.4: tmp = 1.0 / (6.0 + (beta * 5.0)) else: tmp = ((1.0 + alpha) / beta) * (1.0 / beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 6.4) tmp = Float64(1.0 / Float64(6.0 + Float64(beta * 5.0))); else tmp = Float64(Float64(Float64(1.0 + 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 <= 6.4)
tmp = 1.0 / (6.0 + (beta * 5.0));
else
tmp = ((1.0 + 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, 6.4], N[(1.0 / N[(6.0 + N[(beta * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] * N[(1.0 / beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 6.4:\\
\;\;\;\;\frac{1}{6 + \beta \cdot 5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta} \cdot \frac{1}{\beta}\\
\end{array}
\end{array}
if beta < 6.4000000000000004Initial program 99.8%
associate-/l/99.5%
+-commutative99.5%
+-commutative99.5%
associate-+r+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in beta around -inf 28.6%
Taylor expanded in alpha around 0 14.1%
+-commutative14.1%
+-commutative14.1%
Simplified14.1%
Taylor expanded in beta around 0 14.1%
*-commutative14.1%
Simplified14.1%
if 6.4000000000000004 < beta Initial program 85.6%
Simplified92.5%
Taylor expanded in beta around inf 82.7%
Taylor expanded in beta around inf 82.4%
Final simplification36.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.5) (/ 0.5 (* (+ alpha 2.0) (+ alpha 3.0))) (* (/ (+ 1.0 alpha) beta) (/ 1.0 beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.5) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = ((1.0 + 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 <= 4.5d0) then
tmp = 0.5d0 / ((alpha + 2.0d0) * (alpha + 3.0d0))
else
tmp = ((1.0d0 + 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 <= 4.5) {
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) * (1.0 / beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.5: tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0)) else: tmp = ((1.0 + alpha) / beta) * (1.0 / beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.5) tmp = Float64(0.5 / Float64(Float64(alpha + 2.0) * Float64(alpha + 3.0))); else tmp = Float64(Float64(Float64(1.0 + 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 <= 4.5)
tmp = 0.5 / ((alpha + 2.0) * (alpha + 3.0));
else
tmp = ((1.0 + 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, 4.5], 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[(1.0 / beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4.5:\\
\;\;\;\;\frac{0.5}{\left(\alpha + 2\right) \cdot \left(\alpha + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta} \cdot \frac{1}{\beta}\\
\end{array}
\end{array}
if beta < 4.5Initial program 99.8%
Simplified99.5%
associate-*r/99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in alpha around 0 82.9%
+-commutative82.9%
Simplified82.9%
Taylor expanded in beta around 0 81.8%
if 4.5 < beta Initial program 85.6%
Simplified92.5%
Taylor expanded in beta around inf 82.7%
Taylor expanded in beta around inf 82.4%
Final simplification82.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.1) (+ 0.16666666666666666 (* beta -0.1388888888888889)) (/ 1.0 (* beta (+ beta 2.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.1) {
tmp = 0.16666666666666666 + (beta * -0.1388888888888889);
} else {
tmp = 1.0 / (beta * (beta + 2.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.1d0) then
tmp = 0.16666666666666666d0 + (beta * (-0.1388888888888889d0))
else
tmp = 1.0d0 / (beta * (beta + 2.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.1) {
tmp = 0.16666666666666666 + (beta * -0.1388888888888889);
} else {
tmp = 1.0 / (beta * (beta + 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.1: tmp = 0.16666666666666666 + (beta * -0.1388888888888889) else: tmp = 1.0 / (beta * (beta + 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.1) tmp = Float64(0.16666666666666666 + Float64(beta * -0.1388888888888889)); else tmp = Float64(1.0 / Float64(beta * Float64(beta + 2.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.1)
tmp = 0.16666666666666666 + (beta * -0.1388888888888889);
else
tmp = 1.0 / (beta * (beta + 2.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.1], N[(0.16666666666666666 + N[(beta * -0.1388888888888889), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(beta * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.1:\\
\;\;\;\;0.16666666666666666 + \beta \cdot -0.1388888888888889\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \left(\beta + 2\right)}\\
\end{array}
\end{array}
if beta < 1.1000000000000001Initial program 99.8%
associate-/l/99.5%
+-commutative99.5%
+-commutative99.5%
associate-+r+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in beta around -inf 28.6%
Taylor expanded in alpha around 0 14.1%
+-commutative14.1%
+-commutative14.1%
Simplified14.1%
Taylor expanded in beta around 0 14.1%
*-commutative14.1%
Simplified14.1%
if 1.1000000000000001 < beta Initial program 85.6%
Simplified92.5%
Taylor expanded in beta around inf 82.7%
Taylor expanded in alpha around 0 79.0%
+-commutative79.0%
Simplified79.0%
Final simplification35.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.5) (/ 1.0 (+ 6.0 (* beta 5.0))) (/ 1.0 (* beta (+ beta 2.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.5) {
tmp = 1.0 / (6.0 + (beta * 5.0));
} else {
tmp = 1.0 / (beta * (beta + 2.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 4.5d0) then
tmp = 1.0d0 / (6.0d0 + (beta * 5.0d0))
else
tmp = 1.0d0 / (beta * (beta + 2.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 4.5) {
tmp = 1.0 / (6.0 + (beta * 5.0));
} else {
tmp = 1.0 / (beta * (beta + 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.5: tmp = 1.0 / (6.0 + (beta * 5.0)) else: tmp = 1.0 / (beta * (beta + 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.5) tmp = Float64(1.0 / Float64(6.0 + Float64(beta * 5.0))); else tmp = Float64(1.0 / Float64(beta * Float64(beta + 2.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 4.5)
tmp = 1.0 / (6.0 + (beta * 5.0));
else
tmp = 1.0 / (beta * (beta + 2.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 4.5], N[(1.0 / N[(6.0 + N[(beta * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(beta * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4.5:\\
\;\;\;\;\frac{1}{6 + \beta \cdot 5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \left(\beta + 2\right)}\\
\end{array}
\end{array}
if beta < 4.5Initial program 99.8%
associate-/l/99.5%
+-commutative99.5%
+-commutative99.5%
associate-+r+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in beta around -inf 28.6%
Taylor expanded in alpha around 0 14.1%
+-commutative14.1%
+-commutative14.1%
Simplified14.1%
Taylor expanded in beta around 0 14.1%
*-commutative14.1%
Simplified14.1%
if 4.5 < beta Initial program 85.6%
Simplified92.5%
Taylor expanded in beta around inf 82.7%
Taylor expanded in alpha around 0 79.0%
+-commutative79.0%
Simplified79.0%
Final simplification35.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.35) (+ 0.16666666666666666 (* alpha 0.027777777777777776)) (/ 0.25 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.35) {
tmp = 0.16666666666666666 + (alpha * 0.027777777777777776);
} else {
tmp = 0.25 / 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.35d0) then
tmp = 0.16666666666666666d0 + (alpha * 0.027777777777777776d0)
else
tmp = 0.25d0 / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.35) {
tmp = 0.16666666666666666 + (alpha * 0.027777777777777776);
} else {
tmp = 0.25 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.35: tmp = 0.16666666666666666 + (alpha * 0.027777777777777776) else: tmp = 0.25 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.35) tmp = Float64(0.16666666666666666 + Float64(alpha * 0.027777777777777776)); else tmp = Float64(0.25 / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.35)
tmp = 0.16666666666666666 + (alpha * 0.027777777777777776);
else
tmp = 0.25 / 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.35], N[(0.16666666666666666 + N[(alpha * 0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(0.25 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.35:\\
\;\;\;\;0.16666666666666666 + \alpha \cdot 0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{\beta}\\
\end{array}
\end{array}
if beta < 1.3500000000000001Initial program 99.8%
associate-/l/99.5%
+-commutative99.5%
+-commutative99.5%
associate-+r+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in beta around -inf 28.6%
Taylor expanded in beta around 0 28.5%
associate-*r/28.5%
neg-mul-128.5%
sub-neg28.5%
mul-1-neg28.5%
distribute-neg-in28.5%
+-commutative28.5%
mul-1-neg28.5%
distribute-lft-in28.5%
metadata-eval28.5%
mul-1-neg28.5%
unsub-neg28.5%
Simplified28.5%
Taylor expanded in alpha around 0 13.7%
*-commutative13.7%
Simplified13.7%
if 1.3500000000000001 < beta Initial program 85.6%
Simplified92.5%
associate-*r/92.6%
+-commutative92.6%
Applied egg-rr92.6%
Taylor expanded in alpha around 0 81.4%
+-commutative81.4%
Simplified81.4%
Taylor expanded in beta around 0 50.8%
*-commutative50.8%
Simplified50.8%
Taylor expanded in beta around inf 6.9%
Final simplification11.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.1) (+ 0.16666666666666666 (* beta -0.1388888888888889)) (/ 0.25 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.1) {
tmp = 0.16666666666666666 + (beta * -0.1388888888888889);
} else {
tmp = 0.25 / 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.1d0) then
tmp = 0.16666666666666666d0 + (beta * (-0.1388888888888889d0))
else
tmp = 0.25d0 / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.1) {
tmp = 0.16666666666666666 + (beta * -0.1388888888888889);
} else {
tmp = 0.25 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.1: tmp = 0.16666666666666666 + (beta * -0.1388888888888889) else: tmp = 0.25 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.1) tmp = Float64(0.16666666666666666 + Float64(beta * -0.1388888888888889)); else tmp = Float64(0.25 / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.1)
tmp = 0.16666666666666666 + (beta * -0.1388888888888889);
else
tmp = 0.25 / 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.1], N[(0.16666666666666666 + N[(beta * -0.1388888888888889), $MachinePrecision]), $MachinePrecision], N[(0.25 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.1:\\
\;\;\;\;0.16666666666666666 + \beta \cdot -0.1388888888888889\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{\beta}\\
\end{array}
\end{array}
if beta < 1.1000000000000001Initial program 99.8%
associate-/l/99.5%
+-commutative99.5%
+-commutative99.5%
associate-+r+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in beta around -inf 28.6%
Taylor expanded in alpha around 0 14.1%
+-commutative14.1%
+-commutative14.1%
Simplified14.1%
Taylor expanded in beta around 0 14.1%
*-commutative14.1%
Simplified14.1%
if 1.1000000000000001 < beta Initial program 85.6%
Simplified92.5%
associate-*r/92.6%
+-commutative92.6%
Applied egg-rr92.6%
Taylor expanded in alpha around 0 81.4%
+-commutative81.4%
Simplified81.4%
Taylor expanded in beta around 0 50.8%
*-commutative50.8%
Simplified50.8%
Taylor expanded in beta around inf 6.9%
Final simplification11.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.5) 0.16666666666666666 (/ 0.25 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.5) {
tmp = 0.16666666666666666;
} else {
tmp = 0.25 / 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.5d0) then
tmp = 0.16666666666666666d0
else
tmp = 0.25d0 / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.5) {
tmp = 0.16666666666666666;
} else {
tmp = 0.25 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.5: tmp = 0.16666666666666666 else: tmp = 0.25 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.5) tmp = 0.16666666666666666; else tmp = Float64(0.25 / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.5)
tmp = 0.16666666666666666;
else
tmp = 0.25 / 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.5], 0.16666666666666666, N[(0.25 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.5:\\
\;\;\;\;0.16666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{\beta}\\
\end{array}
\end{array}
if beta < 1.5Initial program 99.8%
associate-/l/99.5%
+-commutative99.5%
+-commutative99.5%
associate-+r+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in beta around -inf 28.6%
Taylor expanded in beta around 0 28.5%
associate-*r/28.5%
neg-mul-128.5%
sub-neg28.5%
mul-1-neg28.5%
distribute-neg-in28.5%
+-commutative28.5%
mul-1-neg28.5%
distribute-lft-in28.5%
metadata-eval28.5%
mul-1-neg28.5%
unsub-neg28.5%
Simplified28.5%
Taylor expanded in alpha around 0 14.1%
if 1.5 < beta Initial program 85.6%
Simplified92.5%
associate-*r/92.6%
+-commutative92.6%
Applied egg-rr92.6%
Taylor expanded in alpha around 0 81.4%
+-commutative81.4%
Simplified81.4%
Taylor expanded in beta around 0 50.8%
*-commutative50.8%
Simplified50.8%
Taylor expanded in beta around inf 6.9%
Final simplification11.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 0.16666666666666666)
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.16666666666666666;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.16666666666666666d0
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.16666666666666666;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.16666666666666666
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return 0.16666666666666666 end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.16666666666666666;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := 0.16666666666666666
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
0.16666666666666666
\end{array}
Initial program 95.2%
associate-/l/94.2%
+-commutative94.2%
+-commutative94.2%
associate-+r+94.2%
*-commutative94.2%
metadata-eval94.2%
associate-+l+94.2%
metadata-eval94.2%
associate-+l+94.2%
metadata-eval94.2%
metadata-eval94.2%
associate-+l+94.2%
Simplified94.2%
Taylor expanded in beta around -inf 47.1%
Taylor expanded in beta around 0 23.6%
associate-*r/23.6%
neg-mul-123.6%
sub-neg23.6%
mul-1-neg23.6%
distribute-neg-in23.6%
+-commutative23.6%
mul-1-neg23.6%
distribute-lft-in23.6%
metadata-eval23.6%
mul-1-neg23.6%
unsub-neg23.6%
Simplified23.6%
Taylor expanded in alpha around 0 10.8%
Final simplification10.8%
herbie shell --seed 2023331
(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)))