
(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 17 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 0.0)
(/ (* (expm1 (* n (log1p (/ i n)))) 100.0) (/ i n))
(if (<= t_1 INFINITY)
(* n (/ (+ (* t_0 100.0) -100.0) i))
(* 100.0 (/ n (+ 1.0 (* i -0.5))))))))
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 <= 0.0) {
tmp = (expm1((n * log1p((i / n)))) * 100.0) / (i / n);
} else if (t_1 <= ((double) INFINITY)) {
tmp = n * (((t_0 * 100.0) + -100.0) / i);
} else {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
}
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 <= 0.0) {
tmp = (Math.expm1((n * Math.log1p((i / n)))) * 100.0) / (i / n);
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = n * (((t_0 * 100.0) + -100.0) / i);
} else {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
}
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 <= 0.0: tmp = (math.expm1((n * math.log1p((i / n)))) * 100.0) / (i / n) elif t_1 <= math.inf: tmp = n * (((t_0 * 100.0) + -100.0) / i) else: tmp = 100.0 * (n / (1.0 + (i * -0.5))) 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 <= 0.0) tmp = Float64(Float64(expm1(Float64(n * log1p(Float64(i / n)))) * 100.0) / Float64(i / n)); elseif (t_1 <= Inf) tmp = Float64(n * Float64(Float64(Float64(t_0 * 100.0) + -100.0) / i)); else tmp = Float64(100.0 * Float64(n / Float64(1.0 + Float64(i * -0.5)))); 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, 0.0], N[(N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] * 100.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(n * N[(N[(N[(t$95$0 * 100.0), $MachinePrecision] + -100.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $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 0:\\
\;\;\;\;\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}{\frac{i}{n}}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;n \cdot \frac{t_0 \cdot 100 + -100}{i}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0Initial program 24.6%
associate-*r/24.6%
sub-neg24.6%
distribute-lft-in24.6%
metadata-eval24.6%
metadata-eval24.6%
Simplified24.6%
metadata-eval24.6%
metadata-eval24.6%
distribute-lft-in24.6%
sub-neg24.6%
associate-*r/24.6%
associate-/r/23.9%
associate-*r*23.8%
add-exp-log23.8%
expm1-def23.8%
log-pow31.7%
log1p-udef96.1%
Applied egg-rr96.1%
associate-*r/96.0%
frac-2neg96.0%
distribute-rgt-neg-out96.0%
*-commutative96.0%
associate-/r/98.0%
frac-2neg98.0%
distribute-lft-neg-out98.0%
remove-double-neg98.0%
distribute-frac-neg98.0%
remove-double-neg98.0%
Applied egg-rr98.0%
if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 99.7%
associate-/r/99.8%
associate-*r*99.7%
*-commutative99.7%
associate-*r/99.8%
sub-neg99.8%
distribute-lft-in99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
fma-def99.8%
metadata-eval99.8%
Simplified99.8%
fma-def99.8%
*-commutative99.8%
Applied egg-rr99.8%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
Taylor expanded in n around inf 1.9%
*-commutative1.9%
associate-/l*1.9%
expm1-def77.4%
Simplified77.4%
Taylor expanded in i around 0 99.9%
*-commutative99.9%
Simplified99.9%
Final simplification98.4%
(FPCore (i n)
:precision binary64
(let* ((t_0 (/ (+ (pow (+ 1.0 (/ i n)) n) -1.0) (/ i n))))
(if (<= t_0 0.0)
(* 100.0 (/ n (/ i (expm1 i))))
(if (<= t_0 INFINITY) (* t_0 100.0) (* 100.0 (/ n (+ 1.0 (* i -0.5))))))))
double code(double i, double n) {
double t_0 = (pow((1.0 + (i / n)), n) + -1.0) / (i / n);
double tmp;
if (t_0 <= 0.0) {
tmp = 100.0 * (n / (i / expm1(i)));
} else if (t_0 <= ((double) INFINITY)) {
tmp = t_0 * 100.0;
} else {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = (Math.pow((1.0 + (i / n)), n) + -1.0) / (i / n);
double tmp;
if (t_0 <= 0.0) {
tmp = 100.0 * (n / (i / Math.expm1(i)));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0 * 100.0;
} else {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
}
return tmp;
}
def code(i, n): t_0 = (math.pow((1.0 + (i / n)), n) + -1.0) / (i / n) tmp = 0 if t_0 <= 0.0: tmp = 100.0 * (n / (i / math.expm1(i))) elif t_0 <= math.inf: tmp = t_0 * 100.0 else: tmp = 100.0 * (n / (1.0 + (i * -0.5))) return tmp
function code(i, n) t_0 = Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) + -1.0) / Float64(i / n)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(100.0 * Float64(n / Float64(i / expm1(i)))); elseif (t_0 <= Inf) tmp = Float64(t_0 * 100.0); else tmp = Float64(100.0 * Float64(n / Float64(1.0 + Float64(i * -0.5)))); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[(N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(100.0 * N[(n / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(t$95$0 * 100.0), $MachinePrecision], N[(100.0 * N[(n / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{elif}\;t_0 \leq \infty:\\
\;\;\;\;t_0 \cdot 100\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0Initial program 24.6%
Taylor expanded in n around inf 39.9%
*-commutative39.9%
associate-/l*39.9%
expm1-def81.2%
Simplified81.2%
if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 99.7%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
Taylor expanded in n around inf 1.9%
*-commutative1.9%
associate-/l*1.9%
expm1-def77.4%
Simplified77.4%
Taylor expanded in i around 0 99.9%
*-commutative99.9%
Simplified99.9%
Final simplification85.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 0.0)
(* 100.0 (/ n (/ i (expm1 i))))
(if (<= t_1 INFINITY)
(* n (/ (+ (* t_0 100.0) -100.0) i))
(* 100.0 (/ n (+ 1.0 (* i -0.5))))))))
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 <= 0.0) {
tmp = 100.0 * (n / (i / expm1(i)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = n * (((t_0 * 100.0) + -100.0) / i);
} else {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
}
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 <= 0.0) {
tmp = 100.0 * (n / (i / Math.expm1(i)));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = n * (((t_0 * 100.0) + -100.0) / i);
} else {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
}
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 <= 0.0: tmp = 100.0 * (n / (i / math.expm1(i))) elif t_1 <= math.inf: tmp = n * (((t_0 * 100.0) + -100.0) / i) else: tmp = 100.0 * (n / (1.0 + (i * -0.5))) 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 <= 0.0) tmp = Float64(100.0 * Float64(n / Float64(i / expm1(i)))); elseif (t_1 <= Inf) tmp = Float64(n * Float64(Float64(Float64(t_0 * 100.0) + -100.0) / i)); else tmp = Float64(100.0 * Float64(n / Float64(1.0 + Float64(i * -0.5)))); 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, 0.0], N[(100.0 * N[(n / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(n * N[(N[(N[(t$95$0 * 100.0), $MachinePrecision] + -100.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $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 0:\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;n \cdot \frac{t_0 \cdot 100 + -100}{i}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0Initial program 24.6%
Taylor expanded in n around inf 39.9%
*-commutative39.9%
associate-/l*39.9%
expm1-def81.2%
Simplified81.2%
if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 99.7%
associate-/r/99.8%
associate-*r*99.7%
*-commutative99.7%
associate-*r/99.8%
sub-neg99.8%
distribute-lft-in99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
fma-def99.8%
metadata-eval99.8%
Simplified99.8%
fma-def99.8%
*-commutative99.8%
Applied egg-rr99.8%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
Taylor expanded in n around inf 1.9%
*-commutative1.9%
associate-/l*1.9%
expm1-def77.4%
Simplified77.4%
Taylor expanded in i around 0 99.9%
*-commutative99.9%
Simplified99.9%
Final simplification85.9%
(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 0.0)
(* 100.0 (* (expm1 (* n (log1p (/ i n)))) (/ n i)))
(if (<= t_1 INFINITY)
(* n (/ (+ (* t_0 100.0) -100.0) i))
(* 100.0 (/ n (+ 1.0 (* i -0.5))))))))
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 <= 0.0) {
tmp = 100.0 * (expm1((n * log1p((i / n)))) * (n / i));
} else if (t_1 <= ((double) INFINITY)) {
tmp = n * (((t_0 * 100.0) + -100.0) / i);
} else {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
}
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 <= 0.0) {
tmp = 100.0 * (Math.expm1((n * Math.log1p((i / n)))) * (n / i));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = n * (((t_0 * 100.0) + -100.0) / i);
} else {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
}
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 <= 0.0: tmp = 100.0 * (math.expm1((n * math.log1p((i / n)))) * (n / i)) elif t_1 <= math.inf: tmp = n * (((t_0 * 100.0) + -100.0) / i) else: tmp = 100.0 * (n / (1.0 + (i * -0.5))) 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 <= 0.0) tmp = Float64(100.0 * Float64(expm1(Float64(n * log1p(Float64(i / n)))) * Float64(n / i))); elseif (t_1 <= Inf) tmp = Float64(n * Float64(Float64(Float64(t_0 * 100.0) + -100.0) / i)); else tmp = Float64(100.0 * Float64(n / Float64(1.0 + Float64(i * -0.5)))); 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, 0.0], N[(100.0 * N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] * N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(n * N[(N[(N[(t$95$0 * 100.0), $MachinePrecision] + -100.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $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 0:\\
\;\;\;\;100 \cdot \left(\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot \frac{n}{i}\right)\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;n \cdot \frac{t_0 \cdot 100 + -100}{i}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0Initial program 24.6%
clear-num24.6%
associate-/r/24.6%
clear-num23.8%
add-exp-log23.8%
expm1-def23.8%
log-pow31.7%
log1p-udef95.5%
Applied egg-rr95.5%
if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 99.7%
associate-/r/99.8%
associate-*r*99.7%
*-commutative99.7%
associate-*r/99.8%
sub-neg99.8%
distribute-lft-in99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
fma-def99.8%
metadata-eval99.8%
Simplified99.8%
fma-def99.8%
*-commutative99.8%
Applied egg-rr99.8%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
Taylor expanded in n around inf 1.9%
*-commutative1.9%
associate-/l*1.9%
expm1-def77.4%
Simplified77.4%
Taylor expanded in i around 0 99.9%
*-commutative99.9%
Simplified99.9%
Final simplification96.5%
(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 0.0)
(* n (* 100.0 (/ (expm1 (* n (log1p (/ i n)))) i)))
(if (<= t_1 INFINITY)
(* n (/ (+ (* t_0 100.0) -100.0) i))
(* 100.0 (/ n (+ 1.0 (* i -0.5))))))))
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 <= 0.0) {
tmp = n * (100.0 * (expm1((n * log1p((i / n)))) / i));
} else if (t_1 <= ((double) INFINITY)) {
tmp = n * (((t_0 * 100.0) + -100.0) / i);
} else {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
}
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 <= 0.0) {
tmp = n * (100.0 * (Math.expm1((n * Math.log1p((i / n)))) / i));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = n * (((t_0 * 100.0) + -100.0) / i);
} else {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
}
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 <= 0.0: tmp = n * (100.0 * (math.expm1((n * math.log1p((i / n)))) / i)) elif t_1 <= math.inf: tmp = n * (((t_0 * 100.0) + -100.0) / i) else: tmp = 100.0 * (n / (1.0 + (i * -0.5))) 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 <= 0.0) tmp = Float64(n * Float64(100.0 * Float64(expm1(Float64(n * log1p(Float64(i / n)))) / i))); elseif (t_1 <= Inf) tmp = Float64(n * Float64(Float64(Float64(t_0 * 100.0) + -100.0) / i)); else tmp = Float64(100.0 * Float64(n / Float64(1.0 + Float64(i * -0.5)))); 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, 0.0], 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, Infinity], N[(n * N[(N[(N[(t$95$0 * 100.0), $MachinePrecision] + -100.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $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 0:\\
\;\;\;\;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 \infty:\\
\;\;\;\;n \cdot \frac{t_0 \cdot 100 + -100}{i}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0Initial program 24.6%
associate-*r/24.6%
sub-neg24.6%
distribute-lft-in24.6%
metadata-eval24.6%
metadata-eval24.6%
Simplified24.6%
metadata-eval24.6%
metadata-eval24.6%
distribute-lft-in24.6%
sub-neg24.6%
associate-*r/24.6%
associate-/r/23.9%
associate-*r*23.8%
add-exp-log23.8%
expm1-def23.8%
log-pow31.7%
log1p-udef96.1%
Applied egg-rr96.1%
if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 99.7%
associate-/r/99.8%
associate-*r*99.7%
*-commutative99.7%
associate-*r/99.8%
sub-neg99.8%
distribute-lft-in99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
fma-def99.8%
metadata-eval99.8%
Simplified99.8%
fma-def99.8%
*-commutative99.8%
Applied egg-rr99.8%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
Taylor expanded in n around inf 1.9%
*-commutative1.9%
associate-/l*1.9%
expm1-def77.4%
Simplified77.4%
Taylor expanded in i around 0 99.9%
*-commutative99.9%
Simplified99.9%
Final simplification97.0%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* 100.0 (/ (expm1 i) (/ i n)))))
(if (<= i -1.72e-9)
t_0
(if (<= i 5.4e-7)
(+ (* 50.0 (* i n)) (* n 100.0))
(if (or (<= i 3.2e+129) (not (<= i 5.2e+218))) t_0 (/ 0.0 (/ i n)))))))
double code(double i, double n) {
double t_0 = 100.0 * (expm1(i) / (i / n));
double tmp;
if (i <= -1.72e-9) {
tmp = t_0;
} else if (i <= 5.4e-7) {
tmp = (50.0 * (i * n)) + (n * 100.0);
} else if ((i <= 3.2e+129) || !(i <= 5.2e+218)) {
tmp = t_0;
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = 100.0 * (Math.expm1(i) / (i / n));
double tmp;
if (i <= -1.72e-9) {
tmp = t_0;
} else if (i <= 5.4e-7) {
tmp = (50.0 * (i * n)) + (n * 100.0);
} else if ((i <= 3.2e+129) || !(i <= 5.2e+218)) {
tmp = t_0;
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
def code(i, n): t_0 = 100.0 * (math.expm1(i) / (i / n)) tmp = 0 if i <= -1.72e-9: tmp = t_0 elif i <= 5.4e-7: tmp = (50.0 * (i * n)) + (n * 100.0) elif (i <= 3.2e+129) or not (i <= 5.2e+218): tmp = t_0 else: tmp = 0.0 / (i / n) return tmp
function code(i, n) t_0 = Float64(100.0 * Float64(expm1(i) / Float64(i / n))) tmp = 0.0 if (i <= -1.72e-9) tmp = t_0; elseif (i <= 5.4e-7) tmp = Float64(Float64(50.0 * Float64(i * n)) + Float64(n * 100.0)); elseif ((i <= 3.2e+129) || !(i <= 5.2e+218)) tmp = t_0; else tmp = Float64(0.0 / Float64(i / n)); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.72e-9], t$95$0, If[LessEqual[i, 5.4e-7], N[(N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision] + N[(n * 100.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[i, 3.2e+129], N[Not[LessEqual[i, 5.2e+218]], $MachinePrecision]], t$95$0, N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\
\mathbf{if}\;i \leq -1.72 \cdot 10^{-9}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;i \leq 5.4 \cdot 10^{-7}:\\
\;\;\;\;50 \cdot \left(i \cdot n\right) + n \cdot 100\\
\mathbf{elif}\;i \leq 3.2 \cdot 10^{+129} \lor \neg \left(i \leq 5.2 \cdot 10^{+218}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\end{array}
\end{array}
if i < -1.72000000000000006e-9 or 5.40000000000000018e-7 < i < 3.2000000000000002e129 or 5.20000000000000004e218 < i Initial program 52.6%
Taylor expanded in n around inf 71.8%
expm1-def71.8%
Simplified71.8%
if -1.72000000000000006e-9 < i < 5.40000000000000018e-7Initial program 7.2%
associate-/r/7.6%
associate-*r*7.6%
*-commutative7.6%
associate-*r/7.6%
sub-neg7.6%
distribute-lft-in7.6%
metadata-eval7.6%
metadata-eval7.6%
metadata-eval7.6%
fma-def7.6%
metadata-eval7.6%
Simplified7.6%
Taylor expanded in n around inf 9.2%
Taylor expanded in i around 0 90.5%
if 3.2000000000000002e129 < i < 5.20000000000000004e218Initial program 55.2%
associate-*r/55.2%
sub-neg55.2%
distribute-lft-in55.2%
metadata-eval55.2%
metadata-eval55.2%
Simplified55.2%
Taylor expanded in i around 0 42.9%
Final simplification78.8%
(FPCore (i n) :precision binary64 (if (or (<= n -6.2e-232) (not (<= n 6e-155))) (* 100.0 (* n (/ (expm1 i) i))) (/ 0.0 (/ i n))))
double code(double i, double n) {
double tmp;
if ((n <= -6.2e-232) || !(n <= 6e-155)) {
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 <= -6.2e-232) || !(n <= 6e-155)) {
tmp = 100.0 * (n * (Math.expm1(i) / i));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -6.2e-232) or not (n <= 6e-155): 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 <= -6.2e-232) || !(n <= 6e-155)) 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, -6.2e-232], N[Not[LessEqual[n, 6e-155]], $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 -6.2 \cdot 10^{-232} \lor \neg \left(n \leq 6 \cdot 10^{-155}\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 < -6.1999999999999998e-232 or 5.99999999999999967e-155 < n Initial program 26.1%
Taylor expanded in n around inf 33.7%
*-commutative33.7%
associate-/l*33.7%
expm1-def81.5%
Simplified81.5%
clear-num82.0%
associate-/r/81.5%
clear-num81.5%
Applied egg-rr81.5%
if -6.1999999999999998e-232 < n < 5.99999999999999967e-155Initial program 56.2%
associate-*r/56.2%
sub-neg56.2%
distribute-lft-in56.2%
metadata-eval56.2%
metadata-eval56.2%
Simplified56.2%
Taylor expanded in i around 0 75.5%
Final simplification80.8%
(FPCore (i n) :precision binary64 (if (<= n -2.4e-232) (* 100.0 (/ n (/ i (expm1 i)))) (if (<= n 1.35e-153) (/ 0.0 (/ i n)) (* 100.0 (* n (/ (expm1 i) i))))))
double code(double i, double n) {
double tmp;
if (n <= -2.4e-232) {
tmp = 100.0 * (n / (i / expm1(i)));
} else if (n <= 1.35e-153) {
tmp = 0.0 / (i / n);
} else {
tmp = 100.0 * (n * (expm1(i) / i));
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (n <= -2.4e-232) {
tmp = 100.0 * (n / (i / Math.expm1(i)));
} else if (n <= 1.35e-153) {
tmp = 0.0 / (i / n);
} else {
tmp = 100.0 * (n * (Math.expm1(i) / i));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -2.4e-232: tmp = 100.0 * (n / (i / math.expm1(i))) elif n <= 1.35e-153: tmp = 0.0 / (i / n) else: tmp = 100.0 * (n * (math.expm1(i) / i)) return tmp
function code(i, n) tmp = 0.0 if (n <= -2.4e-232) tmp = Float64(100.0 * Float64(n / Float64(i / expm1(i)))); elseif (n <= 1.35e-153) tmp = Float64(0.0 / Float64(i / n)); else tmp = Float64(100.0 * Float64(n * Float64(expm1(i) / i))); end return tmp end
code[i_, n_] := If[LessEqual[n, -2.4e-232], N[(100.0 * N[(n / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.35e-153], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.4 \cdot 10^{-232}:\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{elif}\;n \leq 1.35 \cdot 10^{-153}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\
\end{array}
\end{array}
if n < -2.39999999999999999e-232Initial program 31.6%
Taylor expanded in n around inf 36.2%
*-commutative36.2%
associate-/l*36.2%
expm1-def78.6%
Simplified78.6%
if -2.39999999999999999e-232 < n < 1.35000000000000005e-153Initial program 56.2%
associate-*r/56.2%
sub-neg56.2%
distribute-lft-in56.2%
metadata-eval56.2%
metadata-eval56.2%
Simplified56.2%
Taylor expanded in i around 0 75.5%
if 1.35000000000000005e-153 < n Initial program 20.3%
Taylor expanded in n around inf 31.0%
*-commutative31.0%
associate-/l*31.0%
expm1-def84.6%
Simplified84.6%
clear-num84.4%
associate-/r/84.6%
clear-num84.6%
Applied egg-rr84.6%
Final simplification80.8%
(FPCore (i n)
:precision binary64
(if (<= n -3e+243)
(/ 100.0 (/ i (* i n)))
(if (<= n 4e-24)
(* 100.0 (/ n (+ 1.0 (* i -0.5))))
(* n (+ 100.0 (* i 50.0))))))
double code(double i, double n) {
double tmp;
if (n <= -3e+243) {
tmp = 100.0 / (i / (i * n));
} else if (n <= 4e-24) {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
} 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 <= (-3d+243)) then
tmp = 100.0d0 / (i / (i * n))
else if (n <= 4d-24) then
tmp = 100.0d0 * (n / (1.0d0 + (i * (-0.5d0))))
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 <= -3e+243) {
tmp = 100.0 / (i / (i * n));
} else if (n <= 4e-24) {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -3e+243: tmp = 100.0 / (i / (i * n)) elif n <= 4e-24: tmp = 100.0 * (n / (1.0 + (i * -0.5))) else: tmp = n * (100.0 + (i * 50.0)) return tmp
function code(i, n) tmp = 0.0 if (n <= -3e+243) tmp = Float64(100.0 / Float64(i / Float64(i * n))); elseif (n <= 4e-24) tmp = Float64(100.0 * Float64(n / Float64(1.0 + Float64(i * -0.5)))); 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 <= -3e+243) tmp = 100.0 / (i / (i * n)); elseif (n <= 4e-24) tmp = 100.0 * (n / (1.0 + (i * -0.5))); else tmp = n * (100.0 + (i * 50.0)); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -3e+243], N[(100.0 / N[(i / N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 4e-24], N[(100.0 * N[(n / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $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 -3 \cdot 10^{+243}:\\
\;\;\;\;\frac{100}{\frac{i}{i \cdot n}}\\
\mathbf{elif}\;n \leq 4 \cdot 10^{-24}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if n < -2.99999999999999984e243Initial program 14.7%
Taylor expanded in n around inf 73.6%
*-commutative73.6%
associate-/l*73.6%
expm1-def93.3%
Simplified93.3%
*-commutative93.3%
clear-num93.2%
un-div-inv93.3%
associate-/l/93.3%
Applied egg-rr93.3%
Taylor expanded in i around 0 61.9%
*-commutative61.9%
Simplified61.9%
if -2.99999999999999984e243 < n < 3.99999999999999969e-24Initial program 36.1%
Taylor expanded in n around inf 28.9%
*-commutative28.9%
associate-/l*28.9%
expm1-def65.7%
Simplified65.7%
Taylor expanded in i around 0 62.6%
*-commutative62.6%
Simplified62.6%
if 3.99999999999999969e-24 < n Initial program 20.6%
associate-/r/21.0%
associate-*r*21.0%
*-commutative21.0%
associate-*r/21.0%
sub-neg21.0%
distribute-lft-in21.0%
metadata-eval21.0%
metadata-eval21.0%
metadata-eval21.0%
fma-def21.0%
metadata-eval21.0%
Simplified21.0%
Taylor expanded in n around inf 39.3%
Taylor expanded in i around 0 70.0%
*-commutative70.0%
Simplified70.0%
Final simplification65.0%
(FPCore (i n)
:precision binary64
(if (<= n -1.15e+243)
(/ 100.0 (/ i (* i n)))
(if (<= n 4.6e-24)
(* 100.0 (/ n (+ 1.0 (* i -0.5))))
(+ (* 50.0 (* i n)) (* n 100.0)))))
double code(double i, double n) {
double tmp;
if (n <= -1.15e+243) {
tmp = 100.0 / (i / (i * n));
} else if (n <= 4.6e-24) {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
} else {
tmp = (50.0 * (i * n)) + (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 (n <= (-1.15d+243)) then
tmp = 100.0d0 / (i / (i * n))
else if (n <= 4.6d-24) then
tmp = 100.0d0 * (n / (1.0d0 + (i * (-0.5d0))))
else
tmp = (50.0d0 * (i * n)) + (n * 100.0d0)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -1.15e+243) {
tmp = 100.0 / (i / (i * n));
} else if (n <= 4.6e-24) {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
} else {
tmp = (50.0 * (i * n)) + (n * 100.0);
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.15e+243: tmp = 100.0 / (i / (i * n)) elif n <= 4.6e-24: tmp = 100.0 * (n / (1.0 + (i * -0.5))) else: tmp = (50.0 * (i * n)) + (n * 100.0) return tmp
function code(i, n) tmp = 0.0 if (n <= -1.15e+243) tmp = Float64(100.0 / Float64(i / Float64(i * n))); elseif (n <= 4.6e-24) tmp = Float64(100.0 * Float64(n / Float64(1.0 + Float64(i * -0.5)))); else tmp = Float64(Float64(50.0 * Float64(i * n)) + Float64(n * 100.0)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -1.15e+243) tmp = 100.0 / (i / (i * n)); elseif (n <= 4.6e-24) tmp = 100.0 * (n / (1.0 + (i * -0.5))); else tmp = (50.0 * (i * n)) + (n * 100.0); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.15e+243], N[(100.0 / N[(i / N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 4.6e-24], N[(100.0 * N[(n / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision] + N[(n * 100.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.15 \cdot 10^{+243}:\\
\;\;\;\;\frac{100}{\frac{i}{i \cdot n}}\\
\mathbf{elif}\;n \leq 4.6 \cdot 10^{-24}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{else}:\\
\;\;\;\;50 \cdot \left(i \cdot n\right) + n \cdot 100\\
\end{array}
\end{array}
if n < -1.14999999999999993e243Initial program 14.7%
Taylor expanded in n around inf 73.6%
*-commutative73.6%
associate-/l*73.6%
expm1-def93.3%
Simplified93.3%
*-commutative93.3%
clear-num93.2%
un-div-inv93.3%
associate-/l/93.3%
Applied egg-rr93.3%
Taylor expanded in i around 0 61.9%
*-commutative61.9%
Simplified61.9%
if -1.14999999999999993e243 < n < 4.6000000000000002e-24Initial program 36.1%
Taylor expanded in n around inf 28.9%
*-commutative28.9%
associate-/l*28.9%
expm1-def65.7%
Simplified65.7%
Taylor expanded in i around 0 62.6%
*-commutative62.6%
Simplified62.6%
if 4.6000000000000002e-24 < n Initial program 20.6%
associate-/r/21.0%
associate-*r*21.0%
*-commutative21.0%
associate-*r/21.0%
sub-neg21.0%
distribute-lft-in21.0%
metadata-eval21.0%
metadata-eval21.0%
metadata-eval21.0%
fma-def21.0%
metadata-eval21.0%
Simplified21.0%
Taylor expanded in n around inf 39.3%
Taylor expanded in i around 0 70.0%
Final simplification65.0%
(FPCore (i n) :precision binary64 (if (<= i 1.9) (/ 100.0 (+ (* (/ i n) -0.5) (/ 1.0 n))) (if (<= i 1.32e+219) (/ 0.0 (/ i n)) (* n (+ 100.0 (* i 50.0))))))
double code(double i, double n) {
double tmp;
if (i <= 1.9) {
tmp = 100.0 / (((i / n) * -0.5) + (1.0 / n));
} else if (i <= 1.32e+219) {
tmp = 0.0 / (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 (i <= 1.9d0) then
tmp = 100.0d0 / (((i / n) * (-0.5d0)) + (1.0d0 / n))
else if (i <= 1.32d+219) then
tmp = 0.0d0 / (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 (i <= 1.9) {
tmp = 100.0 / (((i / n) * -0.5) + (1.0 / n));
} else if (i <= 1.32e+219) {
tmp = 0.0 / (i / n);
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): tmp = 0 if i <= 1.9: tmp = 100.0 / (((i / n) * -0.5) + (1.0 / n)) elif i <= 1.32e+219: tmp = 0.0 / (i / n) else: tmp = n * (100.0 + (i * 50.0)) return tmp
function code(i, n) tmp = 0.0 if (i <= 1.9) tmp = Float64(100.0 / Float64(Float64(Float64(i / n) * -0.5) + Float64(1.0 / n))); elseif (i <= 1.32e+219) tmp = Float64(0.0 / 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 (i <= 1.9) tmp = 100.0 / (((i / n) * -0.5) + (1.0 / n)); elseif (i <= 1.32e+219) tmp = 0.0 / (i / n); else tmp = n * (100.0 + (i * 50.0)); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, 1.9], N[(100.0 / N[(N[(N[(i / n), $MachinePrecision] * -0.5), $MachinePrecision] + N[(1.0 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.32e+219], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq 1.9:\\
\;\;\;\;\frac{100}{\frac{i}{n} \cdot -0.5 + \frac{1}{n}}\\
\mathbf{elif}\;i \leq 1.32 \cdot 10^{+219}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if i < 1.8999999999999999Initial program 20.4%
Taylor expanded in n around inf 32.0%
*-commutative32.0%
associate-/l*32.0%
expm1-def87.7%
Simplified87.7%
*-commutative87.7%
clear-num88.3%
un-div-inv88.3%
associate-/l/78.2%
Applied egg-rr78.2%
Taylor expanded in i around 0 74.3%
if 1.8999999999999999 < i < 1.31999999999999999e219Initial program 43.2%
associate-*r/43.2%
sub-neg43.2%
distribute-lft-in43.2%
metadata-eval43.2%
metadata-eval43.2%
Simplified43.2%
Taylor expanded in i around 0 33.1%
if 1.31999999999999999e219 < i Initial program 85.7%
associate-/r/85.9%
associate-*r*85.7%
*-commutative85.7%
associate-*r/85.7%
sub-neg85.7%
distribute-lft-in85.7%
metadata-eval85.7%
metadata-eval85.7%
metadata-eval85.7%
fma-def85.7%
metadata-eval85.7%
Simplified85.7%
Taylor expanded in n around inf 57.7%
Taylor expanded in i around 0 49.1%
*-commutative49.1%
Simplified49.1%
Final simplification65.0%
(FPCore (i n) :precision binary64 (if (or (<= i -1e-13) (not (<= i 3.9e-35))) (* 100.0 (/ i (/ i n))) (* n 100.0)))
double code(double i, double n) {
double tmp;
if ((i <= -1e-13) || !(i <= 3.9e-35)) {
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-13)) .or. (.not. (i <= 3.9d-35))) 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-13) || !(i <= 3.9e-35)) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * 100.0;
}
return tmp;
}
def code(i, n): tmp = 0 if (i <= -1e-13) or not (i <= 3.9e-35): tmp = 100.0 * (i / (i / n)) else: tmp = n * 100.0 return tmp
function code(i, n) tmp = 0.0 if ((i <= -1e-13) || !(i <= 3.9e-35)) 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-13) || ~((i <= 3.9e-35))) tmp = 100.0 * (i / (i / n)); else tmp = n * 100.0; end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[i, -1e-13], N[Not[LessEqual[i, 3.9e-35]], $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^{-13} \lor \neg \left(i \leq 3.9 \cdot 10^{-35}\right):\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100\\
\end{array}
\end{array}
if i < -1e-13 or 3.8999999999999998e-35 < i Initial program 49.0%
Taylor expanded in i around 0 29.3%
if -1e-13 < i < 3.8999999999999998e-35Initial program 7.6%
Taylor expanded in i around 0 90.4%
*-commutative90.4%
Simplified90.4%
Final simplification57.7%
(FPCore (i n) :precision binary64 (if (or (<= n -8.8e+35) (not (<= n 1.45))) (* n (+ 100.0 (* i 50.0))) (* 100.0 (/ i (/ i n)))))
double code(double i, double n) {
double tmp;
if ((n <= -8.8e+35) || !(n <= 1.45)) {
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 <= (-8.8d+35)) .or. (.not. (n <= 1.45d0))) 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 <= -8.8e+35) || !(n <= 1.45)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -8.8e+35) or not (n <= 1.45): 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 <= -8.8e+35) || !(n <= 1.45)) 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 <= -8.8e+35) || ~((n <= 1.45))) 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, -8.8e+35], N[Not[LessEqual[n, 1.45]], $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.8 \cdot 10^{+35} \lor \neg \left(n \leq 1.45\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -8.7999999999999994e35 or 1.44999999999999996 < n Initial program 23.5%
associate-/r/23.9%
associate-*r*23.9%
*-commutative23.9%
associate-*r/23.9%
sub-neg23.9%
distribute-lft-in23.9%
metadata-eval23.9%
metadata-eval23.9%
metadata-eval23.9%
fma-def23.9%
metadata-eval23.9%
Simplified23.9%
Taylor expanded in n around inf 42.1%
Taylor expanded in i around 0 62.1%
*-commutative62.1%
Simplified62.1%
if -8.7999999999999994e35 < n < 1.44999999999999996Initial program 37.8%
Taylor expanded in i around 0 65.2%
Final simplification63.5%
(FPCore (i n) :precision binary64 (if (<= i -1e-14) (* 100.0 (/ i (/ i n))) (if (<= i 6e-26) (* n 100.0) (* i (* 100.0 (/ n i))))))
double code(double i, double n) {
double tmp;
if (i <= -1e-14) {
tmp = 100.0 * (i / (i / n));
} else if (i <= 6e-26) {
tmp = n * 100.0;
} else {
tmp = i * (100.0 * (n / i));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (i <= (-1d-14)) then
tmp = 100.0d0 * (i / (i / n))
else if (i <= 6d-26) then
tmp = n * 100.0d0
else
tmp = i * (100.0d0 * (n / i))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (i <= -1e-14) {
tmp = 100.0 * (i / (i / n));
} else if (i <= 6e-26) {
tmp = n * 100.0;
} else {
tmp = i * (100.0 * (n / i));
}
return tmp;
}
def code(i, n): tmp = 0 if i <= -1e-14: tmp = 100.0 * (i / (i / n)) elif i <= 6e-26: tmp = n * 100.0 else: tmp = i * (100.0 * (n / i)) return tmp
function code(i, n) tmp = 0.0 if (i <= -1e-14) tmp = Float64(100.0 * Float64(i / Float64(i / n))); elseif (i <= 6e-26) tmp = Float64(n * 100.0); else tmp = Float64(i * Float64(100.0 * Float64(n / i))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (i <= -1e-14) tmp = 100.0 * (i / (i / n)); elseif (i <= 6e-26) tmp = n * 100.0; else tmp = i * (100.0 * (n / i)); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, -1e-14], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 6e-26], N[(n * 100.0), $MachinePrecision], N[(i * N[(100.0 * N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -1 \cdot 10^{-14}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{elif}\;i \leq 6 \cdot 10^{-26}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;i \cdot \left(100 \cdot \frac{n}{i}\right)\\
\end{array}
\end{array}
if i < -9.99999999999999999e-15Initial program 49.1%
Taylor expanded in i around 0 33.5%
if -9.99999999999999999e-15 < i < 6.00000000000000023e-26Initial program 7.5%
Taylor expanded in i around 0 90.6%
*-commutative90.6%
Simplified90.6%
if 6.00000000000000023e-26 < i Initial program 50.3%
*-commutative50.3%
frac-2neg50.3%
associate-*l/50.3%
add-exp-log50.3%
expm1-def50.3%
log-pow36.5%
log1p-udef67.9%
distribute-neg-frac67.9%
Applied egg-rr67.9%
Taylor expanded in i around 0 24.1%
*-commutative24.1%
Simplified24.1%
frac-2neg24.1%
div-inv24.1%
distribute-rgt-neg-in24.1%
metadata-eval24.1%
distribute-frac-neg24.1%
remove-double-neg24.1%
clear-num24.1%
Applied egg-rr24.1%
associate-*l*24.1%
Simplified24.1%
Final simplification57.7%
(FPCore (i n) :precision binary64 (if (<= i 1.8) (* 100.0 (/ n (+ 1.0 (* i -0.5)))) (if (<= i 1.12e+219) (/ 0.0 (/ i n)) (* n (+ 100.0 (* i 50.0))))))
double code(double i, double n) {
double tmp;
if (i <= 1.8) {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
} else if (i <= 1.12e+219) {
tmp = 0.0 / (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 (i <= 1.8d0) then
tmp = 100.0d0 * (n / (1.0d0 + (i * (-0.5d0))))
else if (i <= 1.12d+219) then
tmp = 0.0d0 / (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 (i <= 1.8) {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
} else if (i <= 1.12e+219) {
tmp = 0.0 / (i / n);
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): tmp = 0 if i <= 1.8: tmp = 100.0 * (n / (1.0 + (i * -0.5))) elif i <= 1.12e+219: tmp = 0.0 / (i / n) else: tmp = n * (100.0 + (i * 50.0)) return tmp
function code(i, n) tmp = 0.0 if (i <= 1.8) tmp = Float64(100.0 * Float64(n / Float64(1.0 + Float64(i * -0.5)))); elseif (i <= 1.12e+219) tmp = Float64(0.0 / 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 (i <= 1.8) tmp = 100.0 * (n / (1.0 + (i * -0.5))); elseif (i <= 1.12e+219) tmp = 0.0 / (i / n); else tmp = n * (100.0 + (i * 50.0)); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, 1.8], N[(100.0 * N[(n / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.12e+219], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq 1.8:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{elif}\;i \leq 1.12 \cdot 10^{+219}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if i < 1.80000000000000004Initial program 20.4%
Taylor expanded in n around inf 32.0%
*-commutative32.0%
associate-/l*32.0%
expm1-def87.7%
Simplified87.7%
Taylor expanded in i around 0 73.7%
*-commutative73.7%
Simplified73.7%
if 1.80000000000000004 < i < 1.1199999999999999e219Initial program 43.2%
associate-*r/43.2%
sub-neg43.2%
distribute-lft-in43.2%
metadata-eval43.2%
metadata-eval43.2%
Simplified43.2%
Taylor expanded in i around 0 33.1%
if 1.1199999999999999e219 < i Initial program 85.7%
associate-/r/85.9%
associate-*r*85.7%
*-commutative85.7%
associate-*r/85.7%
sub-neg85.7%
distribute-lft-in85.7%
metadata-eval85.7%
metadata-eval85.7%
metadata-eval85.7%
fma-def85.7%
metadata-eval85.7%
Simplified85.7%
Taylor expanded in n around inf 57.7%
Taylor expanded in i around 0 49.1%
*-commutative49.1%
Simplified49.1%
Final simplification64.5%
(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 29.8%
Taylor expanded in i around 0 53.5%
associate-*r*53.5%
associate-*r/53.5%
metadata-eval53.5%
Simplified53.5%
Taylor expanded in n around 0 2.9%
*-commutative2.9%
Simplified2.9%
Final simplification2.9%
(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 29.8%
Taylor expanded in i around 0 48.5%
*-commutative48.5%
Simplified48.5%
Final simplification48.5%
(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 2024011
(FPCore (i n)
:name "Compound Interest"
:precision binary64
:herbie-target
(* 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))))