
(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 21 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 2e-237)
(* n (* 100.0 (/ (expm1 (* n (log1p (/ i n)))) i)))
(if (<= t_1 2e-77)
(* n (/ (fma 100.0 t_0 -100.0) i))
(* (* n 100.0) (/ (expm1 i) i))))))
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 <= 2e-237) {
tmp = n * (100.0 * (expm1((n * log1p((i / n)))) / i));
} else if (t_1 <= 2e-77) {
tmp = n * (fma(100.0, t_0, -100.0) / i);
} else {
tmp = (n * 100.0) * (expm1(i) / i);
}
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 <= 2e-237) tmp = Float64(n * Float64(100.0 * Float64(expm1(Float64(n * log1p(Float64(i / n)))) / i))); elseif (t_1 <= 2e-77) tmp = Float64(n * Float64(fma(100.0, t_0, -100.0) / i)); else tmp = Float64(Float64(n * 100.0) * Float64(expm1(i) / i)); 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, 2e-237], N[(n * N[(100.0 * N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-77], N[(n * N[(N[(100.0 * t$95$0 + -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}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t\_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-237}:\\
\;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{i}\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-77}:\\
\;\;\;\;n \cdot \frac{\mathsf{fma}\left(100, t\_0, -100\right)}{i}\\
\mathbf{else}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\
\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)) < 2e-237Initial program 23.6%
associate-*r/23.6%
sub-neg23.6%
distribute-rgt-in23.6%
metadata-eval23.6%
metadata-eval23.6%
Simplified23.6%
metadata-eval23.6%
metadata-eval23.6%
distribute-rgt-in23.6%
sub-neg23.6%
associate-*r/23.6%
associate-/r/23.6%
associate-*r*23.5%
add-exp-log23.5%
expm1-define23.5%
log-pow33.4%
log1p-define95.8%
Applied egg-rr95.8%
if 2e-237 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < 1.9999999999999999e-77Initial program 92.0%
associate-/r/92.0%
associate-*r*92.2%
*-commutative92.2%
associate-*r/92.5%
sub-neg92.5%
distribute-lft-in92.3%
metadata-eval92.3%
metadata-eval92.3%
metadata-eval92.3%
fma-define92.5%
metadata-eval92.5%
Simplified92.5%
if 1.9999999999999999e-77 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) Initial program 18.8%
associate-/r/20.3%
associate-*r*20.3%
*-commutative20.3%
associate-*r/20.3%
sub-neg20.3%
distribute-lft-in20.3%
metadata-eval20.3%
metadata-eval20.3%
metadata-eval20.3%
fma-define20.3%
metadata-eval20.3%
Simplified20.3%
Taylor expanded in n around inf 33.2%
sub-neg33.2%
metadata-eval33.2%
metadata-eval33.2%
distribute-lft-in33.2%
metadata-eval33.2%
sub-neg33.2%
expm1-define88.3%
Simplified88.3%
div-inv88.2%
associate-*r*88.3%
associate-*l*88.4%
div-inv88.6%
Applied egg-rr88.6%
Final simplification93.8%
(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 2e-237)
(* n (/ (* 100.0 (expm1 (* n (log1p (/ i n))))) i))
(if (<= t_1 2e-77)
(* n (/ (+ -100.0 (* t_0 100.0)) i))
(* (* n 100.0) (/ (expm1 i) i))))))
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 <= 2e-237) {
tmp = n * ((100.0 * expm1((n * log1p((i / n))))) / i);
} else if (t_1 <= 2e-77) {
tmp = n * ((-100.0 + (t_0 * 100.0)) / i);
} else {
tmp = (n * 100.0) * (expm1(i) / i);
}
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 <= 2e-237) {
tmp = n * ((100.0 * Math.expm1((n * Math.log1p((i / n))))) / i);
} else if (t_1 <= 2e-77) {
tmp = n * ((-100.0 + (t_0 * 100.0)) / i);
} else {
tmp = (n * 100.0) * (Math.expm1(i) / i);
}
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 <= 2e-237: tmp = n * ((100.0 * math.expm1((n * math.log1p((i / n))))) / i) elif t_1 <= 2e-77: tmp = n * ((-100.0 + (t_0 * 100.0)) / i) else: tmp = (n * 100.0) * (math.expm1(i) / i) 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 <= 2e-237) tmp = Float64(n * Float64(Float64(100.0 * expm1(Float64(n * log1p(Float64(i / n))))) / i)); elseif (t_1 <= 2e-77) tmp = Float64(n * Float64(Float64(-100.0 + Float64(t_0 * 100.0)) / i)); else tmp = Float64(Float64(n * 100.0) * Float64(expm1(i) / i)); 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, 2e-237], 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, 2e-77], N[(n * N[(N[(-100.0 + N[(t$95$0 * 100.0), $MachinePrecision]), $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}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t\_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-237}:\\
\;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{i}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-77}:\\
\;\;\;\;n \cdot \frac{-100 + t\_0 \cdot 100}{i}\\
\mathbf{else}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\
\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)) < 2e-237Initial program 23.6%
associate-/r/23.6%
associate-*r*23.5%
*-commutative23.5%
associate-*r/23.5%
sub-neg23.5%
distribute-lft-in23.5%
metadata-eval23.5%
metadata-eval23.5%
metadata-eval23.5%
fma-define23.5%
metadata-eval23.5%
Simplified23.5%
fma-undefine23.5%
metadata-eval23.5%
metadata-eval23.5%
distribute-lft-in23.5%
sub-neg23.5%
*-commutative23.5%
add-exp-log23.5%
expm1-define23.5%
log-pow33.4%
log1p-define95.7%
Applied egg-rr95.7%
if 2e-237 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < 1.9999999999999999e-77Initial program 92.0%
associate-/r/92.0%
associate-*r*92.2%
*-commutative92.2%
associate-*r/92.5%
sub-neg92.5%
distribute-lft-in92.3%
metadata-eval92.3%
metadata-eval92.3%
metadata-eval92.3%
fma-define92.5%
metadata-eval92.5%
Simplified92.5%
fma-undefine92.3%
*-commutative92.3%
Applied egg-rr92.3%
if 1.9999999999999999e-77 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) Initial program 18.8%
associate-/r/20.3%
associate-*r*20.3%
*-commutative20.3%
associate-*r/20.3%
sub-neg20.3%
distribute-lft-in20.3%
metadata-eval20.3%
metadata-eval20.3%
metadata-eval20.3%
fma-define20.3%
metadata-eval20.3%
Simplified20.3%
Taylor expanded in n around inf 33.2%
sub-neg33.2%
metadata-eval33.2%
metadata-eval33.2%
distribute-lft-in33.2%
metadata-eval33.2%
sub-neg33.2%
expm1-define88.3%
Simplified88.3%
div-inv88.2%
associate-*r*88.3%
associate-*l*88.4%
div-inv88.6%
Applied egg-rr88.6%
Final simplification93.7%
(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 2e-237)
(* n (* 100.0 (/ (expm1 (* n (log1p (/ i n)))) i)))
(if (<= t_1 2e-77)
(* n (/ (+ -100.0 (* t_0 100.0)) i))
(* (* n 100.0) (/ (expm1 i) i))))))
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 <= 2e-237) {
tmp = n * (100.0 * (expm1((n * log1p((i / n)))) / i));
} else if (t_1 <= 2e-77) {
tmp = n * ((-100.0 + (t_0 * 100.0)) / i);
} else {
tmp = (n * 100.0) * (expm1(i) / i);
}
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 <= 2e-237) {
tmp = n * (100.0 * (Math.expm1((n * Math.log1p((i / n)))) / i));
} else if (t_1 <= 2e-77) {
tmp = n * ((-100.0 + (t_0 * 100.0)) / i);
} else {
tmp = (n * 100.0) * (Math.expm1(i) / i);
}
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 <= 2e-237: tmp = n * (100.0 * (math.expm1((n * math.log1p((i / n)))) / i)) elif t_1 <= 2e-77: tmp = n * ((-100.0 + (t_0 * 100.0)) / i) else: tmp = (n * 100.0) * (math.expm1(i) / i) 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 <= 2e-237) tmp = Float64(n * Float64(100.0 * Float64(expm1(Float64(n * log1p(Float64(i / n)))) / i))); elseif (t_1 <= 2e-77) tmp = Float64(n * Float64(Float64(-100.0 + Float64(t_0 * 100.0)) / i)); else tmp = Float64(Float64(n * 100.0) * Float64(expm1(i) / i)); 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, 2e-237], N[(n * N[(100.0 * N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-77], N[(n * N[(N[(-100.0 + N[(t$95$0 * 100.0), $MachinePrecision]), $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}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t\_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-237}:\\
\;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{i}\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-77}:\\
\;\;\;\;n \cdot \frac{-100 + t\_0 \cdot 100}{i}\\
\mathbf{else}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\
\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)) < 2e-237Initial program 23.6%
associate-*r/23.6%
sub-neg23.6%
distribute-rgt-in23.6%
metadata-eval23.6%
metadata-eval23.6%
Simplified23.6%
metadata-eval23.6%
metadata-eval23.6%
distribute-rgt-in23.6%
sub-neg23.6%
associate-*r/23.6%
associate-/r/23.6%
associate-*r*23.5%
add-exp-log23.5%
expm1-define23.5%
log-pow33.4%
log1p-define95.8%
Applied egg-rr95.8%
if 2e-237 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < 1.9999999999999999e-77Initial program 92.0%
associate-/r/92.0%
associate-*r*92.2%
*-commutative92.2%
associate-*r/92.5%
sub-neg92.5%
distribute-lft-in92.3%
metadata-eval92.3%
metadata-eval92.3%
metadata-eval92.3%
fma-define92.5%
metadata-eval92.5%
Simplified92.5%
fma-undefine92.3%
*-commutative92.3%
Applied egg-rr92.3%
if 1.9999999999999999e-77 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) Initial program 18.8%
associate-/r/20.3%
associate-*r*20.3%
*-commutative20.3%
associate-*r/20.3%
sub-neg20.3%
distribute-lft-in20.3%
metadata-eval20.3%
metadata-eval20.3%
metadata-eval20.3%
fma-define20.3%
metadata-eval20.3%
Simplified20.3%
Taylor expanded in n around inf 33.2%
sub-neg33.2%
metadata-eval33.2%
metadata-eval33.2%
distribute-lft-in33.2%
metadata-eval33.2%
sub-neg33.2%
expm1-define88.3%
Simplified88.3%
div-inv88.2%
associate-*r*88.3%
associate-*l*88.4%
div-inv88.6%
Applied egg-rr88.6%
Final simplification93.8%
(FPCore (i n) :precision binary64 (if (or (<= n -3.2e-146) (not (<= n 8.5e-197))) (* n (* (expm1 i) (/ 100.0 i))) (/ 0.0 (/ i n))))
double code(double i, double n) {
double tmp;
if ((n <= -3.2e-146) || !(n <= 8.5e-197)) {
tmp = n * (expm1(i) * (100.0 / i));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((n <= -3.2e-146) || !(n <= 8.5e-197)) {
tmp = n * (Math.expm1(i) * (100.0 / i));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -3.2e-146) or not (n <= 8.5e-197): tmp = n * (math.expm1(i) * (100.0 / i)) else: tmp = 0.0 / (i / n) return tmp
function code(i, n) tmp = 0.0 if ((n <= -3.2e-146) || !(n <= 8.5e-197)) tmp = Float64(n * Float64(expm1(i) * Float64(100.0 / i))); else tmp = Float64(0.0 / Float64(i / n)); end return tmp end
code[i_, n_] := If[Or[LessEqual[n, -3.2e-146], N[Not[LessEqual[n, 8.5e-197]], $MachinePrecision]], N[(n * N[(N[(Exp[i] - 1), $MachinePrecision] * N[(100.0 / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -3.2 \cdot 10^{-146} \lor \neg \left(n \leq 8.5 \cdot 10^{-197}\right):\\
\;\;\;\;n \cdot \left(\mathsf{expm1}\left(i\right) \cdot \frac{100}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -3.1999999999999999e-146 or 8.5e-197 < n Initial program 17.7%
Taylor expanded in n around inf 32.5%
*-commutative32.5%
associate-/l*32.5%
expm1-define87.0%
Simplified87.0%
Taylor expanded in n around 0 32.5%
*-commutative32.5%
expm1-define79.6%
associate-*l/67.8%
associate-*l*67.7%
associate-*l/79.6%
associate-*r/86.8%
associate-/l*86.4%
Simplified86.4%
if -3.1999999999999999e-146 < n < 8.5e-197Initial program 52.1%
associate-*r/52.1%
sub-neg52.1%
distribute-rgt-in52.1%
metadata-eval52.1%
metadata-eval52.1%
Simplified52.1%
Taylor expanded in i around 0 66.0%
+-commutative66.0%
Simplified66.0%
Taylor expanded in i around 0 78.2%
Final simplification85.0%
(FPCore (i n) :precision binary64 (if (or (<= n -4.4e-146) (not (<= n 1.15e-194))) (* (* n 100.0) (/ (expm1 i) i)) (/ 0.0 (/ i n))))
double code(double i, double n) {
double tmp;
if ((n <= -4.4e-146) || !(n <= 1.15e-194)) {
tmp = (n * 100.0) * (expm1(i) / i);
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((n <= -4.4e-146) || !(n <= 1.15e-194)) {
tmp = (n * 100.0) * (Math.expm1(i) / i);
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -4.4e-146) or not (n <= 1.15e-194): tmp = (n * 100.0) * (math.expm1(i) / i) else: tmp = 0.0 / (i / n) return tmp
function code(i, n) tmp = 0.0 if ((n <= -4.4e-146) || !(n <= 1.15e-194)) tmp = Float64(Float64(n * 100.0) * Float64(expm1(i) / i)); else tmp = Float64(0.0 / Float64(i / n)); end return tmp end
code[i_, n_] := If[Or[LessEqual[n, -4.4e-146], N[Not[LessEqual[n, 1.15e-194]], $MachinePrecision]], N[(N[(n * 100.0), $MachinePrecision] * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -4.4 \cdot 10^{-146} \lor \neg \left(n \leq 1.15 \cdot 10^{-194}\right):\\
\;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -4.4e-146 or 1.15000000000000001e-194 < n Initial program 17.7%
associate-/r/18.2%
associate-*r*18.1%
*-commutative18.1%
associate-*r/18.2%
sub-neg18.2%
distribute-lft-in18.1%
metadata-eval18.1%
metadata-eval18.1%
metadata-eval18.1%
fma-define18.2%
metadata-eval18.2%
Simplified18.2%
Taylor expanded in n around inf 32.5%
sub-neg32.5%
metadata-eval32.5%
metadata-eval32.5%
distribute-lft-in32.5%
metadata-eval32.5%
sub-neg32.5%
expm1-define79.6%
Simplified79.6%
div-inv79.6%
associate-*r*79.6%
associate-*l*86.8%
div-inv87.0%
Applied egg-rr87.0%
if -4.4e-146 < n < 1.15000000000000001e-194Initial program 52.1%
associate-*r/52.1%
sub-neg52.1%
distribute-rgt-in52.1%
metadata-eval52.1%
metadata-eval52.1%
Simplified52.1%
Taylor expanded in i around 0 66.0%
+-commutative66.0%
Simplified66.0%
Taylor expanded in i around 0 78.2%
Final simplification85.4%
(FPCore (i n) :precision binary64 (if (or (<= n -3.2e-146) (not (<= n 6e-198))) (* 100.0 (* n (/ (expm1 i) i))) (/ 0.0 (/ i n))))
double code(double i, double n) {
double tmp;
if ((n <= -3.2e-146) || !(n <= 6e-198)) {
tmp = 100.0 * (n * (expm1(i) / i));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((n <= -3.2e-146) || !(n <= 6e-198)) {
tmp = 100.0 * (n * (Math.expm1(i) / i));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -3.2e-146) or not (n <= 6e-198): tmp = 100.0 * (n * (math.expm1(i) / i)) else: tmp = 0.0 / (i / n) return tmp
function code(i, n) tmp = 0.0 if ((n <= -3.2e-146) || !(n <= 6e-198)) tmp = Float64(100.0 * Float64(n * Float64(expm1(i) / i))); else tmp = Float64(0.0 / Float64(i / n)); end return tmp end
code[i_, n_] := If[Or[LessEqual[n, -3.2e-146], N[Not[LessEqual[n, 6e-198]], $MachinePrecision]], N[(100.0 * N[(n * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -3.2 \cdot 10^{-146} \lor \neg \left(n \leq 6 \cdot 10^{-198}\right):\\
\;\;\;\;100 \cdot \left(n \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -3.1999999999999999e-146 or 6.0000000000000002e-198 < n Initial program 17.7%
Taylor expanded in n around inf 32.5%
*-commutative32.5%
associate-/l*32.5%
expm1-define87.0%
Simplified87.0%
if -3.1999999999999999e-146 < n < 6.0000000000000002e-198Initial program 52.1%
associate-*r/52.1%
sub-neg52.1%
distribute-rgt-in52.1%
metadata-eval52.1%
metadata-eval52.1%
Simplified52.1%
Taylor expanded in i around 0 66.0%
+-commutative66.0%
Simplified66.0%
Taylor expanded in i around 0 78.2%
Final simplification85.4%
(FPCore (i n) :precision binary64 (if (<= n -1.2e-145) (* n (* (expm1 i) (/ 100.0 i))) (if (<= n 5.6e-196) (/ 0.0 (/ i n)) (* n (/ (expm1 i) (* i 0.01))))))
double code(double i, double n) {
double tmp;
if (n <= -1.2e-145) {
tmp = n * (expm1(i) * (100.0 / i));
} else if (n <= 5.6e-196) {
tmp = 0.0 / (i / n);
} else {
tmp = n * (expm1(i) / (i * 0.01));
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (n <= -1.2e-145) {
tmp = n * (Math.expm1(i) * (100.0 / i));
} else if (n <= 5.6e-196) {
tmp = 0.0 / (i / n);
} else {
tmp = n * (Math.expm1(i) / (i * 0.01));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.2e-145: tmp = n * (math.expm1(i) * (100.0 / i)) elif n <= 5.6e-196: tmp = 0.0 / (i / n) else: tmp = n * (math.expm1(i) / (i * 0.01)) return tmp
function code(i, n) tmp = 0.0 if (n <= -1.2e-145) tmp = Float64(n * Float64(expm1(i) * Float64(100.0 / i))); elseif (n <= 5.6e-196) tmp = Float64(0.0 / Float64(i / n)); else tmp = Float64(n * Float64(expm1(i) / Float64(i * 0.01))); end return tmp end
code[i_, n_] := If[LessEqual[n, -1.2e-145], N[(n * N[(N[(Exp[i] - 1), $MachinePrecision] * N[(100.0 / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5.6e-196], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(n * N[(N[(Exp[i] - 1), $MachinePrecision] / N[(i * 0.01), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.2 \cdot 10^{-145}:\\
\;\;\;\;n \cdot \left(\mathsf{expm1}\left(i\right) \cdot \frac{100}{i}\right)\\
\mathbf{elif}\;n \leq 5.6 \cdot 10^{-196}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \frac{\mathsf{expm1}\left(i\right)}{i \cdot 0.01}\\
\end{array}
\end{array}
if n < -1.20000000000000008e-145Initial program 17.5%
Taylor expanded in n around inf 33.0%
*-commutative33.0%
associate-/l*33.1%
expm1-define86.9%
Simplified86.9%
Taylor expanded in n around 0 33.0%
*-commutative33.0%
expm1-define81.7%
associate-*l/65.4%
associate-*l*65.3%
associate-*l/81.8%
associate-*r/86.6%
associate-/l*86.7%
Simplified86.7%
if -1.20000000000000008e-145 < n < 5.5999999999999997e-196Initial program 52.1%
associate-*r/52.1%
sub-neg52.1%
distribute-rgt-in52.1%
metadata-eval52.1%
metadata-eval52.1%
Simplified52.1%
Taylor expanded in i around 0 66.0%
+-commutative66.0%
Simplified66.0%
Taylor expanded in i around 0 78.2%
if 5.5999999999999997e-196 < n Initial program 18.0%
Taylor expanded in n around inf 32.0%
*-commutative32.0%
associate-/l*32.0%
expm1-define87.2%
Simplified87.2%
Taylor expanded in n around 0 32.0%
*-commutative32.0%
expm1-define77.2%
associate-*l/70.4%
associate-*l*70.2%
associate-*l/77.2%
associate-*r/87.0%
associate-/l*86.1%
Simplified86.1%
clear-num86.0%
un-div-inv87.0%
div-inv86.9%
metadata-eval86.9%
Applied egg-rr86.9%
Final simplification85.3%
(FPCore (i n) :precision binary64 (if (<= n -4.4e-145) (* n (* (expm1 i) (/ 100.0 i))) (if (<= n 4e-195) (/ 0.0 (/ i n)) (* n (/ (* 100.0 (expm1 i)) i)))))
double code(double i, double n) {
double tmp;
if (n <= -4.4e-145) {
tmp = n * (expm1(i) * (100.0 / i));
} else if (n <= 4e-195) {
tmp = 0.0 / (i / n);
} else {
tmp = n * ((100.0 * expm1(i)) / i);
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (n <= -4.4e-145) {
tmp = n * (Math.expm1(i) * (100.0 / i));
} else if (n <= 4e-195) {
tmp = 0.0 / (i / n);
} else {
tmp = n * ((100.0 * Math.expm1(i)) / i);
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -4.4e-145: tmp = n * (math.expm1(i) * (100.0 / i)) elif n <= 4e-195: tmp = 0.0 / (i / n) else: tmp = n * ((100.0 * math.expm1(i)) / i) return tmp
function code(i, n) tmp = 0.0 if (n <= -4.4e-145) tmp = Float64(n * Float64(expm1(i) * Float64(100.0 / i))); elseif (n <= 4e-195) tmp = Float64(0.0 / Float64(i / n)); else tmp = Float64(n * Float64(Float64(100.0 * expm1(i)) / i)); end return tmp end
code[i_, n_] := If[LessEqual[n, -4.4e-145], N[(n * N[(N[(Exp[i] - 1), $MachinePrecision] * N[(100.0 / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 4e-195], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(n * N[(N[(100.0 * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -4.4 \cdot 10^{-145}:\\
\;\;\;\;n \cdot \left(\mathsf{expm1}\left(i\right) \cdot \frac{100}{i}\right)\\
\mathbf{elif}\;n \leq 4 \cdot 10^{-195}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{i}\\
\end{array}
\end{array}
if n < -4.39999999999999998e-145Initial program 17.5%
Taylor expanded in n around inf 33.0%
*-commutative33.0%
associate-/l*33.1%
expm1-define86.9%
Simplified86.9%
Taylor expanded in n around 0 33.0%
*-commutative33.0%
expm1-define81.7%
associate-*l/65.4%
associate-*l*65.3%
associate-*l/81.8%
associate-*r/86.6%
associate-/l*86.7%
Simplified86.7%
if -4.39999999999999998e-145 < n < 4.0000000000000004e-195Initial program 52.1%
associate-*r/52.1%
sub-neg52.1%
distribute-rgt-in52.1%
metadata-eval52.1%
metadata-eval52.1%
Simplified52.1%
Taylor expanded in i around 0 66.0%
+-commutative66.0%
Simplified66.0%
Taylor expanded in i around 0 78.2%
if 4.0000000000000004e-195 < n Initial program 18.0%
associate-/r/18.4%
associate-*r*18.4%
*-commutative18.4%
associate-*r/18.4%
sub-neg18.4%
distribute-lft-in18.4%
metadata-eval18.4%
metadata-eval18.4%
metadata-eval18.4%
fma-define18.4%
metadata-eval18.4%
Simplified18.4%
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-define87.0%
Simplified87.0%
Final simplification85.3%
(FPCore (i n)
:precision binary64
(let* ((t_0
(+
100.0
(*
i
(+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667))))))))
(if (<= n -6.5e-145)
(* n t_0)
(if (<= n 4.5e-225)
(/ 0.0 (/ i n))
(if (<= n 1.9) (* 100.0 (/ i (/ i n))) (/ (* n (* i t_0)) i))))))
double code(double i, double n) {
double t_0 = 100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))));
double tmp;
if (n <= -6.5e-145) {
tmp = n * t_0;
} else if (n <= 4.5e-225) {
tmp = 0.0 / (i / n);
} else if (n <= 1.9) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * (i * t_0)) / i;
}
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 = 100.0d0 + (i * (50.0d0 + (i * (16.666666666666668d0 + (i * 4.166666666666667d0)))))
if (n <= (-6.5d-145)) then
tmp = n * t_0
else if (n <= 4.5d-225) then
tmp = 0.0d0 / (i / n)
else if (n <= 1.9d0) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = (n * (i * t_0)) / i
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = 100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))));
double tmp;
if (n <= -6.5e-145) {
tmp = n * t_0;
} else if (n <= 4.5e-225) {
tmp = 0.0 / (i / n);
} else if (n <= 1.9) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * (i * t_0)) / i;
}
return tmp;
}
def code(i, n): t_0 = 100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))) tmp = 0 if n <= -6.5e-145: tmp = n * t_0 elif n <= 4.5e-225: tmp = 0.0 / (i / n) elif n <= 1.9: tmp = 100.0 * (i / (i / n)) else: tmp = (n * (i * t_0)) / i return tmp
function code(i, n) t_0 = Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667)))))) tmp = 0.0 if (n <= -6.5e-145) tmp = Float64(n * t_0); elseif (n <= 4.5e-225) 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 * t_0)) / i); end return tmp end
function tmp_2 = code(i, n) t_0 = 100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))); tmp = 0.0; if (n <= -6.5e-145) tmp = n * t_0; elseif (n <= 4.5e-225) tmp = 0.0 / (i / n); elseif (n <= 1.9) tmp = 100.0 * (i / (i / n)); else tmp = (n * (i * t_0)) / i; end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -6.5e-145], N[(n * t$95$0), $MachinePrecision], If[LessEqual[n, 4.5e-225], 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 * t$95$0), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\\
\mathbf{if}\;n \leq -6.5 \cdot 10^{-145}:\\
\;\;\;\;n \cdot t\_0\\
\mathbf{elif}\;n \leq 4.5 \cdot 10^{-225}:\\
\;\;\;\;\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 t\_0\right)}{i}\\
\end{array}
\end{array}
if n < -6.5000000000000002e-145Initial program 17.5%
Taylor expanded in n around inf 33.0%
*-commutative33.0%
associate-/l*33.1%
expm1-define86.9%
Simplified86.9%
Taylor expanded in n around 0 33.0%
*-commutative33.0%
expm1-define81.7%
associate-*l/65.4%
associate-*l*65.3%
associate-*l/81.8%
associate-*r/86.6%
associate-/l*86.7%
Simplified86.7%
Taylor expanded in i around 0 64.6%
*-commutative64.6%
Simplified64.6%
if -6.5000000000000002e-145 < n < 4.5e-225Initial program 56.9%
associate-*r/56.9%
sub-neg56.9%
distribute-rgt-in56.9%
metadata-eval56.9%
metadata-eval56.9%
Simplified56.9%
Taylor expanded in i around 0 65.0%
+-commutative65.0%
Simplified65.0%
Taylor expanded in i around 0 78.4%
if 4.5e-225 < n < 1.8999999999999999Initial program 10.3%
Taylor expanded in i around 0 69.1%
if 1.8999999999999999 < n Initial program 22.4%
associate-/r/23.0%
associate-*r*23.0%
*-commutative23.0%
associate-*r/23.0%
sub-neg23.0%
distribute-lft-in23.0%
metadata-eval23.0%
metadata-eval23.0%
metadata-eval23.0%
fma-define23.0%
metadata-eval23.0%
Simplified23.0%
Taylor expanded in n around inf 44.4%
sub-neg44.4%
metadata-eval44.4%
metadata-eval44.4%
distribute-lft-in44.4%
metadata-eval44.4%
sub-neg44.4%
expm1-define99.7%
Simplified99.7%
Taylor expanded in i around 0 82.8%
*-commutative82.8%
Simplified82.8%
Final simplification71.9%
(FPCore (i n)
:precision binary64
(let* ((t_0
(*
n
(+
100.0
(*
i
(+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667)))))))))
(if (<= n -4.8e-146)
t_0
(if (<= n 3.5e-226)
(/ 0.0 (/ i n))
(if (<= n 0.95) (* 100.0 (/ i (/ i n))) t_0)))))
double code(double i, double n) {
double t_0 = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
double tmp;
if (n <= -4.8e-146) {
tmp = t_0;
} else if (n <= 3.5e-226) {
tmp = 0.0 / (i / n);
} else if (n <= 0.95) {
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 * (100.0d0 + (i * (50.0d0 + (i * (16.666666666666668d0 + (i * 4.166666666666667d0))))))
if (n <= (-4.8d-146)) then
tmp = t_0
else if (n <= 3.5d-226) then
tmp = 0.0d0 / (i / n)
else if (n <= 0.95d0) 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 * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
double tmp;
if (n <= -4.8e-146) {
tmp = t_0;
} else if (n <= 3.5e-226) {
tmp = 0.0 / (i / n);
} else if (n <= 0.95) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))) tmp = 0 if n <= -4.8e-146: tmp = t_0 elif n <= 3.5e-226: tmp = 0.0 / (i / n) elif n <= 0.95: tmp = 100.0 * (i / (i / n)) else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667))))))) tmp = 0.0 if (n <= -4.8e-146) tmp = t_0; elseif (n <= 3.5e-226) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 0.95) 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 * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))); tmp = 0.0; if (n <= -4.8e-146) tmp = t_0; elseif (n <= 3.5e-226) tmp = 0.0 / (i / n); elseif (n <= 0.95) 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[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -4.8e-146], t$95$0, If[LessEqual[n, 3.5e-226], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 0.95], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\\
\mathbf{if}\;n \leq -4.8 \cdot 10^{-146}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 3.5 \cdot 10^{-226}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 0.95:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -4.8000000000000003e-146 or 0.94999999999999996 < n Initial program 19.2%
Taylor expanded in n around inf 36.9%
*-commutative36.9%
associate-/l*36.9%
expm1-define91.6%
Simplified91.6%
Taylor expanded in n around 0 36.9%
*-commutative36.9%
expm1-define88.3%
associate-*l/68.1%
associate-*l*68.0%
associate-*l/88.3%
associate-*r/91.4%
associate-/l*90.9%
Simplified90.9%
Taylor expanded in i around 0 70.3%
*-commutative70.3%
Simplified70.3%
if -4.8000000000000003e-146 < n < 3.5e-226Initial program 56.9%
associate-*r/56.9%
sub-neg56.9%
distribute-rgt-in56.9%
metadata-eval56.9%
metadata-eval56.9%
Simplified56.9%
Taylor expanded in i around 0 65.0%
+-commutative65.0%
Simplified65.0%
Taylor expanded in i around 0 78.4%
if 3.5e-226 < n < 0.94999999999999996Initial program 10.5%
Taylor expanded in i around 0 68.4%
Final simplification71.3%
(FPCore (i n)
:precision binary64
(if (<= n -1.8e-145)
(*
n
(+
100.0
(* i (+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667)))))))
(if (<= n 2.2e-225)
(/ 0.0 (/ i n))
(if (<= n 1.82)
(* 100.0 (/ i (/ i n)))
(/ (* n (* i (+ 100.0 (* i (+ 50.0 (* i 16.666666666666668)))))) i)))))
double code(double i, double n) {
double tmp;
if (n <= -1.8e-145) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
} else if (n <= 2.2e-225) {
tmp = 0.0 / (i / n);
} else if (n <= 1.82) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * (i * (100.0 + (i * (50.0 + (i * 16.666666666666668)))))) / 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.8d-145)) then
tmp = n * (100.0d0 + (i * (50.0d0 + (i * (16.666666666666668d0 + (i * 4.166666666666667d0))))))
else if (n <= 2.2d-225) then
tmp = 0.0d0 / (i / n)
else if (n <= 1.82d0) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = (n * (i * (100.0d0 + (i * (50.0d0 + (i * 16.666666666666668d0)))))) / i
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -1.8e-145) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
} else if (n <= 2.2e-225) {
tmp = 0.0 / (i / n);
} else if (n <= 1.82) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * (i * (100.0 + (i * (50.0 + (i * 16.666666666666668)))))) / i;
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.8e-145: tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))) elif n <= 2.2e-225: tmp = 0.0 / (i / n) elif n <= 1.82: tmp = 100.0 * (i / (i / n)) else: tmp = (n * (i * (100.0 + (i * (50.0 + (i * 16.666666666666668)))))) / i return tmp
function code(i, n) tmp = 0.0 if (n <= -1.8e-145) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667))))))); elseif (n <= 2.2e-225) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 1.82) 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 * 16.666666666666668)))))) / i); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -1.8e-145) tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))); elseif (n <= 2.2e-225) tmp = 0.0 / (i / n); elseif (n <= 1.82) tmp = 100.0 * (i / (i / n)); else tmp = (n * (i * (100.0 + (i * (50.0 + (i * 16.666666666666668)))))) / i; end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.8e-145], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.2e-225], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.82], 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 * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.8 \cdot 10^{-145}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\\
\mathbf{elif}\;n \leq 2.2 \cdot 10^{-225}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.82:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot \left(i \cdot \left(100 + i \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\right)}{i}\\
\end{array}
\end{array}
if n < -1.8e-145Initial program 17.5%
Taylor expanded in n around inf 33.0%
*-commutative33.0%
associate-/l*33.1%
expm1-define86.9%
Simplified86.9%
Taylor expanded in n around 0 33.0%
*-commutative33.0%
expm1-define81.7%
associate-*l/65.4%
associate-*l*65.3%
associate-*l/81.8%
associate-*r/86.6%
associate-/l*86.7%
Simplified86.7%
Taylor expanded in i around 0 64.6%
*-commutative64.6%
Simplified64.6%
if -1.8e-145 < n < 2.2e-225Initial program 56.9%
associate-*r/56.9%
sub-neg56.9%
distribute-rgt-in56.9%
metadata-eval56.9%
metadata-eval56.9%
Simplified56.9%
Taylor expanded in i around 0 65.0%
+-commutative65.0%
Simplified65.0%
Taylor expanded in i around 0 78.4%
if 2.2e-225 < n < 1.82000000000000006Initial program 10.3%
Taylor expanded in i around 0 69.1%
if 1.82000000000000006 < n Initial program 22.4%
associate-/r/23.0%
associate-*r*23.0%
*-commutative23.0%
associate-*r/23.0%
sub-neg23.0%
distribute-lft-in23.0%
metadata-eval23.0%
metadata-eval23.0%
metadata-eval23.0%
fma-define23.0%
metadata-eval23.0%
Simplified23.0%
Taylor expanded in n around inf 44.4%
sub-neg44.4%
metadata-eval44.4%
metadata-eval44.4%
distribute-lft-in44.4%
metadata-eval44.4%
sub-neg44.4%
expm1-define99.7%
Simplified99.7%
Taylor expanded in i around 0 80.1%
*-commutative80.1%
Simplified80.1%
Final simplification71.3%
(FPCore (i n)
:precision binary64
(if (<= n -9e-145)
(* n (+ 100.0 (* i (+ 50.0 (* i 16.666666666666668)))))
(if (<= n 4.5e-225)
(/ 0.0 (/ i n))
(if (<= n 7.4e-7)
(* 100.0 (/ i (/ i n)))
(* (* n 100.0) (+ 1.0 (* i (+ 0.5 (* i 0.16666666666666666)))))))))
double code(double i, double n) {
double tmp;
if (n <= -9e-145) {
tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
} else if (n <= 4.5e-225) {
tmp = 0.0 / (i / n);
} else if (n <= 7.4e-7) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * 100.0) * (1.0 + (i * (0.5 + (i * 0.16666666666666666))));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-9d-145)) then
tmp = n * (100.0d0 + (i * (50.0d0 + (i * 16.666666666666668d0))))
else if (n <= 4.5d-225) then
tmp = 0.0d0 / (i / n)
else if (n <= 7.4d-7) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = (n * 100.0d0) * (1.0d0 + (i * (0.5d0 + (i * 0.16666666666666666d0))))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -9e-145) {
tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
} else if (n <= 4.5e-225) {
tmp = 0.0 / (i / n);
} else if (n <= 7.4e-7) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * 100.0) * (1.0 + (i * (0.5 + (i * 0.16666666666666666))));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -9e-145: tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))) elif n <= 4.5e-225: tmp = 0.0 / (i / n) elif n <= 7.4e-7: tmp = 100.0 * (i / (i / n)) else: tmp = (n * 100.0) * (1.0 + (i * (0.5 + (i * 0.16666666666666666)))) return tmp
function code(i, n) tmp = 0.0 if (n <= -9e-145) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * 16.666666666666668))))); elseif (n <= 4.5e-225) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 7.4e-7) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(Float64(n * 100.0) * Float64(1.0 + Float64(i * Float64(0.5 + Float64(i * 0.16666666666666666))))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -9e-145) tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))); elseif (n <= 4.5e-225) tmp = 0.0 / (i / n); elseif (n <= 7.4e-7) tmp = 100.0 * (i / (i / n)); else tmp = (n * 100.0) * (1.0 + (i * (0.5 + (i * 0.16666666666666666)))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -9e-145], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 4.5e-225], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 7.4e-7], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] * N[(1.0 + N[(i * N[(0.5 + N[(i * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -9 \cdot 10^{-145}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\
\mathbf{elif}\;n \leq 4.5 \cdot 10^{-225}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 7.4 \cdot 10^{-7}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \left(1 + i \cdot \left(0.5 + i \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if n < -9.0000000000000001e-145Initial program 17.5%
Taylor expanded in n around inf 33.0%
*-commutative33.0%
associate-/l*33.1%
expm1-define86.9%
Simplified86.9%
Taylor expanded in n around 0 33.0%
*-commutative33.0%
expm1-define81.7%
associate-*l/65.4%
associate-*l*65.3%
associate-*l/81.8%
associate-*r/86.6%
associate-/l*86.7%
Simplified86.7%
Taylor expanded in i around 0 64.5%
*-commutative64.5%
Simplified64.5%
if -9.0000000000000001e-145 < n < 4.5e-225Initial program 56.9%
associate-*r/56.9%
sub-neg56.9%
distribute-rgt-in56.9%
metadata-eval56.9%
metadata-eval56.9%
Simplified56.9%
Taylor expanded in i around 0 65.0%
+-commutative65.0%
Simplified65.0%
Taylor expanded in i around 0 78.4%
if 4.5e-225 < n < 7.40000000000000009e-7Initial program 10.5%
Taylor expanded in i around 0 68.4%
if 7.40000000000000009e-7 < n Initial program 22.1%
associate-/r/22.7%
associate-*r*22.7%
*-commutative22.7%
associate-*r/22.7%
sub-neg22.7%
distribute-lft-in22.7%
metadata-eval22.7%
metadata-eval22.7%
metadata-eval22.7%
fma-define22.7%
metadata-eval22.7%
Simplified22.7%
Taylor expanded in n around inf 43.7%
sub-neg43.7%
metadata-eval43.7%
metadata-eval43.7%
distribute-lft-in43.8%
metadata-eval43.8%
sub-neg43.8%
expm1-define99.7%
Simplified99.7%
div-inv99.7%
associate-*r*99.7%
associate-*l*99.8%
div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in i around 0 79.1%
*-commutative79.1%
Simplified79.1%
Final simplification71.0%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* n (+ 100.0 (* i (+ 50.0 (* i 16.666666666666668)))))))
(if (<= n -8.5e-145)
t_0
(if (<= n 3.2e-225)
(/ 0.0 (/ i n))
(if (<= n 1.0) (* 100.0 (/ i (/ i n))) t_0)))))
double code(double i, double n) {
double t_0 = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
double tmp;
if (n <= -8.5e-145) {
tmp = t_0;
} else if (n <= 3.2e-225) {
tmp = 0.0 / (i / n);
} else if (n <= 1.0) {
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 * (100.0d0 + (i * (50.0d0 + (i * 16.666666666666668d0))))
if (n <= (-8.5d-145)) then
tmp = t_0
else if (n <= 3.2d-225) then
tmp = 0.0d0 / (i / n)
else if (n <= 1.0d0) 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 * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
double tmp;
if (n <= -8.5e-145) {
tmp = t_0;
} else if (n <= 3.2e-225) {
tmp = 0.0 / (i / n);
} else if (n <= 1.0) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))) tmp = 0 if n <= -8.5e-145: tmp = t_0 elif n <= 3.2e-225: tmp = 0.0 / (i / n) elif n <= 1.0: tmp = 100.0 * (i / (i / n)) else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * 16.666666666666668))))) tmp = 0.0 if (n <= -8.5e-145) tmp = t_0; elseif (n <= 3.2e-225) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 1.0) 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 * (100.0 + (i * (50.0 + (i * 16.666666666666668)))); tmp = 0.0; if (n <= -8.5e-145) tmp = t_0; elseif (n <= 3.2e-225) tmp = 0.0 / (i / n); elseif (n <= 1.0) 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[(100.0 + N[(i * N[(50.0 + N[(i * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -8.5e-145], t$95$0, If[LessEqual[n, 3.2e-225], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.0], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \left(100 + i \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\
\mathbf{if}\;n \leq -8.5 \cdot 10^{-145}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 3.2 \cdot 10^{-225}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -8.50000000000000043e-145 or 1 < n Initial program 19.2%
Taylor expanded in n around inf 36.9%
*-commutative36.9%
associate-/l*36.9%
expm1-define91.6%
Simplified91.6%
Taylor expanded in n around 0 36.9%
*-commutative36.9%
expm1-define88.3%
associate-*l/68.1%
associate-*l*68.0%
associate-*l/88.3%
associate-*r/91.4%
associate-/l*90.9%
Simplified90.9%
Taylor expanded in i around 0 69.8%
*-commutative69.8%
Simplified69.8%
if -8.50000000000000043e-145 < n < 3.19999999999999975e-225Initial program 56.9%
associate-*r/56.9%
sub-neg56.9%
distribute-rgt-in56.9%
metadata-eval56.9%
metadata-eval56.9%
Simplified56.9%
Taylor expanded in i around 0 65.0%
+-commutative65.0%
Simplified65.0%
Taylor expanded in i around 0 78.4%
if 3.19999999999999975e-225 < n < 1Initial program 10.5%
Taylor expanded in i around 0 68.4%
Final simplification70.9%
(FPCore (i n)
:precision binary64
(if (<= n -1.6e-144)
(* n (+ 100.0 (* i 50.0)))
(if (<= n 6.6e-226)
(/ 0.0 (/ i n))
(if (<= n 5.2e-15)
(* 100.0 (/ i (/ i n)))
(* (* n 100.0) (+ 1.0 (* i 0.5)))))))
double code(double i, double n) {
double tmp;
if (n <= -1.6e-144) {
tmp = n * (100.0 + (i * 50.0));
} else if (n <= 6.6e-226) {
tmp = 0.0 / (i / n);
} else if (n <= 5.2e-15) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * 100.0) * (1.0 + (i * 0.5));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-1.6d-144)) then
tmp = n * (100.0d0 + (i * 50.0d0))
else if (n <= 6.6d-226) then
tmp = 0.0d0 / (i / n)
else if (n <= 5.2d-15) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = (n * 100.0d0) * (1.0d0 + (i * 0.5d0))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -1.6e-144) {
tmp = n * (100.0 + (i * 50.0));
} else if (n <= 6.6e-226) {
tmp = 0.0 / (i / n);
} else if (n <= 5.2e-15) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * 100.0) * (1.0 + (i * 0.5));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.6e-144: tmp = n * (100.0 + (i * 50.0)) elif n <= 6.6e-226: tmp = 0.0 / (i / n) elif n <= 5.2e-15: tmp = 100.0 * (i / (i / n)) else: tmp = (n * 100.0) * (1.0 + (i * 0.5)) return tmp
function code(i, n) tmp = 0.0 if (n <= -1.6e-144) tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); elseif (n <= 6.6e-226) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 5.2e-15) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(Float64(n * 100.0) * Float64(1.0 + Float64(i * 0.5))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -1.6e-144) tmp = n * (100.0 + (i * 50.0)); elseif (n <= 6.6e-226) tmp = 0.0 / (i / n); elseif (n <= 5.2e-15) tmp = 100.0 * (i / (i / n)); else tmp = (n * 100.0) * (1.0 + (i * 0.5)); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.6e-144], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 6.6e-226], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5.2e-15], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] * N[(1.0 + N[(i * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.6 \cdot 10^{-144}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{elif}\;n \leq 6.6 \cdot 10^{-226}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 5.2 \cdot 10^{-15}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \left(1 + i \cdot 0.5\right)\\
\end{array}
\end{array}
if n < -1.59999999999999986e-144Initial program 17.5%
Taylor expanded in n around inf 33.0%
*-commutative33.0%
associate-/l*33.1%
expm1-define86.9%
Simplified86.9%
Taylor expanded in i around 0 60.2%
+-commutative60.2%
associate-*r*60.2%
distribute-rgt-in60.2%
*-commutative60.2%
Simplified60.2%
if -1.59999999999999986e-144 < n < 6.6e-226Initial program 56.9%
associate-*r/56.9%
sub-neg56.9%
distribute-rgt-in56.9%
metadata-eval56.9%
metadata-eval56.9%
Simplified56.9%
Taylor expanded in i around 0 65.0%
+-commutative65.0%
Simplified65.0%
Taylor expanded in i around 0 78.4%
if 6.6e-226 < n < 5.20000000000000009e-15Initial program 9.7%
Taylor expanded in i around 0 68.4%
if 5.20000000000000009e-15 < n Initial program 22.1%
associate-/r/22.6%
associate-*r*22.6%
*-commutative22.6%
associate-*r/22.6%
sub-neg22.6%
distribute-lft-in22.6%
metadata-eval22.6%
metadata-eval22.6%
metadata-eval22.6%
fma-define22.6%
metadata-eval22.6%
Simplified22.6%
Taylor expanded in n around inf 41.8%
sub-neg41.8%
metadata-eval41.8%
metadata-eval41.8%
distribute-lft-in41.9%
metadata-eval41.9%
sub-neg41.9%
expm1-define97.7%
Simplified97.7%
div-inv97.6%
associate-*r*97.7%
associate-*l*98.3%
div-inv98.4%
Applied egg-rr98.4%
Taylor expanded in i around 0 70.9%
*-commutative70.9%
Simplified70.9%
Final simplification67.2%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* n (+ 100.0 (* i 50.0)))))
(if (<= n -4e-144)
t_0
(if (<= n 1.25e-225)
(/ 0.0 (/ i n))
(if (<= n 5.2e-15) (* 100.0 (/ i (/ i n))) t_0)))))
double code(double i, double n) {
double t_0 = n * (100.0 + (i * 50.0));
double tmp;
if (n <= -4e-144) {
tmp = t_0;
} else if (n <= 1.25e-225) {
tmp = 0.0 / (i / n);
} else if (n <= 5.2e-15) {
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 * (100.0d0 + (i * 50.0d0))
if (n <= (-4d-144)) then
tmp = t_0
else if (n <= 1.25d-225) then
tmp = 0.0d0 / (i / n)
else if (n <= 5.2d-15) 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 * (100.0 + (i * 50.0));
double tmp;
if (n <= -4e-144) {
tmp = t_0;
} else if (n <= 1.25e-225) {
tmp = 0.0 / (i / n);
} else if (n <= 5.2e-15) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = n * (100.0 + (i * 50.0)) tmp = 0 if n <= -4e-144: tmp = t_0 elif n <= 1.25e-225: tmp = 0.0 / (i / n) elif n <= 5.2e-15: tmp = 100.0 * (i / (i / n)) else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(n * Float64(100.0 + Float64(i * 50.0))) tmp = 0.0 if (n <= -4e-144) tmp = t_0; elseif (n <= 1.25e-225) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 5.2e-15) 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 * (100.0 + (i * 50.0)); tmp = 0.0; if (n <= -4e-144) tmp = t_0; elseif (n <= 1.25e-225) tmp = 0.0 / (i / n); elseif (n <= 5.2e-15) 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[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -4e-144], t$95$0, If[LessEqual[n, 1.25e-225], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5.2e-15], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{if}\;n \leq -4 \cdot 10^{-144}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 1.25 \cdot 10^{-225}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 5.2 \cdot 10^{-15}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -3.9999999999999998e-144 or 5.20000000000000009e-15 < n Initial program 19.2%
Taylor expanded in n around inf 36.3%
*-commutative36.3%
associate-/l*36.3%
expm1-define91.2%
Simplified91.2%
Taylor expanded in i around 0 64.2%
+-commutative64.2%
associate-*r*64.2%
distribute-rgt-in64.2%
*-commutative64.2%
Simplified64.2%
if -3.9999999999999998e-144 < n < 1.25e-225Initial program 56.9%
associate-*r/56.9%
sub-neg56.9%
distribute-rgt-in56.9%
metadata-eval56.9%
metadata-eval56.9%
Simplified56.9%
Taylor expanded in i around 0 65.0%
+-commutative65.0%
Simplified65.0%
Taylor expanded in i around 0 78.4%
if 1.25e-225 < n < 5.20000000000000009e-15Initial program 9.7%
Taylor expanded in i around 0 68.4%
Final simplification67.2%
(FPCore (i n) :precision binary64 (if (or (<= i -1e+39) (not (<= i 4e-15))) (* 100.0 (/ i (/ i n))) (* n 100.0)))
double code(double i, double n) {
double tmp;
if ((i <= -1e+39) || !(i <= 4e-15)) {
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+39)) .or. (.not. (i <= 4d-15))) 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+39) || !(i <= 4e-15)) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * 100.0;
}
return tmp;
}
def code(i, n): tmp = 0 if (i <= -1e+39) or not (i <= 4e-15): tmp = 100.0 * (i / (i / n)) else: tmp = n * 100.0 return tmp
function code(i, n) tmp = 0.0 if ((i <= -1e+39) || !(i <= 4e-15)) 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+39) || ~((i <= 4e-15))) tmp = 100.0 * (i / (i / n)); else tmp = n * 100.0; end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[i, -1e+39], N[Not[LessEqual[i, 4e-15]], $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^{+39} \lor \neg \left(i \leq 4 \cdot 10^{-15}\right):\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100\\
\end{array}
\end{array}
if i < -9.9999999999999994e38 or 4.0000000000000003e-15 < i Initial program 46.4%
Taylor expanded in i around 0 30.3%
if -9.9999999999999994e38 < i < 4.0000000000000003e-15Initial program 9.0%
Taylor expanded in i around 0 80.5%
*-commutative80.5%
Simplified80.5%
Final simplification60.5%
(FPCore (i n) :precision binary64 (if (or (<= n -5.2e+17) (not (<= n 5.2e-15))) (* n (+ 100.0 (* i 50.0))) (* 100.0 (/ i (/ i n)))))
double code(double i, double n) {
double tmp;
if ((n <= -5.2e+17) || !(n <= 5.2e-15)) {
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 <= (-5.2d+17)) .or. (.not. (n <= 5.2d-15))) 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 <= -5.2e+17) || !(n <= 5.2e-15)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -5.2e+17) or not (n <= 5.2e-15): 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 <= -5.2e+17) || !(n <= 5.2e-15)) 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 <= -5.2e+17) || ~((n <= 5.2e-15))) 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, -5.2e+17], N[Not[LessEqual[n, 5.2e-15]], $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 -5.2 \cdot 10^{+17} \lor \neg \left(n \leq 5.2 \cdot 10^{-15}\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -5.2e17 or 5.20000000000000009e-15 < n Initial program 18.4%
Taylor expanded in n around inf 40.6%
*-commutative40.6%
associate-/l*40.6%
expm1-define95.8%
Simplified95.8%
Taylor expanded in i around 0 65.9%
+-commutative65.9%
associate-*r*65.9%
distribute-rgt-in65.9%
*-commutative65.9%
Simplified65.9%
if -5.2e17 < n < 5.20000000000000009e-15Initial program 30.9%
Taylor expanded in i around 0 61.9%
Final simplification64.1%
(FPCore (i n) :precision binary64 (if (<= n -2.8e+33) (* (/ 100.0 i) (* i n)) (if (<= n 5.2e-15) (* 100.0 (/ i (/ i n))) (* n (+ 100.0 (* i 50.0))))))
double code(double i, double n) {
double tmp;
if (n <= -2.8e+33) {
tmp = (100.0 / i) * (i * n);
} else if (n <= 5.2e-15) {
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 <= (-2.8d+33)) then
tmp = (100.0d0 / i) * (i * n)
else if (n <= 5.2d-15) 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 <= -2.8e+33) {
tmp = (100.0 / i) * (i * n);
} else if (n <= 5.2e-15) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -2.8e+33: tmp = (100.0 / i) * (i * n) elif n <= 5.2e-15: 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 <= -2.8e+33) tmp = Float64(Float64(100.0 / i) * Float64(i * n)); elseif (n <= 5.2e-15) 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 <= -2.8e+33) tmp = (100.0 / i) * (i * n); elseif (n <= 5.2e-15) 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, -2.8e+33], N[(N[(100.0 / i), $MachinePrecision] * N[(i * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5.2e-15], 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 -2.8 \cdot 10^{+33}:\\
\;\;\;\;\frac{100}{i} \cdot \left(i \cdot n\right)\\
\mathbf{elif}\;n \leq 5.2 \cdot 10^{-15}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if n < -2.8000000000000001e33Initial program 13.4%
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 41.5%
sub-neg41.5%
metadata-eval41.5%
metadata-eval41.5%
distribute-lft-in41.5%
metadata-eval41.5%
sub-neg41.5%
expm1-define95.6%
Simplified95.6%
Taylor expanded in i around 0 62.9%
*-commutative62.9%
Simplified62.9%
*-commutative62.9%
associate-/l*62.9%
Applied egg-rr62.9%
if -2.8000000000000001e33 < n < 5.20000000000000009e-15Initial program 31.6%
Taylor expanded in i around 0 61.5%
if 5.20000000000000009e-15 < n Initial program 22.1%
Taylor expanded in n around inf 41.8%
*-commutative41.8%
associate-/l*41.8%
expm1-define98.5%
Simplified98.5%
Taylor expanded in i around 0 70.9%
+-commutative70.9%
associate-*r*70.9%
distribute-rgt-in70.9%
*-commutative70.9%
Simplified70.9%
Final simplification64.3%
(FPCore (i n) :precision binary64 (if (<= i 4.8e+14) (* n 100.0) (* 50.0 (* i n))))
double code(double i, double n) {
double tmp;
if (i <= 4.8e+14) {
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 <= 4.8d+14) 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 <= 4.8e+14) {
tmp = n * 100.0;
} else {
tmp = 50.0 * (i * n);
}
return tmp;
}
def code(i, n): tmp = 0 if i <= 4.8e+14: tmp = n * 100.0 else: tmp = 50.0 * (i * n) return tmp
function code(i, n) tmp = 0.0 if (i <= 4.8e+14) 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 <= 4.8e+14) tmp = n * 100.0; else tmp = 50.0 * (i * n); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, 4.8e+14], N[(n * 100.0), $MachinePrecision], N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq 4.8 \cdot 10^{+14}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;50 \cdot \left(i \cdot n\right)\\
\end{array}
\end{array}
if i < 4.8e14Initial program 17.2%
Taylor expanded in i around 0 63.1%
*-commutative63.1%
Simplified63.1%
if 4.8e14 < i Initial program 48.3%
Taylor expanded in n around inf 49.9%
*-commutative49.9%
associate-/l*49.9%
expm1-define49.9%
Simplified49.9%
Taylor expanded in i around 0 23.7%
*-commutative23.7%
*-commutative23.7%
Simplified23.7%
Taylor expanded in i around inf 23.7%
Final simplification54.6%
(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 23.9%
associate-/r/24.3%
associate-*r*24.3%
*-commutative24.3%
associate-*r/24.3%
sub-neg24.3%
distribute-lft-in24.3%
metadata-eval24.3%
metadata-eval24.3%
metadata-eval24.3%
fma-define24.3%
metadata-eval24.3%
Simplified24.3%
Taylor expanded in i around 0 54.4%
*-commutative54.4%
associate-*r/54.4%
metadata-eval54.4%
Simplified54.4%
Taylor expanded in n around 0 2.7%
*-commutative2.7%
Simplified2.7%
Final simplification2.7%
(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 23.9%
Taylor expanded in i around 0 50.6%
*-commutative50.6%
Simplified50.6%
Final simplification50.6%
(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 2024059
(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))))