
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t_0}}{t_0}}{t_0 + 1}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ (+ alpha beta) (* 2.0 1.0)))) (/ (/ (/ (+ (+ (+ alpha beta) (* beta alpha)) 1.0) t_0) t_0) (+ t_0 1.0))))
double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = (alpha + beta) + (2.0d0 * 1.0d0)
code = (((((alpha + beta) + (beta * alpha)) + 1.0d0) / t_0) / t_0) / (t_0 + 1.0d0)
end function
public static double code(double alpha, double beta) {
double t_0 = (alpha + beta) + (2.0 * 1.0);
return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0);
}
def code(alpha, beta): t_0 = (alpha + beta) + (2.0 * 1.0) return (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0)
function code(alpha, beta) t_0 = Float64(Float64(alpha + beta) + Float64(2.0 * 1.0)) return Float64(Float64(Float64(Float64(Float64(Float64(alpha + beta) + Float64(beta * alpha)) + 1.0) / t_0) / t_0) / Float64(t_0 + 1.0)) end
function tmp = code(alpha, beta) t_0 = (alpha + beta) + (2.0 * 1.0); tmp = (((((alpha + beta) + (beta * alpha)) + 1.0) / t_0) / t_0) / (t_0 + 1.0); end
code[alpha_, beta_] := Block[{t$95$0 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * 1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(alpha + beta), $MachinePrecision] + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\alpha + \beta\right) + 2 \cdot 1\\
\frac{\frac{\frac{\left(\left(\alpha + \beta\right) + \beta \cdot \alpha\right) + 1}{t_0}}{t_0}}{t_0 + 1}
\end{array}
\end{array}
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.3e+15) (* (/ (/ (+ 1.0 beta) (+ beta 2.0)) (+ beta 3.0)) (/ 1.0 (+ beta 2.0))) (/ (/ (+ 1.0 alpha) (+ 2.0 (+ alpha beta))) (+ 3.0 (+ alpha beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.3e+15) {
tmp = (((1.0 + beta) / (beta + 2.0)) / (beta + 3.0)) * (1.0 / (beta + 2.0));
} else {
tmp = ((1.0 + alpha) / (2.0 + (alpha + beta))) / (3.0 + (alpha + beta));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.3d+15) then
tmp = (((1.0d0 + beta) / (beta + 2.0d0)) / (beta + 3.0d0)) * (1.0d0 / (beta + 2.0d0))
else
tmp = ((1.0d0 + alpha) / (2.0d0 + (alpha + beta))) / (3.0d0 + (alpha + beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.3e+15) {
tmp = (((1.0 + beta) / (beta + 2.0)) / (beta + 3.0)) * (1.0 / (beta + 2.0));
} else {
tmp = ((1.0 + alpha) / (2.0 + (alpha + beta))) / (3.0 + (alpha + beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.3e+15: tmp = (((1.0 + beta) / (beta + 2.0)) / (beta + 3.0)) * (1.0 / (beta + 2.0)) else: tmp = ((1.0 + alpha) / (2.0 + (alpha + beta))) / (3.0 + (alpha + beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.3e+15) tmp = Float64(Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) / Float64(beta + 3.0)) * Float64(1.0 / Float64(beta + 2.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(2.0 + Float64(alpha + beta))) / Float64(3.0 + Float64(alpha + beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.3e+15)
tmp = (((1.0 + beta) / (beta + 2.0)) / (beta + 3.0)) * (1.0 / (beta + 2.0));
else
tmp = ((1.0 + alpha) / (2.0 + (alpha + beta))) / (3.0 + (alpha + beta));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.3e+15], N[(N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.3 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\beta + 2}}{\beta + 3} \cdot \frac{1}{\beta + 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{2 + \left(\alpha + \beta\right)}}{3 + \left(\alpha + \beta\right)}\\
\end{array}
\end{array}
if beta < 2.3e15Initial program 99.9%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/96.1%
Simplified96.1%
Taylor expanded in alpha around 0 73.5%
associate-*r/73.5%
+-commutative73.5%
*-commutative73.5%
Applied egg-rr73.5%
times-frac73.5%
+-commutative73.5%
+-commutative73.5%
+-commutative73.5%
Simplified73.5%
Taylor expanded in alpha around 0 73.2%
Taylor expanded in alpha around 0 73.6%
if 2.3e15 < beta Initial program 79.3%
associate-/l/74.6%
associate-+l+74.6%
+-commutative74.6%
associate-+r+74.6%
associate-+l+74.6%
distribute-rgt1-in74.6%
*-rgt-identity74.6%
distribute-lft-out74.6%
+-commutative74.6%
associate-*l/89.8%
*-commutative89.8%
associate-*r/88.6%
Simplified88.6%
Taylor expanded in beta around inf 85.2%
expm1-log1p-u85.2%
expm1-udef46.4%
un-div-inv46.4%
+-commutative46.4%
associate-+r+46.4%
Applied egg-rr46.4%
expm1-def85.3%
expm1-log1p85.3%
associate-/r*84.4%
associate-+r+84.4%
+-commutative84.4%
+-commutative84.4%
+-commutative84.4%
Simplified84.4%
Final simplification77.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ (/ (+ 1.0 alpha) (+ beta 2.0)) (* (* (+ beta 3.0) (/ 1.0 (+ 1.0 beta))) (+ beta (+ alpha 2.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
return ((1.0 + alpha) / (beta + 2.0)) / (((beta + 3.0) * (1.0 / (1.0 + beta))) * (beta + (alpha + 2.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) / (beta + 2.0d0)) / (((beta + 3.0d0) * (1.0d0 / (1.0d0 + beta))) * (beta + (alpha + 2.0d0)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return ((1.0 + alpha) / (beta + 2.0)) / (((beta + 3.0) * (1.0 / (1.0 + beta))) * (beta + (alpha + 2.0)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return ((1.0 + alpha) / (beta + 2.0)) / (((beta + 3.0) * (1.0 / (1.0 + beta))) * (beta + (alpha + 2.0)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(Float64(1.0 + alpha) / Float64(beta + 2.0)) / Float64(Float64(Float64(beta + 3.0) * Float64(1.0 / Float64(1.0 + beta))) * Float64(beta + Float64(alpha + 2.0)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = ((1.0 + alpha) / (beta + 2.0)) / (((beta + 3.0) * (1.0 / (1.0 + beta))) * (beta + (alpha + 2.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[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(beta + 3.0), $MachinePrecision] * N[(1.0 / N[(1.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{\frac{1 + \alpha}{\beta + 2}}{\left(\left(\beta + 3\right) \cdot \frac{1}{1 + \beta}\right) \cdot \left(\beta + \left(\alpha + 2\right)\right)}
\end{array}
Initial program 93.3%
associate-/l/91.7%
associate-+l+91.7%
+-commutative91.7%
associate-+r+91.7%
associate-+l+91.7%
distribute-rgt1-in91.7%
*-rgt-identity91.7%
distribute-lft-out91.8%
+-commutative91.8%
associate-*l/96.6%
*-commutative96.6%
associate-*r/93.7%
Simplified93.7%
Taylor expanded in alpha around 0 76.8%
associate-*r/76.5%
+-commutative76.5%
*-commutative76.5%
Applied egg-rr76.5%
times-frac76.9%
+-commutative76.9%
+-commutative76.9%
+-commutative76.9%
Simplified76.9%
expm1-log1p-u76.9%
expm1-udef61.4%
associate-/l/61.4%
+-commutative61.4%
+-commutative61.4%
Applied egg-rr61.4%
expm1-def77.2%
expm1-log1p77.2%
*-commutative77.2%
times-frac67.4%
associate-/l*72.2%
associate-*r/73.0%
*-commutative73.0%
associate-*r*72.2%
associate-/l/76.9%
*-commutative76.9%
associate-*r/76.5%
associate-/l*76.5%
Simplified76.9%
div-inv76.9%
+-commutative76.9%
Applied egg-rr76.9%
Final simplification76.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ (/ (+ 1.0 alpha) (+ beta 2.0)) (* (+ beta (+ alpha 2.0)) (/ (+ beta 3.0) (+ 1.0 beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
return ((1.0 + alpha) / (beta + 2.0)) / ((beta + (alpha + 2.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
code = ((1.0d0 + alpha) / (beta + 2.0d0)) / ((beta + (alpha + 2.0d0)) * ((beta + 3.0d0) / (1.0d0 + beta)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return ((1.0 + alpha) / (beta + 2.0)) / ((beta + (alpha + 2.0)) * ((beta + 3.0) / (1.0 + beta)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return ((1.0 + alpha) / (beta + 2.0)) / ((beta + (alpha + 2.0)) * ((beta + 3.0) / (1.0 + beta)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(Float64(1.0 + alpha) / Float64(beta + 2.0)) / Float64(Float64(beta + Float64(alpha + 2.0)) * Float64(Float64(beta + 3.0) / Float64(1.0 + beta)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = ((1.0 + alpha) / (beta + 2.0)) / ((beta + (alpha + 2.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_] := N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + N[(alpha + 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(beta + 3.0), $MachinePrecision] / N[(1.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{\frac{1 + \alpha}{\beta + 2}}{\left(\beta + \left(\alpha + 2\right)\right) \cdot \frac{\beta + 3}{1 + \beta}}
\end{array}
Initial program 93.3%
associate-/l/91.7%
associate-+l+91.7%
+-commutative91.7%
associate-+r+91.7%
associate-+l+91.7%
distribute-rgt1-in91.7%
*-rgt-identity91.7%
distribute-lft-out91.8%
+-commutative91.8%
associate-*l/96.6%
*-commutative96.6%
associate-*r/93.7%
Simplified93.7%
Taylor expanded in alpha around 0 76.8%
associate-*r/76.5%
+-commutative76.5%
*-commutative76.5%
Applied egg-rr76.5%
times-frac76.9%
+-commutative76.9%
+-commutative76.9%
+-commutative76.9%
Simplified76.9%
expm1-log1p-u76.9%
expm1-udef61.4%
associate-/l/61.4%
+-commutative61.4%
+-commutative61.4%
Applied egg-rr61.4%
expm1-def77.2%
expm1-log1p77.2%
*-commutative77.2%
times-frac67.4%
associate-/l*72.2%
associate-*r/73.0%
*-commutative73.0%
associate-*r*72.2%
associate-/l/76.9%
*-commutative76.9%
associate-*r/76.5%
associate-/l*76.5%
Simplified76.9%
Final simplification76.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (* (/ (+ 1.0 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) / (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) / (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) / (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) / (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(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) / (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[(beta + 2.0), $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}{\beta + 2} \cdot \frac{\frac{1 + \beta}{\beta + 2}}{\beta + 3}
\end{array}
Initial program 93.3%
associate-/l/91.7%
associate-+l+91.7%
+-commutative91.7%
associate-+r+91.7%
associate-+l+91.7%
distribute-rgt1-in91.7%
*-rgt-identity91.7%
distribute-lft-out91.8%
+-commutative91.8%
associate-*l/96.6%
*-commutative96.6%
associate-*r/93.7%
Simplified93.7%
Taylor expanded in alpha around 0 76.8%
associate-*r/76.5%
+-commutative76.5%
*-commutative76.5%
Applied egg-rr76.5%
times-frac76.9%
+-commutative76.9%
+-commutative76.9%
+-commutative76.9%
Simplified76.9%
Taylor expanded in alpha around 0 76.6%
Final simplification76.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ (/ (+ 1.0 beta) (+ beta 2.0)) (* (+ beta 3.0) (/ (+ beta 2.0) (+ 1.0 alpha)))))
assert(alpha < beta);
double code(double alpha, double beta) {
return ((1.0 + beta) / (beta + 2.0)) / ((beta + 3.0) * ((beta + 2.0) / (1.0 + alpha)));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = ((1.0d0 + beta) / (beta + 2.0d0)) / ((beta + 3.0d0) * ((beta + 2.0d0) / (1.0d0 + alpha)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return ((1.0 + beta) / (beta + 2.0)) / ((beta + 3.0) * ((beta + 2.0) / (1.0 + alpha)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return ((1.0 + beta) / (beta + 2.0)) / ((beta + 3.0) * ((beta + 2.0) / (1.0 + alpha)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) / Float64(Float64(beta + 3.0) * Float64(Float64(beta + 2.0) / Float64(1.0 + alpha)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 3.0) * ((beta + 2.0) / (1.0 + alpha)));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 3.0), $MachinePrecision] * N[(N[(beta + 2.0), $MachinePrecision] / N[(1.0 + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{\frac{1 + \beta}{\beta + 2}}{\left(\beta + 3\right) \cdot \frac{\beta + 2}{1 + \alpha}}
\end{array}
Initial program 93.3%
associate-/l/91.7%
associate-+l+91.7%
+-commutative91.7%
associate-+r+91.7%
associate-+l+91.7%
distribute-rgt1-in91.7%
*-rgt-identity91.7%
distribute-lft-out91.8%
+-commutative91.8%
associate-*l/96.6%
*-commutative96.6%
associate-*r/93.7%
Simplified93.7%
Taylor expanded in alpha around 0 76.8%
associate-*r/76.5%
+-commutative76.5%
*-commutative76.5%
Applied egg-rr76.5%
times-frac76.9%
+-commutative76.9%
+-commutative76.9%
+-commutative76.9%
Simplified76.9%
Taylor expanded in alpha around 0 76.6%
clear-num76.6%
frac-times76.6%
*-un-lft-identity76.6%
+-commutative76.6%
Applied egg-rr76.6%
Final simplification76.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 3.1)
(*
(/ (+ 1.0 alpha) (+ beta 2.0))
(+ 0.16666666666666666 (* beta 0.027777777777777776)))
(/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 3.0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.1) {
tmp = ((1.0 + alpha) / (beta + 2.0)) * (0.16666666666666666 + (beta * 0.027777777777777776));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.1d0) then
tmp = ((1.0d0 + alpha) / (beta + 2.0d0)) * (0.16666666666666666d0 + (beta * 0.027777777777777776d0))
else
tmp = ((1.0d0 + alpha) / beta) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.1) {
tmp = ((1.0 + alpha) / (beta + 2.0)) * (0.16666666666666666 + (beta * 0.027777777777777776));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.1: tmp = ((1.0 + alpha) / (beta + 2.0)) * (0.16666666666666666 + (beta * 0.027777777777777776)) else: tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.1) tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(beta + 2.0)) * Float64(0.16666666666666666 + Float64(beta * 0.027777777777777776))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.1)
tmp = ((1.0 + alpha) / (beta + 2.0)) * (0.16666666666666666 + (beta * 0.027777777777777776));
else
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.1], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] * N[(0.16666666666666666 + N[(beta * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.1:\\
\;\;\;\;\frac{1 + \alpha}{\beta + 2} \cdot \left(0.16666666666666666 + \beta \cdot 0.027777777777777776\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 3.10000000000000009Initial program 99.9%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/96.0%
Simplified96.0%
Taylor expanded in alpha around 0 73.0%
associate-*r/73.0%
+-commutative73.0%
*-commutative73.0%
Applied egg-rr73.0%
times-frac73.0%
+-commutative73.0%
+-commutative73.0%
+-commutative73.0%
Simplified73.0%
Taylor expanded in alpha around 0 72.6%
Taylor expanded in beta around 0 72.4%
*-commutative72.4%
Simplified72.4%
if 3.10000000000000009 < beta Initial program 80.9%
Taylor expanded in beta around inf 81.4%
Taylor expanded in alpha around 0 81.4%
associate-+r+81.4%
Simplified81.4%
Final simplification75.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (/ (+ 1.0 alpha) (+ beta 2.0))))
(if (<= beta 1.0)
(* t_0 (+ 0.16666666666666666 (* beta 0.027777777777777776)))
(/ t_0 (+ alpha (+ beta 4.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = (1.0 + alpha) / (beta + 2.0);
double tmp;
if (beta <= 1.0) {
tmp = t_0 * (0.16666666666666666 + (beta * 0.027777777777777776));
} else {
tmp = t_0 / (alpha + (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) :: t_0
real(8) :: tmp
t_0 = (1.0d0 + alpha) / (beta + 2.0d0)
if (beta <= 1.0d0) then
tmp = t_0 * (0.16666666666666666d0 + (beta * 0.027777777777777776d0))
else
tmp = t_0 / (alpha + (beta + 4.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = (1.0 + alpha) / (beta + 2.0);
double tmp;
if (beta <= 1.0) {
tmp = t_0 * (0.16666666666666666 + (beta * 0.027777777777777776));
} else {
tmp = t_0 / (alpha + (beta + 4.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = (1.0 + alpha) / (beta + 2.0) tmp = 0 if beta <= 1.0: tmp = t_0 * (0.16666666666666666 + (beta * 0.027777777777777776)) else: tmp = t_0 / (alpha + (beta + 4.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(Float64(1.0 + alpha) / Float64(beta + 2.0)) tmp = 0.0 if (beta <= 1.0) tmp = Float64(t_0 * Float64(0.16666666666666666 + Float64(beta * 0.027777777777777776))); else tmp = Float64(t_0 / Float64(alpha + Float64(beta + 4.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = (1.0 + alpha) / (beta + 2.0);
tmp = 0.0;
if (beta <= 1.0)
tmp = t_0 * (0.16666666666666666 + (beta * 0.027777777777777776));
else
tmp = t_0 / (alpha + (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_] := Block[{t$95$0 = N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 1.0], N[(t$95$0 * N[(0.16666666666666666 + N[(beta * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(alpha + N[(beta + 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \frac{1 + \alpha}{\beta + 2}\\
\mathbf{if}\;\beta \leq 1:\\
\;\;\;\;t_0 \cdot \left(0.16666666666666666 + \beta \cdot 0.027777777777777776\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{\alpha + \left(\beta + 4\right)}\\
\end{array}
\end{array}
if beta < 1Initial program 99.9%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/96.0%
Simplified96.0%
Taylor expanded in alpha around 0 73.0%
associate-*r/73.0%
+-commutative73.0%
*-commutative73.0%
Applied egg-rr73.0%
times-frac73.0%
+-commutative73.0%
+-commutative73.0%
+-commutative73.0%
Simplified73.0%
Taylor expanded in alpha around 0 72.6%
Taylor expanded in beta around 0 72.4%
*-commutative72.4%
Simplified72.4%
if 1 < beta Initial program 80.9%
associate-/l/76.6%
associate-+l+76.6%
+-commutative76.6%
associate-+r+76.6%
associate-+l+76.6%
distribute-rgt1-in76.6%
*-rgt-identity76.6%
distribute-lft-out76.6%
+-commutative76.6%
associate-*l/90.5%
*-commutative90.5%
associate-*r/89.5%
Simplified89.5%
Taylor expanded in alpha around 0 84.1%
associate-*r/83.0%
+-commutative83.0%
*-commutative83.0%
Applied egg-rr83.0%
times-frac84.1%
+-commutative84.1%
+-commutative84.1%
+-commutative84.1%
Simplified84.1%
expm1-log1p-u84.1%
expm1-udef44.8%
associate-/l/44.8%
+-commutative44.8%
+-commutative44.8%
Applied egg-rr44.8%
expm1-def85.0%
expm1-log1p85.0%
*-commutative85.0%
times-frac56.8%
associate-/l*70.8%
associate-*r/73.0%
*-commutative73.0%
associate-*r*70.8%
associate-/l/84.3%
*-commutative84.3%
associate-*r/83.0%
associate-/l*83.0%
Simplified84.2%
Taylor expanded in beta around inf 83.0%
associate-+r+83.0%
Simplified83.0%
Final simplification76.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.75) (* (/ (+ 1.0 beta) (+ beta 2.0)) 0.16666666666666666) (/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.75) {
tmp = ((1.0 + beta) / (beta + 2.0)) * 0.16666666666666666;
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 1.75d0) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) * 0.16666666666666666d0
else
tmp = ((1.0d0 + alpha) / beta) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.75) {
tmp = ((1.0 + beta) / (beta + 2.0)) * 0.16666666666666666;
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.75: tmp = ((1.0 + beta) / (beta + 2.0)) * 0.16666666666666666 else: tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.75) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) * 0.16666666666666666); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.75)
tmp = ((1.0 + beta) / (beta + 2.0)) * 0.16666666666666666;
else
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 1.75], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] * 0.16666666666666666), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.75:\\
\;\;\;\;\frac{1 + \beta}{\beta + 2} \cdot 0.16666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 1.75Initial program 99.9%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/96.0%
Simplified96.0%
Taylor expanded in alpha around 0 73.0%
Taylor expanded in beta around 0 71.5%
Taylor expanded in alpha around 0 71.5%
if 1.75 < beta Initial program 80.9%
Taylor expanded in beta around inf 81.4%
Taylor expanded in alpha around 0 81.4%
associate-+r+81.4%
Simplified81.4%
Final simplification74.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.9) (* (/ (+ 1.0 beta) (+ beta 2.0)) 0.16666666666666666) (/ (/ (+ 1.0 alpha) beta) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.9) {
tmp = ((1.0 + beta) / (beta + 2.0)) * 0.16666666666666666;
} 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.9d0) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) * 0.16666666666666666d0
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.9) {
tmp = ((1.0 + beta) / (beta + 2.0)) * 0.16666666666666666;
} else {
tmp = ((1.0 + alpha) / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.9: tmp = ((1.0 + beta) / (beta + 2.0)) * 0.16666666666666666 else: tmp = ((1.0 + alpha) / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.9) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) * 0.16666666666666666); 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.9)
tmp = ((1.0 + beta) / (beta + 2.0)) * 0.16666666666666666;
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.9], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] * 0.16666666666666666), $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.9:\\
\;\;\;\;\frac{1 + \beta}{\beta + 2} \cdot 0.16666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 2.89999999999999991Initial program 99.9%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/96.0%
Simplified96.0%
Taylor expanded in alpha around 0 73.0%
Taylor expanded in beta around 0 71.5%
Taylor expanded in alpha around 0 71.5%
if 2.89999999999999991 < beta Initial program 80.9%
Taylor expanded in beta around inf 81.4%
Taylor expanded in beta around inf 81.1%
Final simplification74.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.8) (* (/ (+ 1.0 beta) (+ beta 2.0)) 0.16666666666666666) (/ (/ (+ 1.0 alpha) beta) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.8) {
tmp = ((1.0 + beta) / (beta + 2.0)) * 0.16666666666666666;
} 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.8d0) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) * 0.16666666666666666d0
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.8) {
tmp = ((1.0 + beta) / (beta + 2.0)) * 0.16666666666666666;
} 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.8: tmp = ((1.0 + beta) / (beta + 2.0)) * 0.16666666666666666 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.8) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) * 0.16666666666666666); 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.8)
tmp = ((1.0 + beta) / (beta + 2.0)) * 0.16666666666666666;
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.8], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] * 0.16666666666666666), $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.8:\\
\;\;\;\;\frac{1 + \beta}{\beta + 2} \cdot 0.16666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 1.80000000000000004Initial program 99.9%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/96.0%
Simplified96.0%
Taylor expanded in alpha around 0 73.0%
Taylor expanded in beta around 0 71.5%
Taylor expanded in alpha around 0 71.5%
if 1.80000000000000004 < beta Initial program 80.9%
Taylor expanded in beta around inf 81.4%
Taylor expanded in alpha around 0 81.2%
Final simplification74.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.2) (+ 0.08333333333333333 (* alpha 0.041666666666666664)) (/ 1.0 (* beta (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.2) {
tmp = 0.08333333333333333 + (alpha * 0.041666666666666664);
} 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.2d0) then
tmp = 0.08333333333333333d0 + (alpha * 0.041666666666666664d0)
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.2) {
tmp = 0.08333333333333333 + (alpha * 0.041666666666666664);
} else {
tmp = 1.0 / (beta * (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.2: tmp = 0.08333333333333333 + (alpha * 0.041666666666666664) 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.2) tmp = Float64(0.08333333333333333 + Float64(alpha * 0.041666666666666664)); 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.2)
tmp = 0.08333333333333333 + (alpha * 0.041666666666666664);
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.2], N[(0.08333333333333333 + N[(alpha * 0.041666666666666664), $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.2:\\
\;\;\;\;0.08333333333333333 + \alpha \cdot 0.041666666666666664\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 2.2000000000000002Initial program 99.9%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/96.0%
Simplified96.0%
Taylor expanded in alpha around 0 73.0%
Taylor expanded in beta around 0 71.6%
Taylor expanded in alpha around 0 71.2%
*-commutative71.2%
Simplified71.2%
if 2.2000000000000002 < beta Initial program 80.9%
Taylor expanded in beta around inf 81.4%
Taylor expanded in alpha around 0 76.9%
Final simplification73.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.5) (+ 0.08333333333333333 (* alpha 0.041666666666666664)) (/ (+ 1.0 alpha) (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.5) {
tmp = 0.08333333333333333 + (alpha * 0.041666666666666664);
} 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 <= 3.5d0) then
tmp = 0.08333333333333333d0 + (alpha * 0.041666666666666664d0)
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 <= 3.5) {
tmp = 0.08333333333333333 + (alpha * 0.041666666666666664);
} else {
tmp = (1.0 + alpha) / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.5: tmp = 0.08333333333333333 + (alpha * 0.041666666666666664) else: tmp = (1.0 + alpha) / (beta * beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.5) tmp = Float64(0.08333333333333333 + Float64(alpha * 0.041666666666666664)); else tmp = Float64(Float64(1.0 + alpha) / Float64(beta * beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.5)
tmp = 0.08333333333333333 + (alpha * 0.041666666666666664);
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, 3.5], N[(0.08333333333333333 + N[(alpha * 0.041666666666666664), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + alpha), $MachinePrecision] / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.5:\\
\;\;\;\;0.08333333333333333 + \alpha \cdot 0.041666666666666664\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 3.5Initial program 99.9%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/96.0%
Simplified96.0%
Taylor expanded in alpha around 0 73.0%
Taylor expanded in beta around 0 71.6%
Taylor expanded in alpha around 0 71.2%
*-commutative71.2%
Simplified71.2%
if 3.5 < beta Initial program 80.9%
associate-/l/76.6%
associate-+l+76.6%
+-commutative76.6%
associate-+r+76.6%
associate-+l+76.6%
distribute-rgt1-in76.6%
*-rgt-identity76.6%
distribute-lft-out76.6%
+-commutative76.6%
associate-*l/90.5%
*-commutative90.5%
associate-*r/89.5%
Simplified89.5%
Taylor expanded in beta around inf 79.9%
unpow279.9%
Simplified79.9%
Final simplification74.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.5) (+ 0.08333333333333333 (* alpha 0.041666666666666664)) (/ (/ (+ 1.0 alpha) beta) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.5) {
tmp = 0.08333333333333333 + (alpha * 0.041666666666666664);
} 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 <= 3.5d0) then
tmp = 0.08333333333333333d0 + (alpha * 0.041666666666666664d0)
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 <= 3.5) {
tmp = 0.08333333333333333 + (alpha * 0.041666666666666664);
} else {
tmp = ((1.0 + alpha) / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.5: tmp = 0.08333333333333333 + (alpha * 0.041666666666666664) else: tmp = ((1.0 + alpha) / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.5) tmp = Float64(0.08333333333333333 + Float64(alpha * 0.041666666666666664)); 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 <= 3.5)
tmp = 0.08333333333333333 + (alpha * 0.041666666666666664);
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, 3.5], N[(0.08333333333333333 + N[(alpha * 0.041666666666666664), $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 3.5:\\
\;\;\;\;0.08333333333333333 + \alpha \cdot 0.041666666666666664\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 3.5Initial program 99.9%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/96.0%
Simplified96.0%
Taylor expanded in alpha around 0 73.0%
Taylor expanded in beta around 0 71.6%
Taylor expanded in alpha around 0 71.2%
*-commutative71.2%
Simplified71.2%
if 3.5 < beta Initial program 80.9%
Taylor expanded in beta around inf 81.4%
Taylor expanded in beta around inf 81.1%
Final simplification74.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 9.2) (+ 0.08333333333333333 (* alpha 0.041666666666666664)) (/ 1.0 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 9.2) {
tmp = 0.08333333333333333 + (alpha * 0.041666666666666664);
} else {
tmp = 1.0 / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 9.2d0) then
tmp = 0.08333333333333333d0 + (alpha * 0.041666666666666664d0)
else
tmp = 1.0d0 / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 9.2) {
tmp = 0.08333333333333333 + (alpha * 0.041666666666666664);
} else {
tmp = 1.0 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 9.2: tmp = 0.08333333333333333 + (alpha * 0.041666666666666664) else: tmp = 1.0 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 9.2) tmp = Float64(0.08333333333333333 + Float64(alpha * 0.041666666666666664)); else tmp = Float64(1.0 / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 9.2)
tmp = 0.08333333333333333 + (alpha * 0.041666666666666664);
else
tmp = 1.0 / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 9.2], N[(0.08333333333333333 + N[(alpha * 0.041666666666666664), $MachinePrecision]), $MachinePrecision], N[(1.0 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 9.2:\\
\;\;\;\;0.08333333333333333 + \alpha \cdot 0.041666666666666664\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta}\\
\end{array}
\end{array}
if beta < 9.1999999999999993Initial program 99.9%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/96.0%
Simplified96.0%
Taylor expanded in alpha around 0 73.0%
Taylor expanded in beta around 0 71.6%
Taylor expanded in alpha around 0 71.2%
*-commutative71.2%
Simplified71.2%
if 9.1999999999999993 < beta Initial program 80.9%
Taylor expanded in beta around inf 81.4%
Taylor expanded in alpha around inf 7.2%
Final simplification49.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= alpha 2.35) (+ 0.08333333333333333 (* alpha 0.041666666666666664)) (/ 1.0 (* alpha alpha))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (alpha <= 2.35) {
tmp = 0.08333333333333333 + (alpha * 0.041666666666666664);
} else {
tmp = 1.0 / (alpha * alpha);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (alpha <= 2.35d0) then
tmp = 0.08333333333333333d0 + (alpha * 0.041666666666666664d0)
else
tmp = 1.0d0 / (alpha * alpha)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (alpha <= 2.35) {
tmp = 0.08333333333333333 + (alpha * 0.041666666666666664);
} else {
tmp = 1.0 / (alpha * alpha);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if alpha <= 2.35: tmp = 0.08333333333333333 + (alpha * 0.041666666666666664) else: tmp = 1.0 / (alpha * alpha) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (alpha <= 2.35) tmp = Float64(0.08333333333333333 + Float64(alpha * 0.041666666666666664)); else tmp = Float64(1.0 / Float64(alpha * alpha)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (alpha <= 2.35)
tmp = 0.08333333333333333 + (alpha * 0.041666666666666664);
else
tmp = 1.0 / (alpha * alpha);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[alpha, 2.35], N[(0.08333333333333333 + N[(alpha * 0.041666666666666664), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(alpha * alpha), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\alpha \leq 2.35:\\
\;\;\;\;0.08333333333333333 + \alpha \cdot 0.041666666666666664\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\alpha \cdot \alpha}\\
\end{array}
\end{array}
if alpha < 2.35000000000000009Initial program 99.8%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in alpha around 0 98.9%
Taylor expanded in beta around 0 66.3%
Taylor expanded in alpha around 0 66.3%
*-commutative66.3%
Simplified66.3%
if 2.35000000000000009 < alpha Initial program 77.2%
associate-/l/71.9%
associate-/r*58.0%
associate-+l+58.0%
+-commutative58.0%
associate-+r+58.0%
associate-+l+58.0%
distribute-rgt1-in58.0%
*-rgt-identity58.0%
distribute-lft-out58.0%
*-commutative58.0%
metadata-eval58.0%
associate-+l+58.0%
+-commutative58.0%
Simplified58.0%
Taylor expanded in beta around 0 69.9%
Taylor expanded in alpha around inf 70.9%
unpow270.9%
Simplified70.9%
Final simplification67.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.35) (+ 0.08333333333333333 (* alpha 0.041666666666666664)) (/ 1.0 (* beta beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.35) {
tmp = 0.08333333333333333 + (alpha * 0.041666666666666664);
} else {
tmp = 1.0 / (beta * beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.35d0) then
tmp = 0.08333333333333333d0 + (alpha * 0.041666666666666664d0)
else
tmp = 1.0d0 / (beta * beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.35) {
tmp = 0.08333333333333333 + (alpha * 0.041666666666666664);
} else {
tmp = 1.0 / (beta * beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.35: tmp = 0.08333333333333333 + (alpha * 0.041666666666666664) else: tmp = 1.0 / (beta * beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.35) tmp = Float64(0.08333333333333333 + Float64(alpha * 0.041666666666666664)); else tmp = Float64(1.0 / Float64(beta * beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.35)
tmp = 0.08333333333333333 + (alpha * 0.041666666666666664);
else
tmp = 1.0 / (beta * beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.35], N[(0.08333333333333333 + N[(alpha * 0.041666666666666664), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.35:\\
\;\;\;\;0.08333333333333333 + \alpha \cdot 0.041666666666666664\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \beta}\\
\end{array}
\end{array}
if beta < 3.35000000000000009Initial program 99.9%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/96.0%
Simplified96.0%
Taylor expanded in alpha around 0 73.0%
Taylor expanded in beta around 0 71.6%
Taylor expanded in alpha around 0 71.2%
*-commutative71.2%
Simplified71.2%
if 3.35000000000000009 < beta Initial program 80.9%
associate-/l/76.6%
associate-+l+76.6%
+-commutative76.6%
associate-+r+76.6%
associate-+l+76.6%
distribute-rgt1-in76.6%
*-rgt-identity76.6%
distribute-lft-out76.6%
+-commutative76.6%
associate-*l/90.5%
*-commutative90.5%
associate-*r/89.5%
Simplified89.5%
Taylor expanded in beta around inf 79.9%
unpow279.9%
Simplified79.9%
Taylor expanded in alpha around 0 76.8%
unpow276.8%
Simplified76.8%
Final simplification73.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 6.0) 0.16666666666666666 (/ 1.0 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 6.0) {
tmp = 0.16666666666666666;
} else {
tmp = 1.0 / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 6.0d0) then
tmp = 0.16666666666666666d0
else
tmp = 1.0d0 / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 6.0) {
tmp = 0.16666666666666666;
} else {
tmp = 1.0 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 6.0: tmp = 0.16666666666666666 else: tmp = 1.0 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 6.0) tmp = 0.16666666666666666; else tmp = Float64(1.0 / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 6.0)
tmp = 0.16666666666666666;
else
tmp = 1.0 / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 6.0], 0.16666666666666666, N[(1.0 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 6:\\
\;\;\;\;0.16666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta}\\
\end{array}
\end{array}
if beta < 6Initial program 99.9%
associate-/l/99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
distribute-rgt1-in99.8%
*-rgt-identity99.8%
distribute-lft-out99.8%
+-commutative99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/96.0%
Simplified96.0%
Taylor expanded in alpha around 0 73.0%
Taylor expanded in beta around 0 71.6%
Taylor expanded in alpha around inf 14.7%
if 6 < beta Initial program 80.9%
Taylor expanded in beta around inf 81.4%
Taylor expanded in alpha around inf 7.2%
Final simplification12.1%
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 93.3%
associate-/l/91.7%
associate-+l+91.7%
+-commutative91.7%
associate-+r+91.7%
associate-+l+91.7%
distribute-rgt1-in91.7%
*-rgt-identity91.7%
distribute-lft-out91.8%
+-commutative91.8%
associate-*l/96.6%
*-commutative96.6%
associate-*r/93.7%
Simplified93.7%
Taylor expanded in alpha around 0 76.8%
Taylor expanded in beta around 0 48.2%
Taylor expanded in alpha around inf 11.1%
Final simplification11.1%
herbie shell --seed 2023200
(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)))