
(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 14 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))))
(/
(/ (+ 1.0 alpha) t_0)
(* (+ beta (+ alpha 3.0)) (* t_0 (/ 1.0 (+ 1.0 beta)))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = 2.0 + (alpha + beta);
return ((1.0 + alpha) / t_0) / ((beta + (alpha + 3.0)) * (t_0 * (1.0 / (1.0 + beta))));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = 2.0d0 + (alpha + beta)
code = ((1.0d0 + alpha) / t_0) / ((beta + (alpha + 3.0d0)) * (t_0 * (1.0d0 / (1.0d0 + beta))))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = 2.0 + (alpha + beta);
return ((1.0 + alpha) / t_0) / ((beta + (alpha + 3.0)) * (t_0 * (1.0 / (1.0 + beta))));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = 2.0 + (alpha + beta) return ((1.0 + alpha) / t_0) / ((beta + (alpha + 3.0)) * (t_0 * (1.0 / (1.0 + beta))))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(2.0 + Float64(alpha + beta)) return Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(Float64(beta + Float64(alpha + 3.0)) * Float64(t_0 * Float64(1.0 / Float64(1.0 + beta))))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = 2.0 + (alpha + beta);
tmp = ((1.0 + alpha) / t_0) / ((beta + (alpha + 3.0)) * (t_0 * (1.0 / (1.0 + beta))));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(N[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.0 / N[(1.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}{t\_0}}{\left(\beta + \left(\alpha + 3\right)\right) \cdot \left(t\_0 \cdot \frac{1}{1 + \beta}\right)}
\end{array}
\end{array}
Initial program 94.4%
Simplified96.4%
*-commutative96.4%
clear-num96.3%
clear-num96.3%
frac-times96.4%
metadata-eval96.4%
+-commutative96.4%
Applied egg-rr96.4%
associate-/l*99.0%
associate-+r+99.0%
+-commutative99.0%
+-commutative99.0%
+-commutative99.0%
+-commutative99.0%
+-commutative99.0%
associate-+r+99.0%
+-commutative99.0%
+-commutative99.0%
+-commutative99.0%
Simplified99.0%
inv-pow99.0%
*-commutative99.0%
unpow-prod-down99.5%
inv-pow99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
clear-num99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
inv-pow99.5%
associate-/r/99.5%
associate-+r+99.5%
Applied egg-rr99.5%
associate-*r/99.6%
*-rgt-identity99.6%
+-commutative99.6%
*-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
div-inv99.6%
+-commutative99.6%
Applied egg-rr99.6%
Final simplification99.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) t_0) (* (+ beta (+ alpha 3.0)) (/ t_0 (+ 1.0 beta))))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = 2.0 + (alpha + beta);
return ((1.0 + alpha) / t_0) / ((beta + (alpha + 3.0)) * (t_0 / (1.0 + beta)));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = 2.0d0 + (alpha + beta)
code = ((1.0d0 + alpha) / t_0) / ((beta + (alpha + 3.0d0)) * (t_0 / (1.0d0 + beta)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = 2.0 + (alpha + beta);
return ((1.0 + alpha) / t_0) / ((beta + (alpha + 3.0)) * (t_0 / (1.0 + beta)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = 2.0 + (alpha + beta) return ((1.0 + alpha) / t_0) / ((beta + (alpha + 3.0)) * (t_0 / (1.0 + beta)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(2.0 + Float64(alpha + beta)) return Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(Float64(beta + Float64(alpha + 3.0)) * Float64(t_0 / Float64(1.0 + beta)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = 2.0 + (alpha + beta);
tmp = ((1.0 + alpha) / t_0) / ((beta + (alpha + 3.0)) * (t_0 / (1.0 + beta)));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(N[(beta + N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / N[(1.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := 2 + \left(\alpha + \beta\right)\\
\frac{\frac{1 + \alpha}{t\_0}}{\left(\beta + \left(\alpha + 3\right)\right) \cdot \frac{t\_0}{1 + \beta}}
\end{array}
\end{array}
Initial program 94.4%
Simplified96.4%
*-commutative96.4%
clear-num96.3%
clear-num96.3%
frac-times96.4%
metadata-eval96.4%
+-commutative96.4%
Applied egg-rr96.4%
associate-/l*99.0%
associate-+r+99.0%
+-commutative99.0%
+-commutative99.0%
+-commutative99.0%
+-commutative99.0%
+-commutative99.0%
associate-+r+99.0%
+-commutative99.0%
+-commutative99.0%
+-commutative99.0%
Simplified99.0%
inv-pow99.0%
*-commutative99.0%
unpow-prod-down99.5%
inv-pow99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
clear-num99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
inv-pow99.5%
associate-/r/99.5%
associate-+r+99.5%
Applied egg-rr99.5%
associate-*r/99.6%
*-rgt-identity99.6%
+-commutative99.6%
*-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
Final simplification99.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(if (<= beta 6.8e+52)
(/ (/ (+ 1.0 beta) (+ 2.0 beta)) (* (+ 2.0 beta) (+ beta 3.0)))
(/
(/ (+ 1.0 alpha) (+ 2.0 (+ alpha beta)))
(+ (+ beta 4.0) (* alpha 2.0)))))assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 6.8e+52) {
tmp = ((1.0 + beta) / (2.0 + beta)) / ((2.0 + beta) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / (2.0 + (alpha + beta))) / ((beta + 4.0) + (alpha * 2.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 6.8d+52) then
tmp = ((1.0d0 + beta) / (2.0d0 + beta)) / ((2.0d0 + beta) * (beta + 3.0d0))
else
tmp = ((1.0d0 + alpha) / (2.0d0 + (alpha + beta))) / ((beta + 4.0d0) + (alpha * 2.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 6.8e+52) {
tmp = ((1.0 + beta) / (2.0 + beta)) / ((2.0 + beta) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / (2.0 + (alpha + beta))) / ((beta + 4.0) + (alpha * 2.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 6.8e+52: tmp = ((1.0 + beta) / (2.0 + beta)) / ((2.0 + beta) * (beta + 3.0)) else: tmp = ((1.0 + alpha) / (2.0 + (alpha + beta))) / ((beta + 4.0) + (alpha * 2.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 6.8e+52) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(2.0 + beta)) / Float64(Float64(2.0 + beta) * Float64(beta + 3.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(2.0 + Float64(alpha + beta))) / Float64(Float64(beta + 4.0) + Float64(alpha * 2.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 6.8e+52)
tmp = ((1.0 + beta) / (2.0 + beta)) / ((2.0 + beta) * (beta + 3.0));
else
tmp = ((1.0 + alpha) / (2.0 + (alpha + beta))) / ((beta + 4.0) + (alpha * 2.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 6.8e+52], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision] / N[(N[(2.0 + beta), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 4.0), $MachinePrecision] + N[(alpha * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 6.8 \cdot 10^{+52}:\\
\;\;\;\;\frac{\frac{1 + \beta}{2 + \beta}}{\left(2 + \beta\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{2 + \left(\alpha + \beta\right)}}{\left(\beta + 4\right) + \alpha \cdot 2}\\
\end{array}
\end{array}
if beta < 6.8e52Initial program 99.8%
associate-/l/99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
+-commutative99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in alpha around 0 85.4%
Taylor expanded in alpha around 0 68.4%
+-commutative68.4%
+-commutative68.4%
Simplified68.4%
if 6.8e52 < beta Initial program 82.8%
Simplified89.7%
*-commutative89.7%
clear-num89.6%
clear-num89.6%
frac-times89.7%
metadata-eval89.7%
+-commutative89.7%
Applied egg-rr89.7%
associate-/l*97.7%
associate-+r+97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
associate-+r+97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
inv-pow97.7%
*-commutative97.7%
unpow-prod-down99.6%
inv-pow99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
clear-num99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
inv-pow99.6%
associate-/r/99.6%
associate-+r+99.6%
Applied egg-rr99.6%
associate-*r/99.7%
*-rgt-identity99.7%
+-commutative99.7%
*-commutative99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in beta around inf 87.4%
associate-+r+87.4%
Simplified87.4%
Final simplification74.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ (/ (+ 1.0 alpha) (+ 2.0 (+ alpha beta))) (/ (+ 2.0 beta) (/ (+ 1.0 beta) (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
return ((1.0 + alpha) / (2.0 + (alpha + beta))) / ((2.0 + beta) / ((1.0 + beta) / (beta + 3.0)));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = ((1.0d0 + alpha) / (2.0d0 + (alpha + beta))) / ((2.0d0 + beta) / ((1.0d0 + beta) / (beta + 3.0d0)))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return ((1.0 + alpha) / (2.0 + (alpha + beta))) / ((2.0 + beta) / ((1.0 + beta) / (beta + 3.0)));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return ((1.0 + alpha) / (2.0 + (alpha + beta))) / ((2.0 + beta) / ((1.0 + beta) / (beta + 3.0)))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(Float64(1.0 + alpha) / Float64(2.0 + Float64(alpha + beta))) / Float64(Float64(2.0 + beta) / Float64(Float64(1.0 + beta) / Float64(beta + 3.0)))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = ((1.0 + alpha) / (2.0 + (alpha + beta))) / ((2.0 + beta) / ((1.0 + beta) / (beta + 3.0)));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(2.0 + beta), $MachinePrecision] / N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{\frac{1 + \alpha}{2 + \left(\alpha + \beta\right)}}{\frac{2 + \beta}{\frac{1 + \beta}{\beta + 3}}}
\end{array}
Initial program 94.4%
Simplified96.4%
*-commutative96.4%
clear-num96.3%
clear-num96.3%
frac-times96.4%
metadata-eval96.4%
+-commutative96.4%
Applied egg-rr96.4%
associate-/l*99.0%
associate-+r+99.0%
+-commutative99.0%
+-commutative99.0%
+-commutative99.0%
+-commutative99.0%
+-commutative99.0%
associate-+r+99.0%
+-commutative99.0%
+-commutative99.0%
+-commutative99.0%
Simplified99.0%
inv-pow99.0%
*-commutative99.0%
unpow-prod-down99.5%
inv-pow99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
clear-num99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
inv-pow99.5%
associate-/r/99.5%
associate-+r+99.5%
Applied egg-rr99.5%
associate-*r/99.6%
*-rgt-identity99.6%
+-commutative99.6%
*-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in alpha around 0 72.4%
associate-/l*74.1%
+-commutative74.1%
+-commutative74.1%
Simplified74.1%
Final simplification74.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 7.6e+52) (/ (/ (+ 1.0 beta) (+ 2.0 beta)) (* (+ 2.0 beta) (+ beta 3.0))) (/ (/ (+ 1.0 alpha) (+ 2.0 (+ alpha beta))) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 7.6e+52) {
tmp = ((1.0 + beta) / (2.0 + beta)) / ((2.0 + beta) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / (2.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 <= 7.6d+52) then
tmp = ((1.0d0 + beta) / (2.0d0 + beta)) / ((2.0d0 + beta) * (beta + 3.0d0))
else
tmp = ((1.0d0 + alpha) / (2.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 <= 7.6e+52) {
tmp = ((1.0 + beta) / (2.0 + beta)) / ((2.0 + beta) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / (2.0 + (alpha + beta))) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 7.6e+52: tmp = ((1.0 + beta) / (2.0 + beta)) / ((2.0 + beta) * (beta + 3.0)) else: tmp = ((1.0 + alpha) / (2.0 + (alpha + beta))) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 7.6e+52) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(2.0 + beta)) / Float64(Float64(2.0 + beta) * Float64(beta + 3.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / Float64(2.0 + Float64(alpha + beta))) / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 7.6e+52)
tmp = ((1.0 + beta) / (2.0 + beta)) / ((2.0 + beta) * (beta + 3.0));
else
tmp = ((1.0 + alpha) / (2.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, 7.6e+52], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision] / N[(N[(2.0 + beta), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 7.6 \cdot 10^{+52}:\\
\;\;\;\;\frac{\frac{1 + \beta}{2 + \beta}}{\left(2 + \beta\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{2 + \left(\alpha + \beta\right)}}{\beta}\\
\end{array}
\end{array}
if beta < 7.5999999999999999e52Initial program 99.8%
associate-/l/99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
+-commutative99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in alpha around 0 85.4%
Taylor expanded in alpha around 0 68.4%
+-commutative68.4%
+-commutative68.4%
Simplified68.4%
if 7.5999999999999999e52 < beta Initial program 82.8%
Simplified89.7%
Taylor expanded in beta around inf 86.5%
un-div-inv86.6%
+-commutative86.6%
associate-+r+86.6%
+-commutative86.6%
Applied egg-rr86.6%
Final simplification74.2%
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 4.9) (/ 0.25 (+ 1.0 t_0)) (/ (/ (+ 1.0 alpha) t_0) beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = 2.0 + (alpha + beta);
double tmp;
if (beta <= 4.9) {
tmp = 0.25 / (1.0 + t_0);
} else {
tmp = ((1.0 + alpha) / t_0) / beta;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 + (alpha + beta)
if (beta <= 4.9d0) then
tmp = 0.25d0 / (1.0d0 + t_0)
else
tmp = ((1.0d0 + alpha) / t_0) / beta
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 <= 4.9) {
tmp = 0.25 / (1.0 + t_0);
} else {
tmp = ((1.0 + alpha) / t_0) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = 2.0 + (alpha + beta) tmp = 0 if beta <= 4.9: tmp = 0.25 / (1.0 + t_0) else: tmp = ((1.0 + alpha) / t_0) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(2.0 + Float64(alpha + beta)) tmp = 0.0 if (beta <= 4.9) tmp = Float64(0.25 / Float64(1.0 + t_0)); else tmp = Float64(Float64(Float64(1.0 + alpha) / t_0) / beta); 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 <= 4.9)
tmp = 0.25 / (1.0 + t_0);
else
tmp = ((1.0 + alpha) / t_0) / beta;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 4.9], N[(0.25 / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / beta), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := 2 + \left(\alpha + \beta\right)\\
\mathbf{if}\;\beta \leq 4.9:\\
\;\;\;\;\frac{0.25}{1 + t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{t\_0}}{\beta}\\
\end{array}
\end{array}
if beta < 4.9000000000000004Initial program 99.9%
Taylor expanded in beta around 0 98.3%
Taylor expanded in alpha around 0 68.8%
if 4.9000000000000004 < beta Initial program 85.3%
Simplified91.1%
Taylor expanded in beta around inf 82.7%
un-div-inv82.8%
+-commutative82.8%
associate-+r+82.8%
+-commutative82.8%
Applied egg-rr82.8%
Final simplification74.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 7.1) (/ 0.25 (+ 1.0 (+ 2.0 (+ alpha beta)))) (/ (/ (+ 1.0 alpha) beta) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 7.1) {
tmp = 0.25 / (1.0 + (2.0 + (alpha + beta)));
} 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 <= 7.1d0) then
tmp = 0.25d0 / (1.0d0 + (2.0d0 + (alpha + beta)))
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 <= 7.1) {
tmp = 0.25 / (1.0 + (2.0 + (alpha + beta)));
} else {
tmp = ((1.0 + alpha) / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 7.1: tmp = 0.25 / (1.0 + (2.0 + (alpha + beta))) else: tmp = ((1.0 + alpha) / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 7.1) tmp = Float64(0.25 / Float64(1.0 + Float64(2.0 + Float64(alpha + beta)))); 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 <= 7.1)
tmp = 0.25 / (1.0 + (2.0 + (alpha + beta)));
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, 7.1], N[(0.25 / N[(1.0 + N[(2.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 7.1:\\
\;\;\;\;\frac{0.25}{1 + \left(2 + \left(\alpha + \beta\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 7.0999999999999996Initial program 99.9%
Taylor expanded in beta around 0 98.3%
Taylor expanded in alpha around 0 68.8%
if 7.0999999999999996 < beta Initial program 85.3%
Simplified91.1%
Taylor expanded in beta around inf 82.7%
Taylor expanded in beta around inf 82.5%
un-div-inv82.6%
+-commutative82.6%
Applied egg-rr82.6%
Final simplification73.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.6) (/ 0.25 (+ beta 3.0)) (/ 1.0 (* beta (+ 2.0 beta)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.6) {
tmp = 0.25 / (beta + 3.0);
} else {
tmp = 1.0 / (beta * (2.0 + beta));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 4.6d0) then
tmp = 0.25d0 / (beta + 3.0d0)
else
tmp = 1.0d0 / (beta * (2.0d0 + beta))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 4.6) {
tmp = 0.25 / (beta + 3.0);
} else {
tmp = 1.0 / (beta * (2.0 + beta));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.6: tmp = 0.25 / (beta + 3.0) else: tmp = 1.0 / (beta * (2.0 + beta)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.6) tmp = Float64(0.25 / Float64(beta + 3.0)); else tmp = Float64(1.0 / Float64(beta * Float64(2.0 + beta))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 4.6)
tmp = 0.25 / (beta + 3.0);
else
tmp = 1.0 / (beta * (2.0 + beta));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 4.6], N[(0.25 / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(beta * N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4.6:\\
\;\;\;\;\frac{0.25}{\beta + 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \left(2 + \beta\right)}\\
\end{array}
\end{array}
if beta < 4.5999999999999996Initial program 99.9%
Taylor expanded in beta around 0 98.3%
Taylor expanded in alpha around 0 67.4%
+-commutative67.4%
Simplified67.4%
if 4.5999999999999996 < beta Initial program 85.3%
Simplified91.1%
Taylor expanded in beta around inf 82.7%
Taylor expanded in alpha around 0 75.9%
Final simplification70.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.6) (/ 0.25 (+ beta 3.0)) (/ (/ 1.0 beta) (+ 2.0 beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.6) {
tmp = 0.25 / (beta + 3.0);
} else {
tmp = (1.0 / beta) / (2.0 + beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 4.6d0) then
tmp = 0.25d0 / (beta + 3.0d0)
else
tmp = (1.0d0 / beta) / (2.0d0 + beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 4.6) {
tmp = 0.25 / (beta + 3.0);
} else {
tmp = (1.0 / beta) / (2.0 + beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.6: tmp = 0.25 / (beta + 3.0) else: tmp = (1.0 / beta) / (2.0 + beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.6) tmp = Float64(0.25 / Float64(beta + 3.0)); else tmp = Float64(Float64(1.0 / beta) / Float64(2.0 + beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 4.6)
tmp = 0.25 / (beta + 3.0);
else
tmp = (1.0 / beta) / (2.0 + beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 4.6], N[(0.25 / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / beta), $MachinePrecision] / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4.6:\\
\;\;\;\;\frac{0.25}{\beta + 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta}}{2 + \beta}\\
\end{array}
\end{array}
if beta < 4.5999999999999996Initial program 99.9%
Taylor expanded in beta around 0 98.3%
Taylor expanded in alpha around 0 67.4%
+-commutative67.4%
Simplified67.4%
if 4.5999999999999996 < beta Initial program 85.3%
Simplified91.1%
Taylor expanded in beta around inf 82.7%
Taylor expanded in alpha around 0 75.9%
associate-/r*76.9%
+-commutative76.9%
Simplified76.9%
Final simplification71.0%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 6.5) (/ 0.25 (+ beta 3.0)) (/ (/ (+ 1.0 alpha) beta) beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 6.5) {
tmp = 0.25 / (beta + 3.0);
} 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 <= 6.5d0) then
tmp = 0.25d0 / (beta + 3.0d0)
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 <= 6.5) {
tmp = 0.25 / (beta + 3.0);
} else {
tmp = ((1.0 + alpha) / beta) / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 6.5: tmp = 0.25 / (beta + 3.0) else: tmp = ((1.0 + alpha) / beta) / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 6.5) tmp = Float64(0.25 / Float64(beta + 3.0)); 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 <= 6.5)
tmp = 0.25 / (beta + 3.0);
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, 6.5], N[(0.25 / N[(beta + 3.0), $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 6.5:\\
\;\;\;\;\frac{0.25}{\beta + 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta}\\
\end{array}
\end{array}
if beta < 6.5Initial program 99.9%
Taylor expanded in beta around 0 98.3%
Taylor expanded in alpha around 0 67.4%
+-commutative67.4%
Simplified67.4%
if 6.5 < beta Initial program 85.3%
Simplified91.1%
Taylor expanded in beta around inf 82.7%
Taylor expanded in beta around inf 82.5%
un-div-inv82.6%
+-commutative82.6%
Applied egg-rr82.6%
Final simplification73.1%
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.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
metadata-eval99.5%
+-commutative99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in beta around -inf 30.3%
Taylor expanded in alpha around 0 14.3%
+-commutative14.3%
+-commutative14.3%
Simplified14.3%
Taylor expanded in beta around 0 14.2%
if 6 < beta Initial program 85.3%
Simplified91.1%
Taylor expanded in beta around inf 82.7%
Taylor expanded in alpha around inf 6.9%
Final simplification11.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.16666666666666666 (+ 2.0 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.16666666666666666 / (2.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 = 0.16666666666666666d0 / (2.0d0 + beta)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.16666666666666666 / (2.0 + beta);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.16666666666666666 / (2.0 + beta)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.16666666666666666 / Float64(2.0 + beta)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.16666666666666666 / (2.0 + beta);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.16666666666666666 / N[(2.0 + beta), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.16666666666666666}{2 + \beta}
\end{array}
Initial program 94.4%
Simplified96.4%
Taylor expanded in beta around 0 67.4%
+-commutative67.4%
Simplified67.4%
Taylor expanded in alpha around 0 44.8%
+-commutative44.8%
Simplified44.8%
Final simplification44.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ 0.25 (+ beta 3.0)))
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.25 / (beta + 3.0);
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.25d0 / (beta + 3.0d0)
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.25 / (beta + 3.0);
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.25 / (beta + 3.0)
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(0.25 / Float64(beta + 3.0)) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.25 / (beta + 3.0);
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(0.25 / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{0.25}{\beta + 3}
\end{array}
Initial program 94.4%
Taylor expanded in beta around 0 67.5%
Taylor expanded in alpha around 0 45.0%
+-commutative45.0%
Simplified45.0%
Final simplification45.0%
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 94.4%
associate-/l/93.0%
+-commutative93.0%
associate-+l+93.0%
*-commutative93.0%
metadata-eval93.0%
associate-+l+93.0%
metadata-eval93.0%
+-commutative93.0%
metadata-eval93.0%
metadata-eval93.0%
associate-+l+93.0%
Simplified93.0%
Taylor expanded in beta around -inf 49.3%
Taylor expanded in alpha around 0 37.2%
+-commutative37.2%
+-commutative37.2%
Simplified37.2%
Taylor expanded in beta around 0 10.4%
Final simplification10.4%
herbie shell --seed 2024031
(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)))