
(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 15 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)
(* 100.0 (/ (expm1 (* n (log1p (/ i n)))) (/ i n)))
(if (<= t_1 INFINITY)
(/ (+ (* t_0 100.0) -100.0) (/ i n))
(/
n
(+ 0.01 (+ (* i -0.005) (* 0.0008333333333333334 (pow i 2.0)))))))))
double code(double i, double n) {
double t_0 = pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= 0.0) {
tmp = 100.0 * (expm1((n * log1p((i / n)))) / (i / n));
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((t_0 * 100.0) + -100.0) / (i / n);
} else {
tmp = n / (0.01 + ((i * -0.005) + (0.0008333333333333334 * pow(i, 2.0))));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = Math.pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= 0.0) {
tmp = 100.0 * (Math.expm1((n * Math.log1p((i / n)))) / (i / n));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = ((t_0 * 100.0) + -100.0) / (i / n);
} else {
tmp = n / (0.01 + ((i * -0.005) + (0.0008333333333333334 * Math.pow(i, 2.0))));
}
return tmp;
}
def code(i, n): t_0 = math.pow((1.0 + (i / n)), n) t_1 = (t_0 + -1.0) / (i / n) tmp = 0 if t_1 <= 0.0: tmp = 100.0 * (math.expm1((n * math.log1p((i / n)))) / (i / n)) elif t_1 <= math.inf: tmp = ((t_0 * 100.0) + -100.0) / (i / n) else: tmp = n / (0.01 + ((i * -0.005) + (0.0008333333333333334 * math.pow(i, 2.0)))) return tmp
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) ^ n t_1 = Float64(Float64(t_0 + -1.0) / Float64(i / n)) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(100.0 * Float64(expm1(Float64(n * log1p(Float64(i / n)))) / Float64(i / n))); elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(t_0 * 100.0) + -100.0) / Float64(i / n)); else tmp = Float64(n / Float64(0.01 + Float64(Float64(i * -0.005) + Float64(0.0008333333333333334 * (i ^ 2.0))))); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(100.0 * N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[(t$95$0 * 100.0), $MachinePrecision] + -100.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(n / N[(0.01 + N[(N[(i * -0.005), $MachinePrecision] + N[(0.0008333333333333334 * N[Power[i, 2.0], $MachinePrecision]), $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{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{i}{n}}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;\frac{t_0 \cdot 100 + -100}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;\frac{n}{0.01 + \left(i \cdot -0.005 + 0.0008333333333333334 \cdot {i}^{2}\right)}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -0.0Initial program 23.0%
*-un-lft-identity23.0%
pow-to-exp22.5%
expm1-def32.2%
*-commutative32.2%
log1p-def99.3%
Applied egg-rr99.3%
*-lft-identity99.3%
Simplified99.3%
if -0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 99.0%
associate-*r/99.2%
sub-neg99.2%
distribute-rgt-in99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
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-def82.3%
Simplified82.3%
associate-*l/82.3%
associate-/l*82.2%
Applied egg-rr82.2%
Taylor expanded in i around 0 99.8%
Final simplification99.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)
(/
n
(+ 0.01 (+ (* i -0.005) (* 0.0008333333333333334 (pow i 2.0)))))))))
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 = n / (0.01 + ((i * -0.005) + (0.0008333333333333334 * pow(i, 2.0))));
}
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 = n / (0.01 + ((i * -0.005) + (0.0008333333333333334 * Math.pow(i, 2.0))));
}
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 = n / (0.01 + ((i * -0.005) + (0.0008333333333333334 * math.pow(i, 2.0)))) 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(n / Float64(0.01 + Float64(Float64(i * -0.005) + Float64(0.0008333333333333334 * (i ^ 2.0))))); 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[(n / N[(0.01 + N[(N[(i * -0.005), $MachinePrecision] + N[(0.0008333333333333334 * N[Power[i, 2.0], $MachinePrecision]), $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}:\\
\;\;\;\;\frac{n}{0.01 + \left(i \cdot -0.005 + 0.0008333333333333334 \cdot {i}^{2}\right)}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -0.0Initial program 23.0%
Taylor expanded in n around inf 38.0%
*-commutative38.0%
associate-/l*37.9%
expm1-def80.4%
Simplified80.4%
if -0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 99.0%
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-def82.3%
Simplified82.3%
associate-*l/82.3%
associate-/l*82.2%
Applied egg-rr82.2%
Taylor expanded in i around 0 99.8%
Final simplification86.3%
(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)
(/ (+ (* t_0 100.0) -100.0) (/ i n))
(/
n
(+ 0.01 (+ (* i -0.005) (* 0.0008333333333333334 (pow i 2.0)))))))))
double code(double i, double n) {
double t_0 = pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= 0.0) {
tmp = 100.0 * (n / (i / expm1(i)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((t_0 * 100.0) + -100.0) / (i / n);
} else {
tmp = n / (0.01 + ((i * -0.005) + (0.0008333333333333334 * pow(i, 2.0))));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = Math.pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= 0.0) {
tmp = 100.0 * (n / (i / Math.expm1(i)));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = ((t_0 * 100.0) + -100.0) / (i / n);
} else {
tmp = n / (0.01 + ((i * -0.005) + (0.0008333333333333334 * Math.pow(i, 2.0))));
}
return tmp;
}
def code(i, n): t_0 = math.pow((1.0 + (i / n)), n) t_1 = (t_0 + -1.0) / (i / n) tmp = 0 if t_1 <= 0.0: tmp = 100.0 * (n / (i / math.expm1(i))) elif t_1 <= math.inf: tmp = ((t_0 * 100.0) + -100.0) / (i / n) else: tmp = n / (0.01 + ((i * -0.005) + (0.0008333333333333334 * math.pow(i, 2.0)))) return tmp
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) ^ n t_1 = Float64(Float64(t_0 + -1.0) / Float64(i / n)) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(100.0 * Float64(n / Float64(i / expm1(i)))); elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(t_0 * 100.0) + -100.0) / Float64(i / n)); else tmp = Float64(n / Float64(0.01 + Float64(Float64(i * -0.005) + Float64(0.0008333333333333334 * (i ^ 2.0))))); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 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[(t$95$0 * 100.0), $MachinePrecision] + -100.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(n / N[(0.01 + N[(N[(i * -0.005), $MachinePrecision] + N[(0.0008333333333333334 * N[Power[i, 2.0], $MachinePrecision]), $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:\\
\;\;\;\;\frac{t_0 \cdot 100 + -100}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;\frac{n}{0.01 + \left(i \cdot -0.005 + 0.0008333333333333334 \cdot {i}^{2}\right)}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -0.0Initial program 23.0%
Taylor expanded in n around inf 38.0%
*-commutative38.0%
associate-/l*37.9%
expm1-def80.4%
Simplified80.4%
if -0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 99.0%
associate-*r/99.2%
sub-neg99.2%
distribute-rgt-in99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
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-def82.3%
Simplified82.3%
associate-*l/82.3%
associate-/l*82.2%
Applied egg-rr82.2%
Taylor expanded in i around 0 99.8%
Final simplification86.4%
(FPCore (i n) :precision binary64 (if (<= i 5e+141) (* 100.0 (/ n (/ i (expm1 i)))) (* 100.0 (- (pow (/ i n) (+ n -1.0)) (/ n i)))))
double code(double i, double n) {
double tmp;
if (i <= 5e+141) {
tmp = 100.0 * (n / (i / expm1(i)));
} else {
tmp = 100.0 * (pow((i / n), (n + -1.0)) - (n / i));
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (i <= 5e+141) {
tmp = 100.0 * (n / (i / Math.expm1(i)));
} else {
tmp = 100.0 * (Math.pow((i / n), (n + -1.0)) - (n / i));
}
return tmp;
}
def code(i, n): tmp = 0 if i <= 5e+141: tmp = 100.0 * (n / (i / math.expm1(i))) else: tmp = 100.0 * (math.pow((i / n), (n + -1.0)) - (n / i)) return tmp
function code(i, n) tmp = 0.0 if (i <= 5e+141) tmp = Float64(100.0 * Float64(n / Float64(i / expm1(i)))); else tmp = Float64(100.0 * Float64((Float64(i / n) ^ Float64(n + -1.0)) - Float64(n / i))); end return tmp end
code[i_, n_] := If[LessEqual[i, 5e+141], N[(100.0 * N[(n / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(N[Power[N[(i / n), $MachinePrecision], N[(n + -1.0), $MachinePrecision]], $MachinePrecision] - N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq 5 \cdot 10^{+141}:\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left({\left(\frac{i}{n}\right)}^{\left(n + -1\right)} - \frac{n}{i}\right)\\
\end{array}
\end{array}
if i < 5.00000000000000025e141Initial program 20.8%
Taylor expanded in n around inf 30.7%
*-commutative30.7%
associate-/l*30.7%
expm1-def83.2%
Simplified83.2%
if 5.00000000000000025e141 < i Initial program 59.1%
Taylor expanded in i around inf 62.7%
div-sub62.7%
pow162.7%
pow-div88.6%
clear-num87.6%
Applied egg-rr87.6%
Final simplification83.7%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* 100.0 (/ (expm1 i) (/ i n)))))
(if (<= i -5.2e-98)
t_0
(if (<= i 1e-77)
(* n (+ 100.0 (* 100.0 (* i (- 0.5 (/ 0.5 n))))))
(if (<= i 5.4e+253)
t_0
(/ 1.0 (+ (* (/ i n) -0.005) (* 0.01 (/ 1.0 n)))))))))
double code(double i, double n) {
double t_0 = 100.0 * (expm1(i) / (i / n));
double tmp;
if (i <= -5.2e-98) {
tmp = t_0;
} else if (i <= 1e-77) {
tmp = n * (100.0 + (100.0 * (i * (0.5 - (0.5 / n)))));
} else if (i <= 5.4e+253) {
tmp = t_0;
} else {
tmp = 1.0 / (((i / n) * -0.005) + (0.01 * (1.0 / 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 <= -5.2e-98) {
tmp = t_0;
} else if (i <= 1e-77) {
tmp = n * (100.0 + (100.0 * (i * (0.5 - (0.5 / n)))));
} else if (i <= 5.4e+253) {
tmp = t_0;
} else {
tmp = 1.0 / (((i / n) * -0.005) + (0.01 * (1.0 / n)));
}
return tmp;
}
def code(i, n): t_0 = 100.0 * (math.expm1(i) / (i / n)) tmp = 0 if i <= -5.2e-98: tmp = t_0 elif i <= 1e-77: tmp = n * (100.0 + (100.0 * (i * (0.5 - (0.5 / n))))) elif i <= 5.4e+253: tmp = t_0 else: tmp = 1.0 / (((i / n) * -0.005) + (0.01 * (1.0 / n))) return tmp
function code(i, n) t_0 = Float64(100.0 * Float64(expm1(i) / Float64(i / n))) tmp = 0.0 if (i <= -5.2e-98) tmp = t_0; elseif (i <= 1e-77) tmp = Float64(n * Float64(100.0 + Float64(100.0 * Float64(i * Float64(0.5 - Float64(0.5 / n)))))); elseif (i <= 5.4e+253) tmp = t_0; else tmp = Float64(1.0 / Float64(Float64(Float64(i / n) * -0.005) + Float64(0.01 * Float64(1.0 / 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, -5.2e-98], t$95$0, If[LessEqual[i, 1e-77], N[(n * N[(100.0 + N[(100.0 * N[(i * N[(0.5 - N[(0.5 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 5.4e+253], t$95$0, N[(1.0 / N[(N[(N[(i / n), $MachinePrecision] * -0.005), $MachinePrecision] + N[(0.01 * N[(1.0 / n), $MachinePrecision]), $MachinePrecision]), $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 -5.2 \cdot 10^{-98}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;i \leq 10^{-77}:\\
\;\;\;\;n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right)\right)\right)\\
\mathbf{elif}\;i \leq 5.4 \cdot 10^{+253}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{i}{n} \cdot -0.005 + 0.01 \cdot \frac{1}{n}}\\
\end{array}
\end{array}
if i < -5.20000000000000027e-98 or 9.9999999999999993e-78 < i < 5.40000000000000005e253Initial program 40.0%
Taylor expanded in n around inf 54.4%
expm1-def70.8%
Simplified70.8%
if -5.20000000000000027e-98 < i < 9.9999999999999993e-78Initial program 5.7%
associate-*r/5.7%
associate-/r/6.5%
*-commutative6.5%
sub-neg6.5%
distribute-lft-in6.5%
fma-def6.5%
metadata-eval6.5%
metadata-eval6.5%
Simplified6.5%
Taylor expanded in i around 0 91.9%
associate-*r/91.9%
metadata-eval91.9%
Simplified91.9%
if 5.40000000000000005e253 < i Initial program 49.7%
Taylor expanded in n around inf 17.8%
*-commutative17.8%
associate-/l*17.8%
expm1-def17.8%
Simplified17.8%
associate-*l/17.8%
clear-num17.8%
Applied egg-rr17.8%
associate-/l/17.8%
associate-/r*17.0%
*-commutative17.0%
Simplified17.0%
Taylor expanded in i around 0 56.4%
Final simplification79.8%
(FPCore (i n) :precision binary64 (if (or (<= n -3.1e-198) (not (<= n 3.2e-130))) (* 100.0 (/ n (/ i (expm1 i)))) (/ 0.0 (/ i n))))
double code(double i, double n) {
double tmp;
if ((n <= -3.1e-198) || !(n <= 3.2e-130)) {
tmp = 100.0 * (n / (i / expm1(i)));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((n <= -3.1e-198) || !(n <= 3.2e-130)) {
tmp = 100.0 * (n / (i / Math.expm1(i)));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -3.1e-198) or not (n <= 3.2e-130): tmp = 100.0 * (n / (i / math.expm1(i))) else: tmp = 0.0 / (i / n) return tmp
function code(i, n) tmp = 0.0 if ((n <= -3.1e-198) || !(n <= 3.2e-130)) tmp = Float64(100.0 * Float64(n / Float64(i / expm1(i)))); else tmp = Float64(0.0 / Float64(i / n)); end return tmp end
code[i_, n_] := If[Or[LessEqual[n, -3.1e-198], N[Not[LessEqual[n, 3.2e-130]], $MachinePrecision]], N[(100.0 * N[(n / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -3.1 \cdot 10^{-198} \lor \neg \left(n \leq 3.2 \cdot 10^{-130}\right):\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -3.0999999999999998e-198 or 3.2e-130 < n Initial program 20.1%
Taylor expanded in n around inf 28.7%
*-commutative28.7%
associate-/l*28.7%
expm1-def85.0%
Simplified85.0%
if -3.0999999999999998e-198 < n < 3.2e-130Initial program 51.9%
associate-*r/51.9%
sub-neg51.9%
distribute-rgt-in51.9%
metadata-eval51.9%
metadata-eval51.9%
Simplified51.9%
Taylor expanded in i around 0 65.5%
+-commutative65.5%
Simplified65.5%
Taylor expanded in i around 0 75.5%
Final simplification83.6%
(FPCore (i n)
:precision binary64
(if (<= n -6.8e+240)
(/ (* (* i -100.0) (- n)) i)
(if (<= n -4.4e-197)
(/ n (+ 0.01 (* i -0.005)))
(if (<= n 1.25e-129)
(/ 0.0 (/ i n))
(* 100.0 (+ n (* (+ 0.5 (/ -0.5 n)) (* i n))))))))
double code(double i, double n) {
double tmp;
if (n <= -6.8e+240) {
tmp = ((i * -100.0) * -n) / i;
} else if (n <= -4.4e-197) {
tmp = n / (0.01 + (i * -0.005));
} else if (n <= 1.25e-129) {
tmp = 0.0 / (i / n);
} else {
tmp = 100.0 * (n + ((0.5 + (-0.5 / n)) * (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 <= (-6.8d+240)) then
tmp = ((i * (-100.0d0)) * -n) / i
else if (n <= (-4.4d-197)) then
tmp = n / (0.01d0 + (i * (-0.005d0)))
else if (n <= 1.25d-129) then
tmp = 0.0d0 / (i / n)
else
tmp = 100.0d0 * (n + ((0.5d0 + ((-0.5d0) / n)) * (i * n)))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -6.8e+240) {
tmp = ((i * -100.0) * -n) / i;
} else if (n <= -4.4e-197) {
tmp = n / (0.01 + (i * -0.005));
} else if (n <= 1.25e-129) {
tmp = 0.0 / (i / n);
} else {
tmp = 100.0 * (n + ((0.5 + (-0.5 / n)) * (i * n)));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -6.8e+240: tmp = ((i * -100.0) * -n) / i elif n <= -4.4e-197: tmp = n / (0.01 + (i * -0.005)) elif n <= 1.25e-129: tmp = 0.0 / (i / n) else: tmp = 100.0 * (n + ((0.5 + (-0.5 / n)) * (i * n))) return tmp
function code(i, n) tmp = 0.0 if (n <= -6.8e+240) tmp = Float64(Float64(Float64(i * -100.0) * Float64(-n)) / i); elseif (n <= -4.4e-197) tmp = Float64(n / Float64(0.01 + Float64(i * -0.005))); elseif (n <= 1.25e-129) tmp = Float64(0.0 / Float64(i / n)); else tmp = Float64(100.0 * Float64(n + Float64(Float64(0.5 + Float64(-0.5 / n)) * Float64(i * n)))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -6.8e+240) tmp = ((i * -100.0) * -n) / i; elseif (n <= -4.4e-197) tmp = n / (0.01 + (i * -0.005)); elseif (n <= 1.25e-129) tmp = 0.0 / (i / n); else tmp = 100.0 * (n + ((0.5 + (-0.5 / n)) * (i * n))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -6.8e+240], N[(N[(N[(i * -100.0), $MachinePrecision] * (-n)), $MachinePrecision] / i), $MachinePrecision], If[LessEqual[n, -4.4e-197], N[(n / N[(0.01 + N[(i * -0.005), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.25e-129], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n + N[(N[(0.5 + N[(-0.5 / n), $MachinePrecision]), $MachinePrecision] * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -6.8 \cdot 10^{+240}:\\
\;\;\;\;\frac{\left(i \cdot -100\right) \cdot \left(-n\right)}{i}\\
\mathbf{elif}\;n \leq -4.4 \cdot 10^{-197}:\\
\;\;\;\;\frac{n}{0.01 + i \cdot -0.005}\\
\mathbf{elif}\;n \leq 1.25 \cdot 10^{-129}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n + \left(0.5 + \frac{-0.5}{n}\right) \cdot \left(i \cdot n\right)\right)\\
\end{array}
\end{array}
if n < -6.80000000000000017e240Initial program 5.4%
associate-*r/5.4%
sub-neg5.4%
distribute-rgt-in5.4%
metadata-eval5.4%
metadata-eval5.4%
frac-2neg5.4%
*-commutative5.4%
fma-udef5.4%
neg-sub05.4%
fma-udef5.4%
*-commutative5.4%
+-commutative5.4%
associate--r+5.4%
metadata-eval5.4%
distribute-neg-frac5.4%
Applied egg-rr5.4%
associate-/l*6.1%
*-commutative6.1%
associate-/l*6.1%
associate-/r/5.4%
*-commutative5.4%
Simplified5.4%
Taylor expanded in i around 0 11.4%
*-commutative11.4%
Simplified11.4%
*-commutative11.4%
frac-2neg11.4%
associate-*r/66.8%
remove-double-neg66.8%
Applied egg-rr66.8%
if -6.80000000000000017e240 < n < -4.4000000000000001e-197Initial program 30.4%
Taylor expanded in n around inf 23.2%
*-commutative23.2%
associate-/l*23.2%
expm1-def74.8%
Simplified74.8%
associate-*l/74.9%
associate-/l*74.8%
Applied egg-rr74.8%
Taylor expanded in i around 0 61.6%
*-commutative61.6%
Simplified61.6%
if -4.4000000000000001e-197 < n < 1.25000000000000007e-129Initial program 51.9%
associate-*r/51.9%
sub-neg51.9%
distribute-rgt-in51.9%
metadata-eval51.9%
metadata-eval51.9%
Simplified51.9%
Taylor expanded in i around 0 65.5%
+-commutative65.5%
Simplified65.5%
Taylor expanded in i around 0 75.5%
if 1.25000000000000007e-129 < n Initial program 15.0%
Taylor expanded in i around 0 73.4%
associate-*r*73.4%
cancel-sign-sub-inv73.4%
metadata-eval73.4%
associate-*r/73.4%
metadata-eval73.4%
Simplified73.4%
Final simplification69.2%
(FPCore (i n)
:precision binary64
(if (<= n -2.5e+241)
(/ (* (* i -100.0) (- n)) i)
(if (<= n -6.5e-198)
(/ n (+ 0.01 (* i -0.005)))
(if (<= n 3.2e-130)
(/ 0.0 (/ i n))
(* n (+ 100.0 (* 100.0 (* i (- 0.5 (/ 0.5 n))))))))))
double code(double i, double n) {
double tmp;
if (n <= -2.5e+241) {
tmp = ((i * -100.0) * -n) / i;
} else if (n <= -6.5e-198) {
tmp = n / (0.01 + (i * -0.005));
} else if (n <= 3.2e-130) {
tmp = 0.0 / (i / n);
} else {
tmp = n * (100.0 + (100.0 * (i * (0.5 - (0.5 / n)))));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-2.5d+241)) then
tmp = ((i * (-100.0d0)) * -n) / i
else if (n <= (-6.5d-198)) then
tmp = n / (0.01d0 + (i * (-0.005d0)))
else if (n <= 3.2d-130) then
tmp = 0.0d0 / (i / n)
else
tmp = n * (100.0d0 + (100.0d0 * (i * (0.5d0 - (0.5d0 / n)))))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -2.5e+241) {
tmp = ((i * -100.0) * -n) / i;
} else if (n <= -6.5e-198) {
tmp = n / (0.01 + (i * -0.005));
} else if (n <= 3.2e-130) {
tmp = 0.0 / (i / n);
} else {
tmp = n * (100.0 + (100.0 * (i * (0.5 - (0.5 / n)))));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -2.5e+241: tmp = ((i * -100.0) * -n) / i elif n <= -6.5e-198: tmp = n / (0.01 + (i * -0.005)) elif n <= 3.2e-130: tmp = 0.0 / (i / n) else: tmp = n * (100.0 + (100.0 * (i * (0.5 - (0.5 / n))))) return tmp
function code(i, n) tmp = 0.0 if (n <= -2.5e+241) tmp = Float64(Float64(Float64(i * -100.0) * Float64(-n)) / i); elseif (n <= -6.5e-198) tmp = Float64(n / Float64(0.01 + Float64(i * -0.005))); elseif (n <= 3.2e-130) tmp = Float64(0.0 / Float64(i / n)); else tmp = Float64(n * Float64(100.0 + Float64(100.0 * Float64(i * Float64(0.5 - Float64(0.5 / n)))))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -2.5e+241) tmp = ((i * -100.0) * -n) / i; elseif (n <= -6.5e-198) tmp = n / (0.01 + (i * -0.005)); elseif (n <= 3.2e-130) tmp = 0.0 / (i / n); else tmp = n * (100.0 + (100.0 * (i * (0.5 - (0.5 / n))))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -2.5e+241], N[(N[(N[(i * -100.0), $MachinePrecision] * (-n)), $MachinePrecision] / i), $MachinePrecision], If[LessEqual[n, -6.5e-198], N[(n / N[(0.01 + N[(i * -0.005), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 3.2e-130], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 + N[(100.0 * N[(i * N[(0.5 - N[(0.5 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.5 \cdot 10^{+241}:\\
\;\;\;\;\frac{\left(i \cdot -100\right) \cdot \left(-n\right)}{i}\\
\mathbf{elif}\;n \leq -6.5 \cdot 10^{-198}:\\
\;\;\;\;\frac{n}{0.01 + i \cdot -0.005}\\
\mathbf{elif}\;n \leq 3.2 \cdot 10^{-130}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right)\right)\right)\\
\end{array}
\end{array}
if n < -2.50000000000000013e241Initial program 5.4%
associate-*r/5.4%
sub-neg5.4%
distribute-rgt-in5.4%
metadata-eval5.4%
metadata-eval5.4%
frac-2neg5.4%
*-commutative5.4%
fma-udef5.4%
neg-sub05.4%
fma-udef5.4%
*-commutative5.4%
+-commutative5.4%
associate--r+5.4%
metadata-eval5.4%
distribute-neg-frac5.4%
Applied egg-rr5.4%
associate-/l*6.1%
*-commutative6.1%
associate-/l*6.1%
associate-/r/5.4%
*-commutative5.4%
Simplified5.4%
Taylor expanded in i around 0 11.4%
*-commutative11.4%
Simplified11.4%
*-commutative11.4%
frac-2neg11.4%
associate-*r/66.8%
remove-double-neg66.8%
Applied egg-rr66.8%
if -2.50000000000000013e241 < n < -6.5000000000000004e-198Initial program 30.4%
Taylor expanded in n around inf 23.2%
*-commutative23.2%
associate-/l*23.2%
expm1-def74.8%
Simplified74.8%
associate-*l/74.9%
associate-/l*74.8%
Applied egg-rr74.8%
Taylor expanded in i around 0 61.6%
*-commutative61.6%
Simplified61.6%
if -6.5000000000000004e-198 < n < 3.2e-130Initial program 51.9%
associate-*r/51.9%
sub-neg51.9%
distribute-rgt-in51.9%
metadata-eval51.9%
metadata-eval51.9%
Simplified51.9%
Taylor expanded in i around 0 65.5%
+-commutative65.5%
Simplified65.5%
Taylor expanded in i around 0 75.5%
if 3.2e-130 < n Initial program 15.0%
associate-*r/15.1%
associate-/r/15.5%
*-commutative15.5%
sub-neg15.5%
distribute-lft-in15.5%
fma-def15.5%
metadata-eval15.5%
metadata-eval15.5%
Simplified15.5%
Taylor expanded in i around 0 73.4%
associate-*r/73.4%
metadata-eval73.4%
Simplified73.4%
Final simplification69.2%
(FPCore (i n)
:precision binary64
(if (<= n -6.5e+240)
(/ (* (* i -100.0) (- n)) i)
(if (<= n -3.1e-198)
(/ 1.0 (+ (* (/ i n) -0.005) (* 0.01 (/ 1.0 n))))
(if (<= n 1.1e-129)
(/ 0.0 (/ i n))
(* n (+ 100.0 (* 100.0 (* i (- 0.5 (/ 0.5 n))))))))))
double code(double i, double n) {
double tmp;
if (n <= -6.5e+240) {
tmp = ((i * -100.0) * -n) / i;
} else if (n <= -3.1e-198) {
tmp = 1.0 / (((i / n) * -0.005) + (0.01 * (1.0 / n)));
} else if (n <= 1.1e-129) {
tmp = 0.0 / (i / n);
} else {
tmp = n * (100.0 + (100.0 * (i * (0.5 - (0.5 / n)))));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-6.5d+240)) then
tmp = ((i * (-100.0d0)) * -n) / i
else if (n <= (-3.1d-198)) then
tmp = 1.0d0 / (((i / n) * (-0.005d0)) + (0.01d0 * (1.0d0 / n)))
else if (n <= 1.1d-129) then
tmp = 0.0d0 / (i / n)
else
tmp = n * (100.0d0 + (100.0d0 * (i * (0.5d0 - (0.5d0 / n)))))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -6.5e+240) {
tmp = ((i * -100.0) * -n) / i;
} else if (n <= -3.1e-198) {
tmp = 1.0 / (((i / n) * -0.005) + (0.01 * (1.0 / n)));
} else if (n <= 1.1e-129) {
tmp = 0.0 / (i / n);
} else {
tmp = n * (100.0 + (100.0 * (i * (0.5 - (0.5 / n)))));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -6.5e+240: tmp = ((i * -100.0) * -n) / i elif n <= -3.1e-198: tmp = 1.0 / (((i / n) * -0.005) + (0.01 * (1.0 / n))) elif n <= 1.1e-129: tmp = 0.0 / (i / n) else: tmp = n * (100.0 + (100.0 * (i * (0.5 - (0.5 / n))))) return tmp
function code(i, n) tmp = 0.0 if (n <= -6.5e+240) tmp = Float64(Float64(Float64(i * -100.0) * Float64(-n)) / i); elseif (n <= -3.1e-198) tmp = Float64(1.0 / Float64(Float64(Float64(i / n) * -0.005) + Float64(0.01 * Float64(1.0 / n)))); elseif (n <= 1.1e-129) tmp = Float64(0.0 / Float64(i / n)); else tmp = Float64(n * Float64(100.0 + Float64(100.0 * Float64(i * Float64(0.5 - Float64(0.5 / n)))))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -6.5e+240) tmp = ((i * -100.0) * -n) / i; elseif (n <= -3.1e-198) tmp = 1.0 / (((i / n) * -0.005) + (0.01 * (1.0 / n))); elseif (n <= 1.1e-129) tmp = 0.0 / (i / n); else tmp = n * (100.0 + (100.0 * (i * (0.5 - (0.5 / n))))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -6.5e+240], N[(N[(N[(i * -100.0), $MachinePrecision] * (-n)), $MachinePrecision] / i), $MachinePrecision], If[LessEqual[n, -3.1e-198], N[(1.0 / N[(N[(N[(i / n), $MachinePrecision] * -0.005), $MachinePrecision] + N[(0.01 * N[(1.0 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.1e-129], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 + N[(100.0 * N[(i * N[(0.5 - N[(0.5 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -6.5 \cdot 10^{+240}:\\
\;\;\;\;\frac{\left(i \cdot -100\right) \cdot \left(-n\right)}{i}\\
\mathbf{elif}\;n \leq -3.1 \cdot 10^{-198}:\\
\;\;\;\;\frac{1}{\frac{i}{n} \cdot -0.005 + 0.01 \cdot \frac{1}{n}}\\
\mathbf{elif}\;n \leq 1.1 \cdot 10^{-129}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right)\right)\right)\\
\end{array}
\end{array}
if n < -6.50000000000000018e240Initial program 5.4%
associate-*r/5.4%
sub-neg5.4%
distribute-rgt-in5.4%
metadata-eval5.4%
metadata-eval5.4%
frac-2neg5.4%
*-commutative5.4%
fma-udef5.4%
neg-sub05.4%
fma-udef5.4%
*-commutative5.4%
+-commutative5.4%
associate--r+5.4%
metadata-eval5.4%
distribute-neg-frac5.4%
Applied egg-rr5.4%
associate-/l*6.1%
*-commutative6.1%
associate-/l*6.1%
associate-/r/5.4%
*-commutative5.4%
Simplified5.4%
Taylor expanded in i around 0 11.4%
*-commutative11.4%
Simplified11.4%
*-commutative11.4%
frac-2neg11.4%
associate-*r/66.8%
remove-double-neg66.8%
Applied egg-rr66.8%
if -6.50000000000000018e240 < n < -3.0999999999999998e-198Initial program 30.4%
Taylor expanded in n around inf 23.2%
*-commutative23.2%
associate-/l*23.2%
expm1-def74.8%
Simplified74.8%
associate-*l/74.9%
clear-num75.1%
Applied egg-rr75.1%
associate-/l/63.6%
associate-/r*59.9%
*-commutative59.9%
Simplified59.9%
Taylor expanded in i around 0 61.9%
if -3.0999999999999998e-198 < n < 1.10000000000000001e-129Initial program 51.9%
associate-*r/51.9%
sub-neg51.9%
distribute-rgt-in51.9%
metadata-eval51.9%
metadata-eval51.9%
Simplified51.9%
Taylor expanded in i around 0 65.5%
+-commutative65.5%
Simplified65.5%
Taylor expanded in i around 0 75.5%
if 1.10000000000000001e-129 < n Initial program 15.0%
associate-*r/15.1%
associate-/r/15.5%
*-commutative15.5%
sub-neg15.5%
distribute-lft-in15.5%
fma-def15.5%
metadata-eval15.5%
metadata-eval15.5%
Simplified15.5%
Taylor expanded in i around 0 73.4%
associate-*r/73.4%
metadata-eval73.4%
Simplified73.4%
Final simplification69.3%
(FPCore (i n)
:precision binary64
(let* ((t_0 (/ (* (* i -100.0) (- n)) i)))
(if (<= n -3.8e+241)
t_0
(if (<= n -8.5e-197)
(/ n (+ 0.01 (* i -0.005)))
(if (<= n 1.42e-154)
(/ 0.0 (/ i n))
(if (<= n 4.1e+30) (* 100.0 (/ i (/ i n))) t_0))))))
double code(double i, double n) {
double t_0 = ((i * -100.0) * -n) / i;
double tmp;
if (n <= -3.8e+241) {
tmp = t_0;
} else if (n <= -8.5e-197) {
tmp = n / (0.01 + (i * -0.005));
} else if (n <= 1.42e-154) {
tmp = 0.0 / (i / n);
} else if (n <= 4.1e+30) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = ((i * (-100.0d0)) * -n) / i
if (n <= (-3.8d+241)) then
tmp = t_0
else if (n <= (-8.5d-197)) then
tmp = n / (0.01d0 + (i * (-0.005d0)))
else if (n <= 1.42d-154) then
tmp = 0.0d0 / (i / n)
else if (n <= 4.1d+30) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = ((i * -100.0) * -n) / i;
double tmp;
if (n <= -3.8e+241) {
tmp = t_0;
} else if (n <= -8.5e-197) {
tmp = n / (0.01 + (i * -0.005));
} else if (n <= 1.42e-154) {
tmp = 0.0 / (i / n);
} else if (n <= 4.1e+30) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = ((i * -100.0) * -n) / i tmp = 0 if n <= -3.8e+241: tmp = t_0 elif n <= -8.5e-197: tmp = n / (0.01 + (i * -0.005)) elif n <= 1.42e-154: tmp = 0.0 / (i / n) elif n <= 4.1e+30: tmp = 100.0 * (i / (i / n)) else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(Float64(Float64(i * -100.0) * Float64(-n)) / i) tmp = 0.0 if (n <= -3.8e+241) tmp = t_0; elseif (n <= -8.5e-197) tmp = Float64(n / Float64(0.01 + Float64(i * -0.005))); elseif (n <= 1.42e-154) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 4.1e+30) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = t_0; end return tmp end
function tmp_2 = code(i, n) t_0 = ((i * -100.0) * -n) / i; tmp = 0.0; if (n <= -3.8e+241) tmp = t_0; elseif (n <= -8.5e-197) tmp = n / (0.01 + (i * -0.005)); elseif (n <= 1.42e-154) tmp = 0.0 / (i / n); elseif (n <= 4.1e+30) 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[(i * -100.0), $MachinePrecision] * (-n)), $MachinePrecision] / i), $MachinePrecision]}, If[LessEqual[n, -3.8e+241], t$95$0, If[LessEqual[n, -8.5e-197], N[(n / N[(0.01 + N[(i * -0.005), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.42e-154], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 4.1e+30], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(i \cdot -100\right) \cdot \left(-n\right)}{i}\\
\mathbf{if}\;n \leq -3.8 \cdot 10^{+241}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq -8.5 \cdot 10^{-197}:\\
\;\;\;\;\frac{n}{0.01 + i \cdot -0.005}\\
\mathbf{elif}\;n \leq 1.42 \cdot 10^{-154}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 4.1 \cdot 10^{+30}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if n < -3.79999999999999972e241 or 4.10000000000000005e30 < n Initial program 13.9%
associate-*r/13.9%
sub-neg13.9%
distribute-rgt-in13.9%
metadata-eval13.9%
metadata-eval13.9%
frac-2neg13.9%
*-commutative13.9%
fma-udef13.9%
neg-sub013.9%
fma-udef13.9%
*-commutative13.9%
+-commutative13.9%
associate--r+13.9%
metadata-eval13.9%
distribute-neg-frac13.9%
Applied egg-rr13.9%
associate-/l*14.5%
*-commutative14.5%
associate-/l*14.5%
associate-/r/13.9%
*-commutative13.9%
Simplified13.9%
Taylor expanded in i around 0 24.8%
*-commutative24.8%
Simplified24.8%
*-commutative24.8%
frac-2neg24.8%
associate-*r/70.0%
remove-double-neg70.0%
Applied egg-rr70.0%
if -3.79999999999999972e241 < n < -8.5e-197Initial program 30.4%
Taylor expanded in n around inf 23.2%
*-commutative23.2%
associate-/l*23.2%
expm1-def74.8%
Simplified74.8%
associate-*l/74.9%
associate-/l*74.8%
Applied egg-rr74.8%
Taylor expanded in i around 0 61.6%
*-commutative61.6%
Simplified61.6%
if -8.5e-197 < n < 1.42e-154Initial program 57.6%
associate-*r/57.6%
sub-neg57.6%
distribute-rgt-in57.6%
metadata-eval57.6%
metadata-eval57.6%
Simplified57.6%
Taylor expanded in i around 0 67.1%
+-commutative67.1%
Simplified67.1%
Taylor expanded in i around 0 78.2%
if 1.42e-154 < n < 4.10000000000000005e30Initial program 11.2%
Taylor expanded in i around 0 79.3%
Final simplification69.8%
(FPCore (i n)
:precision binary64
(if (<= n -8.4e+240)
(/ (* (* i -100.0) (- n)) i)
(if (<= n -3.1e-198)
(/ n (+ 0.01 (* i -0.005)))
(if (<= n 3.2e-130) (/ 0.0 (/ i n)) (* 100.0 (+ n (* 0.5 (* i n))))))))
double code(double i, double n) {
double tmp;
if (n <= -8.4e+240) {
tmp = ((i * -100.0) * -n) / i;
} else if (n <= -3.1e-198) {
tmp = n / (0.01 + (i * -0.005));
} else if (n <= 3.2e-130) {
tmp = 0.0 / (i / n);
} else {
tmp = 100.0 * (n + (0.5 * (i * n)));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-8.4d+240)) then
tmp = ((i * (-100.0d0)) * -n) / i
else if (n <= (-3.1d-198)) then
tmp = n / (0.01d0 + (i * (-0.005d0)))
else if (n <= 3.2d-130) then
tmp = 0.0d0 / (i / n)
else
tmp = 100.0d0 * (n + (0.5d0 * (i * n)))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -8.4e+240) {
tmp = ((i * -100.0) * -n) / i;
} else if (n <= -3.1e-198) {
tmp = n / (0.01 + (i * -0.005));
} else if (n <= 3.2e-130) {
tmp = 0.0 / (i / n);
} else {
tmp = 100.0 * (n + (0.5 * (i * n)));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -8.4e+240: tmp = ((i * -100.0) * -n) / i elif n <= -3.1e-198: tmp = n / (0.01 + (i * -0.005)) elif n <= 3.2e-130: tmp = 0.0 / (i / n) else: tmp = 100.0 * (n + (0.5 * (i * n))) return tmp
function code(i, n) tmp = 0.0 if (n <= -8.4e+240) tmp = Float64(Float64(Float64(i * -100.0) * Float64(-n)) / i); elseif (n <= -3.1e-198) tmp = Float64(n / Float64(0.01 + Float64(i * -0.005))); elseif (n <= 3.2e-130) tmp = Float64(0.0 / Float64(i / n)); else tmp = Float64(100.0 * Float64(n + Float64(0.5 * Float64(i * n)))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -8.4e+240) tmp = ((i * -100.0) * -n) / i; elseif (n <= -3.1e-198) tmp = n / (0.01 + (i * -0.005)); elseif (n <= 3.2e-130) tmp = 0.0 / (i / n); else tmp = 100.0 * (n + (0.5 * (i * n))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -8.4e+240], N[(N[(N[(i * -100.0), $MachinePrecision] * (-n)), $MachinePrecision] / i), $MachinePrecision], If[LessEqual[n, -3.1e-198], N[(n / N[(0.01 + N[(i * -0.005), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 3.2e-130], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n + N[(0.5 * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -8.4 \cdot 10^{+240}:\\
\;\;\;\;\frac{\left(i \cdot -100\right) \cdot \left(-n\right)}{i}\\
\mathbf{elif}\;n \leq -3.1 \cdot 10^{-198}:\\
\;\;\;\;\frac{n}{0.01 + i \cdot -0.005}\\
\mathbf{elif}\;n \leq 3.2 \cdot 10^{-130}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n + 0.5 \cdot \left(i \cdot n\right)\right)\\
\end{array}
\end{array}
if n < -8.3999999999999996e240Initial program 5.4%
associate-*r/5.4%
sub-neg5.4%
distribute-rgt-in5.4%
metadata-eval5.4%
metadata-eval5.4%
frac-2neg5.4%
*-commutative5.4%
fma-udef5.4%
neg-sub05.4%
fma-udef5.4%
*-commutative5.4%
+-commutative5.4%
associate--r+5.4%
metadata-eval5.4%
distribute-neg-frac5.4%
Applied egg-rr5.4%
associate-/l*6.1%
*-commutative6.1%
associate-/l*6.1%
associate-/r/5.4%
*-commutative5.4%
Simplified5.4%
Taylor expanded in i around 0 11.4%
*-commutative11.4%
Simplified11.4%
*-commutative11.4%
frac-2neg11.4%
associate-*r/66.8%
remove-double-neg66.8%
Applied egg-rr66.8%
if -8.3999999999999996e240 < n < -3.0999999999999998e-198Initial program 30.4%
Taylor expanded in n around inf 23.2%
*-commutative23.2%
associate-/l*23.2%
expm1-def74.8%
Simplified74.8%
associate-*l/74.9%
associate-/l*74.8%
Applied egg-rr74.8%
Taylor expanded in i around 0 61.6%
*-commutative61.6%
Simplified61.6%
if -3.0999999999999998e-198 < n < 3.2e-130Initial program 51.9%
associate-*r/51.9%
sub-neg51.9%
distribute-rgt-in51.9%
metadata-eval51.9%
metadata-eval51.9%
Simplified51.9%
Taylor expanded in i around 0 65.5%
+-commutative65.5%
Simplified65.5%
Taylor expanded in i around 0 75.5%
if 3.2e-130 < n Initial program 15.0%
Taylor expanded in n around inf 27.9%
*-commutative27.9%
associate-/l*27.9%
expm1-def90.9%
Simplified90.9%
Taylor expanded in i around 0 73.4%
*-commutative73.4%
*-commutative73.4%
Simplified73.4%
Final simplification69.2%
(FPCore (i n) :precision binary64 (if (or (<= i -5e+53) (not (<= i 0.05))) (* 100.0 (* i (/ n i))) (* n 100.0)))
double code(double i, double n) {
double tmp;
if ((i <= -5e+53) || !(i <= 0.05)) {
tmp = 100.0 * (i * (n / i));
} 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 <= (-5d+53)) .or. (.not. (i <= 0.05d0))) then
tmp = 100.0d0 * (i * (n / i))
else
tmp = n * 100.0d0
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((i <= -5e+53) || !(i <= 0.05)) {
tmp = 100.0 * (i * (n / i));
} else {
tmp = n * 100.0;
}
return tmp;
}
def code(i, n): tmp = 0 if (i <= -5e+53) or not (i <= 0.05): tmp = 100.0 * (i * (n / i)) else: tmp = n * 100.0 return tmp
function code(i, n) tmp = 0.0 if ((i <= -5e+53) || !(i <= 0.05)) tmp = Float64(100.0 * Float64(i * Float64(n / i))); else tmp = Float64(n * 100.0); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((i <= -5e+53) || ~((i <= 0.05))) tmp = 100.0 * (i * (n / i)); else tmp = n * 100.0; end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[i, -5e+53], N[Not[LessEqual[i, 0.05]], $MachinePrecision]], N[(100.0 * N[(i * N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * 100.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -5 \cdot 10^{+53} \lor \neg \left(i \leq 0.05\right):\\
\;\;\;\;100 \cdot \left(i \cdot \frac{n}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100\\
\end{array}
\end{array}
if i < -5.0000000000000004e53 or 0.050000000000000003 < i Initial program 54.4%
Taylor expanded in i around 0 25.9%
div-inv25.9%
*-commutative25.9%
clear-num23.9%
Applied egg-rr23.9%
if -5.0000000000000004e53 < i < 0.050000000000000003Initial program 7.3%
Taylor expanded in i around 0 82.7%
*-commutative82.7%
Simplified82.7%
Final simplification60.9%
(FPCore (i n) :precision binary64 (if (or (<= i -1e+53) (not (<= i 6.8e-10))) (* 100.0 (/ i (/ i n))) (* n 100.0)))
double code(double i, double n) {
double tmp;
if ((i <= -1e+53) || !(i <= 6.8e-10)) {
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+53)) .or. (.not. (i <= 6.8d-10))) 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+53) || !(i <= 6.8e-10)) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * 100.0;
}
return tmp;
}
def code(i, n): tmp = 0 if (i <= -1e+53) or not (i <= 6.8e-10): tmp = 100.0 * (i / (i / n)) else: tmp = n * 100.0 return tmp
function code(i, n) tmp = 0.0 if ((i <= -1e+53) || !(i <= 6.8e-10)) 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+53) || ~((i <= 6.8e-10))) tmp = 100.0 * (i / (i / n)); else tmp = n * 100.0; end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[i, -1e+53], N[Not[LessEqual[i, 6.8e-10]], $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^{+53} \lor \neg \left(i \leq 6.8 \cdot 10^{-10}\right):\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100\\
\end{array}
\end{array}
if i < -9.9999999999999999e52 or 6.8000000000000003e-10 < i Initial program 53.4%
Taylor expanded in i around 0 26.1%
if -9.9999999999999999e52 < i < 6.8000000000000003e-10Initial program 7.4%
Taylor expanded in i around 0 83.3%
*-commutative83.3%
Simplified83.3%
Final simplification61.6%
(FPCore (i n) :precision binary64 (/ n (+ 0.01 (* i -0.005))))
double code(double i, double n) {
return n / (0.01 + (i * -0.005));
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = n / (0.01d0 + (i * (-0.005d0)))
end function
public static double code(double i, double n) {
return n / (0.01 + (i * -0.005));
}
def code(i, n): return n / (0.01 + (i * -0.005))
function code(i, n) return Float64(n / Float64(0.01 + Float64(i * -0.005))) end
function tmp = code(i, n) tmp = n / (0.01 + (i * -0.005)); end
code[i_, n_] := N[(n / N[(0.01 + N[(i * -0.005), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{n}{0.01 + i \cdot -0.005}
\end{array}
Initial program 24.8%
Taylor expanded in n around inf 30.7%
*-commutative30.7%
associate-/l*30.7%
expm1-def77.6%
Simplified77.6%
associate-*l/77.2%
associate-/l*77.6%
Applied egg-rr77.6%
Taylor expanded in i around 0 63.0%
*-commutative63.0%
Simplified63.0%
Final simplification63.0%
(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 24.8%
Taylor expanded in i around 0 54.0%
*-commutative54.0%
Simplified54.0%
Final simplification54.0%
(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 2023301
(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))))