
(FPCore (i n) :precision binary64 (* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))
double code(double i, double n) {
return 100.0 * ((pow((1.0 + (i / n)), n) - 1.0) / (i / n));
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = 100.0d0 * ((((1.0d0 + (i / n)) ** n) - 1.0d0) / (i / n))
end function
public static double code(double i, double n) {
return 100.0 * ((Math.pow((1.0 + (i / n)), n) - 1.0) / (i / n));
}
def code(i, n): return 100.0 * ((math.pow((1.0 + (i / n)), n) - 1.0) / (i / n))
function code(i, n) return Float64(100.0 * Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) - 1.0) / Float64(i / n))) end
function tmp = code(i, n) tmp = 100.0 * ((((1.0 + (i / n)) ^ n) - 1.0) / (i / n)); end
code[i_, n_] := N[(100.0 * N[(N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] - 1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (i n) :precision binary64 (* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))
double code(double i, double n) {
return 100.0 * ((pow((1.0 + (i / n)), n) - 1.0) / (i / n));
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = 100.0d0 * ((((1.0d0 + (i / n)) ** n) - 1.0d0) / (i / n))
end function
public static double code(double i, double n) {
return 100.0 * ((Math.pow((1.0 + (i / n)), n) - 1.0) / (i / n));
}
def code(i, n): return 100.0 * ((math.pow((1.0 + (i / n)), n) - 1.0) / (i / n))
function code(i, n) return Float64(100.0 * Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) - 1.0) / Float64(i / n))) end
function tmp = code(i, n) tmp = 100.0 * ((((1.0 + (i / n)) ^ n) - 1.0) / (i / n)); end
code[i_, n_] := N[(100.0 * N[(N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] - 1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\end{array}
(FPCore (i n)
:precision binary64
(let* ((t_0 (pow (+ 1.0 (/ i n)) n)) (t_1 (/ (+ t_0 -1.0) (/ i n))))
(if (<= t_1 -5e-46)
(* t_1 100.0)
(if (<= t_1 5e-285)
(* n (/ (* 100.0 (expm1 (* n (log1p (/ i n))))) i))
(if (<= t_1 INFINITY)
(/ (+ (* t_0 100.0) -100.0) (/ i n))
(* n 100.0))))))
double code(double i, double n) {
double t_0 = pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= -5e-46) {
tmp = t_1 * 100.0;
} else if (t_1 <= 5e-285) {
tmp = n * ((100.0 * expm1((n * log1p((i / n))))) / i);
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((t_0 * 100.0) + -100.0) / (i / n);
} else {
tmp = n * 100.0;
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = Math.pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= -5e-46) {
tmp = t_1 * 100.0;
} else if (t_1 <= 5e-285) {
tmp = n * ((100.0 * Math.expm1((n * Math.log1p((i / n))))) / i);
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = ((t_0 * 100.0) + -100.0) / (i / n);
} else {
tmp = n * 100.0;
}
return tmp;
}
def code(i, n): t_0 = math.pow((1.0 + (i / n)), n) t_1 = (t_0 + -1.0) / (i / n) tmp = 0 if t_1 <= -5e-46: tmp = t_1 * 100.0 elif t_1 <= 5e-285: tmp = n * ((100.0 * math.expm1((n * math.log1p((i / n))))) / i) elif t_1 <= math.inf: tmp = ((t_0 * 100.0) + -100.0) / (i / n) else: tmp = n * 100.0 return tmp
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) ^ n t_1 = Float64(Float64(t_0 + -1.0) / Float64(i / n)) tmp = 0.0 if (t_1 <= -5e-46) tmp = Float64(t_1 * 100.0); elseif (t_1 <= 5e-285) tmp = Float64(n * Float64(Float64(100.0 * expm1(Float64(n * log1p(Float64(i / n))))) / i)); elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(t_0 * 100.0) + -100.0) / Float64(i / n)); else tmp = Float64(n * 100.0); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-46], N[(t$95$1 * 100.0), $MachinePrecision], If[LessEqual[t$95$1, 5e-285], N[(n * N[(N[(100.0 * N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[(t$95$0 * 100.0), $MachinePrecision] + -100.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(n * 100.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t\_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-46}:\\
\;\;\;\;t\_1 \cdot 100\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-285}:\\
\;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{i}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{t\_0 \cdot 100 + -100}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < -4.99999999999999992e-46Initial program 100.0%
if -4.99999999999999992e-46 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < 5.00000000000000018e-285Initial program 27.8%
associate-/r/27.8%
associate-*r*27.8%
*-commutative27.8%
associate-*r/27.8%
sub-neg27.8%
distribute-lft-in27.9%
metadata-eval27.9%
metadata-eval27.9%
metadata-eval27.9%
fma-define27.8%
metadata-eval27.8%
Simplified27.8%
fma-undefine27.9%
metadata-eval27.9%
metadata-eval27.9%
distribute-lft-in27.8%
sub-neg27.8%
*-commutative27.8%
add-exp-log27.8%
expm1-define27.8%
log-pow41.3%
log1p-define98.6%
Applied egg-rr98.6%
if 5.00000000000000018e-285 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < +inf.0Initial program 99.7%
associate-*r/99.8%
sub-neg99.8%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) Initial program 0.0%
Taylor expanded in i around 0 77.1%
*-commutative77.1%
Simplified77.1%
Final simplification95.0%
(FPCore (i n) :precision binary64 (if (or (<= i -1.05e+121) (not (<= i 8.5e+141))) (* (/ (+ (pow (+ 1.0 (/ i n)) n) -1.0) (/ i n)) 100.0) (* (* n 100.0) (/ (expm1 i) i))))
double code(double i, double n) {
double tmp;
if ((i <= -1.05e+121) || !(i <= 8.5e+141)) {
tmp = ((pow((1.0 + (i / n)), n) + -1.0) / (i / n)) * 100.0;
} else {
tmp = (n * 100.0) * (expm1(i) / i);
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((i <= -1.05e+121) || !(i <= 8.5e+141)) {
tmp = ((Math.pow((1.0 + (i / n)), n) + -1.0) / (i / n)) * 100.0;
} else {
tmp = (n * 100.0) * (Math.expm1(i) / i);
}
return tmp;
}
def code(i, n): tmp = 0 if (i <= -1.05e+121) or not (i <= 8.5e+141): tmp = ((math.pow((1.0 + (i / n)), n) + -1.0) / (i / n)) * 100.0 else: tmp = (n * 100.0) * (math.expm1(i) / i) return tmp
function code(i, n) tmp = 0.0 if ((i <= -1.05e+121) || !(i <= 8.5e+141)) tmp = Float64(Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) + -1.0) / Float64(i / n)) * 100.0); else tmp = Float64(Float64(n * 100.0) * Float64(expm1(i) / i)); end return tmp end
code[i_, n_] := If[Or[LessEqual[i, -1.05e+121], N[Not[LessEqual[i, 8.5e+141]], $MachinePrecision]], N[(N[(N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision] * 100.0), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -1.05 \cdot 10^{+121} \lor \neg \left(i \leq 8.5 \cdot 10^{+141}\right):\\
\;\;\;\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \cdot 100\\
\mathbf{else}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\
\end{array}
\end{array}
if i < -1.0500000000000001e121 or 8.4999999999999996e141 < i Initial program 71.8%
if -1.0500000000000001e121 < i < 8.4999999999999996e141Initial program 17.5%
associate-/r/17.8%
associate-*r*17.8%
*-commutative17.8%
associate-*r/17.8%
sub-neg17.8%
distribute-lft-in17.8%
metadata-eval17.8%
metadata-eval17.8%
metadata-eval17.8%
fma-define17.8%
metadata-eval17.8%
Simplified17.8%
Taylor expanded in n around inf 26.1%
sub-neg26.1%
metadata-eval26.1%
metadata-eval26.1%
distribute-lft-in26.1%
metadata-eval26.1%
sub-neg26.1%
expm1-define74.4%
Simplified74.4%
associate-*r*74.6%
*-un-lft-identity74.6%
times-frac77.5%
Applied egg-rr77.5%
Final simplification75.9%
(FPCore (i n) :precision binary64 (if (or (<= i -3.5e+120) (not (<= i 1.8e+138))) (* n (/ (+ (* (pow (+ 1.0 (/ i n)) n) 100.0) -100.0) i)) (* (* n 100.0) (/ (expm1 i) i))))
double code(double i, double n) {
double tmp;
if ((i <= -3.5e+120) || !(i <= 1.8e+138)) {
tmp = n * (((pow((1.0 + (i / n)), n) * 100.0) + -100.0) / i);
} else {
tmp = (n * 100.0) * (expm1(i) / i);
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((i <= -3.5e+120) || !(i <= 1.8e+138)) {
tmp = n * (((Math.pow((1.0 + (i / n)), n) * 100.0) + -100.0) / i);
} else {
tmp = (n * 100.0) * (Math.expm1(i) / i);
}
return tmp;
}
def code(i, n): tmp = 0 if (i <= -3.5e+120) or not (i <= 1.8e+138): tmp = n * (((math.pow((1.0 + (i / n)), n) * 100.0) + -100.0) / i) else: tmp = (n * 100.0) * (math.expm1(i) / i) return tmp
function code(i, n) tmp = 0.0 if ((i <= -3.5e+120) || !(i <= 1.8e+138)) tmp = Float64(n * Float64(Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) * 100.0) + -100.0) / i)); else tmp = Float64(Float64(n * 100.0) * Float64(expm1(i) / i)); end return tmp end
code[i_, n_] := If[Or[LessEqual[i, -3.5e+120], N[Not[LessEqual[i, 1.8e+138]], $MachinePrecision]], N[(n * N[(N[(N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] * 100.0), $MachinePrecision] + -100.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -3.5 \cdot 10^{+120} \lor \neg \left(i \leq 1.8 \cdot 10^{+138}\right):\\
\;\;\;\;n \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} \cdot 100 + -100}{i}\\
\mathbf{else}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\
\end{array}
\end{array}
if i < -3.50000000000000007e120 or 1.8000000000000001e138 < i Initial program 71.8%
associate-/r/71.9%
associate-*r*71.9%
*-commutative71.9%
associate-*r/72.0%
sub-neg72.0%
distribute-lft-in72.2%
metadata-eval72.2%
metadata-eval72.2%
metadata-eval72.2%
fma-define72.0%
metadata-eval72.0%
Simplified72.0%
fma-undefine72.2%
*-commutative72.2%
Applied egg-rr72.2%
if -3.50000000000000007e120 < i < 1.8000000000000001e138Initial program 17.5%
associate-/r/17.8%
associate-*r*17.8%
*-commutative17.8%
associate-*r/17.8%
sub-neg17.8%
distribute-lft-in17.8%
metadata-eval17.8%
metadata-eval17.8%
metadata-eval17.8%
fma-define17.8%
metadata-eval17.8%
Simplified17.8%
Taylor expanded in n around inf 26.1%
sub-neg26.1%
metadata-eval26.1%
metadata-eval26.1%
distribute-lft-in26.1%
metadata-eval26.1%
sub-neg26.1%
expm1-define74.4%
Simplified74.4%
associate-*r*74.6%
*-un-lft-identity74.6%
times-frac77.5%
Applied egg-rr77.5%
Final simplification76.0%
(FPCore (i n)
:precision binary64
(if (<= n -7.6e+257)
(* n 100.0)
(if (<= n -5.4e-224)
(* 100.0 (/ (expm1 i) (/ i n)))
(if (<= n 5.5e-167)
(/ 0.0 (/ i n))
(if (<= n 1.9)
(* 100.0 (/ i (/ i n)))
(/
(*
n
(*
i
(+
100.0
(*
i
(+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667))))))))
i))))))
double code(double i, double n) {
double tmp;
if (n <= -7.6e+257) {
tmp = n * 100.0;
} else if (n <= -5.4e-224) {
tmp = 100.0 * (expm1(i) / (i / n));
} else if (n <= 5.5e-167) {
tmp = 0.0 / (i / n);
} else if (n <= 1.9) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i;
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (n <= -7.6e+257) {
tmp = n * 100.0;
} else if (n <= -5.4e-224) {
tmp = 100.0 * (Math.expm1(i) / (i / n));
} else if (n <= 5.5e-167) {
tmp = 0.0 / (i / n);
} else if (n <= 1.9) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i;
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -7.6e+257: tmp = n * 100.0 elif n <= -5.4e-224: tmp = 100.0 * (math.expm1(i) / (i / n)) elif n <= 5.5e-167: tmp = 0.0 / (i / n) elif n <= 1.9: tmp = 100.0 * (i / (i / n)) else: tmp = (n * (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i return tmp
function code(i, n) tmp = 0.0 if (n <= -7.6e+257) tmp = Float64(n * 100.0); elseif (n <= -5.4e-224) tmp = Float64(100.0 * Float64(expm1(i) / Float64(i / n))); elseif (n <= 5.5e-167) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 1.9) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(Float64(n * Float64(i * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667)))))))) / i); end return tmp end
code[i_, n_] := If[LessEqual[n, -7.6e+257], N[(n * 100.0), $MachinePrecision], If[LessEqual[n, -5.4e-224], N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5.5e-167], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.9], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * N[(i * N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -7.6 \cdot 10^{+257}:\\
\;\;\;\;n \cdot 100\\
\mathbf{elif}\;n \leq -5.4 \cdot 10^{-224}:\\
\;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 5.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.9:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot \left(i \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\right)}{i}\\
\end{array}
\end{array}
if n < -7.59999999999999996e257Initial program 12.7%
Taylor expanded in i around 0 87.6%
*-commutative87.6%
Simplified87.6%
if -7.59999999999999996e257 < n < -5.39999999999999996e-224Initial program 36.0%
Taylor expanded in n around inf 29.5%
expm1-define60.9%
Simplified60.9%
if -5.39999999999999996e-224 < n < 5.5000000000000003e-167Initial program 63.5%
associate-*r/63.5%
sub-neg63.5%
distribute-rgt-in63.5%
metadata-eval63.5%
metadata-eval63.5%
Simplified63.5%
Taylor expanded in i around 0 82.4%
if 5.5000000000000003e-167 < n < 1.8999999999999999Initial program 13.6%
Taylor expanded in i around 0 65.9%
if 1.8999999999999999 < n Initial program 21.9%
associate-/r/22.4%
associate-*r*22.4%
*-commutative22.4%
associate-*r/22.4%
sub-neg22.4%
distribute-lft-in22.4%
metadata-eval22.4%
metadata-eval22.4%
metadata-eval22.4%
fma-define22.4%
metadata-eval22.4%
Simplified22.4%
Taylor expanded in n around inf 34.5%
sub-neg34.5%
metadata-eval34.5%
metadata-eval34.5%
distribute-lft-in34.5%
metadata-eval34.5%
sub-neg34.5%
expm1-define92.0%
Simplified92.0%
Taylor expanded in i around 0 92.2%
*-commutative92.2%
Simplified92.2%
Final simplification74.8%
(FPCore (i n)
:precision binary64
(if (<= n -4.6e-104)
(* 100.0 (/ 1.0 (/ i (* n (expm1 i)))))
(if (<= n 9.5e-167)
(/ 0.0 (/ i n))
(if (<= n 2.05)
(* 100.0 (/ i (/ i n)))
(/
(*
n
(*
i
(+
100.0
(*
i
(+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667))))))))
i)))))
double code(double i, double n) {
double tmp;
if (n <= -4.6e-104) {
tmp = 100.0 * (1.0 / (i / (n * expm1(i))));
} else if (n <= 9.5e-167) {
tmp = 0.0 / (i / n);
} else if (n <= 2.05) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i;
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (n <= -4.6e-104) {
tmp = 100.0 * (1.0 / (i / (n * Math.expm1(i))));
} else if (n <= 9.5e-167) {
tmp = 0.0 / (i / n);
} else if (n <= 2.05) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i;
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -4.6e-104: tmp = 100.0 * (1.0 / (i / (n * math.expm1(i)))) elif n <= 9.5e-167: tmp = 0.0 / (i / n) elif n <= 2.05: tmp = 100.0 * (i / (i / n)) else: tmp = (n * (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i return tmp
function code(i, n) tmp = 0.0 if (n <= -4.6e-104) tmp = Float64(100.0 * Float64(1.0 / Float64(i / Float64(n * expm1(i))))); elseif (n <= 9.5e-167) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 2.05) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(Float64(n * Float64(i * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667)))))))) / i); end return tmp end
code[i_, n_] := If[LessEqual[n, -4.6e-104], N[(100.0 * N[(1.0 / N[(i / N[(n * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 9.5e-167], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.05], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * N[(i * N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -4.6 \cdot 10^{-104}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{i}{n \cdot \mathsf{expm1}\left(i\right)}}\\
\mathbf{elif}\;n \leq 9.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 2.05:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot \left(i \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\right)}{i}\\
\end{array}
\end{array}
if n < -4.5999999999999999e-104Initial program 30.6%
Taylor expanded in n around inf 26.4%
expm1-define57.1%
Simplified57.1%
clear-num57.1%
inv-pow57.1%
Applied egg-rr57.1%
unpow-157.1%
associate-/l/71.4%
*-commutative71.4%
Simplified71.4%
if -4.5999999999999999e-104 < n < 9.49999999999999955e-167Initial program 59.2%
associate-*r/59.2%
sub-neg59.2%
distribute-rgt-in59.2%
metadata-eval59.2%
metadata-eval59.2%
Simplified59.2%
Taylor expanded in i around 0 71.3%
if 9.49999999999999955e-167 < n < 2.0499999999999998Initial program 13.6%
Taylor expanded in i around 0 65.9%
if 2.0499999999999998 < n Initial program 21.9%
associate-/r/22.4%
associate-*r*22.4%
*-commutative22.4%
associate-*r/22.4%
sub-neg22.4%
distribute-lft-in22.4%
metadata-eval22.4%
metadata-eval22.4%
metadata-eval22.4%
fma-define22.4%
metadata-eval22.4%
Simplified22.4%
Taylor expanded in n around inf 34.5%
sub-neg34.5%
metadata-eval34.5%
metadata-eval34.5%
distribute-lft-in34.5%
metadata-eval34.5%
sub-neg34.5%
expm1-define92.0%
Simplified92.0%
Taylor expanded in i around 0 92.2%
*-commutative92.2%
Simplified92.2%
Final simplification77.1%
(FPCore (i n)
:precision binary64
(if (<= n -8e-107)
(/ (* n (* 100.0 (expm1 i))) i)
(if (<= n 5.5e-167)
(/ 0.0 (/ i n))
(if (<= n 2.05)
(* 100.0 (/ i (/ i n)))
(/
(*
n
(*
i
(+
100.0
(*
i
(+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667))))))))
i)))))
double code(double i, double n) {
double tmp;
if (n <= -8e-107) {
tmp = (n * (100.0 * expm1(i))) / i;
} else if (n <= 5.5e-167) {
tmp = 0.0 / (i / n);
} else if (n <= 2.05) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i;
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (n <= -8e-107) {
tmp = (n * (100.0 * Math.expm1(i))) / i;
} else if (n <= 5.5e-167) {
tmp = 0.0 / (i / n);
} else if (n <= 2.05) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i;
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -8e-107: tmp = (n * (100.0 * math.expm1(i))) / i elif n <= 5.5e-167: tmp = 0.0 / (i / n) elif n <= 2.05: tmp = 100.0 * (i / (i / n)) else: tmp = (n * (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i return tmp
function code(i, n) tmp = 0.0 if (n <= -8e-107) tmp = Float64(Float64(n * Float64(100.0 * expm1(i))) / i); elseif (n <= 5.5e-167) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 2.05) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(Float64(n * Float64(i * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667)))))))) / i); end return tmp end
code[i_, n_] := If[LessEqual[n, -8e-107], N[(N[(n * N[(100.0 * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision], If[LessEqual[n, 5.5e-167], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.05], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * N[(i * N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -8 \cdot 10^{-107}:\\
\;\;\;\;\frac{n \cdot \left(100 \cdot \mathsf{expm1}\left(i\right)\right)}{i}\\
\mathbf{elif}\;n \leq 5.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 2.05:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot \left(i \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\right)}{i}\\
\end{array}
\end{array}
if n < -8e-107Initial program 30.6%
associate-/r/30.8%
associate-*r*30.8%
*-commutative30.8%
associate-*r/30.9%
sub-neg30.9%
distribute-lft-in30.9%
metadata-eval30.9%
metadata-eval30.9%
metadata-eval30.9%
fma-define30.9%
metadata-eval30.9%
Simplified30.9%
Taylor expanded in n around inf 26.6%
sub-neg26.6%
metadata-eval26.6%
metadata-eval26.6%
distribute-lft-in26.6%
metadata-eval26.6%
sub-neg26.6%
expm1-define71.2%
Simplified71.2%
if -8e-107 < n < 5.5000000000000003e-167Initial program 59.2%
associate-*r/59.2%
sub-neg59.2%
distribute-rgt-in59.2%
metadata-eval59.2%
metadata-eval59.2%
Simplified59.2%
Taylor expanded in i around 0 71.3%
if 5.5000000000000003e-167 < n < 2.0499999999999998Initial program 13.6%
Taylor expanded in i around 0 65.9%
if 2.0499999999999998 < n Initial program 21.9%
associate-/r/22.4%
associate-*r*22.4%
*-commutative22.4%
associate-*r/22.4%
sub-neg22.4%
distribute-lft-in22.4%
metadata-eval22.4%
metadata-eval22.4%
metadata-eval22.4%
fma-define22.4%
metadata-eval22.4%
Simplified22.4%
Taylor expanded in n around inf 34.5%
sub-neg34.5%
metadata-eval34.5%
metadata-eval34.5%
distribute-lft-in34.5%
metadata-eval34.5%
sub-neg34.5%
expm1-define92.0%
Simplified92.0%
Taylor expanded in i around 0 92.2%
*-commutative92.2%
Simplified92.2%
Final simplification77.0%
(FPCore (i n)
:precision binary64
(if (<= n -3.9e-224)
(* (* n 100.0) (/ (expm1 i) i))
(if (<= n 8.5e-163)
(/ 0.0 (/ i n))
(if (<= n 1.95)
(* 100.0 (/ i (/ i n)))
(/
(*
n
(*
i
(+
100.0
(*
i
(+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667))))))))
i)))))
double code(double i, double n) {
double tmp;
if (n <= -3.9e-224) {
tmp = (n * 100.0) * (expm1(i) / i);
} else if (n <= 8.5e-163) {
tmp = 0.0 / (i / n);
} else if (n <= 1.95) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i;
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (n <= -3.9e-224) {
tmp = (n * 100.0) * (Math.expm1(i) / i);
} else if (n <= 8.5e-163) {
tmp = 0.0 / (i / n);
} else if (n <= 1.95) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i;
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -3.9e-224: tmp = (n * 100.0) * (math.expm1(i) / i) elif n <= 8.5e-163: tmp = 0.0 / (i / n) elif n <= 1.95: tmp = 100.0 * (i / (i / n)) else: tmp = (n * (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i return tmp
function code(i, n) tmp = 0.0 if (n <= -3.9e-224) tmp = Float64(Float64(n * 100.0) * Float64(expm1(i) / i)); elseif (n <= 8.5e-163) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 1.95) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(Float64(n * Float64(i * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667)))))))) / i); end return tmp end
code[i_, n_] := If[LessEqual[n, -3.9e-224], N[(N[(n * 100.0), $MachinePrecision] * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 8.5e-163], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.95], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * N[(i * N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -3.9 \cdot 10^{-224}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\
\mathbf{elif}\;n \leq 8.5 \cdot 10^{-163}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.95:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot \left(i \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\right)}{i}\\
\end{array}
\end{array}
if n < -3.8999999999999998e-224Initial program 34.4%
associate-/r/34.6%
associate-*r*34.6%
*-commutative34.6%
associate-*r/34.6%
sub-neg34.6%
distribute-lft-in34.7%
metadata-eval34.7%
metadata-eval34.7%
metadata-eval34.7%
fma-define34.6%
metadata-eval34.6%
Simplified34.6%
Taylor expanded in n around inf 27.7%
sub-neg27.7%
metadata-eval27.7%
metadata-eval27.7%
distribute-lft-in27.7%
metadata-eval27.7%
sub-neg27.7%
expm1-define64.3%
Simplified64.3%
associate-*r*64.4%
*-un-lft-identity64.4%
times-frac69.3%
Applied egg-rr69.3%
if -3.8999999999999998e-224 < n < 8.5e-163Initial program 63.5%
associate-*r/63.5%
sub-neg63.5%
distribute-rgt-in63.5%
metadata-eval63.5%
metadata-eval63.5%
Simplified63.5%
Taylor expanded in i around 0 82.4%
if 8.5e-163 < n < 1.94999999999999996Initial program 13.6%
Taylor expanded in i around 0 65.9%
if 1.94999999999999996 < n Initial program 21.9%
associate-/r/22.4%
associate-*r*22.4%
*-commutative22.4%
associate-*r/22.4%
sub-neg22.4%
distribute-lft-in22.4%
metadata-eval22.4%
metadata-eval22.4%
metadata-eval22.4%
fma-define22.4%
metadata-eval22.4%
Simplified22.4%
Taylor expanded in n around inf 34.5%
sub-neg34.5%
metadata-eval34.5%
metadata-eval34.5%
distribute-lft-in34.5%
metadata-eval34.5%
sub-neg34.5%
expm1-define92.0%
Simplified92.0%
Taylor expanded in i around 0 92.2%
*-commutative92.2%
Simplified92.2%
Final simplification77.8%
(FPCore (i n)
:precision binary64
(let* ((t_0 (/ (* i (* n (* i 50.0))) i)) (t_1 (* 100.0 (/ i (/ i n)))))
(if (<= n -8e+45)
(* (* i n) (/ 100.0 i))
(if (<= n -1e-270)
t_1
(if (<= n 4.5e-281)
t_0
(if (<= n 31500000.0)
t_1
(if (<= n 2.95e+41) t_0 (+ (* n 100.0) (* 50.0 (* i n))))))))))
double code(double i, double n) {
double t_0 = (i * (n * (i * 50.0))) / i;
double t_1 = 100.0 * (i / (i / n));
double tmp;
if (n <= -8e+45) {
tmp = (i * n) * (100.0 / i);
} else if (n <= -1e-270) {
tmp = t_1;
} else if (n <= 4.5e-281) {
tmp = t_0;
} else if (n <= 31500000.0) {
tmp = t_1;
} else if (n <= 2.95e+41) {
tmp = t_0;
} else {
tmp = (n * 100.0) + (50.0 * (i * n));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (i * (n * (i * 50.0d0))) / i
t_1 = 100.0d0 * (i / (i / n))
if (n <= (-8d+45)) then
tmp = (i * n) * (100.0d0 / i)
else if (n <= (-1d-270)) then
tmp = t_1
else if (n <= 4.5d-281) then
tmp = t_0
else if (n <= 31500000.0d0) then
tmp = t_1
else if (n <= 2.95d+41) then
tmp = t_0
else
tmp = (n * 100.0d0) + (50.0d0 * (i * n))
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = (i * (n * (i * 50.0))) / i;
double t_1 = 100.0 * (i / (i / n));
double tmp;
if (n <= -8e+45) {
tmp = (i * n) * (100.0 / i);
} else if (n <= -1e-270) {
tmp = t_1;
} else if (n <= 4.5e-281) {
tmp = t_0;
} else if (n <= 31500000.0) {
tmp = t_1;
} else if (n <= 2.95e+41) {
tmp = t_0;
} else {
tmp = (n * 100.0) + (50.0 * (i * n));
}
return tmp;
}
def code(i, n): t_0 = (i * (n * (i * 50.0))) / i t_1 = 100.0 * (i / (i / n)) tmp = 0 if n <= -8e+45: tmp = (i * n) * (100.0 / i) elif n <= -1e-270: tmp = t_1 elif n <= 4.5e-281: tmp = t_0 elif n <= 31500000.0: tmp = t_1 elif n <= 2.95e+41: tmp = t_0 else: tmp = (n * 100.0) + (50.0 * (i * n)) return tmp
function code(i, n) t_0 = Float64(Float64(i * Float64(n * Float64(i * 50.0))) / i) t_1 = Float64(100.0 * Float64(i / Float64(i / n))) tmp = 0.0 if (n <= -8e+45) tmp = Float64(Float64(i * n) * Float64(100.0 / i)); elseif (n <= -1e-270) tmp = t_1; elseif (n <= 4.5e-281) tmp = t_0; elseif (n <= 31500000.0) tmp = t_1; elseif (n <= 2.95e+41) tmp = t_0; else tmp = Float64(Float64(n * 100.0) + Float64(50.0 * Float64(i * n))); end return tmp end
function tmp_2 = code(i, n) t_0 = (i * (n * (i * 50.0))) / i; t_1 = 100.0 * (i / (i / n)); tmp = 0.0; if (n <= -8e+45) tmp = (i * n) * (100.0 / i); elseif (n <= -1e-270) tmp = t_1; elseif (n <= 4.5e-281) tmp = t_0; elseif (n <= 31500000.0) tmp = t_1; elseif (n <= 2.95e+41) tmp = t_0; else tmp = (n * 100.0) + (50.0 * (i * n)); end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(N[(i * N[(n * N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]}, Block[{t$95$1 = N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -8e+45], N[(N[(i * n), $MachinePrecision] * N[(100.0 / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -1e-270], t$95$1, If[LessEqual[n, 4.5e-281], t$95$0, If[LessEqual[n, 31500000.0], t$95$1, If[LessEqual[n, 2.95e+41], t$95$0, N[(N[(n * 100.0), $MachinePrecision] + N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{i \cdot \left(n \cdot \left(i \cdot 50\right)\right)}{i}\\
t_1 := 100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{if}\;n \leq -8 \cdot 10^{+45}:\\
\;\;\;\;\left(i \cdot n\right) \cdot \frac{100}{i}\\
\mathbf{elif}\;n \leq -1 \cdot 10^{-270}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;n \leq 4.5 \cdot 10^{-281}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 31500000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;n \leq 2.95 \cdot 10^{+41}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100 + 50 \cdot \left(i \cdot n\right)\\
\end{array}
\end{array}
if n < -7.9999999999999994e45Initial program 30.2%
associate-/r/30.6%
associate-*r*30.5%
*-commutative30.5%
associate-*r/30.7%
sub-neg30.7%
distribute-lft-in30.7%
metadata-eval30.7%
metadata-eval30.7%
metadata-eval30.7%
fma-define30.7%
metadata-eval30.7%
Simplified30.7%
Taylor expanded in n around inf 33.4%
sub-neg33.4%
metadata-eval33.4%
metadata-eval33.4%
distribute-lft-in33.4%
metadata-eval33.4%
sub-neg33.4%
expm1-define78.3%
Simplified78.3%
Taylor expanded in i around 0 52.0%
*-commutative52.0%
Simplified52.0%
*-commutative52.0%
associate-/l*52.2%
*-commutative52.2%
Applied egg-rr52.2%
if -7.9999999999999994e45 < n < -1e-270 or 4.49999999999999993e-281 < n < 3.15e7Initial program 36.2%
Taylor expanded in i around 0 54.0%
if -1e-270 < n < 4.49999999999999993e-281 or 3.15e7 < n < 2.95e41Initial program 82.2%
associate-/r/82.3%
associate-*r*82.3%
*-commutative82.3%
associate-*r/82.3%
sub-neg82.3%
distribute-lft-in82.3%
metadata-eval82.3%
metadata-eval82.3%
metadata-eval82.3%
fma-define82.3%
metadata-eval82.3%
Simplified82.3%
Taylor expanded in n around inf 75.0%
sub-neg75.0%
metadata-eval75.0%
metadata-eval75.0%
distribute-lft-in74.9%
metadata-eval74.9%
sub-neg74.9%
expm1-define77.8%
Simplified77.8%
Taylor expanded in i around 0 74.3%
+-commutative74.3%
associate-*r*74.3%
distribute-rgt-in74.3%
*-commutative74.3%
Simplified74.3%
Taylor expanded in i around inf 69.9%
if 2.95e41 < n Initial program 13.3%
associate-/r/13.9%
associate-*r*13.9%
*-commutative13.9%
associate-*r/13.9%
sub-neg13.9%
distribute-lft-in13.9%
metadata-eval13.9%
metadata-eval13.9%
metadata-eval13.9%
fma-define13.9%
metadata-eval13.9%
Simplified13.9%
Taylor expanded in n around inf 30.4%
sub-neg30.4%
metadata-eval30.4%
metadata-eval30.4%
distribute-lft-in30.5%
metadata-eval30.5%
sub-neg30.5%
expm1-define95.2%
Simplified95.2%
Taylor expanded in i around 0 84.3%
Final simplification62.7%
(FPCore (i n)
:precision binary64
(let* ((t_0
(/
(*
n
(*
i
(+
100.0
(*
i
(+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667))))))))
i)))
(if (<= n -1.12e-33)
t_0
(if (<= n 6e-166)
(/ 0.0 (/ i n))
(if (<= n 1.8) (* 100.0 (/ i (/ i n))) t_0)))))
double code(double i, double n) {
double t_0 = (n * (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i;
double tmp;
if (n <= -1.12e-33) {
tmp = t_0;
} else if (n <= 6e-166) {
tmp = 0.0 / (i / n);
} else if (n <= 1.8) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = (n * (i * (100.0d0 + (i * (50.0d0 + (i * (16.666666666666668d0 + (i * 4.166666666666667d0)))))))) / i
if (n <= (-1.12d-33)) then
tmp = t_0
else if (n <= 6d-166) then
tmp = 0.0d0 / (i / n)
else if (n <= 1.8d0) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = (n * (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i;
double tmp;
if (n <= -1.12e-33) {
tmp = t_0;
} else if (n <= 6e-166) {
tmp = 0.0 / (i / n);
} else if (n <= 1.8) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = (n * (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i tmp = 0 if n <= -1.12e-33: tmp = t_0 elif n <= 6e-166: tmp = 0.0 / (i / n) elif n <= 1.8: tmp = 100.0 * (i / (i / n)) else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(Float64(n * Float64(i * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667)))))))) / i) tmp = 0.0 if (n <= -1.12e-33) tmp = t_0; elseif (n <= 6e-166) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 1.8) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = t_0; end return tmp end
function tmp_2 = code(i, n) t_0 = (n * (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i; tmp = 0.0; if (n <= -1.12e-33) tmp = t_0; elseif (n <= 6e-166) tmp = 0.0 / (i / n); elseif (n <= 1.8) tmp = 100.0 * (i / (i / n)); else tmp = t_0; end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(N[(n * N[(i * N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]}, If[LessEqual[n, -1.12e-33], t$95$0, If[LessEqual[n, 6e-166], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.8], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{n \cdot \left(i \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\right)}{i}\\
\mathbf{if}\;n \leq -1.12 \cdot 10^{-33}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 6 \cdot 10^{-166}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.8:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -1.11999999999999999e-33 or 1.80000000000000004 < n Initial program 26.7%
associate-/r/27.1%
associate-*r*27.1%
*-commutative27.1%
associate-*r/27.1%
sub-neg27.1%
distribute-lft-in27.1%
metadata-eval27.1%
metadata-eval27.1%
metadata-eval27.1%
fma-define27.1%
metadata-eval27.1%
Simplified27.1%
Taylor expanded in n around inf 32.0%
sub-neg32.0%
metadata-eval32.0%
metadata-eval32.0%
distribute-lft-in32.0%
metadata-eval32.0%
sub-neg32.0%
expm1-define84.7%
Simplified84.7%
Taylor expanded in i around 0 74.8%
*-commutative74.8%
Simplified74.8%
if -1.11999999999999999e-33 < n < 6.0000000000000005e-166Initial program 53.3%
associate-*r/53.3%
sub-neg53.3%
distribute-rgt-in53.3%
metadata-eval53.3%
metadata-eval53.3%
Simplified53.3%
Taylor expanded in i around 0 63.2%
if 6.0000000000000005e-166 < n < 1.80000000000000004Initial program 13.6%
Taylor expanded in i around 0 65.9%
Final simplification70.7%
(FPCore (i n)
:precision binary64
(if (<= n -1.12e-33)
(+ (* n 100.0) (* i (+ (* 16.666666666666668 (* i n)) (* n 50.0))))
(if (<= n 2.1e-166)
(/ 0.0 (/ i n))
(if (<= n 1.95)
(* 100.0 (/ i (/ i n)))
(/
(+
100.0
(* i (+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667))))))
(/ 1.0 n))))))
double code(double i, double n) {
double tmp;
if (n <= -1.12e-33) {
tmp = (n * 100.0) + (i * ((16.666666666666668 * (i * n)) + (n * 50.0)));
} else if (n <= 2.1e-166) {
tmp = 0.0 / (i / n);
} else if (n <= 1.95) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))) / (1.0 / n);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-1.12d-33)) then
tmp = (n * 100.0d0) + (i * ((16.666666666666668d0 * (i * n)) + (n * 50.0d0)))
else if (n <= 2.1d-166) then
tmp = 0.0d0 / (i / n)
else if (n <= 1.95d0) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = (100.0d0 + (i * (50.0d0 + (i * (16.666666666666668d0 + (i * 4.166666666666667d0)))))) / (1.0d0 / n)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -1.12e-33) {
tmp = (n * 100.0) + (i * ((16.666666666666668 * (i * n)) + (n * 50.0)));
} else if (n <= 2.1e-166) {
tmp = 0.0 / (i / n);
} else if (n <= 1.95) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))) / (1.0 / n);
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.12e-33: tmp = (n * 100.0) + (i * ((16.666666666666668 * (i * n)) + (n * 50.0))) elif n <= 2.1e-166: tmp = 0.0 / (i / n) elif n <= 1.95: tmp = 100.0 * (i / (i / n)) else: tmp = (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))) / (1.0 / n) return tmp
function code(i, n) tmp = 0.0 if (n <= -1.12e-33) tmp = Float64(Float64(n * 100.0) + Float64(i * Float64(Float64(16.666666666666668 * Float64(i * n)) + Float64(n * 50.0)))); elseif (n <= 2.1e-166) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 1.95) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667)))))) / Float64(1.0 / n)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -1.12e-33) tmp = (n * 100.0) + (i * ((16.666666666666668 * (i * n)) + (n * 50.0))); elseif (n <= 2.1e-166) tmp = 0.0 / (i / n); elseif (n <= 1.95) tmp = 100.0 * (i / (i / n)); else tmp = (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))) / (1.0 / n); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.12e-33], N[(N[(n * 100.0), $MachinePrecision] + N[(i * N[(N[(16.666666666666668 * N[(i * n), $MachinePrecision]), $MachinePrecision] + N[(n * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.1e-166], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.95], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 / n), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.12 \cdot 10^{-33}:\\
\;\;\;\;n \cdot 100 + i \cdot \left(16.666666666666668 \cdot \left(i \cdot n\right) + n \cdot 50\right)\\
\mathbf{elif}\;n \leq 2.1 \cdot 10^{-166}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.95:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;\frac{100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)}{\frac{1}{n}}\\
\end{array}
\end{array}
if n < -1.11999999999999999e-33Initial program 31.2%
associate-/r/31.5%
associate-*r*31.4%
*-commutative31.4%
associate-*r/31.5%
sub-neg31.5%
distribute-lft-in31.6%
metadata-eval31.6%
metadata-eval31.6%
metadata-eval31.6%
fma-define31.5%
metadata-eval31.5%
Simplified31.5%
Taylor expanded in n around inf 29.7%
sub-neg29.7%
metadata-eval29.7%
metadata-eval29.7%
distribute-lft-in29.7%
metadata-eval29.7%
sub-neg29.7%
expm1-define77.9%
Simplified77.9%
Taylor expanded in i around 0 55.8%
if -1.11999999999999999e-33 < n < 2.0999999999999999e-166Initial program 53.3%
associate-*r/53.3%
sub-neg53.3%
distribute-rgt-in53.3%
metadata-eval53.3%
metadata-eval53.3%
Simplified53.3%
Taylor expanded in i around 0 63.2%
if 2.0999999999999999e-166 < n < 1.94999999999999996Initial program 13.6%
Taylor expanded in i around 0 65.9%
if 1.94999999999999996 < n Initial program 21.9%
Taylor expanded in n around inf 34.0%
expm1-define67.5%
Simplified67.5%
associate-*r/67.3%
div-inv67.3%
associate-/r*92.0%
Applied egg-rr92.0%
Taylor expanded in i around 0 91.2%
*-commutative91.2%
Simplified91.2%
Final simplification69.5%
(FPCore (i n)
:precision binary64
(if (<= n -2.6e-108)
(* (* i n) (/ 100.0 i))
(if (<= n 2.75e-163)
(/ 0.0 (/ i n))
(if (<= n 70000000000.0)
(* 100.0 (/ i (/ i n)))
(if (<= n 2.6e+42)
(/ (* i (* n (* i 50.0))) i)
(+ (* n 100.0) (* 50.0 (* i n))))))))
double code(double i, double n) {
double tmp;
if (n <= -2.6e-108) {
tmp = (i * n) * (100.0 / i);
} else if (n <= 2.75e-163) {
tmp = 0.0 / (i / n);
} else if (n <= 70000000000.0) {
tmp = 100.0 * (i / (i / n));
} else if (n <= 2.6e+42) {
tmp = (i * (n * (i * 50.0))) / i;
} else {
tmp = (n * 100.0) + (50.0 * (i * n));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-2.6d-108)) then
tmp = (i * n) * (100.0d0 / i)
else if (n <= 2.75d-163) then
tmp = 0.0d0 / (i / n)
else if (n <= 70000000000.0d0) then
tmp = 100.0d0 * (i / (i / n))
else if (n <= 2.6d+42) then
tmp = (i * (n * (i * 50.0d0))) / i
else
tmp = (n * 100.0d0) + (50.0d0 * (i * n))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -2.6e-108) {
tmp = (i * n) * (100.0 / i);
} else if (n <= 2.75e-163) {
tmp = 0.0 / (i / n);
} else if (n <= 70000000000.0) {
tmp = 100.0 * (i / (i / n));
} else if (n <= 2.6e+42) {
tmp = (i * (n * (i * 50.0))) / i;
} else {
tmp = (n * 100.0) + (50.0 * (i * n));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -2.6e-108: tmp = (i * n) * (100.0 / i) elif n <= 2.75e-163: tmp = 0.0 / (i / n) elif n <= 70000000000.0: tmp = 100.0 * (i / (i / n)) elif n <= 2.6e+42: tmp = (i * (n * (i * 50.0))) / i else: tmp = (n * 100.0) + (50.0 * (i * n)) return tmp
function code(i, n) tmp = 0.0 if (n <= -2.6e-108) tmp = Float64(Float64(i * n) * Float64(100.0 / i)); elseif (n <= 2.75e-163) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 70000000000.0) tmp = Float64(100.0 * Float64(i / Float64(i / n))); elseif (n <= 2.6e+42) tmp = Float64(Float64(i * Float64(n * Float64(i * 50.0))) / i); else tmp = Float64(Float64(n * 100.0) + Float64(50.0 * Float64(i * n))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -2.6e-108) tmp = (i * n) * (100.0 / i); elseif (n <= 2.75e-163) tmp = 0.0 / (i / n); elseif (n <= 70000000000.0) tmp = 100.0 * (i / (i / n)); elseif (n <= 2.6e+42) tmp = (i * (n * (i * 50.0))) / i; else tmp = (n * 100.0) + (50.0 * (i * n)); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -2.6e-108], N[(N[(i * n), $MachinePrecision] * N[(100.0 / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.75e-163], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 70000000000.0], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.6e+42], N[(N[(i * N[(n * N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] + N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.6 \cdot 10^{-108}:\\
\;\;\;\;\left(i \cdot n\right) \cdot \frac{100}{i}\\
\mathbf{elif}\;n \leq 2.75 \cdot 10^{-163}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 70000000000:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 2.6 \cdot 10^{+42}:\\
\;\;\;\;\frac{i \cdot \left(n \cdot \left(i \cdot 50\right)\right)}{i}\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100 + 50 \cdot \left(i \cdot n\right)\\
\end{array}
\end{array}
if n < -2.59999999999999984e-108Initial program 30.6%
associate-/r/30.8%
associate-*r*30.8%
*-commutative30.8%
associate-*r/30.9%
sub-neg30.9%
distribute-lft-in30.9%
metadata-eval30.9%
metadata-eval30.9%
metadata-eval30.9%
fma-define30.9%
metadata-eval30.9%
Simplified30.9%
Taylor expanded in n around inf 26.6%
sub-neg26.6%
metadata-eval26.6%
metadata-eval26.6%
distribute-lft-in26.6%
metadata-eval26.6%
sub-neg26.6%
expm1-define71.2%
Simplified71.2%
Taylor expanded in i around 0 50.8%
*-commutative50.8%
Simplified50.8%
*-commutative50.8%
associate-/l*51.0%
*-commutative51.0%
Applied egg-rr51.0%
if -2.59999999999999984e-108 < n < 2.7499999999999999e-163Initial program 59.2%
associate-*r/59.2%
sub-neg59.2%
distribute-rgt-in59.2%
metadata-eval59.2%
metadata-eval59.2%
Simplified59.2%
Taylor expanded in i around 0 71.3%
if 2.7499999999999999e-163 < n < 7e10Initial program 13.6%
Taylor expanded in i around 0 65.9%
if 7e10 < n < 2.5999999999999999e42Initial program 73.5%
associate-/r/73.5%
associate-*r*73.5%
*-commutative73.5%
associate-*r/73.5%
sub-neg73.5%
distribute-lft-in73.5%
metadata-eval73.5%
metadata-eval73.5%
metadata-eval73.5%
fma-define73.5%
metadata-eval73.5%
Simplified73.5%
Taylor expanded in n around inf 58.9%
sub-neg58.9%
metadata-eval58.9%
metadata-eval58.9%
distribute-lft-in58.8%
metadata-eval58.8%
sub-neg58.8%
expm1-define72.9%
Simplified72.9%
Taylor expanded in i around 0 82.7%
+-commutative82.7%
associate-*r*82.7%
distribute-rgt-in82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in i around inf 65.8%
if 2.5999999999999999e42 < n Initial program 13.3%
associate-/r/13.9%
associate-*r*13.9%
*-commutative13.9%
associate-*r/13.9%
sub-neg13.9%
distribute-lft-in13.9%
metadata-eval13.9%
metadata-eval13.9%
metadata-eval13.9%
fma-define13.9%
metadata-eval13.9%
Simplified13.9%
Taylor expanded in n around inf 30.4%
sub-neg30.4%
metadata-eval30.4%
metadata-eval30.4%
distribute-lft-in30.5%
metadata-eval30.5%
sub-neg30.5%
expm1-define95.2%
Simplified95.2%
Taylor expanded in i around 0 84.3%
Final simplification66.3%
(FPCore (i n)
:precision binary64
(if (<= n -1.12e-33)
(/ (* i (* n (+ 100.0 (* i 50.0)))) i)
(if (<= n 7e-167)
(/ 0.0 (/ i n))
(if (<= n 5.5e-8)
(* 100.0 (/ i (/ i n)))
(/ (* i (+ (* n 100.0) (* 50.0 (* i n)))) i)))))
double code(double i, double n) {
double tmp;
if (n <= -1.12e-33) {
tmp = (i * (n * (100.0 + (i * 50.0)))) / i;
} else if (n <= 7e-167) {
tmp = 0.0 / (i / n);
} else if (n <= 5.5e-8) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-1.12d-33)) then
tmp = (i * (n * (100.0d0 + (i * 50.0d0)))) / i
else if (n <= 7d-167) then
tmp = 0.0d0 / (i / n)
else if (n <= 5.5d-8) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = (i * ((n * 100.0d0) + (50.0d0 * (i * n)))) / i
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -1.12e-33) {
tmp = (i * (n * (100.0 + (i * 50.0)))) / i;
} else if (n <= 7e-167) {
tmp = 0.0 / (i / n);
} else if (n <= 5.5e-8) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i;
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.12e-33: tmp = (i * (n * (100.0 + (i * 50.0)))) / i elif n <= 7e-167: tmp = 0.0 / (i / n) elif n <= 5.5e-8: tmp = 100.0 * (i / (i / n)) else: tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i return tmp
function code(i, n) tmp = 0.0 if (n <= -1.12e-33) tmp = Float64(Float64(i * Float64(n * Float64(100.0 + Float64(i * 50.0)))) / i); elseif (n <= 7e-167) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 5.5e-8) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(Float64(i * Float64(Float64(n * 100.0) + Float64(50.0 * Float64(i * n)))) / i); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -1.12e-33) tmp = (i * (n * (100.0 + (i * 50.0)))) / i; elseif (n <= 7e-167) tmp = 0.0 / (i / n); elseif (n <= 5.5e-8) tmp = 100.0 * (i / (i / n)); else tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i; end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.12e-33], N[(N[(i * N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision], If[LessEqual[n, 7e-167], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5.5e-8], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(i * N[(N[(n * 100.0), $MachinePrecision] + N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.12 \cdot 10^{-33}:\\
\;\;\;\;\frac{i \cdot \left(n \cdot \left(100 + i \cdot 50\right)\right)}{i}\\
\mathbf{elif}\;n \leq 7 \cdot 10^{-167}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 5.5 \cdot 10^{-8}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;\frac{i \cdot \left(n \cdot 100 + 50 \cdot \left(i \cdot n\right)\right)}{i}\\
\end{array}
\end{array}
if n < -1.11999999999999999e-33Initial program 31.2%
associate-/r/31.5%
associate-*r*31.4%
*-commutative31.4%
associate-*r/31.5%
sub-neg31.5%
distribute-lft-in31.6%
metadata-eval31.6%
metadata-eval31.6%
metadata-eval31.6%
fma-define31.5%
metadata-eval31.5%
Simplified31.5%
Taylor expanded in n around inf 29.7%
sub-neg29.7%
metadata-eval29.7%
metadata-eval29.7%
distribute-lft-in29.7%
metadata-eval29.7%
sub-neg29.7%
expm1-define77.9%
Simplified77.9%
Taylor expanded in i around 0 55.1%
+-commutative55.1%
associate-*r*55.1%
distribute-rgt-in55.1%
*-commutative55.1%
Simplified55.1%
if -1.11999999999999999e-33 < n < 6.9999999999999998e-167Initial program 53.3%
associate-*r/53.3%
sub-neg53.3%
distribute-rgt-in53.3%
metadata-eval53.3%
metadata-eval53.3%
Simplified53.3%
Taylor expanded in i around 0 63.2%
if 6.9999999999999998e-167 < n < 5.5000000000000003e-8Initial program 10.5%
Taylor expanded in i around 0 67.0%
if 5.5000000000000003e-8 < n Initial program 22.6%
associate-/r/23.1%
associate-*r*23.2%
*-commutative23.2%
associate-*r/23.1%
sub-neg23.1%
distribute-lft-in23.1%
metadata-eval23.1%
metadata-eval23.1%
metadata-eval23.1%
fma-define23.1%
metadata-eval23.1%
Simplified23.1%
Taylor expanded in n around inf 33.7%
sub-neg33.7%
metadata-eval33.7%
metadata-eval33.7%
distribute-lft-in33.7%
metadata-eval33.7%
sub-neg33.7%
expm1-define90.9%
Simplified90.9%
Taylor expanded in i around 0 87.8%
Final simplification68.5%
(FPCore (i n)
:precision binary64
(if (<= n -1.12e-33)
(/ (+ 100.0 (* i (+ 50.0 (* i 16.666666666666668)))) (/ 1.0 n))
(if (<= n 1.15e-166)
(/ 0.0 (/ i n))
(if (<= n 1.8e-7)
(* 100.0 (/ i (/ i n)))
(/ (* i (+ (* n 100.0) (* 50.0 (* i n)))) i)))))
double code(double i, double n) {
double tmp;
if (n <= -1.12e-33) {
tmp = (100.0 + (i * (50.0 + (i * 16.666666666666668)))) / (1.0 / n);
} else if (n <= 1.15e-166) {
tmp = 0.0 / (i / n);
} else if (n <= 1.8e-7) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-1.12d-33)) then
tmp = (100.0d0 + (i * (50.0d0 + (i * 16.666666666666668d0)))) / (1.0d0 / n)
else if (n <= 1.15d-166) then
tmp = 0.0d0 / (i / n)
else if (n <= 1.8d-7) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = (i * ((n * 100.0d0) + (50.0d0 * (i * n)))) / i
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -1.12e-33) {
tmp = (100.0 + (i * (50.0 + (i * 16.666666666666668)))) / (1.0 / n);
} else if (n <= 1.15e-166) {
tmp = 0.0 / (i / n);
} else if (n <= 1.8e-7) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i;
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.12e-33: tmp = (100.0 + (i * (50.0 + (i * 16.666666666666668)))) / (1.0 / n) elif n <= 1.15e-166: tmp = 0.0 / (i / n) elif n <= 1.8e-7: tmp = 100.0 * (i / (i / n)) else: tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i return tmp
function code(i, n) tmp = 0.0 if (n <= -1.12e-33) tmp = Float64(Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * 16.666666666666668)))) / Float64(1.0 / n)); elseif (n <= 1.15e-166) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 1.8e-7) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(Float64(i * Float64(Float64(n * 100.0) + Float64(50.0 * Float64(i * n)))) / i); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -1.12e-33) tmp = (100.0 + (i * (50.0 + (i * 16.666666666666668)))) / (1.0 / n); elseif (n <= 1.15e-166) tmp = 0.0 / (i / n); elseif (n <= 1.8e-7) tmp = 100.0 * (i / (i / n)); else tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i; end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.12e-33], N[(N[(100.0 + N[(i * N[(50.0 + N[(i * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.15e-166], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.8e-7], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(i * N[(N[(n * 100.0), $MachinePrecision] + N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.12 \cdot 10^{-33}:\\
\;\;\;\;\frac{100 + i \cdot \left(50 + i \cdot 16.666666666666668\right)}{\frac{1}{n}}\\
\mathbf{elif}\;n \leq 1.15 \cdot 10^{-166}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.8 \cdot 10^{-7}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;\frac{i \cdot \left(n \cdot 100 + 50 \cdot \left(i \cdot n\right)\right)}{i}\\
\end{array}
\end{array}
if n < -1.11999999999999999e-33Initial program 31.2%
Taylor expanded in n around inf 29.5%
expm1-define61.5%
Simplified61.5%
associate-*r/61.3%
div-inv61.3%
associate-/r*78.0%
Applied egg-rr78.0%
Taylor expanded in i around 0 55.7%
*-commutative55.7%
Simplified55.7%
if -1.11999999999999999e-33 < n < 1.14999999999999999e-166Initial program 53.3%
associate-*r/53.3%
sub-neg53.3%
distribute-rgt-in53.3%
metadata-eval53.3%
metadata-eval53.3%
Simplified53.3%
Taylor expanded in i around 0 63.2%
if 1.14999999999999999e-166 < n < 1.79999999999999997e-7Initial program 10.5%
Taylor expanded in i around 0 67.0%
if 1.79999999999999997e-7 < n Initial program 22.6%
associate-/r/23.1%
associate-*r*23.2%
*-commutative23.2%
associate-*r/23.1%
sub-neg23.1%
distribute-lft-in23.1%
metadata-eval23.1%
metadata-eval23.1%
metadata-eval23.1%
fma-define23.1%
metadata-eval23.1%
Simplified23.1%
Taylor expanded in n around inf 33.7%
sub-neg33.7%
metadata-eval33.7%
metadata-eval33.7%
distribute-lft-in33.7%
metadata-eval33.7%
sub-neg33.7%
expm1-define90.9%
Simplified90.9%
Taylor expanded in i around 0 87.8%
Final simplification68.7%
(FPCore (i n)
:precision binary64
(if (<= n -1.12e-33)
(+ (* n 100.0) (* i (+ (* 16.666666666666668 (* i n)) (* n 50.0))))
(if (<= n 5.5e-167)
(/ 0.0 (/ i n))
(if (<= n 1.8e-7)
(* 100.0 (/ i (/ i n)))
(/ (* i (+ (* n 100.0) (* 50.0 (* i n)))) i)))))
double code(double i, double n) {
double tmp;
if (n <= -1.12e-33) {
tmp = (n * 100.0) + (i * ((16.666666666666668 * (i * n)) + (n * 50.0)));
} else if (n <= 5.5e-167) {
tmp = 0.0 / (i / n);
} else if (n <= 1.8e-7) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-1.12d-33)) then
tmp = (n * 100.0d0) + (i * ((16.666666666666668d0 * (i * n)) + (n * 50.0d0)))
else if (n <= 5.5d-167) then
tmp = 0.0d0 / (i / n)
else if (n <= 1.8d-7) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = (i * ((n * 100.0d0) + (50.0d0 * (i * n)))) / i
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -1.12e-33) {
tmp = (n * 100.0) + (i * ((16.666666666666668 * (i * n)) + (n * 50.0)));
} else if (n <= 5.5e-167) {
tmp = 0.0 / (i / n);
} else if (n <= 1.8e-7) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i;
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.12e-33: tmp = (n * 100.0) + (i * ((16.666666666666668 * (i * n)) + (n * 50.0))) elif n <= 5.5e-167: tmp = 0.0 / (i / n) elif n <= 1.8e-7: tmp = 100.0 * (i / (i / n)) else: tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i return tmp
function code(i, n) tmp = 0.0 if (n <= -1.12e-33) tmp = Float64(Float64(n * 100.0) + Float64(i * Float64(Float64(16.666666666666668 * Float64(i * n)) + Float64(n * 50.0)))); elseif (n <= 5.5e-167) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 1.8e-7) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(Float64(i * Float64(Float64(n * 100.0) + Float64(50.0 * Float64(i * n)))) / i); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -1.12e-33) tmp = (n * 100.0) + (i * ((16.666666666666668 * (i * n)) + (n * 50.0))); elseif (n <= 5.5e-167) tmp = 0.0 / (i / n); elseif (n <= 1.8e-7) tmp = 100.0 * (i / (i / n)); else tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i; end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.12e-33], N[(N[(n * 100.0), $MachinePrecision] + N[(i * N[(N[(16.666666666666668 * N[(i * n), $MachinePrecision]), $MachinePrecision] + N[(n * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5.5e-167], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.8e-7], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(i * N[(N[(n * 100.0), $MachinePrecision] + N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.12 \cdot 10^{-33}:\\
\;\;\;\;n \cdot 100 + i \cdot \left(16.666666666666668 \cdot \left(i \cdot n\right) + n \cdot 50\right)\\
\mathbf{elif}\;n \leq 5.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.8 \cdot 10^{-7}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;\frac{i \cdot \left(n \cdot 100 + 50 \cdot \left(i \cdot n\right)\right)}{i}\\
\end{array}
\end{array}
if n < -1.11999999999999999e-33Initial program 31.2%
associate-/r/31.5%
associate-*r*31.4%
*-commutative31.4%
associate-*r/31.5%
sub-neg31.5%
distribute-lft-in31.6%
metadata-eval31.6%
metadata-eval31.6%
metadata-eval31.6%
fma-define31.5%
metadata-eval31.5%
Simplified31.5%
Taylor expanded in n around inf 29.7%
sub-neg29.7%
metadata-eval29.7%
metadata-eval29.7%
distribute-lft-in29.7%
metadata-eval29.7%
sub-neg29.7%
expm1-define77.9%
Simplified77.9%
Taylor expanded in i around 0 55.8%
if -1.11999999999999999e-33 < n < 5.5000000000000003e-167Initial program 53.3%
associate-*r/53.3%
sub-neg53.3%
distribute-rgt-in53.3%
metadata-eval53.3%
metadata-eval53.3%
Simplified53.3%
Taylor expanded in i around 0 63.2%
if 5.5000000000000003e-167 < n < 1.79999999999999997e-7Initial program 10.5%
Taylor expanded in i around 0 67.0%
if 1.79999999999999997e-7 < n Initial program 22.6%
associate-/r/23.1%
associate-*r*23.2%
*-commutative23.2%
associate-*r/23.1%
sub-neg23.1%
distribute-lft-in23.1%
metadata-eval23.1%
metadata-eval23.1%
metadata-eval23.1%
fma-define23.1%
metadata-eval23.1%
Simplified23.1%
Taylor expanded in n around inf 33.7%
sub-neg33.7%
metadata-eval33.7%
metadata-eval33.7%
distribute-lft-in33.7%
metadata-eval33.7%
sub-neg33.7%
expm1-define90.9%
Simplified90.9%
Taylor expanded in i around 0 87.8%
Final simplification68.8%
(FPCore (i n)
:precision binary64
(let* ((t_0 (/ (* i (* n (+ 100.0 (* i 50.0)))) i)))
(if (<= n -1.12e-33)
t_0
(if (<= n 2.05e-162)
(/ 0.0 (/ i n))
(if (<= n 1.65e-7) (* 100.0 (/ i (/ i n))) t_0)))))
double code(double i, double n) {
double t_0 = (i * (n * (100.0 + (i * 50.0)))) / i;
double tmp;
if (n <= -1.12e-33) {
tmp = t_0;
} else if (n <= 2.05e-162) {
tmp = 0.0 / (i / n);
} else if (n <= 1.65e-7) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = (i * (n * (100.0d0 + (i * 50.0d0)))) / i
if (n <= (-1.12d-33)) then
tmp = t_0
else if (n <= 2.05d-162) then
tmp = 0.0d0 / (i / n)
else if (n <= 1.65d-7) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = (i * (n * (100.0 + (i * 50.0)))) / i;
double tmp;
if (n <= -1.12e-33) {
tmp = t_0;
} else if (n <= 2.05e-162) {
tmp = 0.0 / (i / n);
} else if (n <= 1.65e-7) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = (i * (n * (100.0 + (i * 50.0)))) / i tmp = 0 if n <= -1.12e-33: tmp = t_0 elif n <= 2.05e-162: tmp = 0.0 / (i / n) elif n <= 1.65e-7: tmp = 100.0 * (i / (i / n)) else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(Float64(i * Float64(n * Float64(100.0 + Float64(i * 50.0)))) / i) tmp = 0.0 if (n <= -1.12e-33) tmp = t_0; elseif (n <= 2.05e-162) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 1.65e-7) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = t_0; end return tmp end
function tmp_2 = code(i, n) t_0 = (i * (n * (100.0 + (i * 50.0)))) / i; tmp = 0.0; if (n <= -1.12e-33) tmp = t_0; elseif (n <= 2.05e-162) tmp = 0.0 / (i / n); elseif (n <= 1.65e-7) tmp = 100.0 * (i / (i / n)); else tmp = t_0; end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(N[(i * N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]}, If[LessEqual[n, -1.12e-33], t$95$0, If[LessEqual[n, 2.05e-162], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.65e-7], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{i \cdot \left(n \cdot \left(100 + i \cdot 50\right)\right)}{i}\\
\mathbf{if}\;n \leq -1.12 \cdot 10^{-33}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 2.05 \cdot 10^{-162}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.65 \cdot 10^{-7}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -1.11999999999999999e-33 or 1.6500000000000001e-7 < n Initial program 27.0%
associate-/r/27.4%
associate-*r*27.4%
*-commutative27.4%
associate-*r/27.4%
sub-neg27.4%
distribute-lft-in27.4%
metadata-eval27.4%
metadata-eval27.4%
metadata-eval27.4%
fma-define27.4%
metadata-eval27.4%
Simplified27.4%
Taylor expanded in n around inf 31.7%
sub-neg31.7%
metadata-eval31.7%
metadata-eval31.7%
distribute-lft-in31.7%
metadata-eval31.7%
sub-neg31.7%
expm1-define84.3%
Simplified84.3%
Taylor expanded in i around 0 71.2%
+-commutative71.2%
associate-*r*71.2%
distribute-rgt-in71.1%
*-commutative71.1%
Simplified71.1%
if -1.11999999999999999e-33 < n < 2.0500000000000001e-162Initial program 53.3%
associate-*r/53.3%
sub-neg53.3%
distribute-rgt-in53.3%
metadata-eval53.3%
metadata-eval53.3%
Simplified53.3%
Taylor expanded in i around 0 63.2%
if 2.0500000000000001e-162 < n < 1.6500000000000001e-7Initial program 10.5%
Taylor expanded in i around 0 67.0%
Final simplification68.5%
(FPCore (i n)
:precision binary64
(if (<= n -8.4e+45)
(* (* i n) (/ 100.0 i))
(if (<= n 1.8e-7)
(* 100.0 (/ i (/ i n)))
(+ (* n 100.0) (* 50.0 (* i n))))))
double code(double i, double n) {
double tmp;
if (n <= -8.4e+45) {
tmp = (i * n) * (100.0 / i);
} else if (n <= 1.8e-7) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * 100.0) + (50.0 * (i * n));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-8.4d+45)) then
tmp = (i * n) * (100.0d0 / i)
else if (n <= 1.8d-7) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = (n * 100.0d0) + (50.0d0 * (i * n))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -8.4e+45) {
tmp = (i * n) * (100.0 / i);
} else if (n <= 1.8e-7) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * 100.0) + (50.0 * (i * n));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -8.4e+45: tmp = (i * n) * (100.0 / i) elif n <= 1.8e-7: tmp = 100.0 * (i / (i / n)) else: tmp = (n * 100.0) + (50.0 * (i * n)) return tmp
function code(i, n) tmp = 0.0 if (n <= -8.4e+45) tmp = Float64(Float64(i * n) * Float64(100.0 / i)); elseif (n <= 1.8e-7) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(Float64(n * 100.0) + Float64(50.0 * Float64(i * n))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -8.4e+45) tmp = (i * n) * (100.0 / i); elseif (n <= 1.8e-7) tmp = 100.0 * (i / (i / n)); else tmp = (n * 100.0) + (50.0 * (i * n)); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -8.4e+45], N[(N[(i * n), $MachinePrecision] * N[(100.0 / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.8e-7], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] + N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -8.4 \cdot 10^{+45}:\\
\;\;\;\;\left(i \cdot n\right) \cdot \frac{100}{i}\\
\mathbf{elif}\;n \leq 1.8 \cdot 10^{-7}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100 + 50 \cdot \left(i \cdot n\right)\\
\end{array}
\end{array}
if n < -8.39999999999999979e45Initial program 30.2%
associate-/r/30.6%
associate-*r*30.5%
*-commutative30.5%
associate-*r/30.7%
sub-neg30.7%
distribute-lft-in30.7%
metadata-eval30.7%
metadata-eval30.7%
metadata-eval30.7%
fma-define30.7%
metadata-eval30.7%
Simplified30.7%
Taylor expanded in n around inf 33.4%
sub-neg33.4%
metadata-eval33.4%
metadata-eval33.4%
distribute-lft-in33.4%
metadata-eval33.4%
sub-neg33.4%
expm1-define78.3%
Simplified78.3%
Taylor expanded in i around 0 52.0%
*-commutative52.0%
Simplified52.0%
*-commutative52.0%
associate-/l*52.2%
*-commutative52.2%
Applied egg-rr52.2%
if -8.39999999999999979e45 < n < 1.79999999999999997e-7Initial program 41.3%
Taylor expanded in i around 0 52.0%
if 1.79999999999999997e-7 < n Initial program 22.6%
associate-/r/23.1%
associate-*r*23.2%
*-commutative23.2%
associate-*r/23.1%
sub-neg23.1%
distribute-lft-in23.1%
metadata-eval23.1%
metadata-eval23.1%
metadata-eval23.1%
fma-define23.1%
metadata-eval23.1%
Simplified23.1%
Taylor expanded in n around inf 33.7%
sub-neg33.7%
metadata-eval33.7%
metadata-eval33.7%
distribute-lft-in33.7%
metadata-eval33.7%
sub-neg33.7%
expm1-define90.9%
Simplified90.9%
Taylor expanded in i around 0 75.1%
Final simplification59.2%
(FPCore (i n) :precision binary64 (if (or (<= i -1e+61) (not (<= i 10.0))) (* 100.0 (/ i (/ i n))) (* n 100.0)))
double code(double i, double n) {
double tmp;
if ((i <= -1e+61) || !(i <= 10.0)) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * 100.0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((i <= (-1d+61)) .or. (.not. (i <= 10.0d0))) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = n * 100.0d0
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((i <= -1e+61) || !(i <= 10.0)) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * 100.0;
}
return tmp;
}
def code(i, n): tmp = 0 if (i <= -1e+61) or not (i <= 10.0): tmp = 100.0 * (i / (i / n)) else: tmp = n * 100.0 return tmp
function code(i, n) tmp = 0.0 if ((i <= -1e+61) || !(i <= 10.0)) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(n * 100.0); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((i <= -1e+61) || ~((i <= 10.0))) tmp = 100.0 * (i / (i / n)); else tmp = n * 100.0; end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[i, -1e+61], N[Not[LessEqual[i, 10.0]], $MachinePrecision]], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * 100.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -1 \cdot 10^{+61} \lor \neg \left(i \leq 10\right):\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100\\
\end{array}
\end{array}
if i < -9.99999999999999949e60 or 10 < i Initial program 57.2%
Taylor expanded in i around 0 22.8%
if -9.99999999999999949e60 < i < 10Initial program 13.4%
Taylor expanded in i around 0 79.3%
*-commutative79.3%
Simplified79.3%
Final simplification54.4%
(FPCore (i n) :precision binary64 (if (or (<= n -8e+45) (not (<= n 1.8e-7))) (* n (+ 100.0 (* i 50.0))) (* 100.0 (/ i (/ i n)))))
double code(double i, double n) {
double tmp;
if ((n <= -8e+45) || !(n <= 1.8e-7)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-8d+45)) .or. (.not. (n <= 1.8d-7))) then
tmp = n * (100.0d0 + (i * 50.0d0))
else
tmp = 100.0d0 * (i / (i / n))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -8e+45) || !(n <= 1.8e-7)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -8e+45) or not (n <= 1.8e-7): tmp = n * (100.0 + (i * 50.0)) else: tmp = 100.0 * (i / (i / n)) return tmp
function code(i, n) tmp = 0.0 if ((n <= -8e+45) || !(n <= 1.8e-7)) tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); else tmp = Float64(100.0 * Float64(i / Float64(i / n))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -8e+45) || ~((n <= 1.8e-7))) tmp = n * (100.0 + (i * 50.0)); else tmp = 100.0 * (i / (i / n)); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -8e+45], N[Not[LessEqual[n, 1.8e-7]], $MachinePrecision]], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -8 \cdot 10^{+45} \lor \neg \left(n \leq 1.8 \cdot 10^{-7}\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -7.9999999999999994e45 or 1.79999999999999997e-7 < n Initial program 26.1%
associate-/r/26.5%
associate-*r*26.5%
*-commutative26.5%
associate-*r/26.5%
sub-neg26.5%
distribute-lft-in26.5%
metadata-eval26.5%
metadata-eval26.5%
metadata-eval26.5%
fma-define26.5%
metadata-eval26.5%
Simplified26.5%
Taylor expanded in i around 0 68.8%
*-commutative68.8%
associate-*r/68.8%
metadata-eval68.8%
Simplified68.8%
Taylor expanded in n around inf 64.5%
*-commutative64.5%
Simplified64.5%
if -7.9999999999999994e45 < n < 1.79999999999999997e-7Initial program 41.3%
Taylor expanded in i around 0 52.0%
Final simplification59.0%
(FPCore (i n) :precision binary64 (if (<= n -8e+45) (* (* i n) (/ 100.0 i)) (if (<= n 1.8e-7) (* 100.0 (/ i (/ i n))) (* n (+ 100.0 (* i 50.0))))))
double code(double i, double n) {
double tmp;
if (n <= -8e+45) {
tmp = (i * n) * (100.0 / i);
} else if (n <= 1.8e-7) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-8d+45)) then
tmp = (i * n) * (100.0d0 / i)
else if (n <= 1.8d-7) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = n * (100.0d0 + (i * 50.0d0))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -8e+45) {
tmp = (i * n) * (100.0 / i);
} else if (n <= 1.8e-7) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -8e+45: tmp = (i * n) * (100.0 / i) elif n <= 1.8e-7: tmp = 100.0 * (i / (i / n)) else: tmp = n * (100.0 + (i * 50.0)) return tmp
function code(i, n) tmp = 0.0 if (n <= -8e+45) tmp = Float64(Float64(i * n) * Float64(100.0 / i)); elseif (n <= 1.8e-7) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -8e+45) tmp = (i * n) * (100.0 / i); elseif (n <= 1.8e-7) tmp = 100.0 * (i / (i / n)); else tmp = n * (100.0 + (i * 50.0)); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -8e+45], N[(N[(i * n), $MachinePrecision] * N[(100.0 / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.8e-7], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -8 \cdot 10^{+45}:\\
\;\;\;\;\left(i \cdot n\right) \cdot \frac{100}{i}\\
\mathbf{elif}\;n \leq 1.8 \cdot 10^{-7}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if n < -7.9999999999999994e45Initial program 30.2%
associate-/r/30.6%
associate-*r*30.5%
*-commutative30.5%
associate-*r/30.7%
sub-neg30.7%
distribute-lft-in30.7%
metadata-eval30.7%
metadata-eval30.7%
metadata-eval30.7%
fma-define30.7%
metadata-eval30.7%
Simplified30.7%
Taylor expanded in n around inf 33.4%
sub-neg33.4%
metadata-eval33.4%
metadata-eval33.4%
distribute-lft-in33.4%
metadata-eval33.4%
sub-neg33.4%
expm1-define78.3%
Simplified78.3%
Taylor expanded in i around 0 52.0%
*-commutative52.0%
Simplified52.0%
*-commutative52.0%
associate-/l*52.2%
*-commutative52.2%
Applied egg-rr52.2%
if -7.9999999999999994e45 < n < 1.79999999999999997e-7Initial program 41.3%
Taylor expanded in i around 0 52.0%
if 1.79999999999999997e-7 < n Initial program 22.6%
associate-/r/23.1%
associate-*r*23.2%
*-commutative23.2%
associate-*r/23.1%
sub-neg23.1%
distribute-lft-in23.1%
metadata-eval23.1%
metadata-eval23.1%
metadata-eval23.1%
fma-define23.1%
metadata-eval23.1%
Simplified23.1%
Taylor expanded in i around 0 83.0%
*-commutative83.0%
associate-*r/83.0%
metadata-eval83.0%
Simplified83.0%
Taylor expanded in n around inf 75.0%
*-commutative75.0%
Simplified75.0%
Final simplification59.2%
(FPCore (i n) :precision binary64 (if (<= i 5.4e+54) (* n 100.0) (* 50.0 (* i n))))
double code(double i, double n) {
double tmp;
if (i <= 5.4e+54) {
tmp = n * 100.0;
} else {
tmp = 50.0 * (i * n);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (i <= 5.4d+54) then
tmp = n * 100.0d0
else
tmp = 50.0d0 * (i * n)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (i <= 5.4e+54) {
tmp = n * 100.0;
} else {
tmp = 50.0 * (i * n);
}
return tmp;
}
def code(i, n): tmp = 0 if i <= 5.4e+54: tmp = n * 100.0 else: tmp = 50.0 * (i * n) return tmp
function code(i, n) tmp = 0.0 if (i <= 5.4e+54) tmp = Float64(n * 100.0); else tmp = Float64(50.0 * Float64(i * n)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (i <= 5.4e+54) tmp = n * 100.0; else tmp = 50.0 * (i * n); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, 5.4e+54], N[(n * 100.0), $MachinePrecision], N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq 5.4 \cdot 10^{+54}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;50 \cdot \left(i \cdot n\right)\\
\end{array}
\end{array}
if i < 5.40000000000000022e54Initial program 28.2%
Taylor expanded in i around 0 57.8%
*-commutative57.8%
Simplified57.8%
if 5.40000000000000022e54 < i Initial program 49.4%
associate-/r/49.6%
associate-*r*49.6%
*-commutative49.6%
associate-*r/49.7%
sub-neg49.7%
distribute-lft-in49.8%
metadata-eval49.8%
metadata-eval49.8%
metadata-eval49.8%
fma-define49.7%
metadata-eval49.7%
Simplified49.7%
Taylor expanded in n around inf 39.0%
sub-neg39.0%
metadata-eval39.0%
metadata-eval39.0%
distribute-lft-in39.0%
metadata-eval39.0%
sub-neg39.0%
expm1-define39.0%
Simplified39.0%
Taylor expanded in i around 0 21.0%
Taylor expanded in i around inf 21.0%
Final simplification49.9%
(FPCore (i n) :precision binary64 (* i -50.0))
double code(double i, double n) {
return i * -50.0;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = i * (-50.0d0)
end function
public static double code(double i, double n) {
return i * -50.0;
}
def code(i, n): return i * -50.0
function code(i, n) return Float64(i * -50.0) end
function tmp = code(i, n) tmp = i * -50.0; end
code[i_, n_] := N[(i * -50.0), $MachinePrecision]
\begin{array}{l}
\\
i \cdot -50
\end{array}
Initial program 32.7%
associate-/r/33.1%
associate-*r*33.1%
*-commutative33.1%
associate-*r/33.1%
sub-neg33.1%
distribute-lft-in33.1%
metadata-eval33.1%
metadata-eval33.1%
metadata-eval33.1%
fma-define33.1%
metadata-eval33.1%
Simplified33.1%
Taylor expanded in i around 0 52.6%
*-commutative52.6%
associate-*r/52.6%
metadata-eval52.6%
Simplified52.6%
Taylor expanded in n around 0 2.5%
*-commutative2.5%
Simplified2.5%
Final simplification2.5%
(FPCore (i n) :precision binary64 (* n 100.0))
double code(double i, double n) {
return n * 100.0;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = n * 100.0d0
end function
public static double code(double i, double n) {
return n * 100.0;
}
def code(i, n): return n * 100.0
function code(i, n) return Float64(n * 100.0) end
function tmp = code(i, n) tmp = n * 100.0; end
code[i_, n_] := N[(n * 100.0), $MachinePrecision]
\begin{array}{l}
\\
n \cdot 100
\end{array}
Initial program 32.7%
Taylor expanded in i around 0 46.3%
*-commutative46.3%
Simplified46.3%
Final simplification46.3%
(FPCore (i n)
:precision binary64
(let* ((t_0 (+ 1.0 (/ i n))))
(*
100.0
(/
(-
(exp
(*
n
(if (== t_0 1.0)
(/ i n)
(/ (* (/ i n) (log t_0)) (- (+ (/ i n) 1.0) 1.0)))))
1.0)
(/ i n)))))
double code(double i, double n) {
double t_0 = 1.0 + (i / n);
double tmp;
if (t_0 == 1.0) {
tmp = i / n;
} else {
tmp = ((i / n) * log(t_0)) / (((i / n) + 1.0) - 1.0);
}
return 100.0 * ((exp((n * tmp)) - 1.0) / (i / n));
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (i / n)
if (t_0 == 1.0d0) then
tmp = i / n
else
tmp = ((i / n) * log(t_0)) / (((i / n) + 1.0d0) - 1.0d0)
end if
code = 100.0d0 * ((exp((n * tmp)) - 1.0d0) / (i / n))
end function
public static double code(double i, double n) {
double t_0 = 1.0 + (i / n);
double tmp;
if (t_0 == 1.0) {
tmp = i / n;
} else {
tmp = ((i / n) * Math.log(t_0)) / (((i / n) + 1.0) - 1.0);
}
return 100.0 * ((Math.exp((n * tmp)) - 1.0) / (i / n));
}
def code(i, n): t_0 = 1.0 + (i / n) tmp = 0 if t_0 == 1.0: tmp = i / n else: tmp = ((i / n) * math.log(t_0)) / (((i / n) + 1.0) - 1.0) return 100.0 * ((math.exp((n * tmp)) - 1.0) / (i / n))
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) tmp = 0.0 if (t_0 == 1.0) tmp = Float64(i / n); else tmp = Float64(Float64(Float64(i / n) * log(t_0)) / Float64(Float64(Float64(i / n) + 1.0) - 1.0)); end return Float64(100.0 * Float64(Float64(exp(Float64(n * tmp)) - 1.0) / Float64(i / n))) end
function tmp_2 = code(i, n) t_0 = 1.0 + (i / n); tmp = 0.0; if (t_0 == 1.0) tmp = i / n; else tmp = ((i / n) * log(t_0)) / (((i / n) + 1.0) - 1.0); end tmp_2 = 100.0 * ((exp((n * tmp)) - 1.0) / (i / n)); end
code[i_, n_] := Block[{t$95$0 = N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision]}, N[(100.0 * N[(N[(N[Exp[N[(n * If[Equal[t$95$0, 1.0], N[(i / n), $MachinePrecision], N[(N[(N[(i / n), $MachinePrecision] * N[Log[t$95$0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(i / n), $MachinePrecision] + 1.0), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]], $MachinePrecision] - 1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{i}{n}\\
100 \cdot \frac{e^{n \cdot \begin{array}{l}
\mathbf{if}\;t\_0 = 1:\\
\;\;\;\;\frac{i}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{i}{n} \cdot \log t\_0}{\left(\frac{i}{n} + 1\right) - 1}\\
\end{array}} - 1}{\frac{i}{n}}
\end{array}
\end{array}
herbie shell --seed 2024112
(FPCore (i n)
:name "Compound Interest"
:precision binary64
:alt
(* 100.0 (/ (- (exp (* n (if (== (+ 1.0 (/ i n)) 1.0) (/ i n) (/ (* (/ i n) (log (+ 1.0 (/ i n)))) (- (+ (/ i n) 1.0) 1.0))))) 1.0) (/ i n)))
(* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))