
(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 16 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) (* t_0 (/ (+ (+ alpha beta) 3.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) / (t_0 * (((alpha + beta) + 3.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) / (t_0 * (((alpha + beta) + 3.0d0) / (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) / (t_0 * (((alpha + beta) + 3.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) / (t_0 * (((alpha + beta) + 3.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(t_0 * Float64(Float64(Float64(alpha + beta) + 3.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) / (t_0 * (((alpha + beta) + 3.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[(t$95$0 * N[(N[(N[(alpha + beta), $MachinePrecision] + 3.0), $MachinePrecision] / 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}}{t\_0 \cdot \frac{\left(\alpha + \beta\right) + 3}{1 + \beta}}
\end{array}
\end{array}
Initial program 96.4%
Simplified87.0%
times-frac95.9%
+-commutative95.9%
Applied egg-rr95.9%
+-commutative95.9%
+-commutative95.9%
+-commutative95.9%
+-commutative95.9%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.8%
*-commutative99.8%
clear-num99.4%
frac-times91.9%
*-un-lft-identity91.9%
+-commutative91.9%
+-commutative91.9%
+-commutative91.9%
Applied egg-rr91.9%
*-commutative91.9%
associate-/r*99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
associate-/r/99.4%
associate-+r+99.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)))) (* (/ (+ 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 96.4%
Simplified87.0%
times-frac95.9%
+-commutative95.9%
Applied egg-rr95.9%
+-commutative95.9%
+-commutative95.9%
+-commutative95.9%
+-commutative95.9%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.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 (* (/ (+ 1.0 alpha) (+ alpha (+ beta 2.0))) (/ (/ (+ 1.0 beta) (+ beta 2.0)) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
return ((1.0 + alpha) / (alpha + (beta + 2.0))) * (((1.0 + beta) / (beta + 2.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
code = ((1.0d0 + alpha) / (alpha + (beta + 2.0d0))) * (((1.0d0 + beta) / (beta + 2.0d0)) / (alpha + (beta + 3.0d0)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return ((1.0 + alpha) / (alpha + (beta + 2.0))) * (((1.0 + beta) / (beta + 2.0)) / (alpha + (beta + 3.0)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return ((1.0 + alpha) / (alpha + (beta + 2.0))) * (((1.0 + beta) / (beta + 2.0)) / (alpha + (beta + 3.0)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 2.0))) * Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) / Float64(alpha + Float64(beta + 3.0)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) * (((1.0 + beta) / (beta + 2.0)) / (alpha + (beta + 3.0)));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{1 + \alpha}{\alpha + \left(\beta + 2\right)} \cdot \frac{\frac{1 + \beta}{\beta + 2}}{\alpha + \left(\beta + 3\right)}
\end{array}
Initial program 96.4%
Simplified87.0%
times-frac95.9%
+-commutative95.9%
Applied egg-rr95.9%
+-commutative95.9%
+-commutative95.9%
+-commutative95.9%
+-commutative95.9%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 72.5%
+-commutative72.5%
Simplified72.5%
Final simplification72.5%
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) (* t_0 (/ (+ beta 3.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) / (t_0 * ((beta + 3.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) / (t_0 * ((beta + 3.0d0) / (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) / (t_0 * ((beta + 3.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) / (t_0 * ((beta + 3.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(t_0 * Float64(Float64(beta + 3.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) / (t_0 * ((beta + 3.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[(t$95$0 * N[(N[(beta + 3.0), $MachinePrecision] / 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}}{t\_0 \cdot \frac{\beta + 3}{1 + \beta}}
\end{array}
\end{array}
Initial program 96.4%
Simplified87.0%
times-frac95.9%
+-commutative95.9%
Applied egg-rr95.9%
+-commutative95.9%
+-commutative95.9%
+-commutative95.9%
+-commutative95.9%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.8%
+-commutative99.8%
Applied egg-rr99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.8%
*-commutative99.8%
clear-num99.4%
frac-times91.9%
*-un-lft-identity91.9%
+-commutative91.9%
+-commutative91.9%
+-commutative91.9%
Applied egg-rr91.9%
*-commutative91.9%
associate-/r*99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
associate-/r/99.4%
associate-+r+99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in alpha around 0 72.5%
+-commutative72.5%
Simplified72.5%
Final simplification72.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (* (/ (+ 1.0 alpha) (+ alpha (+ beta 2.0))) (/ (/ (+ 1.0 beta) (+ beta 2.0)) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
return ((1.0 + alpha) / (alpha + (beta + 2.0))) * (((1.0 + beta) / (beta + 2.0)) / (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 + alpha) / (alpha + (beta + 2.0d0))) * (((1.0d0 + beta) / (beta + 2.0d0)) / (beta + 3.0d0))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return ((1.0 + alpha) / (alpha + (beta + 2.0))) * (((1.0 + beta) / (beta + 2.0)) / (beta + 3.0));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return ((1.0 + alpha) / (alpha + (beta + 2.0))) * (((1.0 + beta) / (beta + 2.0)) / (beta + 3.0))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 2.0))) * Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) / Float64(beta + 3.0))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = ((1.0 + alpha) / (alpha + (beta + 2.0))) * (((1.0 + beta) / (beta + 2.0)) / (beta + 3.0));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{1 + \alpha}{\alpha + \left(\beta + 2\right)} \cdot \frac{\frac{1 + \beta}{\beta + 2}}{\beta + 3}
\end{array}
Initial program 96.4%
Simplified87.0%
times-frac95.9%
+-commutative95.9%
Applied egg-rr95.9%
+-commutative95.9%
+-commutative95.9%
+-commutative95.9%
+-commutative95.9%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 70.6%
associate-/r*71.7%
+-commutative71.7%
+-commutative71.7%
Simplified71.7%
Final simplification71.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.7) (/ (/ (+ 1.0 alpha) (+ alpha 2.0)) (* (+ alpha 2.0) (+ alpha 3.0))) (/ (/ (+ 1.0 alpha) beta) (+ beta (+ alpha 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.7) {
tmp = ((1.0 + alpha) / (alpha + 2.0)) / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.7d0) then
tmp = ((1.0d0 + alpha) / (alpha + 2.0d0)) / ((alpha + 2.0d0) * (alpha + 3.0d0))
else
tmp = ((1.0d0 + alpha) / beta) / (beta + (alpha + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.7) {
tmp = ((1.0 + alpha) / (alpha + 2.0)) / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.7: tmp = ((1.0 + alpha) / (alpha + 2.0)) / ((alpha + 2.0) * (alpha + 3.0)) else: tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.7) tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + 2.0)) / Float64(Float64(alpha + 2.0) * Float64(alpha + 3.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(beta + Float64(alpha + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.7)
tmp = ((1.0 + alpha) / (alpha + 2.0)) / ((alpha + 2.0) * (alpha + 3.0));
else
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.7], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(alpha + 2.0), $MachinePrecision] * N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.7:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + 2}}{\left(\alpha + 2\right) \cdot \left(\alpha + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + \left(\alpha + 3\right)}\\
\end{array}
\end{array}
if beta < 2.7000000000000002Initial program 99.9%
associate-/l/99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
metadata-eval99.4%
associate-+l+99.4%
metadata-eval99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
metadata-eval99.4%
metadata-eval99.4%
associate-+l+99.4%
Simplified99.4%
Taylor expanded in beta around 0 98.2%
Taylor expanded in beta around 0 98.2%
if 2.7000000000000002 < beta Initial program 87.6%
Taylor expanded in beta around inf 81.3%
Taylor expanded in alpha around 0 81.3%
associate-+r+81.3%
+-commutative81.3%
Simplified81.3%
Final simplification93.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 3.75)
(/ (/ (+ 1.0 alpha) (+ alpha 2.0)) (* (+ alpha 2.0) (+ alpha 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);
double tmp;
if (beta <= 3.75) {
tmp = ((1.0 + alpha) / (alpha + 2.0)) / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = ((1.0 + alpha) / t_0) / t_0;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 3.75d0) then
tmp = ((1.0d0 + alpha) / (alpha + 2.0d0)) / ((alpha + 2.0d0) * (alpha + 3.0d0))
else
tmp = ((1.0d0 + alpha) / t_0) / 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 <= 3.75) {
tmp = ((1.0 + alpha) / (alpha + 2.0)) / ((alpha + 2.0) * (alpha + 3.0));
} else {
tmp = ((1.0 + alpha) / t_0) / t_0;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 3.75: tmp = ((1.0 + alpha) / (alpha + 2.0)) / ((alpha + 2.0) * (alpha + 3.0)) else: tmp = ((1.0 + alpha) / t_0) / t_0 return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 3.75) tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + 2.0)) / Float64(Float64(alpha + 2.0) * Float64(alpha + 3.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / t_0) / t_0); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 3.75)
tmp = ((1.0 + alpha) / (alpha + 2.0)) / ((alpha + 2.0) * (alpha + 3.0));
else
tmp = ((1.0 + alpha) / t_0) / t_0;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 3.75], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(alpha + 2.0), $MachinePrecision] * N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 3.75:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + 2}}{\left(\alpha + 2\right) \cdot \left(\alpha + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t\_0}}{t\_0}\\
\end{array}
\end{array}
if beta < 3.75Initial program 99.9%
associate-/l/99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
metadata-eval99.4%
associate-+l+99.4%
metadata-eval99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
metadata-eval99.4%
metadata-eval99.4%
associate-+l+99.4%
Simplified99.4%
Taylor expanded in beta around 0 98.2%
Taylor expanded in beta around 0 98.2%
if 3.75 < beta Initial program 87.6%
Simplified67.2%
times-frac87.0%
+-commutative87.0%
Applied egg-rr87.0%
+-commutative87.0%
+-commutative87.0%
+-commutative87.0%
+-commutative87.0%
associate-/r*99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
div-inv99.6%
+-commutative99.6%
Applied egg-rr99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
div-inv99.7%
*-commutative99.7%
clear-num99.3%
frac-times84.5%
*-un-lft-identity84.5%
+-commutative84.5%
+-commutative84.5%
+-commutative84.5%
Applied egg-rr84.5%
*-commutative84.5%
associate-/r*99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
associate-/r/99.4%
associate-+r+99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in beta around inf 81.7%
Final simplification93.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.95) (/ 0.25 (+ 1.0 (+ 2.0 (+ alpha beta)))) (/ (/ (+ 1.0 alpha) beta) (+ beta (+ alpha 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.95) {
tmp = 0.25 / (1.0 + (2.0 + (alpha + beta)));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.95d0) then
tmp = 0.25d0 / (1.0d0 + (2.0d0 + (alpha + beta)))
else
tmp = ((1.0d0 + alpha) / beta) / (beta + (alpha + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.95) {
tmp = 0.25 / (1.0 + (2.0 + (alpha + beta)));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.95: tmp = 0.25 / (1.0 + (2.0 + (alpha + beta))) else: tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.95) tmp = Float64(0.25 / Float64(1.0 + Float64(2.0 + Float64(alpha + beta)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(beta + Float64(alpha + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.95)
tmp = 0.25 / (1.0 + (2.0 + (alpha + beta)));
else
tmp = ((1.0 + alpha) / beta) / (beta + (alpha + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.95], N[(0.25 / N[(1.0 + N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.95:\\
\;\;\;\;\frac{0.25}{1 + \left(2 + \left(\alpha + \beta\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + \left(\alpha + 3\right)}\\
\end{array}
\end{array}
if beta < 3.9500000000000002Initial program 99.9%
Taylor expanded in beta around 0 98.5%
Taylor expanded in alpha around 0 68.7%
if 3.9500000000000002 < beta Initial program 87.6%
Taylor expanded in beta around inf 81.3%
Taylor expanded in alpha around 0 81.3%
associate-+r+81.3%
+-commutative81.3%
Simplified81.3%
Final simplification72.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 1.7)
(+
0.08333333333333333
(* beta (- (* beta -0.011574074074074073) 0.027777777777777776)))
(/ (/ (+ 1.0 alpha) beta) beta)))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.7) {
tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776));
} else {
tmp = ((1.0 + alpha) / beta) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.7d0) then
tmp = 0.08333333333333333d0 + (beta * ((beta * (-0.011574074074074073d0)) - 0.027777777777777776d0))
else
tmp = ((1.0d0 + alpha) / beta) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.7) {
tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776));
} else {
tmp = ((1.0 + alpha) / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.7: tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776)) else: tmp = ((1.0 + alpha) / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.7) tmp = Float64(0.08333333333333333 + Float64(beta * Float64(Float64(beta * -0.011574074074074073) - 0.027777777777777776))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.7)
tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776));
else
tmp = ((1.0 + alpha) / beta) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.7], N[(0.08333333333333333 + N[(beta * N[(N[(beta * -0.011574074074074073), $MachinePrecision] - 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.7:\\
\;\;\;\;0.08333333333333333 + \beta \cdot \left(\beta \cdot -0.011574074074074073 - 0.027777777777777776\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 1.69999999999999996Initial program 99.9%
Simplified94.9%
times-frac99.4%
+-commutative99.4%
Applied egg-rr99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
associate-/r*99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in alpha around 0 67.1%
associate-/r*67.1%
+-commutative67.1%
+-commutative67.1%
Simplified67.1%
Taylor expanded in alpha around 0 67.2%
+-commutative67.2%
Simplified67.2%
Taylor expanded in beta around 0 67.1%
if 1.69999999999999996 < beta Initial program 87.6%
Taylor expanded in beta around inf 81.3%
Taylor expanded in beta around inf 81.1%
Final simplification71.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 1.55)
(+
0.08333333333333333
(* beta (- (* beta -0.011574074074074073) 0.027777777777777776)))
(/ (/ (+ 1.0 alpha) beta) (+ beta 3.0))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.55) {
tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776));
} 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 <= 1.55d0) then
tmp = 0.08333333333333333d0 + (beta * ((beta * (-0.011574074074074073d0)) - 0.027777777777777776d0))
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 <= 1.55) {
tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + 3.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.55: tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776)) 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 <= 1.55) tmp = Float64(0.08333333333333333 + Float64(beta * Float64(Float64(beta * -0.011574074074074073) - 0.027777777777777776))); 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 <= 1.55)
tmp = 0.08333333333333333 + (beta * ((beta * -0.011574074074074073) - 0.027777777777777776));
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, 1.55], N[(0.08333333333333333 + N[(beta * N[(N[(beta * -0.011574074074074073), $MachinePrecision] - 0.027777777777777776), $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 1.55:\\
\;\;\;\;0.08333333333333333 + \beta \cdot \left(\beta \cdot -0.011574074074074073 - 0.027777777777777776\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 1.55000000000000004Initial program 99.9%
Simplified94.9%
times-frac99.4%
+-commutative99.4%
Applied egg-rr99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
associate-/r*99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in alpha around 0 67.1%
associate-/r*67.1%
+-commutative67.1%
+-commutative67.1%
Simplified67.1%
Taylor expanded in alpha around 0 67.2%
+-commutative67.2%
Simplified67.2%
Taylor expanded in beta around 0 67.1%
if 1.55000000000000004 < beta Initial program 87.6%
Taylor expanded in beta around inf 81.3%
Taylor expanded in alpha around 0 81.1%
+-commutative81.1%
Simplified81.1%
Final simplification71.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.8) (/ 0.25 (+ 1.0 (+ 2.0 (+ alpha beta)))) (/ (/ (+ 1.0 alpha) beta) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.8) {
tmp = 0.25 / (1.0 + (2.0 + (alpha + beta)));
} 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 <= 4.8d0) then
tmp = 0.25d0 / (1.0d0 + (2.0d0 + (alpha + beta)))
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 <= 4.8) {
tmp = 0.25 / (1.0 + (2.0 + (alpha + beta)));
} else {
tmp = ((1.0 + alpha) / beta) / (beta + 3.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.8: tmp = 0.25 / (1.0 + (2.0 + (alpha + beta))) 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 <= 4.8) tmp = Float64(0.25 / Float64(1.0 + Float64(2.0 + Float64(alpha + beta)))); 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 <= 4.8)
tmp = 0.25 / (1.0 + (2.0 + (alpha + beta)));
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, 4.8], N[(0.25 / N[(1.0 + N[(2.0 + N[(alpha + beta), $MachinePrecision]), $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 4.8:\\
\;\;\;\;\frac{0.25}{1 + \left(2 + \left(\alpha + \beta\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 4.79999999999999982Initial program 99.9%
Taylor expanded in beta around 0 98.5%
Taylor expanded in alpha around 0 68.7%
if 4.79999999999999982 < beta Initial program 87.6%
Taylor expanded in beta around inf 81.3%
Taylor expanded in alpha around 0 81.1%
+-commutative81.1%
Simplified81.1%
Final simplification72.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.5) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ 1.0 (* beta (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = 1.0 / (beta * (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.5d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = 1.0d0 / (beta * (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = 1.0 / (beta * (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.5: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = 1.0 / (beta * (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.5) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(1.0 / Float64(beta * Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.5)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = 1.0 / (beta * (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.5], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(beta * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.5:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 2.5Initial program 99.9%
Taylor expanded in beta around 0 98.5%
Taylor expanded in alpha around 0 67.0%
+-commutative67.0%
Simplified67.0%
Taylor expanded in beta around 0 67.0%
*-commutative67.0%
Simplified67.0%
if 2.5 < beta Initial program 87.6%
Taylor expanded in beta around inf 81.3%
Taylor expanded in alpha around 0 72.3%
Final simplification68.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.8) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ (/ (+ 1.0 alpha) beta) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.8) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.8d0) then
tmp = 0.08333333333333333d0 + (beta * (-0.027777777777777776d0))
else
tmp = ((1.0d0 + alpha) / beta) / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.8) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = ((1.0 + alpha) / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.8: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = ((1.0 + alpha) / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.8) tmp = Float64(0.08333333333333333 + Float64(beta * -0.027777777777777776)); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.8)
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
else
tmp = ((1.0 + alpha) / beta) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.8], N[(0.08333333333333333 + N[(beta * -0.027777777777777776), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.8:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 2.7999999999999998Initial program 99.9%
Taylor expanded in beta around 0 98.5%
Taylor expanded in alpha around 0 67.0%
+-commutative67.0%
Simplified67.0%
Taylor expanded in beta around 0 67.0%
*-commutative67.0%
Simplified67.0%
if 2.7999999999999998 < beta Initial program 87.6%
Taylor expanded in beta around inf 81.3%
Taylor expanded in beta around inf 81.1%
Final simplification71.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.6) (+ 0.08333333333333333 (* beta -0.027777777777777776)) (/ 0.25 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.6) {
tmp = 0.08333333333333333 + (beta * -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 <= 2.6d0) then
tmp = 0.08333333333333333d0 + (beta * (-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 <= 2.6) {
tmp = 0.08333333333333333 + (beta * -0.027777777777777776);
} else {
tmp = 0.25 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.6: tmp = 0.08333333333333333 + (beta * -0.027777777777777776) else: tmp = 0.25 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.6) tmp = Float64(0.08333333333333333 + Float64(beta * -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 <= 2.6)
tmp = 0.08333333333333333 + (beta * -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, 2.6], N[(0.08333333333333333 + N[(beta * -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 2.6:\\
\;\;\;\;0.08333333333333333 + \beta \cdot -0.027777777777777776\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{\beta}\\
\end{array}
\end{array}
if beta < 2.60000000000000009Initial program 99.9%
Taylor expanded in beta around 0 98.5%
Taylor expanded in alpha around 0 67.0%
+-commutative67.0%
Simplified67.0%
Taylor expanded in beta around 0 67.0%
*-commutative67.0%
Simplified67.0%
if 2.60000000000000009 < beta Initial program 87.6%
Taylor expanded in beta around 0 11.1%
Taylor expanded in alpha around 0 6.9%
+-commutative6.9%
Simplified6.9%
Taylor expanded in beta around inf 6.9%
Final simplification49.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.25 (+ beta 3.0)))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.25 / (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 = 0.25d0 / (beta + 3.0d0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.25 / (beta + 3.0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.25 / (beta + 3.0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.25 / Float64(beta + 3.0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.25 / (beta + 3.0);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.25 / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.25}{\beta + 3}
\end{array}
Initial program 96.4%
Taylor expanded in beta around 0 73.6%
Taylor expanded in alpha around 0 49.9%
+-commutative49.9%
Simplified49.9%
Final simplification49.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 0.08333333333333333)
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.08333333333333333;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.08333333333333333d0
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.08333333333333333;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.08333333333333333
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return 0.08333333333333333 end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.08333333333333333;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := 0.08333333333333333
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
0.08333333333333333
\end{array}
Initial program 96.4%
Taylor expanded in beta around 0 73.6%
Taylor expanded in alpha around 0 49.9%
+-commutative49.9%
Simplified49.9%
Taylor expanded in beta around 0 48.8%
Final simplification48.8%
herbie shell --seed 2024109
(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)))