
(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 16 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) -1.0) (/ i n))) (t_1 (* t_0 100.0)))
(if (<= t_0 -200000000.0)
t_1
(if (<= t_0 0.0)
(* (expm1 (* n (log1p (/ i n)))) (/ (* n 100.0) i))
(if (<= t_0 INFINITY)
t_1
(/ n (+ 0.01 (* 0.01 (* i (+ (/ 0.5 n) -0.5))))))))))
double code(double i, double n) {
double t_0 = (pow((1.0 + (i / n)), n) + -1.0) / (i / n);
double t_1 = t_0 * 100.0;
double tmp;
if (t_0 <= -200000000.0) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = expm1((n * log1p((i / n)))) * ((n * 100.0) / i);
} else if (t_0 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -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 t_1 = t_0 * 100.0;
double tmp;
if (t_0 <= -200000000.0) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = Math.expm1((n * Math.log1p((i / n)))) * ((n * 100.0) / i);
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5))));
}
return tmp;
}
def code(i, n): t_0 = (math.pow((1.0 + (i / n)), n) + -1.0) / (i / n) t_1 = t_0 * 100.0 tmp = 0 if t_0 <= -200000000.0: tmp = t_1 elif t_0 <= 0.0: tmp = math.expm1((n * math.log1p((i / n)))) * ((n * 100.0) / i) elif t_0 <= math.inf: tmp = t_1 else: tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5)))) return tmp
function code(i, n) t_0 = Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) + -1.0) / Float64(i / n)) t_1 = Float64(t_0 * 100.0) tmp = 0.0 if (t_0 <= -200000000.0) tmp = t_1; elseif (t_0 <= 0.0) tmp = Float64(expm1(Float64(n * log1p(Float64(i / n)))) * Float64(Float64(n * 100.0) / i)); elseif (t_0 <= Inf) tmp = t_1; else tmp = Float64(n / Float64(0.01 + Float64(0.01 * Float64(i * Float64(Float64(0.5 / n) + -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]}, Block[{t$95$1 = N[(t$95$0 * 100.0), $MachinePrecision]}, If[LessEqual[t$95$0, -200000000.0], t$95$1, If[LessEqual[t$95$0, 0.0], N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] * N[(N[(n * 100.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], t$95$1, N[(n / N[(0.01 + N[(0.01 * N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $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}}\\
t_1 := t_0 \cdot 100\\
\mathbf{if}\;t_0 \leq -200000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_0 \leq 0:\\
\;\;\;\;\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot \frac{n \cdot 100}{i}\\
\mathbf{elif}\;t_0 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{n}{0.01 + 0.01 \cdot \left(i \cdot \left(\frac{0.5}{n} + -0.5\right)\right)}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -2e8 or -0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 99.9%
if -2e8 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -0.0Initial program 30.2%
associate-*r/30.2%
sub-neg30.2%
distribute-lft-in30.2%
metadata-eval30.2%
metadata-eval30.2%
fma-udef30.2%
associate-/r/29.9%
*-commutative29.9%
expm1-log1p-u29.9%
expm1-udef26.5%
Applied egg-rr47.8%
expm1-def79.9%
expm1-log1p99.4%
associate-*l/99.5%
Simplified99.5%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
associate-*r/0.0%
sub-neg0.0%
distribute-lft-in0.0%
metadata-eval0.0%
metadata-eval0.0%
fma-udef0.0%
associate-/r/1.9%
*-commutative1.9%
clear-num1.9%
un-div-inv1.9%
fma-udef1.9%
metadata-eval1.9%
metadata-eval1.9%
distribute-lft-in1.9%
sub-neg1.9%
*-commutative1.9%
Applied egg-rr1.9%
Taylor expanded in i around 0 99.8%
sub-neg99.8%
associate-*r/99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.6%
(FPCore (i n)
:precision binary64
(let* ((t_0 (/ (+ (pow (+ 1.0 (/ i n)) n) -1.0) (/ i n))) (t_1 (* t_0 100.0)))
(if (<= t_0 (- INFINITY))
t_1
(if (<= t_0 0.0)
(* 100.0 (* n (/ (expm1 (* n (log1p (/ i n)))) i)))
(if (<= t_0 INFINITY)
t_1
(/ n (+ 0.01 (* 0.01 (* i (+ (/ 0.5 n) -0.5))))))))))
double code(double i, double n) {
double t_0 = (pow((1.0 + (i / n)), n) + -1.0) / (i / n);
double t_1 = t_0 * 100.0;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = 100.0 * (n * (expm1((n * log1p((i / n)))) / i));
} else if (t_0 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -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 t_1 = t_0 * 100.0;
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = 100.0 * (n * (Math.expm1((n * Math.log1p((i / n)))) / i));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5))));
}
return tmp;
}
def code(i, n): t_0 = (math.pow((1.0 + (i / n)), n) + -1.0) / (i / n) t_1 = t_0 * 100.0 tmp = 0 if t_0 <= -math.inf: tmp = t_1 elif t_0 <= 0.0: tmp = 100.0 * (n * (math.expm1((n * math.log1p((i / n)))) / i)) elif t_0 <= math.inf: tmp = t_1 else: tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5)))) return tmp
function code(i, n) t_0 = Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) + -1.0) / Float64(i / n)) t_1 = Float64(t_0 * 100.0) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = t_1; elseif (t_0 <= 0.0) tmp = Float64(100.0 * Float64(n * Float64(expm1(Float64(n * log1p(Float64(i / n)))) / i))); elseif (t_0 <= Inf) tmp = t_1; else tmp = Float64(n / Float64(0.01 + Float64(0.01 * Float64(i * Float64(Float64(0.5 / n) + -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]}, Block[{t$95$1 = N[(t$95$0 * 100.0), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], t$95$1, If[LessEqual[t$95$0, 0.0], N[(100.0 * N[(n * N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], t$95$1, N[(n / N[(0.01 + N[(0.01 * N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $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}}\\
t_1 := t_0 \cdot 100\\
\mathbf{if}\;t_0 \leq -\infty:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_0 \leq 0:\\
\;\;\;\;100 \cdot \left(n \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{i}\right)\\
\mathbf{elif}\;t_0 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{n}{0.01 + 0.01 \cdot \left(i \cdot \left(\frac{0.5}{n} + -0.5\right)\right)}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -inf.0 or -0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 99.9%
if -inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -0.0Initial program 30.6%
associate-/r/30.4%
pow-to-exp30.4%
expm1-def39.8%
add-log-exp30.4%
pow-to-exp30.4%
log-pow39.8%
log1p-udef99.3%
Applied egg-rr99.3%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
associate-*r/0.0%
sub-neg0.0%
distribute-lft-in0.0%
metadata-eval0.0%
metadata-eval0.0%
fma-udef0.0%
associate-/r/1.9%
*-commutative1.9%
clear-num1.9%
un-div-inv1.9%
fma-udef1.9%
metadata-eval1.9%
metadata-eval1.9%
distribute-lft-in1.9%
sub-neg1.9%
*-commutative1.9%
Applied egg-rr1.9%
Taylor expanded in i around 0 99.8%
sub-neg99.8%
associate-*r/99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.5%
(FPCore (i n) :precision binary64 (if (or (<= i -6e+52) (and (not (<= i 14500000.0)) (<= i 7.8e+262))) (* (expm1 i) (* 100.0 (/ n i))) (/ n (+ 0.01 (* 0.01 (* i (+ (/ 0.5 n) -0.5)))))))
double code(double i, double n) {
double tmp;
if ((i <= -6e+52) || (!(i <= 14500000.0) && (i <= 7.8e+262))) {
tmp = expm1(i) * (100.0 * (n / i));
} else {
tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5))));
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((i <= -6e+52) || (!(i <= 14500000.0) && (i <= 7.8e+262))) {
tmp = Math.expm1(i) * (100.0 * (n / i));
} else {
tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5))));
}
return tmp;
}
def code(i, n): tmp = 0 if (i <= -6e+52) or (not (i <= 14500000.0) and (i <= 7.8e+262)): tmp = math.expm1(i) * (100.0 * (n / i)) else: tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5)))) return tmp
function code(i, n) tmp = 0.0 if ((i <= -6e+52) || (!(i <= 14500000.0) && (i <= 7.8e+262))) tmp = Float64(expm1(i) * Float64(100.0 * Float64(n / i))); else tmp = Float64(n / Float64(0.01 + Float64(0.01 * Float64(i * Float64(Float64(0.5 / n) + -0.5))))); end return tmp end
code[i_, n_] := If[Or[LessEqual[i, -6e+52], And[N[Not[LessEqual[i, 14500000.0]], $MachinePrecision], LessEqual[i, 7.8e+262]]], N[(N[(Exp[i] - 1), $MachinePrecision] * N[(100.0 * N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n / N[(0.01 + N[(0.01 * N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -6 \cdot 10^{+52} \lor \neg \left(i \leq 14500000\right) \land i \leq 7.8 \cdot 10^{+262}:\\
\;\;\;\;\mathsf{expm1}\left(i\right) \cdot \left(100 \cdot \frac{n}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{n}{0.01 + 0.01 \cdot \left(i \cdot \left(\frac{0.5}{n} + -0.5\right)\right)}\\
\end{array}
\end{array}
if i < -6e52 or 1.45e7 < i < 7.79999999999999971e262Initial program 57.4%
Taylor expanded in n around inf 63.7%
*-commutative63.7%
expm1-def63.7%
Simplified63.7%
Taylor expanded in n around 0 63.7%
expm1-def63.7%
associate-*l/63.6%
associate-*r*63.6%
Simplified63.6%
if -6e52 < i < 1.45e7 or 7.79999999999999971e262 < i Initial program 13.9%
associate-*r/13.9%
sub-neg13.9%
distribute-lft-in13.8%
metadata-eval13.8%
metadata-eval13.8%
fma-udef13.9%
associate-/r/14.5%
*-commutative14.5%
clear-num14.5%
un-div-inv14.5%
fma-udef14.5%
metadata-eval14.5%
metadata-eval14.5%
distribute-lft-in14.5%
sub-neg14.5%
*-commutative14.5%
Applied egg-rr65.8%
Taylor expanded in i around 0 91.6%
sub-neg91.6%
associate-*r/91.6%
metadata-eval91.6%
metadata-eval91.6%
Simplified91.6%
Final simplification80.6%
(FPCore (i n) :precision binary64 (if (or (<= n -9.8e-8) (not (<= n 1.05e-7))) (* 100.0 (/ (* n (expm1 i)) i)) (/ n (+ 0.01 (* 0.01 (* i (+ (/ 0.5 n) -0.5)))))))
double code(double i, double n) {
double tmp;
if ((n <= -9.8e-8) || !(n <= 1.05e-7)) {
tmp = 100.0 * ((n * expm1(i)) / i);
} else {
tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5))));
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((n <= -9.8e-8) || !(n <= 1.05e-7)) {
tmp = 100.0 * ((n * Math.expm1(i)) / i);
} else {
tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5))));
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -9.8e-8) or not (n <= 1.05e-7): tmp = 100.0 * ((n * math.expm1(i)) / i) else: tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5)))) return tmp
function code(i, n) tmp = 0.0 if ((n <= -9.8e-8) || !(n <= 1.05e-7)) tmp = Float64(100.0 * Float64(Float64(n * expm1(i)) / i)); else tmp = Float64(n / Float64(0.01 + Float64(0.01 * Float64(i * Float64(Float64(0.5 / n) + -0.5))))); end return tmp end
code[i_, n_] := If[Or[LessEqual[n, -9.8e-8], N[Not[LessEqual[n, 1.05e-7]], $MachinePrecision]], N[(100.0 * N[(N[(n * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(n / N[(0.01 + N[(0.01 * N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -9.8 \cdot 10^{-8} \lor \neg \left(n \leq 1.05 \cdot 10^{-7}\right):\\
\;\;\;\;100 \cdot \frac{n \cdot \mathsf{expm1}\left(i\right)}{i}\\
\mathbf{else}:\\
\;\;\;\;\frac{n}{0.01 + 0.01 \cdot \left(i \cdot \left(\frac{0.5}{n} + -0.5\right)\right)}\\
\end{array}
\end{array}
if n < -9.8000000000000004e-8 or 1.05e-7 < n Initial program 23.9%
Taylor expanded in n around inf 37.7%
*-commutative37.7%
expm1-def90.2%
Simplified90.2%
if -9.8000000000000004e-8 < n < 1.05e-7Initial program 41.1%
associate-*r/41.1%
sub-neg41.1%
distribute-lft-in41.1%
metadata-eval41.1%
metadata-eval41.1%
fma-udef41.1%
associate-/r/40.9%
*-commutative40.9%
clear-num40.9%
un-div-inv40.9%
fma-udef40.8%
metadata-eval40.8%
metadata-eval40.8%
distribute-lft-in40.9%
sub-neg40.9%
*-commutative40.9%
Applied egg-rr88.8%
Taylor expanded in i around 0 85.9%
sub-neg85.9%
associate-*r/85.9%
metadata-eval85.9%
metadata-eval85.9%
Simplified85.9%
Final simplification88.5%
(FPCore (i n)
:precision binary64
(if (<= n -1e-7)
(* 100.0 (/ (* n (expm1 i)) i))
(if (<= n 1.15e-7)
(/ n (+ 0.01 (* 0.01 (* i (+ (/ 0.5 n) -0.5)))))
(/ n (* 0.01 (/ i (expm1 i)))))))
double code(double i, double n) {
double tmp;
if (n <= -1e-7) {
tmp = 100.0 * ((n * expm1(i)) / i);
} else if (n <= 1.15e-7) {
tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5))));
} else {
tmp = n / (0.01 * (i / expm1(i)));
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (n <= -1e-7) {
tmp = 100.0 * ((n * Math.expm1(i)) / i);
} else if (n <= 1.15e-7) {
tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5))));
} else {
tmp = n / (0.01 * (i / Math.expm1(i)));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1e-7: tmp = 100.0 * ((n * math.expm1(i)) / i) elif n <= 1.15e-7: tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5)))) else: tmp = n / (0.01 * (i / math.expm1(i))) return tmp
function code(i, n) tmp = 0.0 if (n <= -1e-7) tmp = Float64(100.0 * Float64(Float64(n * expm1(i)) / i)); elseif (n <= 1.15e-7) tmp = Float64(n / Float64(0.01 + Float64(0.01 * Float64(i * Float64(Float64(0.5 / n) + -0.5))))); else tmp = Float64(n / Float64(0.01 * Float64(i / expm1(i)))); end return tmp end
code[i_, n_] := If[LessEqual[n, -1e-7], N[(100.0 * N[(N[(n * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.15e-7], N[(n / N[(0.01 + N[(0.01 * N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n / N[(0.01 * N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1 \cdot 10^{-7}:\\
\;\;\;\;100 \cdot \frac{n \cdot \mathsf{expm1}\left(i\right)}{i}\\
\mathbf{elif}\;n \leq 1.15 \cdot 10^{-7}:\\
\;\;\;\;\frac{n}{0.01 + 0.01 \cdot \left(i \cdot \left(\frac{0.5}{n} + -0.5\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{n}{0.01 \cdot \frac{i}{\mathsf{expm1}\left(i\right)}}\\
\end{array}
\end{array}
if n < -9.9999999999999995e-8Initial program 24.6%
Taylor expanded in n around inf 34.5%
*-commutative34.5%
expm1-def86.3%
Simplified86.3%
if -9.9999999999999995e-8 < n < 1.14999999999999997e-7Initial program 41.1%
associate-*r/41.1%
sub-neg41.1%
distribute-lft-in41.1%
metadata-eval41.1%
metadata-eval41.1%
fma-udef41.1%
associate-/r/40.9%
*-commutative40.9%
clear-num40.9%
un-div-inv40.9%
fma-udef40.8%
metadata-eval40.8%
metadata-eval40.8%
distribute-lft-in40.9%
sub-neg40.9%
*-commutative40.9%
Applied egg-rr88.8%
Taylor expanded in i around 0 85.9%
sub-neg85.9%
associate-*r/85.9%
metadata-eval85.9%
metadata-eval85.9%
Simplified85.9%
if 1.14999999999999997e-7 < n Initial program 23.3%
associate-*r/23.3%
sub-neg23.3%
distribute-lft-in23.3%
metadata-eval23.3%
metadata-eval23.3%
fma-udef23.3%
associate-/r/23.9%
*-commutative23.9%
clear-num23.9%
un-div-inv24.0%
fma-udef24.0%
metadata-eval24.0%
metadata-eval24.0%
distribute-lft-in24.0%
sub-neg24.0%
*-commutative24.0%
Applied egg-rr63.4%
Taylor expanded in n around inf 40.7%
expm1-def93.7%
Simplified93.7%
Final simplification88.5%
(FPCore (i n)
:precision binary64
(if (<= n 1.15e-7)
(/ n (+ 0.01 (* 0.01 (* i (+ (/ 0.5 n) -0.5)))))
(*
100.0
(+ n (* n (* i (+ (- 0.5 (/ 0.5 n)) (* i 0.16666666666666666))))))))
double code(double i, double n) {
double tmp;
if (n <= 1.15e-7) {
tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5))));
} else {
tmp = 100.0 * (n + (n * (i * ((0.5 - (0.5 / n)) + (i * 0.16666666666666666)))));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= 1.15d-7) then
tmp = n / (0.01d0 + (0.01d0 * (i * ((0.5d0 / n) + (-0.5d0)))))
else
tmp = 100.0d0 * (n + (n * (i * ((0.5d0 - (0.5d0 / n)) + (i * 0.16666666666666666d0)))))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= 1.15e-7) {
tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5))));
} else {
tmp = 100.0 * (n + (n * (i * ((0.5 - (0.5 / n)) + (i * 0.16666666666666666)))));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= 1.15e-7: tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5)))) else: tmp = 100.0 * (n + (n * (i * ((0.5 - (0.5 / n)) + (i * 0.16666666666666666))))) return tmp
function code(i, n) tmp = 0.0 if (n <= 1.15e-7) tmp = Float64(n / Float64(0.01 + Float64(0.01 * Float64(i * Float64(Float64(0.5 / n) + -0.5))))); else tmp = Float64(100.0 * Float64(n + Float64(n * Float64(i * Float64(Float64(0.5 - Float64(0.5 / n)) + Float64(i * 0.16666666666666666)))))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= 1.15e-7) tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5)))); else tmp = 100.0 * (n + (n * (i * ((0.5 - (0.5 / n)) + (i * 0.16666666666666666))))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, 1.15e-7], N[(n / N[(0.01 + N[(0.01 * N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n + N[(n * N[(i * N[(N[(0.5 - N[(0.5 / n), $MachinePrecision]), $MachinePrecision] + N[(i * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 1.15 \cdot 10^{-7}:\\
\;\;\;\;\frac{n}{0.01 + 0.01 \cdot \left(i \cdot \left(\frac{0.5}{n} + -0.5\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n + n \cdot \left(i \cdot \left(\left(0.5 - \frac{0.5}{n}\right) + i \cdot 0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if n < 1.14999999999999997e-7Initial program 34.3%
associate-*r/34.3%
sub-neg34.3%
distribute-lft-in34.3%
metadata-eval34.3%
metadata-eval34.3%
fma-udef34.3%
associate-/r/34.4%
*-commutative34.4%
clear-num34.5%
un-div-inv34.4%
fma-udef34.4%
metadata-eval34.4%
metadata-eval34.4%
distribute-lft-in34.4%
sub-neg34.4%
*-commutative34.4%
Applied egg-rr75.3%
Taylor expanded in i around 0 75.7%
sub-neg75.7%
associate-*r/75.7%
metadata-eval75.7%
metadata-eval75.7%
Simplified75.7%
if 1.14999999999999997e-7 < n Initial program 23.3%
Taylor expanded in i around 0 70.4%
distribute-lft-out70.7%
unpow270.7%
associate--l+70.7%
associate-*r/70.7%
metadata-eval70.7%
unpow270.7%
associate-*r/70.7%
metadata-eval70.7%
associate-*r/70.7%
metadata-eval70.7%
Simplified70.7%
Taylor expanded in n around inf 70.7%
unpow270.7%
associate-*r*70.7%
Simplified70.7%
+-commutative70.7%
*-commutative70.7%
distribute-lft-out70.7%
*-commutative70.7%
Applied egg-rr70.7%
Final simplification74.1%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* 100.0 (+ n (* n (* i (* i 0.16666666666666666)))))))
(if (<= n -1.25e-81)
t_0
(if (<= n 3.8e-225)
(* 100.0 (/ 0.0 (/ i n)))
(if (<= n 5.8e-8) (* 100.0 (/ i (/ i n))) t_0)))))
double code(double i, double n) {
double t_0 = 100.0 * (n + (n * (i * (i * 0.16666666666666666))));
double tmp;
if (n <= -1.25e-81) {
tmp = t_0;
} else if (n <= 3.8e-225) {
tmp = 100.0 * (0.0 / (i / n));
} else if (n <= 5.8e-8) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = 100.0d0 * (n + (n * (i * (i * 0.16666666666666666d0))))
if (n <= (-1.25d-81)) then
tmp = t_0
else if (n <= 3.8d-225) then
tmp = 100.0d0 * (0.0d0 / (i / n))
else if (n <= 5.8d-8) 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 = 100.0 * (n + (n * (i * (i * 0.16666666666666666))));
double tmp;
if (n <= -1.25e-81) {
tmp = t_0;
} else if (n <= 3.8e-225) {
tmp = 100.0 * (0.0 / (i / n));
} else if (n <= 5.8e-8) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = 100.0 * (n + (n * (i * (i * 0.16666666666666666)))) tmp = 0 if n <= -1.25e-81: tmp = t_0 elif n <= 3.8e-225: tmp = 100.0 * (0.0 / (i / n)) elif n <= 5.8e-8: tmp = 100.0 * (i / (i / n)) else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(100.0 * Float64(n + Float64(n * Float64(i * Float64(i * 0.16666666666666666))))) tmp = 0.0 if (n <= -1.25e-81) tmp = t_0; elseif (n <= 3.8e-225) tmp = Float64(100.0 * Float64(0.0 / Float64(i / n))); elseif (n <= 5.8e-8) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = t_0; end return tmp end
function tmp_2 = code(i, n) t_0 = 100.0 * (n + (n * (i * (i * 0.16666666666666666)))); tmp = 0.0; if (n <= -1.25e-81) tmp = t_0; elseif (n <= 3.8e-225) tmp = 100.0 * (0.0 / (i / n)); elseif (n <= 5.8e-8) tmp = 100.0 * (i / (i / n)); else tmp = t_0; end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(100.0 * N[(n + N[(n * N[(i * N[(i * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.25e-81], t$95$0, If[LessEqual[n, 3.8e-225], N[(100.0 * N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5.8e-8], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 100 \cdot \left(n + n \cdot \left(i \cdot \left(i \cdot 0.16666666666666666\right)\right)\right)\\
\mathbf{if}\;n \leq -1.25 \cdot 10^{-81}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq 3.8 \cdot 10^{-225}:\\
\;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 5.8 \cdot 10^{-8}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if n < -1.24999999999999995e-81 or 5.8000000000000003e-8 < n Initial program 22.5%
Taylor expanded in i around 0 66.2%
distribute-lft-out66.5%
unpow266.5%
associate--l+66.5%
associate-*r/66.5%
metadata-eval66.5%
unpow266.5%
associate-*r/66.5%
metadata-eval66.5%
associate-*r/66.5%
metadata-eval66.5%
Simplified66.5%
Taylor expanded in n around inf 66.5%
unpow266.5%
associate-*r*66.5%
Simplified66.5%
Taylor expanded in i around inf 66.0%
unpow266.0%
*-commutative66.0%
associate-*r*66.0%
Simplified66.0%
if -1.24999999999999995e-81 < n < 3.8000000000000003e-225Initial program 72.6%
Taylor expanded in i around 0 76.6%
if 3.8000000000000003e-225 < n < 5.8000000000000003e-8Initial program 12.0%
Taylor expanded in i around 0 75.8%
Final simplification69.4%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* n (+ 100.0 (* i 50.0)))) (t_1 (* 100.0 (/ i (/ i n)))))
(if (<= n -2.15e+79)
t_0
(if (<= n -4.1e-299)
t_1
(if (<= n 1e-275) (* (* i n) 50.0) (if (<= n 1.15e-7) t_1 t_0))))))
double code(double i, double n) {
double t_0 = n * (100.0 + (i * 50.0));
double t_1 = 100.0 * (i / (i / n));
double tmp;
if (n <= -2.15e+79) {
tmp = t_0;
} else if (n <= -4.1e-299) {
tmp = t_1;
} else if (n <= 1e-275) {
tmp = (i * n) * 50.0;
} else if (n <= 1.15e-7) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = n * (100.0d0 + (i * 50.0d0))
t_1 = 100.0d0 * (i / (i / n))
if (n <= (-2.15d+79)) then
tmp = t_0
else if (n <= (-4.1d-299)) then
tmp = t_1
else if (n <= 1d-275) then
tmp = (i * n) * 50.0d0
else if (n <= 1.15d-7) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = n * (100.0 + (i * 50.0));
double t_1 = 100.0 * (i / (i / n));
double tmp;
if (n <= -2.15e+79) {
tmp = t_0;
} else if (n <= -4.1e-299) {
tmp = t_1;
} else if (n <= 1e-275) {
tmp = (i * n) * 50.0;
} else if (n <= 1.15e-7) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = n * (100.0 + (i * 50.0)) t_1 = 100.0 * (i / (i / n)) tmp = 0 if n <= -2.15e+79: tmp = t_0 elif n <= -4.1e-299: tmp = t_1 elif n <= 1e-275: tmp = (i * n) * 50.0 elif n <= 1.15e-7: tmp = t_1 else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(n * Float64(100.0 + Float64(i * 50.0))) t_1 = Float64(100.0 * Float64(i / Float64(i / n))) tmp = 0.0 if (n <= -2.15e+79) tmp = t_0; elseif (n <= -4.1e-299) tmp = t_1; elseif (n <= 1e-275) tmp = Float64(Float64(i * n) * 50.0); elseif (n <= 1.15e-7) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(i, n) t_0 = n * (100.0 + (i * 50.0)); t_1 = 100.0 * (i / (i / n)); tmp = 0.0; if (n <= -2.15e+79) tmp = t_0; elseif (n <= -4.1e-299) tmp = t_1; elseif (n <= 1e-275) tmp = (i * n) * 50.0; elseif (n <= 1.15e-7) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -2.15e+79], t$95$0, If[LessEqual[n, -4.1e-299], t$95$1, If[LessEqual[n, 1e-275], N[(N[(i * n), $MachinePrecision] * 50.0), $MachinePrecision], If[LessEqual[n, 1.15e-7], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \left(100 + i \cdot 50\right)\\
t_1 := 100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{if}\;n \leq -2.15 \cdot 10^{+79}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq -4.1 \cdot 10^{-299}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;n \leq 10^{-275}:\\
\;\;\;\;\left(i \cdot n\right) \cdot 50\\
\mathbf{elif}\;n \leq 1.15 \cdot 10^{-7}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if n < -2.1500000000000002e79 or 1.14999999999999997e-7 < n Initial program 20.3%
Taylor expanded in n around inf 39.4%
*-commutative39.4%
expm1-def92.5%
Simplified92.5%
associate-*l/92.3%
Applied egg-rr92.3%
Taylor expanded in i around 0 64.0%
*-commutative64.0%
*-commutative64.0%
associate-*r*64.0%
+-commutative64.0%
distribute-lft-in64.0%
Simplified64.0%
if -2.1500000000000002e79 < n < -4.1000000000000001e-299 or 9.99999999999999934e-276 < n < 1.14999999999999997e-7Initial program 39.7%
Taylor expanded in i around 0 61.6%
if -4.1000000000000001e-299 < n < 9.99999999999999934e-276Initial program 100.0%
Taylor expanded in n around inf 83.6%
*-commutative83.6%
expm1-def83.6%
Simplified83.6%
Taylor expanded in i around 0 9.2%
Taylor expanded in i around inf 84.6%
Final simplification63.4%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* 100.0 (/ (* i n) i))) (t_1 (* 100.0 (/ i (/ i n)))))
(if (<= n -1e-14)
t_0
(if (<= n 1e-307)
t_1
(if (<= n 1.4e-275)
t_0
(if (<= n 1.1e-7) t_1 (* n (+ 100.0 (* i 50.0)))))))))
double code(double i, double n) {
double t_0 = 100.0 * ((i * n) / i);
double t_1 = 100.0 * (i / (i / n));
double tmp;
if (n <= -1e-14) {
tmp = t_0;
} else if (n <= 1e-307) {
tmp = t_1;
} else if (n <= 1.4e-275) {
tmp = t_0;
} else if (n <= 1.1e-7) {
tmp = t_1;
} 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 100.0d0 * ((i * n) / i)
t_1 = 100.0d0 * (i / (i / n))
if (n <= (-1d-14)) then
tmp = t_0
else if (n <= 1d-307) then
tmp = t_1
else if (n <= 1.4d-275) then
tmp = t_0
else if (n <= 1.1d-7) then
tmp = t_1
else
tmp = n * (100.0d0 + (i * 50.0d0))
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = 100.0 * ((i * n) / i);
double t_1 = 100.0 * (i / (i / n));
double tmp;
if (n <= -1e-14) {
tmp = t_0;
} else if (n <= 1e-307) {
tmp = t_1;
} else if (n <= 1.4e-275) {
tmp = t_0;
} else if (n <= 1.1e-7) {
tmp = t_1;
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): t_0 = 100.0 * ((i * n) / i) t_1 = 100.0 * (i / (i / n)) tmp = 0 if n <= -1e-14: tmp = t_0 elif n <= 1e-307: tmp = t_1 elif n <= 1.4e-275: tmp = t_0 elif n <= 1.1e-7: tmp = t_1 else: tmp = n * (100.0 + (i * 50.0)) return tmp
function code(i, n) t_0 = Float64(100.0 * Float64(Float64(i * n) / i)) t_1 = Float64(100.0 * Float64(i / Float64(i / n))) tmp = 0.0 if (n <= -1e-14) tmp = t_0; elseif (n <= 1e-307) tmp = t_1; elseif (n <= 1.4e-275) tmp = t_0; elseif (n <= 1.1e-7) tmp = t_1; else tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); end return tmp end
function tmp_2 = code(i, n) t_0 = 100.0 * ((i * n) / i); t_1 = 100.0 * (i / (i / n)); tmp = 0.0; if (n <= -1e-14) tmp = t_0; elseif (n <= 1e-307) tmp = t_1; elseif (n <= 1.4e-275) tmp = t_0; elseif (n <= 1.1e-7) tmp = t_1; else tmp = n * (100.0 + (i * 50.0)); end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(100.0 * N[(N[(i * n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1e-14], t$95$0, If[LessEqual[n, 1e-307], t$95$1, If[LessEqual[n, 1.4e-275], t$95$0, If[LessEqual[n, 1.1e-7], t$95$1, N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 100 \cdot \frac{i \cdot n}{i}\\
t_1 := 100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{if}\;n \leq -1 \cdot 10^{-14}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq 10^{-307}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;n \leq 1.4 \cdot 10^{-275}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq 1.1 \cdot 10^{-7}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if n < -9.99999999999999999e-15 or 9.99999999999999909e-308 < n < 1.39999999999999997e-275Initial program 29.7%
Taylor expanded in n around inf 37.4%
*-commutative37.4%
expm1-def86.4%
Simplified86.4%
Taylor expanded in i around 0 62.3%
if -9.99999999999999999e-15 < n < 9.99999999999999909e-308 or 1.39999999999999997e-275 < n < 1.1000000000000001e-7Initial program 38.2%
Taylor expanded in i around 0 62.6%
if 1.1000000000000001e-7 < n Initial program 23.3%
Taylor expanded in n around inf 40.7%
*-commutative40.7%
expm1-def93.7%
Simplified93.7%
associate-*l/93.5%
Applied egg-rr93.5%
Taylor expanded in i around 0 65.5%
*-commutative65.5%
*-commutative65.5%
associate-*r*65.5%
+-commutative65.5%
distribute-lft-in65.5%
Simplified65.5%
Final simplification63.4%
(FPCore (i n)
:precision binary64
(if (<= n -1.25e-81)
(* 100.0 (/ (* i n) i))
(if (<= n 6e-227)
(* 100.0 (/ 0.0 (/ i n)))
(if (<= n 5.8e-8)
(* 100.0 (/ i (/ i n)))
(+ (* n 100.0) (* (* i n) 50.0))))))
double code(double i, double n) {
double tmp;
if (n <= -1.25e-81) {
tmp = 100.0 * ((i * n) / i);
} else if (n <= 6e-227) {
tmp = 100.0 * (0.0 / (i / n));
} else if (n <= 5.8e-8) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * 100.0) + ((i * n) * 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 <= (-1.25d-81)) then
tmp = 100.0d0 * ((i * n) / i)
else if (n <= 6d-227) then
tmp = 100.0d0 * (0.0d0 / (i / n))
else if (n <= 5.8d-8) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = (n * 100.0d0) + ((i * n) * 50.0d0)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -1.25e-81) {
tmp = 100.0 * ((i * n) / i);
} else if (n <= 6e-227) {
tmp = 100.0 * (0.0 / (i / n));
} else if (n <= 5.8e-8) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (n * 100.0) + ((i * n) * 50.0);
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.25e-81: tmp = 100.0 * ((i * n) / i) elif n <= 6e-227: tmp = 100.0 * (0.0 / (i / n)) elif n <= 5.8e-8: tmp = 100.0 * (i / (i / n)) else: tmp = (n * 100.0) + ((i * n) * 50.0) return tmp
function code(i, n) tmp = 0.0 if (n <= -1.25e-81) tmp = Float64(100.0 * Float64(Float64(i * n) / i)); elseif (n <= 6e-227) tmp = Float64(100.0 * Float64(0.0 / Float64(i / n))); elseif (n <= 5.8e-8) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(Float64(n * 100.0) + Float64(Float64(i * n) * 50.0)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -1.25e-81) tmp = 100.0 * ((i * n) / i); elseif (n <= 6e-227) tmp = 100.0 * (0.0 / (i / n)); elseif (n <= 5.8e-8) tmp = 100.0 * (i / (i / n)); else tmp = (n * 100.0) + ((i * n) * 50.0); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.25e-81], N[(100.0 * N[(N[(i * n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 6e-227], N[(100.0 * N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5.8e-8], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] + N[(N[(i * n), $MachinePrecision] * 50.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.25 \cdot 10^{-81}:\\
\;\;\;\;100 \cdot \frac{i \cdot n}{i}\\
\mathbf{elif}\;n \leq 6 \cdot 10^{-227}:\\
\;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 5.8 \cdot 10^{-8}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100 + \left(i \cdot n\right) \cdot 50\\
\end{array}
\end{array}
if n < -1.24999999999999995e-81Initial program 21.7%
Taylor expanded in n around inf 29.4%
*-commutative29.4%
expm1-def83.2%
Simplified83.2%
Taylor expanded in i around 0 60.7%
if -1.24999999999999995e-81 < n < 5.9999999999999999e-227Initial program 72.6%
Taylor expanded in i around 0 76.6%
if 5.9999999999999999e-227 < n < 5.8000000000000003e-8Initial program 12.0%
Taylor expanded in i around 0 75.8%
if 5.8000000000000003e-8 < n Initial program 23.3%
Taylor expanded in n around inf 40.7%
*-commutative40.7%
expm1-def93.7%
Simplified93.7%
Taylor expanded in i around 0 65.5%
Final simplification67.3%
(FPCore (i n) :precision binary64 (if (<= n 1.15e-7) (/ n (+ 0.01 (* 0.01 (* i (+ (/ 0.5 n) -0.5))))) (* 100.0 (+ n (* n (* i (* i 0.16666666666666666)))))))
double code(double i, double n) {
double tmp;
if (n <= 1.15e-7) {
tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5))));
} else {
tmp = 100.0 * (n + (n * (i * (i * 0.16666666666666666))));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= 1.15d-7) then
tmp = n / (0.01d0 + (0.01d0 * (i * ((0.5d0 / n) + (-0.5d0)))))
else
tmp = 100.0d0 * (n + (n * (i * (i * 0.16666666666666666d0))))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= 1.15e-7) {
tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5))));
} else {
tmp = 100.0 * (n + (n * (i * (i * 0.16666666666666666))));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= 1.15e-7: tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5)))) else: tmp = 100.0 * (n + (n * (i * (i * 0.16666666666666666)))) return tmp
function code(i, n) tmp = 0.0 if (n <= 1.15e-7) tmp = Float64(n / Float64(0.01 + Float64(0.01 * Float64(i * Float64(Float64(0.5 / n) + -0.5))))); else tmp = Float64(100.0 * Float64(n + Float64(n * Float64(i * Float64(i * 0.16666666666666666))))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= 1.15e-7) tmp = n / (0.01 + (0.01 * (i * ((0.5 / n) + -0.5)))); else tmp = 100.0 * (n + (n * (i * (i * 0.16666666666666666)))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, 1.15e-7], N[(n / N[(0.01 + N[(0.01 * N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n + N[(n * N[(i * N[(i * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 1.15 \cdot 10^{-7}:\\
\;\;\;\;\frac{n}{0.01 + 0.01 \cdot \left(i \cdot \left(\frac{0.5}{n} + -0.5\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n + n \cdot \left(i \cdot \left(i \cdot 0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if n < 1.14999999999999997e-7Initial program 34.3%
associate-*r/34.3%
sub-neg34.3%
distribute-lft-in34.3%
metadata-eval34.3%
metadata-eval34.3%
fma-udef34.3%
associate-/r/34.4%
*-commutative34.4%
clear-num34.5%
un-div-inv34.4%
fma-udef34.4%
metadata-eval34.4%
metadata-eval34.4%
distribute-lft-in34.4%
sub-neg34.4%
*-commutative34.4%
Applied egg-rr75.3%
Taylor expanded in i around 0 75.7%
sub-neg75.7%
associate-*r/75.7%
metadata-eval75.7%
metadata-eval75.7%
Simplified75.7%
if 1.14999999999999997e-7 < n Initial program 23.3%
Taylor expanded in i around 0 70.4%
distribute-lft-out70.7%
unpow270.7%
associate--l+70.7%
associate-*r/70.7%
metadata-eval70.7%
unpow270.7%
associate-*r/70.7%
metadata-eval70.7%
associate-*r/70.7%
metadata-eval70.7%
Simplified70.7%
Taylor expanded in n around inf 70.7%
unpow270.7%
associate-*r*70.7%
Simplified70.7%
Taylor expanded in i around inf 70.0%
unpow270.0%
*-commutative70.0%
associate-*r*70.0%
Simplified70.0%
Final simplification73.9%
(FPCore (i n)
:precision binary64
(if (<= n -1.25e-81)
(* 100.0 (/ (* i n) i))
(if (<= n 3.5e-230)
(* 100.0 (/ 0.0 (/ i n)))
(if (<= n 1.15e-7) (* 100.0 (/ i (/ i n))) (* n (+ 100.0 (* i 50.0)))))))
double code(double i, double n) {
double tmp;
if (n <= -1.25e-81) {
tmp = 100.0 * ((i * n) / i);
} else if (n <= 3.5e-230) {
tmp = 100.0 * (0.0 / (i / n));
} else if (n <= 1.15e-7) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-1.25d-81)) then
tmp = 100.0d0 * ((i * n) / i)
else if (n <= 3.5d-230) then
tmp = 100.0d0 * (0.0d0 / (i / n))
else if (n <= 1.15d-7) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = n * (100.0d0 + (i * 50.0d0))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -1.25e-81) {
tmp = 100.0 * ((i * n) / i);
} else if (n <= 3.5e-230) {
tmp = 100.0 * (0.0 / (i / n));
} else if (n <= 1.15e-7) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.25e-81: tmp = 100.0 * ((i * n) / i) elif n <= 3.5e-230: tmp = 100.0 * (0.0 / (i / n)) elif n <= 1.15e-7: tmp = 100.0 * (i / (i / n)) else: tmp = n * (100.0 + (i * 50.0)) return tmp
function code(i, n) tmp = 0.0 if (n <= -1.25e-81) tmp = Float64(100.0 * Float64(Float64(i * n) / i)); elseif (n <= 3.5e-230) tmp = Float64(100.0 * Float64(0.0 / Float64(i / n))); elseif (n <= 1.15e-7) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -1.25e-81) tmp = 100.0 * ((i * n) / i); elseif (n <= 3.5e-230) tmp = 100.0 * (0.0 / (i / n)); elseif (n <= 1.15e-7) tmp = 100.0 * (i / (i / n)); else tmp = n * (100.0 + (i * 50.0)); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.25e-81], N[(100.0 * N[(N[(i * n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 3.5e-230], N[(100.0 * N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.15e-7], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.25 \cdot 10^{-81}:\\
\;\;\;\;100 \cdot \frac{i \cdot n}{i}\\
\mathbf{elif}\;n \leq 3.5 \cdot 10^{-230}:\\
\;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.15 \cdot 10^{-7}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if n < -1.24999999999999995e-81Initial program 21.7%
Taylor expanded in n around inf 29.4%
*-commutative29.4%
expm1-def83.2%
Simplified83.2%
Taylor expanded in i around 0 60.7%
if -1.24999999999999995e-81 < n < 3.49999999999999988e-230Initial program 72.6%
Taylor expanded in i around 0 76.6%
if 3.49999999999999988e-230 < n < 1.14999999999999997e-7Initial program 12.0%
Taylor expanded in i around 0 75.8%
if 1.14999999999999997e-7 < n Initial program 23.3%
Taylor expanded in n around inf 40.7%
*-commutative40.7%
expm1-def93.7%
Simplified93.7%
associate-*l/93.5%
Applied egg-rr93.5%
Taylor expanded in i around 0 65.5%
*-commutative65.5%
*-commutative65.5%
associate-*r*65.5%
+-commutative65.5%
distribute-lft-in65.5%
Simplified65.5%
Final simplification67.3%
(FPCore (i n) :precision binary64 (if (or (<= i -2e+55) (not (<= i 1.3e-62))) (* 100.0 (/ i (/ i n))) (* n 100.0)))
double code(double i, double n) {
double tmp;
if ((i <= -2e+55) || !(i <= 1.3e-62)) {
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 <= (-2d+55)) .or. (.not. (i <= 1.3d-62))) 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 <= -2e+55) || !(i <= 1.3e-62)) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * 100.0;
}
return tmp;
}
def code(i, n): tmp = 0 if (i <= -2e+55) or not (i <= 1.3e-62): tmp = 100.0 * (i / (i / n)) else: tmp = n * 100.0 return tmp
function code(i, n) tmp = 0.0 if ((i <= -2e+55) || !(i <= 1.3e-62)) 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 <= -2e+55) || ~((i <= 1.3e-62))) tmp = 100.0 * (i / (i / n)); else tmp = n * 100.0; end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[i, -2e+55], N[Not[LessEqual[i, 1.3e-62]], $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 -2 \cdot 10^{+55} \lor \neg \left(i \leq 1.3 \cdot 10^{-62}\right):\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100\\
\end{array}
\end{array}
if i < -2.00000000000000002e55 or 1.3e-62 < i Initial program 52.7%
Taylor expanded in i around 0 29.1%
if -2.00000000000000002e55 < i < 1.3e-62Initial program 13.6%
Taylor expanded in i around 0 80.8%
*-commutative80.8%
Simplified80.8%
Final simplification58.0%
(FPCore (i n) :precision binary64 (if (<= i 350000000000.0) (* n 100.0) (* (* i n) 50.0)))
double code(double i, double n) {
double tmp;
if (i <= 350000000000.0) {
tmp = n * 100.0;
} else {
tmp = (i * n) * 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 <= 350000000000.0d0) then
tmp = n * 100.0d0
else
tmp = (i * n) * 50.0d0
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (i <= 350000000000.0) {
tmp = n * 100.0;
} else {
tmp = (i * n) * 50.0;
}
return tmp;
}
def code(i, n): tmp = 0 if i <= 350000000000.0: tmp = n * 100.0 else: tmp = (i * n) * 50.0 return tmp
function code(i, n) tmp = 0.0 if (i <= 350000000000.0) tmp = Float64(n * 100.0); else tmp = Float64(Float64(i * n) * 50.0); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (i <= 350000000000.0) tmp = n * 100.0; else tmp = (i * n) * 50.0; end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, 350000000000.0], N[(n * 100.0), $MachinePrecision], N[(N[(i * n), $MachinePrecision] * 50.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq 350000000000:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot n\right) \cdot 50\\
\end{array}
\end{array}
if i < 3.5e11Initial program 26.3%
Taylor expanded in i around 0 60.5%
*-commutative60.5%
Simplified60.5%
if 3.5e11 < i Initial program 48.8%
Taylor expanded in n around inf 48.8%
*-commutative48.8%
expm1-def48.8%
Simplified48.8%
Taylor expanded in i around 0 20.5%
Taylor expanded in i around inf 20.5%
Final simplification52.4%
(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 30.9%
Taylor expanded in i around 0 51.9%
associate-*r*52.1%
*-commutative52.1%
associate-*r/52.1%
metadata-eval52.1%
Simplified52.1%
Taylor expanded in n around 0 2.7%
*-commutative2.7%
Simplified2.7%
Final simplification2.7%
(FPCore (i n) :precision binary64 (* n 100.0))
double code(double i, double n) {
return n * 100.0;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = n * 100.0d0
end function
public static double code(double i, double n) {
return n * 100.0;
}
def code(i, n): return n * 100.0
function code(i, n) return Float64(n * 100.0) end
function tmp = code(i, n) tmp = n * 100.0; end
code[i_, n_] := N[(n * 100.0), $MachinePrecision]
\begin{array}{l}
\\
n \cdot 100
\end{array}
Initial program 30.9%
Taylor expanded in i around 0 49.1%
*-commutative49.1%
Simplified49.1%
Final simplification49.1%
(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 2023174
(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))))