
(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 (+ 2.0 (+ alpha beta)))
(t_1 (+ alpha (+ 3.0 beta)))
(t_2 (+ alpha (+ beta 2.0))))
(if (<= beta 6e+16)
(* (/ (+ 1.0 beta) (* t_1 t_2)) (/ (+ 1.0 alpha) t_2))
(* (/ (/ (+ 1.0 alpha) t_1) t_0) (/ beta t_0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = 2.0 + (alpha + beta);
double t_1 = alpha + (3.0 + beta);
double t_2 = alpha + (beta + 2.0);
double tmp;
if (beta <= 6e+16) {
tmp = ((1.0 + beta) / (t_1 * t_2)) * ((1.0 + alpha) / t_2);
} else {
tmp = (((1.0 + alpha) / t_1) / t_0) * (beta / t_0);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 2.0d0 + (alpha + beta)
t_1 = alpha + (3.0d0 + beta)
t_2 = alpha + (beta + 2.0d0)
if (beta <= 6d+16) then
tmp = ((1.0d0 + beta) / (t_1 * t_2)) * ((1.0d0 + alpha) / t_2)
else
tmp = (((1.0d0 + alpha) / t_1) / t_0) * (beta / t_0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = 2.0 + (alpha + beta);
double t_1 = alpha + (3.0 + beta);
double t_2 = alpha + (beta + 2.0);
double tmp;
if (beta <= 6e+16) {
tmp = ((1.0 + beta) / (t_1 * t_2)) * ((1.0 + alpha) / t_2);
} else {
tmp = (((1.0 + alpha) / t_1) / t_0) * (beta / t_0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = 2.0 + (alpha + beta) t_1 = alpha + (3.0 + beta) t_2 = alpha + (beta + 2.0) tmp = 0 if beta <= 6e+16: tmp = ((1.0 + beta) / (t_1 * t_2)) * ((1.0 + alpha) / t_2) else: tmp = (((1.0 + alpha) / t_1) / t_0) * (beta / t_0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(2.0 + Float64(alpha + beta)) t_1 = Float64(alpha + Float64(3.0 + beta)) t_2 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 6e+16) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(t_1 * t_2)) * Float64(Float64(1.0 + alpha) / t_2)); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / t_1) / t_0) * Float64(beta / t_0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = 2.0 + (alpha + beta);
t_1 = alpha + (3.0 + beta);
t_2 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 6e+16)
tmp = ((1.0 + beta) / (t_1 * t_2)) * ((1.0 + alpha) / t_2);
else
tmp = (((1.0 + alpha) / t_1) / t_0) * (beta / t_0);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(alpha + N[(3.0 + beta), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 6e+16], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + alpha), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(beta / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := 2 + \left(\alpha + \beta\right)\\
t_1 := \alpha + \left(3 + \beta\right)\\
t_2 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 6 \cdot 10^{+16}:\\
\;\;\;\;\frac{1 + \beta}{t_1 \cdot t_2} \cdot \frac{1 + \alpha}{t_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t_1}}{t_0} \cdot \frac{\beta}{t_0}\\
\end{array}
\end{array}
if beta < 6e16Initial program 99.8%
Simplified99.4%
if 6e16 < beta Initial program 76.6%
Simplified48.3%
Taylor expanded in beta around inf 48.3%
*-commutative48.3%
*-commutative48.3%
times-frac84.7%
*-commutative84.7%
associate-+r+84.7%
+-commutative84.7%
+-commutative84.7%
associate-+r+84.7%
+-commutative84.7%
+-commutative84.7%
Applied egg-rr84.7%
associate-/r*99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Final simplification99.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 3.7e+45)
(*
(/ (+ 1.0 beta) (+ 2.0 (+ alpha beta)))
(/ 1.0 (* (+ 3.0 beta) (+ beta 2.0))))
(*
(/ (+ 1.0 (/ (- -1.0 alpha) beta)) (+ alpha (+ 3.0 beta)))
(/ (+ 1.0 alpha) (+ alpha (+ beta 2.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.7e+45) {
tmp = ((1.0 + beta) / (2.0 + (alpha + beta))) * (1.0 / ((3.0 + beta) * (beta + 2.0)));
} else {
tmp = ((1.0 + ((-1.0 - alpha) / beta)) / (alpha + (3.0 + beta))) * ((1.0 + alpha) / (alpha + (beta + 2.0)));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.7d+45) then
tmp = ((1.0d0 + beta) / (2.0d0 + (alpha + beta))) * (1.0d0 / ((3.0d0 + beta) * (beta + 2.0d0)))
else
tmp = ((1.0d0 + (((-1.0d0) - alpha) / beta)) / (alpha + (3.0d0 + beta))) * ((1.0d0 + alpha) / (alpha + (beta + 2.0d0)))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.7e+45) {
tmp = ((1.0 + beta) / (2.0 + (alpha + beta))) * (1.0 / ((3.0 + beta) * (beta + 2.0)));
} else {
tmp = ((1.0 + ((-1.0 - alpha) / beta)) / (alpha + (3.0 + beta))) * ((1.0 + alpha) / (alpha + (beta + 2.0)));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.7e+45: tmp = ((1.0 + beta) / (2.0 + (alpha + beta))) * (1.0 / ((3.0 + beta) * (beta + 2.0))) else: tmp = ((1.0 + ((-1.0 - alpha) / beta)) / (alpha + (3.0 + beta))) * ((1.0 + alpha) / (alpha + (beta + 2.0))) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.7e+45) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(2.0 + Float64(alpha + beta))) * Float64(1.0 / Float64(Float64(3.0 + beta) * Float64(beta + 2.0)))); else tmp = Float64(Float64(Float64(1.0 + Float64(Float64(-1.0 - alpha) / beta)) / Float64(alpha + Float64(3.0 + beta))) * Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 2.0)))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.7e+45)
tmp = ((1.0 + beta) / (2.0 + (alpha + beta))) * (1.0 / ((3.0 + beta) * (beta + 2.0)));
else
tmp = ((1.0 + ((-1.0 - alpha) / beta)) / (alpha + (3.0 + beta))) * ((1.0 + alpha) / (alpha + (beta + 2.0)));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.7e+45], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(3.0 + beta), $MachinePrecision] * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(N[(-1.0 - alpha), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision] / N[(alpha + N[(3.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 3.7 \cdot 10^{+45}:\\
\;\;\;\;\frac{1 + \beta}{2 + \left(\alpha + \beta\right)} \cdot \frac{1}{\left(3 + \beta\right) \cdot \left(\beta + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \frac{-1 - \alpha}{\beta}}{\alpha + \left(3 + \beta\right)} \cdot \frac{1 + \alpha}{\alpha + \left(\beta + 2\right)}\\
\end{array}
\end{array}
if beta < 3.69999999999999977e45Initial program 99.8%
div-inv99.8%
+-commutative99.8%
*-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
distribute-rgt1-in99.8%
fma-def99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+r+99.8%
metadata-eval99.8%
associate-+r+99.8%
Applied egg-rr99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in alpha around 0 99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
associate-/l/99.4%
*-commutative99.4%
+-commutative99.4%
times-frac99.8%
Applied egg-rr99.4%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 66.8%
+-commutative66.8%
Simplified66.8%
if 3.69999999999999977e45 < beta Initial program 75.2%
Simplified83.8%
clear-num83.8%
associate-+r+83.8%
*-commutative83.8%
frac-times65.1%
*-un-lft-identity65.1%
+-commutative65.1%
*-commutative65.1%
associate-+r+65.1%
Applied egg-rr65.1%
associate-/r*83.8%
associate-/l*68.0%
associate-*l/83.8%
*-commutative83.8%
times-frac99.6%
associate-/r*83.8%
*-commutative83.8%
associate-/r*99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in beta around inf 71.7%
mul-1-neg71.7%
unsub-neg71.7%
Simplified71.7%
Final simplification68.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ 2.0 (+ alpha beta))))
(if (<= beta 19500000000000.0)
(* (/ (+ 1.0 beta) t_0) (/ 1.0 (* (+ 3.0 beta) (+ beta 2.0))))
(* (/ (/ (+ 1.0 alpha) (+ alpha (+ 3.0 beta))) t_0) (/ beta t_0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = 2.0 + (alpha + beta);
double tmp;
if (beta <= 19500000000000.0) {
tmp = ((1.0 + beta) / t_0) * (1.0 / ((3.0 + beta) * (beta + 2.0)));
} else {
tmp = (((1.0 + alpha) / (alpha + (3.0 + beta))) / t_0) * (beta / t_0);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 + (alpha + beta)
if (beta <= 19500000000000.0d0) then
tmp = ((1.0d0 + beta) / t_0) * (1.0d0 / ((3.0d0 + beta) * (beta + 2.0d0)))
else
tmp = (((1.0d0 + alpha) / (alpha + (3.0d0 + beta))) / t_0) * (beta / t_0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = 2.0 + (alpha + beta);
double tmp;
if (beta <= 19500000000000.0) {
tmp = ((1.0 + beta) / t_0) * (1.0 / ((3.0 + beta) * (beta + 2.0)));
} else {
tmp = (((1.0 + alpha) / (alpha + (3.0 + beta))) / t_0) * (beta / t_0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = 2.0 + (alpha + beta) tmp = 0 if beta <= 19500000000000.0: tmp = ((1.0 + beta) / t_0) * (1.0 / ((3.0 + beta) * (beta + 2.0))) else: tmp = (((1.0 + alpha) / (alpha + (3.0 + beta))) / t_0) * (beta / t_0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(2.0 + Float64(alpha + beta)) tmp = 0.0 if (beta <= 19500000000000.0) tmp = Float64(Float64(Float64(1.0 + beta) / t_0) * Float64(1.0 / Float64(Float64(3.0 + beta) * Float64(beta + 2.0)))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(3.0 + beta))) / t_0) * Float64(beta / t_0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = 2.0 + (alpha + beta);
tmp = 0.0;
if (beta <= 19500000000000.0)
tmp = ((1.0 + beta) / t_0) * (1.0 / ((3.0 + beta) * (beta + 2.0)));
else
tmp = (((1.0 + alpha) / (alpha + (3.0 + beta))) / t_0) * (beta / t_0);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 19500000000000.0], N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(1.0 / N[(N[(3.0 + beta), $MachinePrecision] * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(3.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(beta / t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := 2 + \left(\alpha + \beta\right)\\
\mathbf{if}\;\beta \leq 19500000000000:\\
\;\;\;\;\frac{1 + \beta}{t_0} \cdot \frac{1}{\left(3 + \beta\right) \cdot \left(\beta + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(3 + \beta\right)}}{t_0} \cdot \frac{\beta}{t_0}\\
\end{array}
\end{array}
if beta < 1.95e13Initial program 99.8%
div-inv99.8%
+-commutative99.8%
*-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
distribute-rgt1-in99.8%
fma-def99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+r+99.8%
metadata-eval99.8%
associate-+r+99.8%
Applied egg-rr99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in alpha around 0 99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
associate-/l/99.4%
*-commutative99.4%
+-commutative99.4%
times-frac99.8%
Applied egg-rr99.4%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 67.6%
+-commutative67.6%
Simplified67.6%
if 1.95e13 < beta Initial program 76.6%
Simplified48.3%
Taylor expanded in beta around inf 48.3%
*-commutative48.3%
*-commutative48.3%
times-frac84.7%
*-commutative84.7%
associate-+r+84.7%
+-commutative84.7%
+-commutative84.7%
associate-+r+84.7%
+-commutative84.7%
+-commutative84.7%
Applied egg-rr84.7%
associate-/r*99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Final simplification76.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (let* ((t_0 (+ 2.0 (+ alpha beta)))) (* (/ (/ (+ 1.0 alpha) (+ alpha (+ 3.0 beta))) t_0) (/ (+ 1.0 beta) t_0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = 2.0 + (alpha + beta);
return (((1.0 + alpha) / (alpha + (3.0 + beta))) / t_0) * ((1.0 + beta) / t_0);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = 2.0d0 + (alpha + beta)
code = (((1.0d0 + alpha) / (alpha + (3.0d0 + beta))) / t_0) * ((1.0d0 + beta) / t_0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = 2.0 + (alpha + beta);
return (((1.0 + alpha) / (alpha + (3.0 + beta))) / t_0) * ((1.0 + beta) / t_0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = 2.0 + (alpha + beta) return (((1.0 + alpha) / (alpha + (3.0 + beta))) / t_0) * ((1.0 + beta) / t_0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(2.0 + Float64(alpha + beta)) return Float64(Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(3.0 + beta))) / t_0) * Float64(Float64(1.0 + beta) / t_0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = 2.0 + (alpha + beta);
tmp = (((1.0 + alpha) / (alpha + (3.0 + beta))) / t_0) * ((1.0 + beta) / t_0);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(3.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := 2 + \left(\alpha + \beta\right)\\
\frac{\frac{1 + \alpha}{\alpha + \left(3 + \beta\right)}}{t_0} \cdot \frac{1 + \beta}{t_0}
\end{array}
\end{array}
Initial program 93.3%
div-inv93.3%
+-commutative93.3%
*-commutative93.3%
associate-+r+93.3%
+-commutative93.3%
distribute-rgt1-in93.3%
fma-def93.3%
+-commutative93.3%
metadata-eval93.3%
associate-+r+93.3%
metadata-eval93.3%
associate-+r+93.3%
Applied egg-rr93.3%
associate-*l/93.3%
Simplified99.8%
Taylor expanded in alpha around 0 99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
associate-/l/95.3%
*-commutative95.3%
+-commutative95.3%
times-frac99.8%
Applied egg-rr95.3%
associate-/r*99.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
(if (<= beta 1.66e+16)
(*
(/ (+ 1.0 beta) (+ 2.0 (+ alpha beta)))
(/ 1.0 (* (+ 3.0 beta) (+ beta 2.0))))
(/
(* (/ (+ 1.0 alpha) beta) (/ (+ 1.0 beta) (+ alpha (+ beta 2.0))))
(+ alpha (+ 3.0 beta)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.66e+16) {
tmp = ((1.0 + beta) / (2.0 + (alpha + beta))) * (1.0 / ((3.0 + beta) * (beta + 2.0)));
} else {
tmp = (((1.0 + alpha) / beta) * ((1.0 + beta) / (alpha + (beta + 2.0)))) / (alpha + (3.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 <= 1.66d+16) then
tmp = ((1.0d0 + beta) / (2.0d0 + (alpha + beta))) * (1.0d0 / ((3.0d0 + beta) * (beta + 2.0d0)))
else
tmp = (((1.0d0 + alpha) / beta) * ((1.0d0 + beta) / (alpha + (beta + 2.0d0)))) / (alpha + (3.0d0 + beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.66e+16) {
tmp = ((1.0 + beta) / (2.0 + (alpha + beta))) * (1.0 / ((3.0 + beta) * (beta + 2.0)));
} else {
tmp = (((1.0 + alpha) / beta) * ((1.0 + beta) / (alpha + (beta + 2.0)))) / (alpha + (3.0 + beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.66e+16: tmp = ((1.0 + beta) / (2.0 + (alpha + beta))) * (1.0 / ((3.0 + beta) * (beta + 2.0))) else: tmp = (((1.0 + alpha) / beta) * ((1.0 + beta) / (alpha + (beta + 2.0)))) / (alpha + (3.0 + beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.66e+16) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(2.0 + Float64(alpha + beta))) * Float64(1.0 / Float64(Float64(3.0 + beta) * Float64(beta + 2.0)))); else tmp = Float64(Float64(Float64(Float64(1.0 + alpha) / beta) * Float64(Float64(1.0 + beta) / Float64(alpha + Float64(beta + 2.0)))) / Float64(alpha + Float64(3.0 + beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.66e+16)
tmp = ((1.0 + beta) / (2.0 + (alpha + beta))) * (1.0 / ((3.0 + beta) * (beta + 2.0)));
else
tmp = (((1.0 + alpha) / beta) * ((1.0 + beta) / (alpha + (beta + 2.0)))) / (alpha + (3.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, 1.66e+16], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(3.0 + beta), $MachinePrecision] * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] * N[(N[(1.0 + beta), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(alpha + N[(3.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.66 \cdot 10^{+16}:\\
\;\;\;\;\frac{1 + \beta}{2 + \left(\alpha + \beta\right)} \cdot \frac{1}{\left(3 + \beta\right) \cdot \left(\beta + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta} \cdot \frac{1 + \beta}{\alpha + \left(\beta + 2\right)}}{\alpha + \left(3 + \beta\right)}\\
\end{array}
\end{array}
if beta < 1.66e16Initial program 99.8%
div-inv99.8%
+-commutative99.8%
*-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
distribute-rgt1-in99.8%
fma-def99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+r+99.8%
metadata-eval99.8%
associate-+r+99.8%
Applied egg-rr99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in alpha around 0 99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
associate-/l/99.4%
*-commutative99.4%
+-commutative99.4%
times-frac99.8%
Applied egg-rr99.4%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 67.6%
+-commutative67.6%
Simplified67.6%
if 1.66e16 < beta Initial program 76.6%
div-inv76.5%
+-commutative76.5%
*-commutative76.5%
associate-+r+76.5%
+-commutative76.5%
distribute-rgt1-in76.5%
fma-def76.5%
+-commutative76.5%
metadata-eval76.5%
associate-+r+76.5%
metadata-eval76.5%
associate-+r+76.5%
Applied egg-rr76.5%
associate-*l/76.5%
Simplified99.8%
Taylor expanded in alpha around 0 99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in beta around inf 70.7%
expm1-log1p-u70.7%
expm1-udef47.4%
Applied egg-rr47.4%
expm1-def70.7%
expm1-log1p70.7%
associate-*l/70.7%
associate-*r/70.7%
rem-3cbrt-lft70.5%
unpow270.5%
associate-*r/70.5%
Simplified70.7%
Final simplification68.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ 2.0 (+ alpha beta))))
(if (<= beta 2.65e+18)
(* (/ (+ 1.0 beta) t_0) (/ 1.0 (* (+ 3.0 beta) (+ beta 2.0))))
(/ (/ (+ 1.0 alpha) (+ alpha (+ 3.0 beta))) t_0))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = 2.0 + (alpha + beta);
double tmp;
if (beta <= 2.65e+18) {
tmp = ((1.0 + beta) / t_0) * (1.0 / ((3.0 + beta) * (beta + 2.0)));
} else {
tmp = ((1.0 + alpha) / (alpha + (3.0 + beta))) / t_0;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 + (alpha + beta)
if (beta <= 2.65d+18) then
tmp = ((1.0d0 + beta) / t_0) * (1.0d0 / ((3.0d0 + beta) * (beta + 2.0d0)))
else
tmp = ((1.0d0 + alpha) / (alpha + (3.0d0 + beta))) / t_0
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = 2.0 + (alpha + beta);
double tmp;
if (beta <= 2.65e+18) {
tmp = ((1.0 + beta) / t_0) * (1.0 / ((3.0 + beta) * (beta + 2.0)));
} else {
tmp = ((1.0 + alpha) / (alpha + (3.0 + beta))) / t_0;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = 2.0 + (alpha + beta) tmp = 0 if beta <= 2.65e+18: tmp = ((1.0 + beta) / t_0) * (1.0 / ((3.0 + beta) * (beta + 2.0))) else: tmp = ((1.0 + alpha) / (alpha + (3.0 + beta))) / t_0 return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(2.0 + Float64(alpha + beta)) tmp = 0.0 if (beta <= 2.65e+18) tmp = Float64(Float64(Float64(1.0 + beta) / t_0) * Float64(1.0 / Float64(Float64(3.0 + beta) * Float64(beta + 2.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(3.0 + beta))) / t_0); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = 2.0 + (alpha + beta);
tmp = 0.0;
if (beta <= 2.65e+18)
tmp = ((1.0 + beta) / t_0) * (1.0 / ((3.0 + beta) * (beta + 2.0)));
else
tmp = ((1.0 + alpha) / (alpha + (3.0 + beta))) / t_0;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 2.65e+18], N[(N[(N[(1.0 + beta), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(1.0 / N[(N[(3.0 + beta), $MachinePrecision] * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(3.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := 2 + \left(\alpha + \beta\right)\\
\mathbf{if}\;\beta \leq 2.65 \cdot 10^{+18}:\\
\;\;\;\;\frac{1 + \beta}{t_0} \cdot \frac{1}{\left(3 + \beta\right) \cdot \left(\beta + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(3 + \beta\right)}}{t_0}\\
\end{array}
\end{array}
if beta < 2.65e18Initial program 99.8%
div-inv99.8%
+-commutative99.8%
*-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
distribute-rgt1-in99.8%
fma-def99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+r+99.8%
metadata-eval99.8%
associate-+r+99.8%
Applied egg-rr99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in alpha around 0 99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
associate-/l/99.4%
*-commutative99.4%
+-commutative99.4%
times-frac99.8%
Applied egg-rr99.4%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 67.3%
+-commutative67.3%
Simplified67.3%
if 2.65e18 < beta Initial program 76.2%
div-inv76.2%
+-commutative76.2%
*-commutative76.2%
associate-+r+76.2%
+-commutative76.2%
distribute-rgt1-in76.2%
fma-def76.2%
+-commutative76.2%
metadata-eval76.2%
associate-+r+76.2%
metadata-eval76.2%
associate-+r+76.2%
Applied egg-rr76.2%
associate-*l/76.2%
Simplified99.8%
Taylor expanded in beta around inf 71.6%
expm1-log1p-u71.6%
expm1-udef47.9%
associate-/l/47.9%
metadata-eval47.9%
associate-+l+47.9%
metadata-eval47.9%
associate-+r+47.9%
+-commutative47.9%
associate-+r+47.9%
+-commutative47.9%
+-commutative47.9%
Applied egg-rr47.9%
expm1-def79.4%
expm1-log1p79.4%
associate-/r*71.6%
+-commutative71.6%
+-commutative71.6%
Simplified71.6%
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.0) (/ (+ 1.0 beta) (* (+ beta 2.0) (+ 6.0 (* beta 5.0)))) (/ (/ (+ 1.0 alpha) (+ alpha (+ 3.0 beta))) (+ 2.0 (+ alpha beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.0) {
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
} else {
tmp = ((1.0 + alpha) / (alpha + (3.0 + beta))) / (2.0 + (alpha + beta));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.0d0) then
tmp = (1.0d0 + beta) / ((beta + 2.0d0) * (6.0d0 + (beta * 5.0d0)))
else
tmp = ((1.0d0 + alpha) / (alpha + (3.0d0 + beta))) / (2.0d0 + (alpha + beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.0) {
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
} else {
tmp = ((1.0 + alpha) / (alpha + (3.0 + beta))) / (2.0 + (alpha + beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.0: tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0))) else: tmp = ((1.0 + alpha) / (alpha + (3.0 + beta))) / (2.0 + (alpha + beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.0) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(6.0 + Float64(beta * 5.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(3.0 + beta))) / Float64(2.0 + Float64(alpha + beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.0)
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
else
tmp = ((1.0 + alpha) / (alpha + (3.0 + beta))) / (2.0 + (alpha + beta));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.0], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(6.0 + N[(beta * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(3.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(6 + \beta \cdot 5\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\alpha + \left(3 + \beta\right)}}{2 + \left(\alpha + \beta\right)}\\
\end{array}
\end{array}
if beta < 2Initial program 99.8%
Simplified99.4%
Taylor expanded in beta around 0 99.1%
Taylor expanded in alpha around 0 65.9%
*-commutative65.9%
Simplified65.9%
if 2 < beta Initial program 76.9%
div-inv76.8%
+-commutative76.8%
*-commutative76.8%
associate-+r+76.8%
+-commutative76.8%
distribute-rgt1-in76.8%
fma-def76.8%
+-commutative76.8%
metadata-eval76.8%
associate-+r+76.8%
metadata-eval76.8%
associate-+r+76.8%
Applied egg-rr76.8%
associate-*l/76.9%
Simplified99.8%
Taylor expanded in beta around inf 70.3%
expm1-log1p-u70.3%
expm1-udef47.3%
associate-/l/47.3%
metadata-eval47.3%
associate-+l+47.3%
metadata-eval47.3%
associate-+r+47.3%
+-commutative47.3%
associate-+r+47.3%
+-commutative47.3%
+-commutative47.3%
Applied egg-rr47.3%
expm1-def77.9%
expm1-log1p77.9%
associate-/r*70.3%
+-commutative70.3%
+-commutative70.3%
Simplified70.3%
Final simplification67.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 5.0) (/ (+ 1.0 beta) (* (+ beta 2.0) (+ 6.0 (* beta 5.0)))) (/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 2.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 5.0) {
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 2.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 5.0d0) then
tmp = (1.0d0 + beta) / ((beta + 2.0d0) * (6.0d0 + (beta * 5.0d0)))
else
tmp = ((1.0d0 + alpha) / beta) / (alpha + (beta + 2.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 5.0) {
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 5.0: tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0))) else: tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 5.0) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(6.0 + Float64(beta * 5.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 2.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 5.0)
tmp = (1.0 + beta) / ((beta + 2.0) * (6.0 + (beta * 5.0)));
else
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 2.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 5.0], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(6.0 + N[(beta * 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 5:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(6 + \beta \cdot 5\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(\beta + 2\right)}\\
\end{array}
\end{array}
if beta < 5Initial program 99.8%
Simplified99.4%
Taylor expanded in beta around 0 99.1%
Taylor expanded in alpha around 0 65.9%
*-commutative65.9%
Simplified65.9%
if 5 < beta Initial program 76.9%
Simplified84.8%
Taylor expanded in beta around inf 69.3%
associate-*l/69.4%
+-commutative69.4%
Applied egg-rr69.4%
associate-*r/69.4%
*-rgt-identity69.4%
+-commutative69.4%
Simplified69.4%
Final simplification66.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.7e+15) (/ 1.0 (* (+ 3.0 beta) (+ beta 2.0))) (/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 2.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.7e+15) {
tmp = 1.0 / ((3.0 + beta) * (beta + 2.0));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 2.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.7d+15) then
tmp = 1.0d0 / ((3.0d0 + beta) * (beta + 2.0d0))
else
tmp = ((1.0d0 + alpha) / beta) / (alpha + (beta + 2.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.7e+15) {
tmp = 1.0 / ((3.0 + beta) * (beta + 2.0));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.7e+15: tmp = 1.0 / ((3.0 + beta) * (beta + 2.0)) else: tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.7e+15) tmp = Float64(1.0 / Float64(Float64(3.0 + beta) * Float64(beta + 2.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 2.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.7e+15)
tmp = 1.0 / ((3.0 + beta) * (beta + 2.0));
else
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 2.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.7e+15], N[(1.0 / N[(N[(3.0 + beta), $MachinePrecision] * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.7 \cdot 10^{+15}:\\
\;\;\;\;\frac{1}{\left(3 + \beta\right) \cdot \left(\beta + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(\beta + 2\right)}\\
\end{array}
\end{array}
if beta < 2.7e15Initial program 99.8%
div-inv99.8%
+-commutative99.8%
*-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
distribute-rgt1-in99.8%
fma-def99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+r+99.8%
metadata-eval99.8%
associate-+r+99.8%
Applied egg-rr99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in beta around inf 15.1%
Taylor expanded in alpha around 0 14.1%
if 2.7e15 < beta Initial program 76.6%
Simplified84.6%
Taylor expanded in beta around inf 69.7%
associate-*l/69.8%
+-commutative69.8%
Applied egg-rr69.8%
associate-*r/69.8%
*-rgt-identity69.8%
+-commutative69.8%
Simplified69.8%
Final simplification29.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.5) (/ (+ 1.0 alpha) 6.0) (* (/ (+ 1.0 alpha) beta) (/ 1.0 beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = (1.0 + alpha) / 6.0;
} else {
tmp = ((1.0 + alpha) / beta) * (1.0 / beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.5d0) then
tmp = (1.0d0 + alpha) / 6.0d0
else
tmp = ((1.0d0 + alpha) / beta) * (1.0d0 / beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = (1.0 + alpha) / 6.0;
} else {
tmp = ((1.0 + alpha) / beta) * (1.0 / beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.5: tmp = (1.0 + alpha) / 6.0 else: tmp = ((1.0 + alpha) / beta) * (1.0 / beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.5) tmp = Float64(Float64(1.0 + alpha) / 6.0); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) * Float64(1.0 / beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.5)
tmp = (1.0 + alpha) / 6.0;
else
tmp = ((1.0 + alpha) / beta) * (1.0 / beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.5], N[(N[(1.0 + alpha), $MachinePrecision] / 6.0), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] * N[(1.0 / beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.5:\\
\;\;\;\;\frac{1 + \alpha}{6}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta} \cdot \frac{1}{\beta}\\
\end{array}
\end{array}
if beta < 2.5Initial program 99.8%
div-inv99.8%
+-commutative99.8%
*-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
distribute-rgt1-in99.8%
fma-def99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+r+99.8%
metadata-eval99.8%
associate-+r+99.8%
Applied egg-rr99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in beta around inf 14.9%
Taylor expanded in beta around 0 31.7%
+-commutative31.7%
+-commutative31.7%
Simplified31.7%
Taylor expanded in alpha around 0 13.5%
if 2.5 < beta Initial program 76.9%
Simplified84.8%
Taylor expanded in beta around inf 69.3%
Taylor expanded in beta around inf 68.9%
Final simplification29.3%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.15e+39) (/ 1.0 (* (+ 3.0 beta) (+ beta 2.0))) (* (/ (+ 1.0 alpha) beta) (/ 1.0 beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.15e+39) {
tmp = 1.0 / ((3.0 + beta) * (beta + 2.0));
} else {
tmp = ((1.0 + alpha) / beta) * (1.0 / beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 4.15d+39) then
tmp = 1.0d0 / ((3.0d0 + beta) * (beta + 2.0d0))
else
tmp = ((1.0d0 + alpha) / beta) * (1.0d0 / beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 4.15e+39) {
tmp = 1.0 / ((3.0 + beta) * (beta + 2.0));
} else {
tmp = ((1.0 + alpha) / beta) * (1.0 / beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.15e+39: tmp = 1.0 / ((3.0 + beta) * (beta + 2.0)) else: tmp = ((1.0 + alpha) / beta) * (1.0 / beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.15e+39) tmp = Float64(1.0 / Float64(Float64(3.0 + beta) * Float64(beta + 2.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) * Float64(1.0 / beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 4.15e+39)
tmp = 1.0 / ((3.0 + beta) * (beta + 2.0));
else
tmp = ((1.0 + alpha) / beta) * (1.0 / beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 4.15e+39], N[(1.0 / N[(N[(3.0 + beta), $MachinePrecision] * N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] * N[(1.0 / beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4.15 \cdot 10^{+39}:\\
\;\;\;\;\frac{1}{\left(3 + \beta\right) \cdot \left(\beta + 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta} \cdot \frac{1}{\beta}\\
\end{array}
\end{array}
if beta < 4.1500000000000002e39Initial program 99.8%
div-inv99.8%
+-commutative99.8%
*-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
distribute-rgt1-in99.8%
fma-def99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+r+99.8%
metadata-eval99.8%
associate-+r+99.8%
Applied egg-rr99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in beta around inf 15.4%
Taylor expanded in alpha around 0 14.4%
if 4.1500000000000002e39 < beta Initial program 75.2%
Simplified83.8%
Taylor expanded in beta around inf 72.1%
Taylor expanded in beta around inf 71.8%
Final simplification29.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.25) (/ (+ 1.0 alpha) 6.0) (/ 1.0 (* beta (+ 3.0 beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.25) {
tmp = (1.0 + alpha) / 6.0;
} else {
tmp = 1.0 / (beta * (3.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 <= 1.25d0) then
tmp = (1.0d0 + alpha) / 6.0d0
else
tmp = 1.0d0 / (beta * (3.0d0 + beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.25) {
tmp = (1.0 + alpha) / 6.0;
} else {
tmp = 1.0 / (beta * (3.0 + beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.25: tmp = (1.0 + alpha) / 6.0 else: tmp = 1.0 / (beta * (3.0 + beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.25) tmp = Float64(Float64(1.0 + alpha) / 6.0); else tmp = Float64(1.0 / Float64(beta * Float64(3.0 + beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.25)
tmp = (1.0 + alpha) / 6.0;
else
tmp = 1.0 / (beta * (3.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, 1.25], N[(N[(1.0 + alpha), $MachinePrecision] / 6.0), $MachinePrecision], N[(1.0 / N[(beta * N[(3.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.25:\\
\;\;\;\;\frac{1 + \alpha}{6}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \left(3 + \beta\right)}\\
\end{array}
\end{array}
if beta < 1.25Initial program 99.8%
div-inv99.8%
+-commutative99.8%
*-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
distribute-rgt1-in99.8%
fma-def99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+r+99.8%
metadata-eval99.8%
associate-+r+99.8%
Applied egg-rr99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in beta around inf 14.9%
Taylor expanded in beta around 0 31.7%
+-commutative31.7%
+-commutative31.7%
Simplified31.7%
Taylor expanded in alpha around 0 13.5%
if 1.25 < beta Initial program 76.9%
Taylor expanded in beta around -inf 69.4%
Taylor expanded in alpha around 0 66.4%
Final simplification28.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.3) (/ (+ 1.0 alpha) 6.0) (/ (/ 1.0 beta) (+ 3.0 beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.3) {
tmp = (1.0 + alpha) / 6.0;
} else {
tmp = (1.0 / beta) / (3.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 <= 1.3d0) then
tmp = (1.0d0 + alpha) / 6.0d0
else
tmp = (1.0d0 / beta) / (3.0d0 + beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.3) {
tmp = (1.0 + alpha) / 6.0;
} else {
tmp = (1.0 / beta) / (3.0 + beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.3: tmp = (1.0 + alpha) / 6.0 else: tmp = (1.0 / beta) / (3.0 + beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.3) tmp = Float64(Float64(1.0 + alpha) / 6.0); else tmp = Float64(Float64(1.0 / beta) / Float64(3.0 + beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.3)
tmp = (1.0 + alpha) / 6.0;
else
tmp = (1.0 / beta) / (3.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, 1.3], N[(N[(1.0 + alpha), $MachinePrecision] / 6.0), $MachinePrecision], N[(N[(1.0 / beta), $MachinePrecision] / N[(3.0 + beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.3:\\
\;\;\;\;\frac{1 + \alpha}{6}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta}}{3 + \beta}\\
\end{array}
\end{array}
if beta < 1.30000000000000004Initial program 99.8%
div-inv99.8%
+-commutative99.8%
*-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
distribute-rgt1-in99.8%
fma-def99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+r+99.8%
metadata-eval99.8%
associate-+r+99.8%
Applied egg-rr99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in beta around inf 14.9%
Taylor expanded in beta around 0 31.7%
+-commutative31.7%
+-commutative31.7%
Simplified31.7%
Taylor expanded in alpha around 0 13.5%
if 1.30000000000000004 < beta Initial program 76.9%
Taylor expanded in beta around -inf 69.4%
Taylor expanded in alpha around 0 66.4%
associate-/r*66.4%
+-commutative66.4%
Simplified66.4%
Final simplification28.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.8) (/ (+ 1.0 alpha) 6.0) (/ 1.0 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.8) {
tmp = (1.0 + alpha) / 6.0;
} 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 <= 4.8d0) then
tmp = (1.0d0 + alpha) / 6.0d0
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 <= 4.8) {
tmp = (1.0 + alpha) / 6.0;
} else {
tmp = 1.0 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.8: tmp = (1.0 + alpha) / 6.0 else: tmp = 1.0 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.8) tmp = Float64(Float64(1.0 + alpha) / 6.0); 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 <= 4.8)
tmp = (1.0 + alpha) / 6.0;
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, 4.8], N[(N[(1.0 + alpha), $MachinePrecision] / 6.0), $MachinePrecision], N[(1.0 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4.8:\\
\;\;\;\;\frac{1 + \alpha}{6}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta}\\
\end{array}
\end{array}
if beta < 4.79999999999999982Initial program 99.8%
div-inv99.8%
+-commutative99.8%
*-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
distribute-rgt1-in99.8%
fma-def99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+r+99.8%
metadata-eval99.8%
associate-+r+99.8%
Applied egg-rr99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in beta around inf 14.9%
Taylor expanded in beta around 0 31.7%
+-commutative31.7%
+-commutative31.7%
Simplified31.7%
Taylor expanded in alpha around 0 13.5%
if 4.79999999999999982 < beta Initial program 76.9%
Simplified84.8%
Taylor expanded in beta around inf 69.3%
Taylor expanded in alpha around inf 6.2%
Final simplification11.5%
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.8%
div-inv99.8%
+-commutative99.8%
*-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
distribute-rgt1-in99.8%
fma-def99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+r+99.8%
metadata-eval99.8%
associate-+r+99.8%
Applied egg-rr99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in beta around inf 14.9%
Taylor expanded in beta around 0 31.7%
+-commutative31.7%
+-commutative31.7%
Simplified31.7%
Taylor expanded in alpha around 0 13.9%
if 6 < beta Initial program 76.9%
Simplified84.8%
Taylor expanded in beta around inf 69.3%
Taylor expanded in alpha around inf 6.2%
Final simplification11.7%
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%
div-inv93.3%
+-commutative93.3%
*-commutative93.3%
associate-+r+93.3%
+-commutative93.3%
distribute-rgt1-in93.3%
fma-def93.3%
+-commutative93.3%
metadata-eval93.3%
associate-+r+93.3%
metadata-eval93.3%
associate-+r+93.3%
Applied egg-rr93.3%
associate-*l/93.3%
Simplified99.8%
Taylor expanded in beta around inf 30.7%
Taylor expanded in beta around 0 27.8%
+-commutative27.8%
+-commutative27.8%
Simplified27.8%
Taylor expanded in alpha around 0 11.0%
Final simplification11.0%
herbie shell --seed 2024011
(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)))