
(FPCore (alpha beta i)
:precision binary64
(let* ((t_0 (* i (+ (+ alpha beta) i)))
(t_1 (+ (+ alpha beta) (* 2.0 i)))
(t_2 (* t_1 t_1)))
(/ (/ (* t_0 (+ (* beta alpha) t_0)) t_2) (- t_2 1.0))))
double code(double alpha, double beta, double i) {
double t_0 = i * ((alpha + beta) + i);
double t_1 = (alpha + beta) + (2.0 * i);
double t_2 = t_1 * t_1;
return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0);
}
real(8) function code(alpha, beta, i)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = i * ((alpha + beta) + i)
t_1 = (alpha + beta) + (2.0d0 * i)
t_2 = t_1 * t_1
code = ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0d0)
end function
public static double code(double alpha, double beta, double i) {
double t_0 = i * ((alpha + beta) + i);
double t_1 = (alpha + beta) + (2.0 * i);
double t_2 = t_1 * t_1;
return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0);
}
def code(alpha, beta, i): t_0 = i * ((alpha + beta) + i) t_1 = (alpha + beta) + (2.0 * i) t_2 = t_1 * t_1 return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0)
function code(alpha, beta, i) t_0 = Float64(i * Float64(Float64(alpha + beta) + i)) t_1 = Float64(Float64(alpha + beta) + Float64(2.0 * i)) t_2 = Float64(t_1 * t_1) return Float64(Float64(Float64(t_0 * Float64(Float64(beta * alpha) + t_0)) / t_2) / Float64(t_2 - 1.0)) end
function tmp = code(alpha, beta, i) t_0 = i * ((alpha + beta) + i); t_1 = (alpha + beta) + (2.0 * i); t_2 = t_1 * t_1; tmp = ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0); end
code[alpha_, beta_, i_] := Block[{t$95$0 = N[(i * N[(N[(alpha + beta), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * t$95$1), $MachinePrecision]}, N[(N[(N[(t$95$0 * N[(N[(beta * alpha), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] / N[(t$95$2 - 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := i \cdot \left(\left(\alpha + \beta\right) + i\right)\\
t_1 := \left(\alpha + \beta\right) + 2 \cdot i\\
t_2 := t_1 \cdot t_1\\
\frac{\frac{t_0 \cdot \left(\beta \cdot \alpha + t_0\right)}{t_2}}{t_2 - 1}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (alpha beta i)
:precision binary64
(let* ((t_0 (* i (+ (+ alpha beta) i)))
(t_1 (+ (+ alpha beta) (* 2.0 i)))
(t_2 (* t_1 t_1)))
(/ (/ (* t_0 (+ (* beta alpha) t_0)) t_2) (- t_2 1.0))))
double code(double alpha, double beta, double i) {
double t_0 = i * ((alpha + beta) + i);
double t_1 = (alpha + beta) + (2.0 * i);
double t_2 = t_1 * t_1;
return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0);
}
real(8) function code(alpha, beta, i)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = i * ((alpha + beta) + i)
t_1 = (alpha + beta) + (2.0d0 * i)
t_2 = t_1 * t_1
code = ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0d0)
end function
public static double code(double alpha, double beta, double i) {
double t_0 = i * ((alpha + beta) + i);
double t_1 = (alpha + beta) + (2.0 * i);
double t_2 = t_1 * t_1;
return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0);
}
def code(alpha, beta, i): t_0 = i * ((alpha + beta) + i) t_1 = (alpha + beta) + (2.0 * i) t_2 = t_1 * t_1 return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0)
function code(alpha, beta, i) t_0 = Float64(i * Float64(Float64(alpha + beta) + i)) t_1 = Float64(Float64(alpha + beta) + Float64(2.0 * i)) t_2 = Float64(t_1 * t_1) return Float64(Float64(Float64(t_0 * Float64(Float64(beta * alpha) + t_0)) / t_2) / Float64(t_2 - 1.0)) end
function tmp = code(alpha, beta, i) t_0 = i * ((alpha + beta) + i); t_1 = (alpha + beta) + (2.0 * i); t_2 = t_1 * t_1; tmp = ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0); end
code[alpha_, beta_, i_] := Block[{t$95$0 = N[(i * N[(N[(alpha + beta), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * t$95$1), $MachinePrecision]}, N[(N[(N[(t$95$0 * N[(N[(beta * alpha), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] / N[(t$95$2 - 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := i \cdot \left(\left(\alpha + \beta\right) + i\right)\\
t_1 := \left(\alpha + \beta\right) + 2 \cdot i\\
t_2 := t_1 \cdot t_1\\
\frac{\frac{t_0 \cdot \left(\beta \cdot \alpha + t_0\right)}{t_2}}{t_2 - 1}
\end{array}
\end{array}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta i)
:precision binary64
(let* ((t_0 (+ i (+ beta alpha))) (t_1 (+ alpha (fma i 2.0 beta))))
(if (<= beta 7.2e+109)
0.0625
(if (<= beta 1.45e+129)
(*
(/ i (fma t_1 t_1 -1.0))
(* (/ (fma i t_0 (* beta alpha)) t_1) (/ t_0 t_1)))
(if (<= beta 3.5e+194) 0.0625 (/ (/ (+ i alpha) beta) (/ beta i)))))))assert(alpha < beta);
double code(double alpha, double beta, double i) {
double t_0 = i + (beta + alpha);
double t_1 = alpha + fma(i, 2.0, beta);
double tmp;
if (beta <= 7.2e+109) {
tmp = 0.0625;
} else if (beta <= 1.45e+129) {
tmp = (i / fma(t_1, t_1, -1.0)) * ((fma(i, t_0, (beta * alpha)) / t_1) * (t_0 / t_1));
} else if (beta <= 3.5e+194) {
tmp = 0.0625;
} else {
tmp = ((i + alpha) / beta) / (beta / i);
}
return tmp;
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta, i) t_0 = Float64(i + Float64(beta + alpha)) t_1 = Float64(alpha + fma(i, 2.0, beta)) tmp = 0.0 if (beta <= 7.2e+109) tmp = 0.0625; elseif (beta <= 1.45e+129) tmp = Float64(Float64(i / fma(t_1, t_1, -1.0)) * Float64(Float64(fma(i, t_0, Float64(beta * alpha)) / t_1) * Float64(t_0 / t_1))); elseif (beta <= 3.5e+194) tmp = 0.0625; else tmp = Float64(Float64(Float64(i + alpha) / beta) / Float64(beta / i)); end return tmp end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_, i_] := Block[{t$95$0 = N[(i + N[(beta + alpha), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(alpha + N[(i * 2.0 + beta), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 7.2e+109], 0.0625, If[LessEqual[beta, 1.45e+129], N[(N[(i / N[(t$95$1 * t$95$1 + -1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(i * t$95$0 + N[(beta * alpha), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(t$95$0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[beta, 3.5e+194], 0.0625, N[(N[(N[(i + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta / i), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := i + \left(\beta + \alpha\right)\\
t_1 := \alpha + \mathsf{fma}\left(i, 2, \beta\right)\\
\mathbf{if}\;\beta \leq 7.2 \cdot 10^{+109}:\\
\;\;\;\;0.0625\\
\mathbf{elif}\;\beta \leq 1.45 \cdot 10^{+129}:\\
\;\;\;\;\frac{i}{\mathsf{fma}\left(t_1, t_1, -1\right)} \cdot \left(\frac{\mathsf{fma}\left(i, t_0, \beta \cdot \alpha\right)}{t_1} \cdot \frac{t_0}{t_1}\right)\\
\mathbf{elif}\;\beta \leq 3.5 \cdot 10^{+194}:\\
\;\;\;\;0.0625\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{i + \alpha}{\beta}}{\frac{\beta}{i}}\\
\end{array}
\end{array}
if beta < 7.2e109 or 1.45000000000000001e129 < beta < 3.4999999999999997e194Initial program 17.6%
associate-/l/17.1%
associate-*l*17.0%
times-frac22.0%
Simplified37.0%
Taylor expanded in i around inf 80.4%
if 7.2e109 < beta < 1.45000000000000001e129Initial program 2.0%
associate-/l/0.0%
associate-*l*0.0%
times-frac34.4%
Simplified77.8%
if 3.4999999999999997e194 < beta Initial program 0.0%
associate-/l/0.0%
associate-*l*0.0%
times-frac0.0%
Simplified15.8%
Taylor expanded in beta around inf 38.9%
*-commutative38.9%
associate-/l*41.0%
+-commutative41.0%
unpow241.0%
Simplified41.0%
*-un-lft-identity41.0%
associate-/l*52.7%
Applied egg-rr52.7%
*-lft-identity52.7%
associate-/r/52.7%
Simplified52.7%
Taylor expanded in beta around 0 38.9%
*-commutative38.9%
associate-/l*41.0%
unpow241.0%
associate-*r/52.7%
associate-/r*79.7%
+-commutative79.7%
Simplified79.7%
Final simplification80.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta i)
:precision binary64
(let* ((t_0 (+ (+ beta alpha) (* i 2.0))))
(if (<= beta 9.5e+109)
0.0625
(if (<= beta 1.38e+129)
(/
(-
(+
(fma i (+ i alpha) (/ (* i i) (/ beta (+ i alpha))))
(/ (pow (+ i alpha) 2.0) (/ beta i)))
(/ i (/ beta (* (+ i alpha) (fma 4.0 i (* alpha 2.0))))))
(+ -1.0 (* t_0 t_0)))
(if (<= beta 3.5e+194) 0.0625 (/ (/ (+ i alpha) beta) (/ beta i)))))))assert(alpha < beta);
double code(double alpha, double beta, double i) {
double t_0 = (beta + alpha) + (i * 2.0);
double tmp;
if (beta <= 9.5e+109) {
tmp = 0.0625;
} else if (beta <= 1.38e+129) {
tmp = ((fma(i, (i + alpha), ((i * i) / (beta / (i + alpha)))) + (pow((i + alpha), 2.0) / (beta / i))) - (i / (beta / ((i + alpha) * fma(4.0, i, (alpha * 2.0)))))) / (-1.0 + (t_0 * t_0));
} else if (beta <= 3.5e+194) {
tmp = 0.0625;
} else {
tmp = ((i + alpha) / beta) / (beta / i);
}
return tmp;
}
alpha, beta = sort([alpha, beta]) function code(alpha, beta, i) t_0 = Float64(Float64(beta + alpha) + Float64(i * 2.0)) tmp = 0.0 if (beta <= 9.5e+109) tmp = 0.0625; elseif (beta <= 1.38e+129) tmp = Float64(Float64(Float64(fma(i, Float64(i + alpha), Float64(Float64(i * i) / Float64(beta / Float64(i + alpha)))) + Float64((Float64(i + alpha) ^ 2.0) / Float64(beta / i))) - Float64(i / Float64(beta / Float64(Float64(i + alpha) * fma(4.0, i, Float64(alpha * 2.0)))))) / Float64(-1.0 + Float64(t_0 * t_0))); elseif (beta <= 3.5e+194) tmp = 0.0625; else tmp = Float64(Float64(Float64(i + alpha) / beta) / Float64(beta / i)); end return tmp end
NOTE: alpha and beta should be sorted in increasing order before calling this function.
code[alpha_, beta_, i_] := Block[{t$95$0 = N[(N[(beta + alpha), $MachinePrecision] + N[(i * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[beta, 9.5e+109], 0.0625, If[LessEqual[beta, 1.38e+129], N[(N[(N[(N[(i * N[(i + alpha), $MachinePrecision] + N[(N[(i * i), $MachinePrecision] / N[(beta / N[(i + alpha), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[(i + alpha), $MachinePrecision], 2.0], $MachinePrecision] / N[(beta / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i / N[(beta / N[(N[(i + alpha), $MachinePrecision] * N[(4.0 * i + N[(alpha * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 + N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[beta, 3.5e+194], 0.0625, N[(N[(N[(i + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta / i), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
t_0 := \left(\beta + \alpha\right) + i \cdot 2\\
\mathbf{if}\;\beta \leq 9.5 \cdot 10^{+109}:\\
\;\;\;\;0.0625\\
\mathbf{elif}\;\beta \leq 1.38 \cdot 10^{+129}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(i, i + \alpha, \frac{i \cdot i}{\frac{\beta}{i + \alpha}}\right) + \frac{{\left(i + \alpha\right)}^{2}}{\frac{\beta}{i}}\right) - \frac{i}{\frac{\beta}{\left(i + \alpha\right) \cdot \mathsf{fma}\left(4, i, \alpha \cdot 2\right)}}}{-1 + t_0 \cdot t_0}\\
\mathbf{elif}\;\beta \leq 3.5 \cdot 10^{+194}:\\
\;\;\;\;0.0625\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{i + \alpha}{\beta}}{\frac{\beta}{i}}\\
\end{array}
\end{array}
if beta < 9.49999999999999972e109 or 1.3800000000000001e129 < beta < 3.4999999999999997e194Initial program 17.6%
associate-/l/17.1%
associate-*l*17.0%
times-frac22.0%
Simplified37.0%
Taylor expanded in i around inf 80.4%
if 9.49999999999999972e109 < beta < 1.3800000000000001e129Initial program 2.0%
Taylor expanded in beta around inf 55.2%
+-commutative55.2%
fma-def55.2%
+-commutative55.2%
*-commutative55.2%
associate-/l*55.2%
unpow255.2%
+-commutative55.2%
associate-/l*55.4%
+-commutative55.4%
associate-/l*77.3%
+-commutative77.3%
fma-def77.3%
*-commutative77.3%
Simplified77.3%
if 3.4999999999999997e194 < beta Initial program 0.0%
associate-/l/0.0%
associate-*l*0.0%
times-frac0.0%
Simplified15.8%
Taylor expanded in beta around inf 38.9%
*-commutative38.9%
associate-/l*41.0%
+-commutative41.0%
unpow241.0%
Simplified41.0%
*-un-lft-identity41.0%
associate-/l*52.7%
Applied egg-rr52.7%
*-lft-identity52.7%
associate-/r/52.7%
Simplified52.7%
Taylor expanded in beta around 0 38.9%
*-commutative38.9%
associate-/l*41.0%
unpow241.0%
associate-*r/52.7%
associate-/r*79.7%
+-commutative79.7%
Simplified79.7%
Final simplification80.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta i)
:precision binary64
(if (<= beta 9.5e+109)
0.0625
(if (<= beta 1.4e+129)
(/ (+ i alpha) (/ (* beta beta) i))
(if (<= beta 1.65e+194) 0.0625 (/ (/ (+ i alpha) beta) (/ beta i))))))assert(alpha < beta);
double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 9.5e+109) {
tmp = 0.0625;
} else if (beta <= 1.4e+129) {
tmp = (i + alpha) / ((beta * beta) / i);
} else if (beta <= 1.65e+194) {
tmp = 0.0625;
} else {
tmp = ((i + alpha) / beta) / (beta / i);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta, i)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
real(8) :: tmp
if (beta <= 9.5d+109) then
tmp = 0.0625d0
else if (beta <= 1.4d+129) then
tmp = (i + alpha) / ((beta * beta) / i)
else if (beta <= 1.65d+194) then
tmp = 0.0625d0
else
tmp = ((i + alpha) / beta) / (beta / i)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 9.5e+109) {
tmp = 0.0625;
} else if (beta <= 1.4e+129) {
tmp = (i + alpha) / ((beta * beta) / i);
} else if (beta <= 1.65e+194) {
tmp = 0.0625;
} else {
tmp = ((i + alpha) / beta) / (beta / i);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta, i): tmp = 0 if beta <= 9.5e+109: tmp = 0.0625 elif beta <= 1.4e+129: tmp = (i + alpha) / ((beta * beta) / i) elif beta <= 1.65e+194: tmp = 0.0625 else: tmp = ((i + alpha) / beta) / (beta / i) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta, i) tmp = 0.0 if (beta <= 9.5e+109) tmp = 0.0625; elseif (beta <= 1.4e+129) tmp = Float64(Float64(i + alpha) / Float64(Float64(beta * beta) / i)); elseif (beta <= 1.65e+194) tmp = 0.0625; else tmp = Float64(Float64(Float64(i + alpha) / beta) / Float64(beta / i)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta, i)
tmp = 0.0;
if (beta <= 9.5e+109)
tmp = 0.0625;
elseif (beta <= 1.4e+129)
tmp = (i + alpha) / ((beta * beta) / i);
elseif (beta <= 1.65e+194)
tmp = 0.0625;
else
tmp = ((i + alpha) / beta) / (beta / i);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_, i_] := If[LessEqual[beta, 9.5e+109], 0.0625, If[LessEqual[beta, 1.4e+129], N[(N[(i + alpha), $MachinePrecision] / N[(N[(beta * beta), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[beta, 1.65e+194], 0.0625, N[(N[(N[(i + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta / i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 9.5 \cdot 10^{+109}:\\
\;\;\;\;0.0625\\
\mathbf{elif}\;\beta \leq 1.4 \cdot 10^{+129}:\\
\;\;\;\;\frac{i + \alpha}{\frac{\beta \cdot \beta}{i}}\\
\mathbf{elif}\;\beta \leq 1.65 \cdot 10^{+194}:\\
\;\;\;\;0.0625\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{i + \alpha}{\beta}}{\frac{\beta}{i}}\\
\end{array}
\end{array}
if beta < 9.49999999999999972e109 or 1.39999999999999987e129 < beta < 1.64999999999999992e194Initial program 17.6%
associate-/l/17.1%
associate-*l*17.0%
times-frac22.0%
Simplified37.0%
Taylor expanded in i around inf 80.4%
if 9.49999999999999972e109 < beta < 1.39999999999999987e129Initial program 2.0%
associate-/l/0.0%
associate-*l*0.0%
times-frac34.4%
Simplified77.8%
Taylor expanded in beta around inf 75.3%
*-commutative75.3%
associate-/l*75.9%
+-commutative75.9%
unpow275.9%
Simplified75.9%
if 1.64999999999999992e194 < beta Initial program 0.0%
associate-/l/0.0%
associate-*l*0.0%
times-frac0.0%
Simplified15.8%
Taylor expanded in beta around inf 38.9%
*-commutative38.9%
associate-/l*41.0%
+-commutative41.0%
unpow241.0%
Simplified41.0%
*-un-lft-identity41.0%
associate-/l*52.7%
Applied egg-rr52.7%
*-lft-identity52.7%
associate-/r/52.7%
Simplified52.7%
Taylor expanded in beta around 0 38.9%
*-commutative38.9%
associate-/l*41.0%
unpow241.0%
associate-*r/52.7%
associate-/r*79.7%
+-commutative79.7%
Simplified79.7%
Final simplification80.2%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta i)
:precision binary64
(if (<= beta 9.5e+109)
0.0625
(if (<= beta 1.38e+129)
(* (+ i alpha) (/ (/ i beta) beta))
(if (<= beta 2.4e+197) 0.0625 (* (/ i beta) (/ i beta))))))assert(alpha < beta);
double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 9.5e+109) {
tmp = 0.0625;
} else if (beta <= 1.38e+129) {
tmp = (i + alpha) * ((i / beta) / beta);
} else if (beta <= 2.4e+197) {
tmp = 0.0625;
} else {
tmp = (i / beta) * (i / beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta, i)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
real(8) :: tmp
if (beta <= 9.5d+109) then
tmp = 0.0625d0
else if (beta <= 1.38d+129) then
tmp = (i + alpha) * ((i / beta) / beta)
else if (beta <= 2.4d+197) then
tmp = 0.0625d0
else
tmp = (i / beta) * (i / beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 9.5e+109) {
tmp = 0.0625;
} else if (beta <= 1.38e+129) {
tmp = (i + alpha) * ((i / beta) / beta);
} else if (beta <= 2.4e+197) {
tmp = 0.0625;
} else {
tmp = (i / beta) * (i / beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta, i): tmp = 0 if beta <= 9.5e+109: tmp = 0.0625 elif beta <= 1.38e+129: tmp = (i + alpha) * ((i / beta) / beta) elif beta <= 2.4e+197: tmp = 0.0625 else: tmp = (i / beta) * (i / beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta, i) tmp = 0.0 if (beta <= 9.5e+109) tmp = 0.0625; elseif (beta <= 1.38e+129) tmp = Float64(Float64(i + alpha) * Float64(Float64(i / beta) / beta)); elseif (beta <= 2.4e+197) tmp = 0.0625; else tmp = Float64(Float64(i / beta) * Float64(i / beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta, i)
tmp = 0.0;
if (beta <= 9.5e+109)
tmp = 0.0625;
elseif (beta <= 1.38e+129)
tmp = (i + alpha) * ((i / beta) / beta);
elseif (beta <= 2.4e+197)
tmp = 0.0625;
else
tmp = (i / beta) * (i / beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_, i_] := If[LessEqual[beta, 9.5e+109], 0.0625, If[LessEqual[beta, 1.38e+129], N[(N[(i + alpha), $MachinePrecision] * N[(N[(i / beta), $MachinePrecision] / beta), $MachinePrecision]), $MachinePrecision], If[LessEqual[beta, 2.4e+197], 0.0625, N[(N[(i / beta), $MachinePrecision] * N[(i / beta), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 9.5 \cdot 10^{+109}:\\
\;\;\;\;0.0625\\
\mathbf{elif}\;\beta \leq 1.38 \cdot 10^{+129}:\\
\;\;\;\;\left(i + \alpha\right) \cdot \frac{\frac{i}{\beta}}{\beta}\\
\mathbf{elif}\;\beta \leq 2.4 \cdot 10^{+197}:\\
\;\;\;\;0.0625\\
\mathbf{else}:\\
\;\;\;\;\frac{i}{\beta} \cdot \frac{i}{\beta}\\
\end{array}
\end{array}
if beta < 9.49999999999999972e109 or 1.3800000000000001e129 < beta < 2.3999999999999999e197Initial program 17.6%
associate-/l/17.1%
associate-*l*17.0%
times-frac22.0%
Simplified37.0%
Taylor expanded in i around inf 80.4%
if 9.49999999999999972e109 < beta < 1.3800000000000001e129Initial program 2.0%
associate-/l/0.0%
associate-*l*0.0%
times-frac34.4%
Simplified77.8%
Taylor expanded in beta around inf 75.3%
*-commutative75.3%
associate-/l*75.9%
+-commutative75.9%
unpow275.9%
Simplified75.9%
div-inv75.9%
clear-num75.7%
associate-/r*75.7%
Applied egg-rr75.7%
if 2.3999999999999999e197 < beta Initial program 0.0%
associate-/l/0.0%
associate-*l*0.0%
times-frac0.0%
Simplified15.8%
Taylor expanded in beta around inf 38.9%
*-commutative38.9%
associate-/l*41.0%
+-commutative41.0%
unpow241.0%
Simplified41.0%
*-un-lft-identity41.0%
associate-/l*52.7%
Applied egg-rr52.7%
Taylor expanded in alpha around 0 39.4%
unpow239.4%
unpow239.4%
times-frac74.4%
Simplified74.4%
Final simplification79.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta i)
:precision binary64
(if (<= beta 9.5e+109)
0.0625
(if (<= beta 1.5e+129)
(/ (+ i alpha) (* beta (/ beta i)))
(if (<= beta 4.3e+196) 0.0625 (* (/ i beta) (/ i beta))))))assert(alpha < beta);
double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 9.5e+109) {
tmp = 0.0625;
} else if (beta <= 1.5e+129) {
tmp = (i + alpha) / (beta * (beta / i));
} else if (beta <= 4.3e+196) {
tmp = 0.0625;
} else {
tmp = (i / beta) * (i / beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta, i)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
real(8) :: tmp
if (beta <= 9.5d+109) then
tmp = 0.0625d0
else if (beta <= 1.5d+129) then
tmp = (i + alpha) / (beta * (beta / i))
else if (beta <= 4.3d+196) then
tmp = 0.0625d0
else
tmp = (i / beta) * (i / beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 9.5e+109) {
tmp = 0.0625;
} else if (beta <= 1.5e+129) {
tmp = (i + alpha) / (beta * (beta / i));
} else if (beta <= 4.3e+196) {
tmp = 0.0625;
} else {
tmp = (i / beta) * (i / beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta, i): tmp = 0 if beta <= 9.5e+109: tmp = 0.0625 elif beta <= 1.5e+129: tmp = (i + alpha) / (beta * (beta / i)) elif beta <= 4.3e+196: tmp = 0.0625 else: tmp = (i / beta) * (i / beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta, i) tmp = 0.0 if (beta <= 9.5e+109) tmp = 0.0625; elseif (beta <= 1.5e+129) tmp = Float64(Float64(i + alpha) / Float64(beta * Float64(beta / i))); elseif (beta <= 4.3e+196) tmp = 0.0625; else tmp = Float64(Float64(i / beta) * Float64(i / beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta, i)
tmp = 0.0;
if (beta <= 9.5e+109)
tmp = 0.0625;
elseif (beta <= 1.5e+129)
tmp = (i + alpha) / (beta * (beta / i));
elseif (beta <= 4.3e+196)
tmp = 0.0625;
else
tmp = (i / beta) * (i / beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_, i_] := If[LessEqual[beta, 9.5e+109], 0.0625, If[LessEqual[beta, 1.5e+129], N[(N[(i + alpha), $MachinePrecision] / N[(beta * N[(beta / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[beta, 4.3e+196], 0.0625, N[(N[(i / beta), $MachinePrecision] * N[(i / beta), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 9.5 \cdot 10^{+109}:\\
\;\;\;\;0.0625\\
\mathbf{elif}\;\beta \leq 1.5 \cdot 10^{+129}:\\
\;\;\;\;\frac{i + \alpha}{\beta \cdot \frac{\beta}{i}}\\
\mathbf{elif}\;\beta \leq 4.3 \cdot 10^{+196}:\\
\;\;\;\;0.0625\\
\mathbf{else}:\\
\;\;\;\;\frac{i}{\beta} \cdot \frac{i}{\beta}\\
\end{array}
\end{array}
if beta < 9.49999999999999972e109 or 1.50000000000000015e129 < beta < 4.30000000000000012e196Initial program 17.6%
associate-/l/17.1%
associate-*l*17.0%
times-frac22.0%
Simplified37.0%
Taylor expanded in i around inf 80.4%
if 9.49999999999999972e109 < beta < 1.50000000000000015e129Initial program 2.0%
associate-/l/0.0%
associate-*l*0.0%
times-frac34.4%
Simplified77.8%
Taylor expanded in beta around inf 75.3%
*-commutative75.3%
associate-/l*75.9%
+-commutative75.9%
unpow275.9%
Simplified75.9%
*-un-lft-identity75.9%
associate-/l*75.9%
Applied egg-rr75.9%
*-lft-identity75.9%
associate-/r/75.7%
Simplified75.7%
if 4.30000000000000012e196 < beta Initial program 0.0%
associate-/l/0.0%
associate-*l*0.0%
times-frac0.0%
Simplified15.8%
Taylor expanded in beta around inf 38.9%
*-commutative38.9%
associate-/l*41.0%
+-commutative41.0%
unpow241.0%
Simplified41.0%
*-un-lft-identity41.0%
associate-/l*52.7%
Applied egg-rr52.7%
Taylor expanded in alpha around 0 39.4%
unpow239.4%
unpow239.4%
times-frac74.4%
Simplified74.4%
Final simplification79.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function.
(FPCore (alpha beta i)
:precision binary64
(if (<= beta 9e+109)
0.0625
(if (<= beta 1.4e+129)
(/ (+ i alpha) (/ (* beta beta) i))
(if (<= beta 5.2e+194) 0.0625 (* (/ i beta) (/ i beta))))))assert(alpha < beta);
double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 9e+109) {
tmp = 0.0625;
} else if (beta <= 1.4e+129) {
tmp = (i + alpha) / ((beta * beta) / i);
} else if (beta <= 5.2e+194) {
tmp = 0.0625;
} else {
tmp = (i / beta) * (i / beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta, i)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
real(8) :: tmp
if (beta <= 9d+109) then
tmp = 0.0625d0
else if (beta <= 1.4d+129) then
tmp = (i + alpha) / ((beta * beta) / i)
else if (beta <= 5.2d+194) then
tmp = 0.0625d0
else
tmp = (i / beta) * (i / beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 9e+109) {
tmp = 0.0625;
} else if (beta <= 1.4e+129) {
tmp = (i + alpha) / ((beta * beta) / i);
} else if (beta <= 5.2e+194) {
tmp = 0.0625;
} else {
tmp = (i / beta) * (i / beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta, i): tmp = 0 if beta <= 9e+109: tmp = 0.0625 elif beta <= 1.4e+129: tmp = (i + alpha) / ((beta * beta) / i) elif beta <= 5.2e+194: tmp = 0.0625 else: tmp = (i / beta) * (i / beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta, i) tmp = 0.0 if (beta <= 9e+109) tmp = 0.0625; elseif (beta <= 1.4e+129) tmp = Float64(Float64(i + alpha) / Float64(Float64(beta * beta) / i)); elseif (beta <= 5.2e+194) tmp = 0.0625; else tmp = Float64(Float64(i / beta) * Float64(i / beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta, i)
tmp = 0.0;
if (beta <= 9e+109)
tmp = 0.0625;
elseif (beta <= 1.4e+129)
tmp = (i + alpha) / ((beta * beta) / i);
elseif (beta <= 5.2e+194)
tmp = 0.0625;
else
tmp = (i / beta) * (i / beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_, i_] := If[LessEqual[beta, 9e+109], 0.0625, If[LessEqual[beta, 1.4e+129], N[(N[(i + alpha), $MachinePrecision] / N[(N[(beta * beta), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[beta, 5.2e+194], 0.0625, N[(N[(i / beta), $MachinePrecision] * N[(i / beta), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 9 \cdot 10^{+109}:\\
\;\;\;\;0.0625\\
\mathbf{elif}\;\beta \leq 1.4 \cdot 10^{+129}:\\
\;\;\;\;\frac{i + \alpha}{\frac{\beta \cdot \beta}{i}}\\
\mathbf{elif}\;\beta \leq 5.2 \cdot 10^{+194}:\\
\;\;\;\;0.0625\\
\mathbf{else}:\\
\;\;\;\;\frac{i}{\beta} \cdot \frac{i}{\beta}\\
\end{array}
\end{array}
if beta < 8.9999999999999992e109 or 1.39999999999999987e129 < beta < 5.1999999999999998e194Initial program 17.6%
associate-/l/17.1%
associate-*l*17.0%
times-frac22.0%
Simplified37.0%
Taylor expanded in i around inf 80.4%
if 8.9999999999999992e109 < beta < 1.39999999999999987e129Initial program 2.0%
associate-/l/0.0%
associate-*l*0.0%
times-frac34.4%
Simplified77.8%
Taylor expanded in beta around inf 75.3%
*-commutative75.3%
associate-/l*75.9%
+-commutative75.9%
unpow275.9%
Simplified75.9%
if 5.1999999999999998e194 < beta Initial program 0.0%
associate-/l/0.0%
associate-*l*0.0%
times-frac0.0%
Simplified15.8%
Taylor expanded in beta around inf 38.9%
*-commutative38.9%
associate-/l*41.0%
+-commutative41.0%
unpow241.0%
Simplified41.0%
*-un-lft-identity41.0%
associate-/l*52.7%
Applied egg-rr52.7%
Taylor expanded in alpha around 0 39.4%
unpow239.4%
unpow239.4%
times-frac74.4%
Simplified74.4%
Final simplification79.5%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta i) :precision binary64 (if (<= beta 2e+199) 0.0625 (* (/ i beta) (/ alpha beta))))
assert(alpha < beta);
double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 2e+199) {
tmp = 0.0625;
} else {
tmp = (i / beta) * (alpha / beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta, i)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
real(8) :: tmp
if (beta <= 2d+199) then
tmp = 0.0625d0
else
tmp = (i / beta) * (alpha / beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 2e+199) {
tmp = 0.0625;
} else {
tmp = (i / beta) * (alpha / beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta, i): tmp = 0 if beta <= 2e+199: tmp = 0.0625 else: tmp = (i / beta) * (alpha / beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta, i) tmp = 0.0 if (beta <= 2e+199) tmp = 0.0625; else tmp = Float64(Float64(i / beta) * Float64(alpha / beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta, i)
tmp = 0.0;
if (beta <= 2e+199)
tmp = 0.0625;
else
tmp = (i / beta) * (alpha / beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_, i_] := If[LessEqual[beta, 2e+199], 0.0625, N[(N[(i / beta), $MachinePrecision] * N[(alpha / beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2 \cdot 10^{+199}:\\
\;\;\;\;0.0625\\
\mathbf{else}:\\
\;\;\;\;\frac{i}{\beta} \cdot \frac{\alpha}{\beta}\\
\end{array}
\end{array}
if beta < 2.00000000000000019e199Initial program 17.0%
associate-/l/16.4%
associate-*l*16.3%
times-frac22.5%
Simplified38.6%
Taylor expanded in i around inf 78.3%
if 2.00000000000000019e199 < beta Initial program 0.0%
associate-/l/0.0%
associate-*l*0.0%
times-frac0.0%
Simplified15.8%
Taylor expanded in beta around inf 38.9%
*-commutative38.9%
associate-/l*41.0%
+-commutative41.0%
unpow241.0%
Simplified41.0%
*-un-lft-identity41.0%
associate-/l*52.7%
Applied egg-rr52.7%
Taylor expanded in alpha around inf 40.4%
*-commutative40.4%
unpow240.4%
times-frac46.5%
Simplified46.5%
Final simplification74.4%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta i) :precision binary64 (if (<= beta 9.2e+193) 0.0625 (* (/ i beta) (/ i beta))))
assert(alpha < beta);
double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 9.2e+193) {
tmp = 0.0625;
} else {
tmp = (i / beta) * (i / beta);
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta, i)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
real(8) :: tmp
if (beta <= 9.2d+193) then
tmp = 0.0625d0
else
tmp = (i / beta) * (i / beta)
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 9.2e+193) {
tmp = 0.0625;
} else {
tmp = (i / beta) * (i / beta);
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta, i): tmp = 0 if beta <= 9.2e+193: tmp = 0.0625 else: tmp = (i / beta) * (i / beta) return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta, i) tmp = 0.0 if (beta <= 9.2e+193) tmp = 0.0625; else tmp = Float64(Float64(i / beta) * Float64(i / beta)); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta, i)
tmp = 0.0;
if (beta <= 9.2e+193)
tmp = 0.0625;
else
tmp = (i / beta) * (i / beta);
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_, i_] := If[LessEqual[beta, 9.2e+193], 0.0625, N[(N[(i / beta), $MachinePrecision] * N[(i / beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 9.2 \cdot 10^{+193}:\\
\;\;\;\;0.0625\\
\mathbf{else}:\\
\;\;\;\;\frac{i}{\beta} \cdot \frac{i}{\beta}\\
\end{array}
\end{array}
if beta < 9.20000000000000053e193Initial program 17.0%
associate-/l/16.4%
associate-*l*16.3%
times-frac22.5%
Simplified38.6%
Taylor expanded in i around inf 78.3%
if 9.20000000000000053e193 < beta Initial program 0.0%
associate-/l/0.0%
associate-*l*0.0%
times-frac0.0%
Simplified15.8%
Taylor expanded in beta around inf 38.9%
*-commutative38.9%
associate-/l*41.0%
+-commutative41.0%
unpow241.0%
Simplified41.0%
*-un-lft-identity41.0%
associate-/l*52.7%
Applied egg-rr52.7%
Taylor expanded in alpha around 0 39.4%
unpow239.4%
unpow239.4%
times-frac74.4%
Simplified74.4%
Final simplification77.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta i) :precision binary64 (if (<= beta 2e+199) 0.0625 (/ 0.0 i)))
assert(alpha < beta);
double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 2e+199) {
tmp = 0.0625;
} else {
tmp = 0.0 / i;
}
return tmp;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta, i)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
real(8) :: tmp
if (beta <= 2d+199) then
tmp = 0.0625d0
else
tmp = 0.0d0 / i
end if
code = tmp
end function
assert alpha < beta;
public static double code(double alpha, double beta, double i) {
double tmp;
if (beta <= 2e+199) {
tmp = 0.0625;
} else {
tmp = 0.0 / i;
}
return tmp;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta, i): tmp = 0 if beta <= 2e+199: tmp = 0.0625 else: tmp = 0.0 / i return tmp
alpha, beta = sort([alpha, beta]) function code(alpha, beta, i) tmp = 0.0 if (beta <= 2e+199) tmp = 0.0625; else tmp = Float64(0.0 / i); end return tmp end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp_2 = code(alpha, beta, i)
tmp = 0.0;
if (beta <= 2e+199)
tmp = 0.0625;
else
tmp = 0.0 / i;
end
tmp_2 = tmp;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_, i_] := If[LessEqual[beta, 2e+199], 0.0625, N[(0.0 / i), $MachinePrecision]]
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2 \cdot 10^{+199}:\\
\;\;\;\;0.0625\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{i}\\
\end{array}
\end{array}
if beta < 2.00000000000000019e199Initial program 17.0%
associate-/l/16.4%
associate-*l*16.3%
times-frac22.5%
Simplified38.6%
Taylor expanded in i around inf 78.3%
if 2.00000000000000019e199 < beta Initial program 0.0%
associate-/l/0.0%
associate-*l*0.0%
times-frac0.0%
Simplified15.8%
Taylor expanded in i around inf 50.1%
cancel-sign-sub-inv50.1%
distribute-lft-out50.1%
metadata-eval50.1%
Simplified50.1%
Taylor expanded in i around 0 41.0%
distribute-rgt-out41.0%
metadata-eval41.0%
mul0-rgt41.0%
Simplified41.0%
Final simplification73.8%
NOTE: alpha and beta should be sorted in increasing order before calling this function. (FPCore (alpha beta i) :precision binary64 0.0625)
assert(alpha < beta);
double code(double alpha, double beta, double i) {
return 0.0625;
}
NOTE: alpha and beta should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta, i)
real(8), intent (in) :: alpha
real(8), intent (in) :: beta
real(8), intent (in) :: i
code = 0.0625d0
end function
assert alpha < beta;
public static double code(double alpha, double beta, double i) {
return 0.0625;
}
[alpha, beta] = sort([alpha, beta]) def code(alpha, beta, i): return 0.0625
alpha, beta = sort([alpha, beta]) function code(alpha, beta, i) return 0.0625 end
alpha, beta = num2cell(sort([alpha, beta])){:}
function tmp = code(alpha, beta, i)
tmp = 0.0625;
end
NOTE: alpha and beta should be sorted in increasing order before calling this function. code[alpha_, beta_, i_] := 0.0625
\begin{array}{l}
[alpha, beta] = \mathsf{sort}([alpha, beta])\\
\\
0.0625
\end{array}
Initial program 14.9%
associate-/l/14.4%
associate-*l*14.3%
times-frac19.7%
Simplified35.9%
Taylor expanded in i around inf 70.4%
Final simplification70.4%
herbie shell --seed 2023244
(FPCore (alpha beta i)
:name "Octave 3.8, jcobi/4"
:precision binary64
:pre (and (and (> alpha -1.0) (> beta -1.0)) (> i 1.0))
(/ (/ (* (* i (+ (+ alpha beta) i)) (+ (* beta alpha) (* i (+ (+ alpha beta) i)))) (* (+ (+ alpha beta) (* 2.0 i)) (+ (+ alpha beta) (* 2.0 i)))) (- (* (+ (+ alpha beta) (* 2.0 i)) (+ (+ alpha beta) (* 2.0 i))) 1.0)))