
(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 (+ alpha (+ beta 2.0)))) (/ (/ (/ (+ 1.0 alpha) t_0) (/ t_0 (+ 1.0 beta))) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return (((1.0 + alpha) / t_0) / (t_0 / (1.0 + beta))) / (alpha + (beta + 3.0));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
t_0 = alpha + (beta + 2.0d0)
code = (((1.0d0 + alpha) / t_0) / (t_0 / (1.0d0 + beta))) / (alpha + (beta + 3.0d0))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
return (((1.0 + alpha) / t_0) / (t_0 / (1.0 + beta))) / (alpha + (beta + 3.0));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) return (((1.0 + alpha) / t_0) / (t_0 / (1.0 + beta))) / (alpha + (beta + 3.0))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) return Float64(Float64(Float64(Float64(1.0 + alpha) / t_0) / Float64(t_0 / Float64(1.0 + beta))) / Float64(alpha + Float64(beta + 3.0))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = (((1.0 + alpha) / t_0) / (t_0 / (1.0 + beta))) / (alpha + (beta + 3.0));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 / N[(1.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\frac{\frac{\frac{1 + \alpha}{t_0}}{\frac{t_0}{1 + \beta}}}{\alpha + \left(\beta + 3\right)}
\end{array}
\end{array}
Initial program 94.9%
Simplified97.1%
clear-num97.1%
inv-pow97.1%
Applied egg-rr97.1%
unpow-197.1%
associate-/l*99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
expm1-log1p-u99.1%
expm1-udef74.9%
un-div-inv74.9%
associate-/r/74.9%
+-commutative74.9%
+-commutative74.9%
Applied egg-rr74.9%
expm1-def99.1%
expm1-log1p99.1%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta)
:precision binary64
(let* ((t_0 (+ alpha (+ beta 2.0))))
(if (<= beta 3.2e+38)
(/ (/ (+ 1.0 (+ alpha beta)) t_0) (* t_0 (+ 3.0 (+ alpha beta))))
(/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 3.0))))))assert(alpha < beta);
double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 3.2e+38) {
tmp = ((1.0 + (alpha + beta)) / t_0) / (t_0 * (3.0 + (alpha + beta)));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: t_0
real(8) :: tmp
t_0 = alpha + (beta + 2.0d0)
if (beta <= 3.2d+38) then
tmp = ((1.0d0 + (alpha + beta)) / t_0) / (t_0 * (3.0d0 + (alpha + beta)))
else
tmp = ((1.0d0 + alpha) / beta) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double t_0 = alpha + (beta + 2.0);
double tmp;
if (beta <= 3.2e+38) {
tmp = ((1.0 + (alpha + beta)) / t_0) / (t_0 * (3.0 + (alpha + beta)));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): t_0 = alpha + (beta + 2.0) tmp = 0 if beta <= 3.2e+38: tmp = ((1.0 + (alpha + beta)) / t_0) / (t_0 * (3.0 + (alpha + beta))) else: tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) t_0 = Float64(alpha + Float64(beta + 2.0)) tmp = 0.0 if (beta <= 3.2e+38) tmp = Float64(Float64(Float64(1.0 + Float64(alpha + beta)) / t_0) / Float64(t_0 * Float64(3.0 + Float64(alpha + beta)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
t_0 = alpha + (beta + 2.0);
tmp = 0.0;
if (beta <= 3.2e+38)
tmp = ((1.0 + (alpha + beta)) / t_0) / (t_0 * (3.0 + (alpha + beta)));
else
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_] := Block[{t$95$0 = N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 3.2e+38], N[(N[(N[(1.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(t$95$0 * N[(3.0 + N[(alpha + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \alpha + \left(\beta + 2\right)\\
\mathbf{if}\;\beta \leq 3.2 \cdot 10^{+38}:\\
\;\;\;\;\frac{\frac{1 + \left(\alpha + \beta\right)}{t_0}}{t_0 \cdot \left(3 + \left(\alpha + \beta\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 3.19999999999999985e38Initial program 99.8%
associate-/l/98.8%
+-commutative98.8%
associate-+l+98.8%
*-commutative98.8%
metadata-eval98.8%
associate-+l+98.8%
metadata-eval98.8%
+-commutative98.8%
metadata-eval98.8%
metadata-eval98.8%
associate-+l+98.8%
Simplified98.8%
Taylor expanded in alpha around 0 96.7%
if 3.19999999999999985e38 < beta Initial program 82.6%
Simplified92.8%
clear-num92.8%
inv-pow92.8%
Applied egg-rr92.8%
unpow-192.8%
associate-/l*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
expm1-log1p-u99.8%
expm1-udef62.7%
un-div-inv62.7%
associate-/r/62.7%
+-commutative62.7%
+-commutative62.7%
Applied egg-rr62.7%
expm1-def99.9%
expm1-log1p99.9%
associate-/r*99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
div-inv99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in beta around inf 89.7%
Final simplification94.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (/ (/ (/ (+ 1.0 alpha) (+ alpha (+ beta 2.0))) (/ (+ beta 2.0) (+ 1.0 beta))) (+ alpha (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
return (((1.0 + alpha) / (alpha + (beta + 2.0))) / ((beta + 2.0) / (1.0 + beta))) / (alpha + (beta + 3.0));
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = (((1.0d0 + alpha) / (alpha + (beta + 2.0d0))) / ((beta + 2.0d0) / (1.0d0 + beta))) / (alpha + (beta + 3.0d0))
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return (((1.0 + alpha) / (alpha + (beta + 2.0))) / ((beta + 2.0) / (1.0 + beta))) / (alpha + (beta + 3.0));
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return (((1.0 + alpha) / (alpha + (beta + 2.0))) / ((beta + 2.0) / (1.0 + beta))) / (alpha + (beta + 3.0))
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return Float64(Float64(Float64(Float64(1.0 + alpha) / Float64(alpha + Float64(beta + 2.0))) / Float64(Float64(beta + 2.0) / Float64(1.0 + beta))) / Float64(alpha + Float64(beta + 3.0))) end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = (((1.0 + alpha) / (alpha + (beta + 2.0))) / ((beta + 2.0) / (1.0 + beta))) / (alpha + (beta + 3.0));
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := N[(N[(N[(N[(1.0 + alpha), $MachinePrecision] / N[(alpha + N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] / N[(1.0 + beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\frac{\frac{\frac{1 + \alpha}{\alpha + \left(\beta + 2\right)}}{\frac{\beta + 2}{1 + \beta}}}{\alpha + \left(\beta + 3\right)}
\end{array}
Initial program 94.9%
Simplified97.1%
clear-num97.1%
inv-pow97.1%
Applied egg-rr97.1%
unpow-197.1%
associate-/l*99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
expm1-log1p-u99.1%
expm1-udef74.9%
un-div-inv74.9%
associate-/r/74.9%
+-commutative74.9%
+-commutative74.9%
Applied egg-rr74.9%
expm1-def99.1%
expm1-log1p99.1%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in alpha around 0 74.5%
+-commutative74.5%
Simplified74.5%
Final simplification74.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 7.2e+15) (/ (+ 1.0 beta) (* (+ beta 2.0) (* (+ beta 2.0) (+ beta 3.0)))) (/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 7.2e+15) {
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 7.2d+15) then
tmp = (1.0d0 + beta) / ((beta + 2.0d0) * ((beta + 2.0d0) * (beta + 3.0d0)))
else
tmp = ((1.0d0 + alpha) / beta) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 7.2e+15) {
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0)));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 7.2e+15: tmp = (1.0 + beta) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0))) else: tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 7.2e+15) tmp = Float64(Float64(1.0 + beta) / Float64(Float64(beta + 2.0) * Float64(Float64(beta + 2.0) * Float64(beta + 3.0)))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 7.2e+15)
tmp = (1.0 + beta) / ((beta + 2.0) * ((beta + 2.0) * (beta + 3.0)));
else
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 7.2e+15], N[(N[(1.0 + beta), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 7.2 \cdot 10^{+15}:\\
\;\;\;\;\frac{1 + \beta}{\left(\beta + 2\right) \cdot \left(\left(\beta + 2\right) \cdot \left(\beta + 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 7.2e15Initial program 99.8%
Simplified98.8%
clear-num98.8%
associate-+r+98.8%
*-commutative98.8%
frac-times98.8%
*-un-lft-identity98.8%
+-commutative98.8%
*-commutative98.8%
associate-+r+98.8%
Applied egg-rr98.8%
Taylor expanded in alpha around 0 85.8%
+-commutative85.8%
Simplified85.8%
Taylor expanded in alpha around 0 67.2%
if 7.2e15 < beta Initial program 84.1%
Simplified93.4%
clear-num93.4%
inv-pow93.4%
Applied egg-rr93.4%
unpow-193.4%
associate-/l*99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
expm1-log1p-u99.7%
expm1-udef58.8%
un-div-inv58.8%
associate-/r/58.8%
+-commutative58.8%
+-commutative58.8%
Applied egg-rr58.8%
expm1-def99.8%
expm1-log1p99.8%
associate-/r*99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
div-inv99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in beta around inf 88.1%
Final simplification73.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 5e+38) (/ (/ (+ 1.0 beta) (+ beta 2.0)) (* (+ beta 2.0) (+ beta 3.0))) (/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 5e+38) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 5d+38) then
tmp = ((1.0d0 + beta) / (beta + 2.0d0)) / ((beta + 2.0d0) * (beta + 3.0d0))
else
tmp = ((1.0d0 + alpha) / beta) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 5e+38) {
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 5e+38: tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0)) else: tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 5e+38) tmp = Float64(Float64(Float64(1.0 + beta) / Float64(beta + 2.0)) / Float64(Float64(beta + 2.0) * Float64(beta + 3.0))); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 5e+38)
tmp = ((1.0 + beta) / (beta + 2.0)) / ((beta + 2.0) * (beta + 3.0));
else
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 5e+38], N[(N[(N[(1.0 + beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(beta + 2.0), $MachinePrecision] * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 5 \cdot 10^{+38}:\\
\;\;\;\;\frac{\frac{1 + \beta}{\beta + 2}}{\left(\beta + 2\right) \cdot \left(\beta + 3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 4.9999999999999997e38Initial program 99.8%
associate-/l/98.8%
+-commutative98.8%
associate-+l+98.8%
*-commutative98.8%
metadata-eval98.8%
associate-+l+98.8%
metadata-eval98.8%
+-commutative98.8%
metadata-eval98.8%
metadata-eval98.8%
associate-+l+98.8%
Simplified98.8%
Taylor expanded in alpha around 0 85.8%
Taylor expanded in alpha around 0 67.4%
+-commutative67.4%
+-commutative67.4%
Simplified67.4%
if 4.9999999999999997e38 < beta Initial program 82.6%
Simplified92.8%
clear-num92.8%
inv-pow92.8%
Applied egg-rr92.8%
unpow-192.8%
associate-/l*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
expm1-log1p-u99.8%
expm1-udef62.7%
un-div-inv62.7%
associate-/r/62.7%
+-commutative62.7%
+-commutative62.7%
Applied egg-rr62.7%
expm1-def99.9%
expm1-log1p99.9%
associate-/r*99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
div-inv99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in beta around inf 89.7%
Final simplification73.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.5) (/ 0.25 (+ alpha 3.0)) (/ (/ (+ 1.0 alpha) beta) (+ alpha (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = 0.25 / (alpha + 3.0);
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.5d0) then
tmp = 0.25d0 / (alpha + 3.0d0)
else
tmp = ((1.0d0 + alpha) / beta) / (alpha + (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.5) {
tmp = 0.25 / (alpha + 3.0);
} else {
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.5: tmp = 0.25 / (alpha + 3.0) else: tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.5) tmp = Float64(0.25 / Float64(alpha + 3.0)); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(alpha + Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.5)
tmp = 0.25 / (alpha + 3.0);
else
tmp = ((1.0 + alpha) / beta) / (alpha + (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.5], N[(0.25 / N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(alpha + N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.5:\\
\;\;\;\;\frac{0.25}{\alpha + 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\alpha + \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 2.5Initial program 99.9%
associate-/l/98.8%
+-commutative98.8%
associate-+l+98.8%
*-commutative98.8%
metadata-eval98.8%
associate-+l+98.8%
metadata-eval98.8%
+-commutative98.8%
metadata-eval98.8%
metadata-eval98.8%
associate-+l+98.8%
Simplified98.8%
Taylor expanded in alpha around 0 85.7%
Taylor expanded in beta around 0 84.7%
associate-/r*84.8%
Simplified84.8%
Taylor expanded in alpha around 0 67.8%
if 2.5 < beta Initial program 84.4%
Simplified93.6%
clear-num93.5%
inv-pow93.5%
Applied egg-rr93.5%
unpow-193.5%
associate-/l*99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
expm1-log1p-u99.7%
expm1-udef57.5%
un-div-inv57.5%
associate-/r/57.5%
+-commutative57.5%
+-commutative57.5%
Applied egg-rr57.5%
expm1-def99.8%
expm1-log1p99.8%
associate-/r*99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
div-inv99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in beta around inf 87.6%
Final simplification74.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 3.85) (/ 0.25 (+ alpha 3.0)) (* (/ (+ 1.0 alpha) beta) (/ 1.0 beta))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 3.85) {
tmp = 0.25 / (alpha + 3.0);
} else {
tmp = ((1.0 + alpha) / beta) * (1.0 / beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 3.85d0) then
tmp = 0.25d0 / (alpha + 3.0d0)
else
tmp = ((1.0d0 + alpha) / beta) * (1.0d0 / beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 3.85) {
tmp = 0.25 / (alpha + 3.0);
} else {
tmp = ((1.0 + alpha) / beta) * (1.0 / beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 3.85: tmp = 0.25 / (alpha + 3.0) else: tmp = ((1.0 + alpha) / beta) * (1.0 / beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 3.85) tmp = Float64(0.25 / Float64(alpha + 3.0)); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) * Float64(1.0 / beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 3.85)
tmp = 0.25 / (alpha + 3.0);
else
tmp = ((1.0 + alpha) / beta) * (1.0 / beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 3.85], N[(0.25 / N[(alpha + 3.0), $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 3.85:\\
\;\;\;\;\frac{0.25}{\alpha + 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \alpha}{\beta} \cdot \frac{1}{\beta}\\
\end{array}
\end{array}
if beta < 3.85000000000000009Initial program 99.9%
associate-/l/98.8%
+-commutative98.8%
associate-+l+98.8%
*-commutative98.8%
metadata-eval98.8%
associate-+l+98.8%
metadata-eval98.8%
+-commutative98.8%
metadata-eval98.8%
metadata-eval98.8%
associate-+l+98.8%
Simplified98.8%
Taylor expanded in alpha around 0 85.7%
Taylor expanded in beta around 0 84.7%
associate-/r*84.8%
Simplified84.8%
Taylor expanded in alpha around 0 67.8%
if 3.85000000000000009 < beta Initial program 84.4%
Simplified93.6%
Taylor expanded in beta around inf 87.4%
Taylor expanded in beta around inf 87.3%
Final simplification74.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.7) (/ 0.25 (+ alpha 3.0)) (/ (/ (+ 1.0 alpha) beta) (+ beta 3.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.7) {
tmp = 0.25 / (alpha + 3.0);
} else {
tmp = ((1.0 + alpha) / beta) / (beta + 3.0);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.7d0) then
tmp = 0.25d0 / (alpha + 3.0d0)
else
tmp = ((1.0d0 + alpha) / beta) / (beta + 3.0d0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.7) {
tmp = 0.25 / (alpha + 3.0);
} else {
tmp = ((1.0 + alpha) / beta) / (beta + 3.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.7: tmp = 0.25 / (alpha + 3.0) else: tmp = ((1.0 + alpha) / beta) / (beta + 3.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.7) tmp = Float64(0.25 / Float64(alpha + 3.0)); else tmp = Float64(Float64(Float64(1.0 + alpha) / beta) / Float64(beta + 3.0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.7)
tmp = 0.25 / (alpha + 3.0);
else
tmp = ((1.0 + alpha) / beta) / (beta + 3.0);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.7], N[(0.25 / N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.7:\\
\;\;\;\;\frac{0.25}{\alpha + 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \alpha}{\beta}}{\beta + 3}\\
\end{array}
\end{array}
if beta < 2.7000000000000002Initial program 99.9%
associate-/l/98.8%
+-commutative98.8%
associate-+l+98.8%
*-commutative98.8%
metadata-eval98.8%
associate-+l+98.8%
metadata-eval98.8%
+-commutative98.8%
metadata-eval98.8%
metadata-eval98.8%
associate-+l+98.8%
Simplified98.8%
Taylor expanded in alpha around 0 85.7%
Taylor expanded in beta around 0 84.7%
associate-/r*84.8%
Simplified84.8%
Taylor expanded in alpha around 0 67.8%
if 2.7000000000000002 < beta Initial program 84.4%
Taylor expanded in beta around -inf 87.6%
Taylor expanded in alpha around 0 87.5%
Final simplification74.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.4) (/ 0.25 (+ alpha 3.0)) (/ 1.0 (* beta (+ beta 3.0)))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.4) {
tmp = 0.25 / (alpha + 3.0);
} else {
tmp = 1.0 / (beta * (beta + 3.0));
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.4d0) then
tmp = 0.25d0 / (alpha + 3.0d0)
else
tmp = 1.0d0 / (beta * (beta + 3.0d0))
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.4) {
tmp = 0.25 / (alpha + 3.0);
} else {
tmp = 1.0 / (beta * (beta + 3.0));
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.4: tmp = 0.25 / (alpha + 3.0) else: tmp = 1.0 / (beta * (beta + 3.0)) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.4) tmp = Float64(0.25 / Float64(alpha + 3.0)); else tmp = Float64(1.0 / Float64(beta * Float64(beta + 3.0))); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.4)
tmp = 0.25 / (alpha + 3.0);
else
tmp = 1.0 / (beta * (beta + 3.0));
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.4], N[(0.25 / N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(beta * N[(beta + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.4:\\
\;\;\;\;\frac{0.25}{\alpha + 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\beta \cdot \left(\beta + 3\right)}\\
\end{array}
\end{array}
if beta < 2.39999999999999991Initial program 99.9%
associate-/l/98.8%
+-commutative98.8%
associate-+l+98.8%
*-commutative98.8%
metadata-eval98.8%
associate-+l+98.8%
metadata-eval98.8%
+-commutative98.8%
metadata-eval98.8%
metadata-eval98.8%
associate-+l+98.8%
Simplified98.8%
Taylor expanded in alpha around 0 85.7%
Taylor expanded in beta around 0 84.7%
associate-/r*84.8%
Simplified84.8%
Taylor expanded in alpha around 0 67.8%
if 2.39999999999999991 < beta Initial program 84.4%
Taylor expanded in beta around -inf 87.6%
Taylor expanded in alpha around 0 82.6%
+-commutative82.6%
Simplified82.6%
Final simplification72.6%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.8) (/ 0.25 (+ alpha 3.0)) (/ (/ 1.0 beta) (+ beta 2.0))))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.8) {
tmp = 0.25 / (alpha + 3.0);
} else {
tmp = (1.0 / beta) / (beta + 2.0);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8) :: tmp
if (beta <= 2.8d0) then
tmp = 0.25d0 / (alpha + 3.0d0)
else
tmp = (1.0d0 / beta) / (beta + 2.0d0)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.8) {
tmp = 0.25 / (alpha + 3.0);
} else {
tmp = (1.0 / beta) / (beta + 2.0);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.8: tmp = 0.25 / (alpha + 3.0) else: tmp = (1.0 / beta) / (beta + 2.0) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.8) tmp = Float64(0.25 / Float64(alpha + 3.0)); else tmp = Float64(Float64(1.0 / beta) / Float64(beta + 2.0)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.8)
tmp = 0.25 / (alpha + 3.0);
else
tmp = (1.0 / beta) / (beta + 2.0);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := If[LessEqual[beta, 2.8], N[(0.25 / N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / beta), $MachinePrecision] / N[(beta + 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.8:\\
\;\;\;\;\frac{0.25}{\alpha + 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\beta}}{\beta + 2}\\
\end{array}
\end{array}
if beta < 2.7999999999999998Initial program 99.9%
associate-/l/98.8%
+-commutative98.8%
associate-+l+98.8%
*-commutative98.8%
metadata-eval98.8%
associate-+l+98.8%
metadata-eval98.8%
+-commutative98.8%
metadata-eval98.8%
metadata-eval98.8%
associate-+l+98.8%
Simplified98.8%
Taylor expanded in alpha around 0 85.7%
Taylor expanded in beta around 0 84.7%
associate-/r*84.8%
Simplified84.8%
Taylor expanded in alpha around 0 67.8%
if 2.7999999999999998 < beta Initial program 84.4%
Simplified93.6%
Taylor expanded in beta around inf 87.4%
Taylor expanded in alpha around 0 82.6%
associate-/r*83.2%
+-commutative83.2%
Simplified83.2%
Final simplification72.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 2.75e+66) 0.08333333333333333 (* (/ alpha beta) 0.3333333333333333)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 2.75e+66) {
tmp = 0.08333333333333333;
} else {
tmp = (alpha / beta) * 0.3333333333333333;
}
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.75d+66) then
tmp = 0.08333333333333333d0
else
tmp = (alpha / beta) * 0.3333333333333333d0
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 2.75e+66) {
tmp = 0.08333333333333333;
} else {
tmp = (alpha / beta) * 0.3333333333333333;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 2.75e+66: tmp = 0.08333333333333333 else: tmp = (alpha / beta) * 0.3333333333333333 return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 2.75e+66) tmp = 0.08333333333333333; else tmp = Float64(Float64(alpha / beta) * 0.3333333333333333); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 2.75e+66)
tmp = 0.08333333333333333;
else
tmp = (alpha / beta) * 0.3333333333333333;
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.75e+66], 0.08333333333333333, N[(N[(alpha / beta), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2.75 \cdot 10^{+66}:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{\alpha}{\beta} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if beta < 2.75e66Initial program 99.8%
associate-/l/98.9%
+-commutative98.9%
associate-+l+98.9%
*-commutative98.9%
metadata-eval98.9%
associate-+l+98.9%
metadata-eval98.9%
+-commutative98.9%
metadata-eval98.9%
metadata-eval98.9%
associate-+l+98.9%
Simplified98.9%
Taylor expanded in alpha around 0 85.6%
Taylor expanded in beta around 0 79.9%
associate-/r*79.9%
Simplified79.9%
Taylor expanded in alpha around 0 61.4%
if 2.75e66 < beta Initial program 81.4%
Taylor expanded in beta around -inf 91.7%
Taylor expanded in alpha around 0 91.6%
Taylor expanded in beta around 0 5.7%
sub-neg5.7%
mul-1-neg5.7%
distribute-neg-in5.7%
+-commutative5.7%
distribute-neg-in5.7%
metadata-eval5.7%
unsub-neg5.7%
Simplified5.7%
Taylor expanded in alpha around inf 37.0%
*-commutative37.0%
Simplified37.0%
Final simplification54.9%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 1.9e+69) (/ 0.25 (+ alpha 3.0)) (* (/ alpha beta) 0.3333333333333333)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 1.9e+69) {
tmp = 0.25 / (alpha + 3.0);
} else {
tmp = (alpha / beta) * 0.3333333333333333;
}
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.9d+69) then
tmp = 0.25d0 / (alpha + 3.0d0)
else
tmp = (alpha / beta) * 0.3333333333333333d0
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 1.9e+69) {
tmp = 0.25 / (alpha + 3.0);
} else {
tmp = (alpha / beta) * 0.3333333333333333;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 1.9e+69: tmp = 0.25 / (alpha + 3.0) else: tmp = (alpha / beta) * 0.3333333333333333 return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 1.9e+69) tmp = Float64(0.25 / Float64(alpha + 3.0)); else tmp = Float64(Float64(alpha / beta) * 0.3333333333333333); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 1.9e+69)
tmp = 0.25 / (alpha + 3.0);
else
tmp = (alpha / beta) * 0.3333333333333333;
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.9e+69], N[(0.25 / N[(alpha + 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(alpha / beta), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.9 \cdot 10^{+69}:\\
\;\;\;\;\frac{0.25}{\alpha + 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\alpha}{\beta} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if beta < 1.90000000000000014e69Initial program 99.8%
associate-/l/98.9%
+-commutative98.9%
associate-+l+98.9%
*-commutative98.9%
metadata-eval98.9%
associate-+l+98.9%
metadata-eval98.9%
+-commutative98.9%
metadata-eval98.9%
metadata-eval98.9%
associate-+l+98.9%
Simplified98.9%
Taylor expanded in alpha around 0 85.6%
Taylor expanded in beta around 0 79.9%
associate-/r*79.9%
Simplified79.9%
Taylor expanded in alpha around 0 63.2%
if 1.90000000000000014e69 < beta Initial program 81.4%
Taylor expanded in beta around -inf 91.7%
Taylor expanded in alpha around 0 91.6%
Taylor expanded in beta around 0 5.7%
sub-neg5.7%
mul-1-neg5.7%
distribute-neg-in5.7%
+-commutative5.7%
distribute-neg-in5.7%
metadata-eval5.7%
unsub-neg5.7%
Simplified5.7%
Taylor expanded in alpha around inf 37.0%
*-commutative37.0%
Simplified37.0%
Final simplification56.1%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 (if (<= beta 4.0) 0.08333333333333333 (/ 0.3333333333333333 beta)))
assert(alpha < beta);
double code(double alpha, double beta) {
double tmp;
if (beta <= 4.0) {
tmp = 0.08333333333333333;
} else {
tmp = 0.3333333333333333 / 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.0d0) then
tmp = 0.08333333333333333d0
else
tmp = 0.3333333333333333d0 / beta
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
double tmp;
if (beta <= 4.0) {
tmp = 0.08333333333333333;
} else {
tmp = 0.3333333333333333 / beta;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): tmp = 0 if beta <= 4.0: tmp = 0.08333333333333333 else: tmp = 0.3333333333333333 / beta return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta) tmp = 0.0 if (beta <= 4.0) tmp = 0.08333333333333333; else tmp = Float64(0.3333333333333333 / beta); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta)
tmp = 0.0;
if (beta <= 4.0)
tmp = 0.08333333333333333;
else
tmp = 0.3333333333333333 / 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.0], 0.08333333333333333, N[(0.3333333333333333 / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4:\\
\;\;\;\;0.08333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333}{\beta}\\
\end{array}
\end{array}
if beta < 4Initial program 99.9%
associate-/l/98.8%
+-commutative98.8%
associate-+l+98.8%
*-commutative98.8%
metadata-eval98.8%
associate-+l+98.8%
metadata-eval98.8%
+-commutative98.8%
metadata-eval98.8%
metadata-eval98.8%
associate-+l+98.8%
Simplified98.8%
Taylor expanded in alpha around 0 85.7%
Taylor expanded in beta around 0 84.7%
associate-/r*84.8%
Simplified84.8%
Taylor expanded in alpha around 0 65.9%
if 4 < beta Initial program 84.4%
Taylor expanded in beta around -inf 87.6%
Taylor expanded in alpha around 0 87.5%
Taylor expanded in beta around 0 5.9%
sub-neg5.9%
mul-1-neg5.9%
distribute-neg-in5.9%
+-commutative5.9%
distribute-neg-in5.9%
metadata-eval5.9%
unsub-neg5.9%
Simplified5.9%
Taylor expanded in alpha around 0 6.5%
Final simplification46.7%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta) :precision binary64 0.08333333333333333)
assert(alpha < beta);
double code(double alpha, double beta) {
return 0.08333333333333333;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
code = 0.08333333333333333d0
end function
assert alpha < beta;
public static double code(double alpha, double beta) {
return 0.08333333333333333;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta): return 0.08333333333333333
alpha, beta = sort([alpha, beta]) function code(alpha, beta) return 0.08333333333333333 end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta)
tmp = 0.08333333333333333;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_] := 0.08333333333333333
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
0.08333333333333333
\end{array}
Initial program 94.9%
associate-/l/93.8%
+-commutative93.8%
associate-+l+93.8%
*-commutative93.8%
metadata-eval93.8%
associate-+l+93.8%
metadata-eval93.8%
+-commutative93.8%
metadata-eval93.8%
metadata-eval93.8%
associate-+l+93.8%
Simplified93.8%
Taylor expanded in alpha around 0 86.7%
Taylor expanded in beta around 0 61.3%
associate-/r*61.3%
Simplified61.3%
Taylor expanded in alpha around 0 45.8%
Final simplification45.8%
herbie shell --seed 2024024
(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)))