
(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 18 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) (* n (/ (fma 100.0 t_0 -100.0) i)) (* n 100.0)))))
double code(double i, double n) {
double t_0 = pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= 0.0) {
tmp = 100.0 * (expm1((n * log1p((i / n)))) / (i / n));
} else if (t_1 <= ((double) INFINITY)) {
tmp = n * (fma(100.0, t_0, -100.0) / i);
} else {
tmp = n * 100.0;
}
return tmp;
}
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) ^ n t_1 = Float64(Float64(t_0 + -1.0) / Float64(i / n)) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(100.0 * Float64(expm1(Float64(n * log1p(Float64(i / n)))) / Float64(i / n))); elseif (t_1 <= Inf) tmp = Float64(n * Float64(fma(100.0, t_0, -100.0) / i)); else tmp = Float64(n * 100.0); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 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[(N[(100.0 * t$95$0 + -100.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(n * 100.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t\_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t\_1 \leq 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:\\
\;\;\;\;n \cdot \frac{\mathsf{fma}\left(100, t\_0, -100\right)}{i}\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -0.0Initial program 26.0%
sub-neg26.0%
metadata-eval26.0%
Applied egg-rr26.0%
metadata-eval26.0%
sub-neg26.0%
exp-to-pow24.0%
log1p-undefine45.2%
*-commutative45.2%
expm1-undefine97.7%
Simplified97.7%
if -0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 99.7%
associate-/r/99.8%
associate-*r*99.9%
*-commutative99.9%
associate-*r/99.9%
sub-neg99.9%
distribute-lft-in99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
fma-define99.9%
metadata-eval99.9%
Simplified99.9%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
Taylor expanded in i around 0 86.1%
*-commutative86.1%
Simplified86.1%
Final simplification96.1%
(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) (/ (+ -100.0 (* t_0 100.0)) (/ i n)) (* n 100.0)))))
double code(double i, double n) {
double t_0 = pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= 0.0) {
tmp = 100.0 * (expm1((n * log1p((i / n)))) / (i / n));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (-100.0 + (t_0 * 100.0)) / (i / n);
} else {
tmp = n * 100.0;
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = Math.pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= 0.0) {
tmp = 100.0 * (Math.expm1((n * Math.log1p((i / n)))) / (i / n));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (-100.0 + (t_0 * 100.0)) / (i / n);
} else {
tmp = n * 100.0;
}
return tmp;
}
def code(i, n): t_0 = math.pow((1.0 + (i / n)), n) t_1 = (t_0 + -1.0) / (i / n) tmp = 0 if t_1 <= 0.0: tmp = 100.0 * (math.expm1((n * math.log1p((i / n)))) / (i / n)) elif t_1 <= math.inf: tmp = (-100.0 + (t_0 * 100.0)) / (i / n) else: tmp = n * 100.0 return tmp
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) ^ n t_1 = Float64(Float64(t_0 + -1.0) / Float64(i / n)) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(100.0 * Float64(expm1(Float64(n * log1p(Float64(i / n)))) / Float64(i / n))); elseif (t_1 <= Inf) tmp = Float64(Float64(-100.0 + Float64(t_0 * 100.0)) / Float64(i / n)); else tmp = Float64(n * 100.0); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 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[(-100.0 + N[(t$95$0 * 100.0), $MachinePrecision]), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(n * 100.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t\_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t\_1 \leq 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{-100 + t\_0 \cdot 100}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -0.0Initial program 26.0%
sub-neg26.0%
metadata-eval26.0%
Applied egg-rr26.0%
metadata-eval26.0%
sub-neg26.0%
exp-to-pow24.0%
log1p-undefine45.2%
*-commutative45.2%
expm1-undefine97.7%
Simplified97.7%
if -0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 99.7%
associate-*r/99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
Taylor expanded in i around 0 86.1%
*-commutative86.1%
Simplified86.1%
Final simplification96.1%
(FPCore (i n) :precision binary64 (if (or (<= n -2e-193) (not (<= n 7.3e-214))) (* n (* (expm1 i) (/ 100.0 i))) (/ 0.0 (/ i n))))
double code(double i, double n) {
double tmp;
if ((n <= -2e-193) || !(n <= 7.3e-214)) {
tmp = n * (expm1(i) * (100.0 / i));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((n <= -2e-193) || !(n <= 7.3e-214)) {
tmp = n * (Math.expm1(i) * (100.0 / i));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -2e-193) or not (n <= 7.3e-214): tmp = n * (math.expm1(i) * (100.0 / i)) else: tmp = 0.0 / (i / n) return tmp
function code(i, n) tmp = 0.0 if ((n <= -2e-193) || !(n <= 7.3e-214)) tmp = Float64(n * Float64(expm1(i) * Float64(100.0 / i))); else tmp = Float64(0.0 / Float64(i / n)); end return tmp end
code[i_, n_] := If[Or[LessEqual[n, -2e-193], N[Not[LessEqual[n, 7.3e-214]], $MachinePrecision]], N[(n * N[(N[(Exp[i] - 1), $MachinePrecision] * N[(100.0 / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2 \cdot 10^{-193} \lor \neg \left(n \leq 7.3 \cdot 10^{-214}\right):\\
\;\;\;\;n \cdot \left(\mathsf{expm1}\left(i\right) \cdot \frac{100}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -2.0000000000000001e-193 or 7.30000000000000029e-214 < n Initial program 22.9%
Taylor expanded in n around inf 35.6%
*-commutative35.6%
associate-/l*35.6%
expm1-define86.3%
Simplified86.3%
Taylor expanded in n around 0 35.6%
*-commutative35.6%
expm1-define76.4%
associate-*r/86.3%
associate-*r*86.3%
associate-*l/86.2%
associate-/l*85.4%
Simplified85.4%
if -2.0000000000000001e-193 < n < 7.30000000000000029e-214Initial program 73.1%
associate-*r/73.1%
sub-neg73.1%
distribute-rgt-in73.1%
metadata-eval73.1%
metadata-eval73.1%
Simplified73.1%
Taylor expanded in i around 0 90.3%
+-commutative90.3%
Simplified90.3%
Taylor expanded in i around 0 90.3%
Final simplification86.0%
(FPCore (i n) :precision binary64 (if (or (<= n -2.95e-192) (not (<= n 2.1e-214))) (* 100.0 (* n (/ (expm1 i) i))) (/ 0.0 (/ i n))))
double code(double i, double n) {
double tmp;
if ((n <= -2.95e-192) || !(n <= 2.1e-214)) {
tmp = 100.0 * (n * (expm1(i) / i));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((n <= -2.95e-192) || !(n <= 2.1e-214)) {
tmp = 100.0 * (n * (Math.expm1(i) / i));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -2.95e-192) or not (n <= 2.1e-214): tmp = 100.0 * (n * (math.expm1(i) / i)) else: tmp = 0.0 / (i / n) return tmp
function code(i, n) tmp = 0.0 if ((n <= -2.95e-192) || !(n <= 2.1e-214)) tmp = Float64(100.0 * Float64(n * Float64(expm1(i) / i))); else tmp = Float64(0.0 / Float64(i / n)); end return tmp end
code[i_, n_] := If[Or[LessEqual[n, -2.95e-192], N[Not[LessEqual[n, 2.1e-214]], $MachinePrecision]], N[(100.0 * N[(n * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.95 \cdot 10^{-192} \lor \neg \left(n \leq 2.1 \cdot 10^{-214}\right):\\
\;\;\;\;100 \cdot \left(n \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -2.9499999999999998e-192 or 2.09999999999999992e-214 < n Initial program 22.9%
Taylor expanded in n around inf 35.6%
*-commutative35.6%
associate-/l*35.6%
expm1-define86.3%
Simplified86.3%
if -2.9499999999999998e-192 < n < 2.09999999999999992e-214Initial program 73.1%
associate-*r/73.1%
sub-neg73.1%
distribute-rgt-in73.1%
metadata-eval73.1%
metadata-eval73.1%
Simplified73.1%
Taylor expanded in i around 0 90.3%
+-commutative90.3%
Simplified90.3%
Taylor expanded in i around 0 90.3%
Final simplification86.8%
(FPCore (i n)
:precision binary64
(if (<= i -9e-8)
(* 100.0 (/ (expm1 i) (/ i n)))
(+
(* n 100.0)
(*
i
(+
(* n 50.0)
(*
i
(+
(* n 16.666666666666668)
(*
i
(+
(* n 4.166666666666667)
(*
i
(+
(* 0.1388888888888889 (* i n))
(* n 0.8333333333333334))))))))))))
double code(double i, double n) {
double tmp;
if (i <= -9e-8) {
tmp = 100.0 * (expm1(i) / (i / n));
} else {
tmp = (n * 100.0) + (i * ((n * 50.0) + (i * ((n * 16.666666666666668) + (i * ((n * 4.166666666666667) + (i * ((0.1388888888888889 * (i * n)) + (n * 0.8333333333333334)))))))));
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (i <= -9e-8) {
tmp = 100.0 * (Math.expm1(i) / (i / n));
} else {
tmp = (n * 100.0) + (i * ((n * 50.0) + (i * ((n * 16.666666666666668) + (i * ((n * 4.166666666666667) + (i * ((0.1388888888888889 * (i * n)) + (n * 0.8333333333333334)))))))));
}
return tmp;
}
def code(i, n): tmp = 0 if i <= -9e-8: tmp = 100.0 * (math.expm1(i) / (i / n)) else: tmp = (n * 100.0) + (i * ((n * 50.0) + (i * ((n * 16.666666666666668) + (i * ((n * 4.166666666666667) + (i * ((0.1388888888888889 * (i * n)) + (n * 0.8333333333333334))))))))) return tmp
function code(i, n) tmp = 0.0 if (i <= -9e-8) tmp = Float64(100.0 * Float64(expm1(i) / Float64(i / n))); else tmp = Float64(Float64(n * 100.0) + Float64(i * Float64(Float64(n * 50.0) + Float64(i * Float64(Float64(n * 16.666666666666668) + Float64(i * Float64(Float64(n * 4.166666666666667) + Float64(i * Float64(Float64(0.1388888888888889 * Float64(i * n)) + Float64(n * 0.8333333333333334)))))))))); end return tmp end
code[i_, n_] := If[LessEqual[i, -9e-8], N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] + N[(i * N[(N[(n * 50.0), $MachinePrecision] + N[(i * N[(N[(n * 16.666666666666668), $MachinePrecision] + N[(i * N[(N[(n * 4.166666666666667), $MachinePrecision] + N[(i * N[(N[(0.1388888888888889 * N[(i * n), $MachinePrecision]), $MachinePrecision] + N[(n * 0.8333333333333334), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -9 \cdot 10^{-8}:\\
\;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100 + i \cdot \left(n \cdot 50 + i \cdot \left(n \cdot 16.666666666666668 + i \cdot \left(n \cdot 4.166666666666667 + i \cdot \left(0.1388888888888889 \cdot \left(i \cdot n\right) + n \cdot 0.8333333333333334\right)\right)\right)\right)\\
\end{array}
\end{array}
if i < -8.99999999999999986e-8Initial program 57.7%
Taylor expanded in n around inf 85.7%
expm1-define85.7%
Simplified85.7%
if -8.99999999999999986e-8 < i Initial program 20.6%
Taylor expanded in n around inf 27.4%
*-commutative27.4%
associate-/l*27.4%
expm1-define81.2%
Simplified81.2%
Taylor expanded in i around 0 80.9%
Final simplification82.0%
(FPCore (i n)
:precision binary64
(if (<= n -1.25e-191)
(*
n
(+
100.0
(*
i
(+
50.0
(*
i
(+
16.666666666666668
(* i (+ 4.166666666666667 (* i 0.8333333333333334)))))))))
(if (<= n 2.15e-214)
(/ 0.0 (/ i n))
(*
n
(+
100.0
(*
i
(+
50.0
(*
i
(+
16.666666666666668
(*
i
(+
4.166666666666667
(* i (+ 0.8333333333333334 (* i 0.1388888888888889))))))))))))))
double code(double i, double n) {
double tmp;
if (n <= -1.25e-191) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * (4.166666666666667 + (i * 0.8333333333333334))))))));
} else if (n <= 2.15e-214) {
tmp = 0.0 / (i / n);
} else {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * (4.166666666666667 + (i * (0.8333333333333334 + (i * 0.1388888888888889))))))))));
}
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-191)) then
tmp = n * (100.0d0 + (i * (50.0d0 + (i * (16.666666666666668d0 + (i * (4.166666666666667d0 + (i * 0.8333333333333334d0))))))))
else if (n <= 2.15d-214) then
tmp = 0.0d0 / (i / n)
else
tmp = n * (100.0d0 + (i * (50.0d0 + (i * (16.666666666666668d0 + (i * (4.166666666666667d0 + (i * (0.8333333333333334d0 + (i * 0.1388888888888889d0))))))))))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -1.25e-191) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * (4.166666666666667 + (i * 0.8333333333333334))))))));
} else if (n <= 2.15e-214) {
tmp = 0.0 / (i / n);
} else {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * (4.166666666666667 + (i * (0.8333333333333334 + (i * 0.1388888888888889))))))))));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.25e-191: tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * (4.166666666666667 + (i * 0.8333333333333334)))))))) elif n <= 2.15e-214: tmp = 0.0 / (i / n) else: tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * (4.166666666666667 + (i * (0.8333333333333334 + (i * 0.1388888888888889)))))))))) return tmp
function code(i, n) tmp = 0.0 if (n <= -1.25e-191) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * Float64(4.166666666666667 + Float64(i * 0.8333333333333334))))))))); elseif (n <= 2.15e-214) tmp = Float64(0.0 / Float64(i / n)); else tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * Float64(4.166666666666667 + Float64(i * Float64(0.8333333333333334 + Float64(i * 0.1388888888888889))))))))))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -1.25e-191) tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * (4.166666666666667 + (i * 0.8333333333333334)))))))); elseif (n <= 2.15e-214) tmp = 0.0 / (i / n); else tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * (4.166666666666667 + (i * (0.8333333333333334 + (i * 0.1388888888888889)))))))))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.25e-191], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * N[(4.166666666666667 + N[(i * 0.8333333333333334), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.15e-214], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * N[(4.166666666666667 + N[(i * N[(0.8333333333333334 + N[(i * 0.1388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.25 \cdot 10^{-191}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot \left(4.166666666666667 + i \cdot 0.8333333333333334\right)\right)\right)\right)\\
\mathbf{elif}\;n \leq 2.15 \cdot 10^{-214}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot \left(4.166666666666667 + i \cdot \left(0.8333333333333334 + i \cdot 0.1388888888888889\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if n < -1.25e-191Initial program 22.9%
Taylor expanded in n around inf 32.3%
*-commutative32.3%
associate-/l*32.2%
expm1-define86.0%
Simplified86.0%
Taylor expanded in n around 0 32.3%
*-commutative32.3%
expm1-define77.8%
associate-*r/86.0%
associate-*r*85.9%
associate-*l/85.9%
associate-/l*85.9%
Simplified85.9%
Taylor expanded in i around 0 63.9%
*-commutative63.9%
Simplified63.9%
if -1.25e-191 < n < 2.15e-214Initial program 73.1%
associate-*r/73.1%
sub-neg73.1%
distribute-rgt-in73.1%
metadata-eval73.1%
metadata-eval73.1%
Simplified73.1%
Taylor expanded in i around 0 90.3%
+-commutative90.3%
Simplified90.3%
Taylor expanded in i around 0 90.3%
if 2.15e-214 < n Initial program 22.9%
Taylor expanded in n around inf 38.3%
*-commutative38.3%
associate-/l*38.4%
expm1-define86.6%
Simplified86.6%
Taylor expanded in n around 0 38.3%
*-commutative38.3%
expm1-define75.3%
associate-*r/86.6%
associate-*r*86.6%
associate-*l/86.5%
associate-/l*85.1%
Simplified85.1%
Taylor expanded in i around 0 79.1%
*-commutative79.1%
Simplified79.1%
Final simplification74.4%
(FPCore (i n)
:precision binary64
(if (or (<= n -1.6e-191) (not (<= n 1.15e-213)))
(*
n
(+
100.0
(* i (+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667)))))))
(/ 0.0 (/ i n))))
double code(double i, double n) {
double tmp;
if ((n <= -1.6e-191) || !(n <= 1.15e-213)) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-1.6d-191)) .or. (.not. (n <= 1.15d-213))) then
tmp = n * (100.0d0 + (i * (50.0d0 + (i * (16.666666666666668d0 + (i * 4.166666666666667d0))))))
else
tmp = 0.0d0 / (i / n)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -1.6e-191) || !(n <= 1.15e-213)) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -1.6e-191) or not (n <= 1.15e-213): tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))) else: tmp = 0.0 / (i / n) return tmp
function code(i, n) tmp = 0.0 if ((n <= -1.6e-191) || !(n <= 1.15e-213)) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667))))))); else tmp = Float64(0.0 / Float64(i / n)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -1.6e-191) || ~((n <= 1.15e-213))) tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))); else tmp = 0.0 / (i / n); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -1.6e-191], N[Not[LessEqual[n, 1.15e-213]], $MachinePrecision]], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.6 \cdot 10^{-191} \lor \neg \left(n \leq 1.15 \cdot 10^{-213}\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -1.6000000000000002e-191 or 1.15000000000000001e-213 < n Initial program 22.9%
Taylor expanded in n around inf 35.6%
*-commutative35.6%
associate-/l*35.6%
expm1-define86.3%
Simplified86.3%
Taylor expanded in n around 0 35.6%
*-commutative35.6%
expm1-define76.4%
associate-*r/86.3%
associate-*r*86.3%
associate-*l/86.2%
associate-/l*85.4%
Simplified85.4%
Taylor expanded in i around 0 71.9%
*-commutative71.9%
Simplified71.9%
if -1.6000000000000002e-191 < n < 1.15000000000000001e-213Initial program 73.1%
associate-*r/73.1%
sub-neg73.1%
distribute-rgt-in73.1%
metadata-eval73.1%
metadata-eval73.1%
Simplified73.1%
Taylor expanded in i around 0 90.3%
+-commutative90.3%
Simplified90.3%
Taylor expanded in i around 0 90.3%
Final simplification74.0%
(FPCore (i n)
:precision binary64
(if (<= n -5.3e-191)
(*
n
(+
100.0
(*
i
(+
50.0
(*
i
(+
16.666666666666668
(* i (+ 4.166666666666667 (* i 0.8333333333333334)))))))))
(if (<= n 1.15e-213)
(/ 0.0 (/ i n))
(*
n
(+
100.0
(* i (+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667))))))))))
double code(double i, double n) {
double tmp;
if (n <= -5.3e-191) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * (4.166666666666667 + (i * 0.8333333333333334))))))));
} else if (n <= 1.15e-213) {
tmp = 0.0 / (i / n);
} else {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-5.3d-191)) then
tmp = n * (100.0d0 + (i * (50.0d0 + (i * (16.666666666666668d0 + (i * (4.166666666666667d0 + (i * 0.8333333333333334d0))))))))
else if (n <= 1.15d-213) then
tmp = 0.0d0 / (i / n)
else
tmp = n * (100.0d0 + (i * (50.0d0 + (i * (16.666666666666668d0 + (i * 4.166666666666667d0))))))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -5.3e-191) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * (4.166666666666667 + (i * 0.8333333333333334))))))));
} else if (n <= 1.15e-213) {
tmp = 0.0 / (i / n);
} else {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -5.3e-191: tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * (4.166666666666667 + (i * 0.8333333333333334)))))))) elif n <= 1.15e-213: tmp = 0.0 / (i / n) else: tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))) return tmp
function code(i, n) tmp = 0.0 if (n <= -5.3e-191) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * Float64(4.166666666666667 + Float64(i * 0.8333333333333334))))))))); elseif (n <= 1.15e-213) tmp = Float64(0.0 / Float64(i / n)); else tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667))))))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -5.3e-191) tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * (4.166666666666667 + (i * 0.8333333333333334)))))))); elseif (n <= 1.15e-213) tmp = 0.0 / (i / n); else tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -5.3e-191], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * N[(4.166666666666667 + N[(i * 0.8333333333333334), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.15e-213], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -5.3 \cdot 10^{-191}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot \left(4.166666666666667 + i \cdot 0.8333333333333334\right)\right)\right)\right)\\
\mathbf{elif}\;n \leq 1.15 \cdot 10^{-213}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\\
\end{array}
\end{array}
if n < -5.29999999999999985e-191Initial program 22.9%
Taylor expanded in n around inf 32.3%
*-commutative32.3%
associate-/l*32.2%
expm1-define86.0%
Simplified86.0%
Taylor expanded in n around 0 32.3%
*-commutative32.3%
expm1-define77.8%
associate-*r/86.0%
associate-*r*85.9%
associate-*l/85.9%
associate-/l*85.9%
Simplified85.9%
Taylor expanded in i around 0 63.9%
*-commutative63.9%
Simplified63.9%
if -5.29999999999999985e-191 < n < 1.15000000000000001e-213Initial program 73.1%
associate-*r/73.1%
sub-neg73.1%
distribute-rgt-in73.1%
metadata-eval73.1%
metadata-eval73.1%
Simplified73.1%
Taylor expanded in i around 0 90.3%
+-commutative90.3%
Simplified90.3%
Taylor expanded in i around 0 90.3%
if 1.15000000000000001e-213 < n Initial program 22.9%
Taylor expanded in n around inf 38.3%
*-commutative38.3%
associate-/l*38.4%
expm1-define86.6%
Simplified86.6%
Taylor expanded in n around 0 38.3%
*-commutative38.3%
expm1-define75.3%
associate-*r/86.6%
associate-*r*86.6%
associate-*l/86.5%
associate-/l*85.1%
Simplified85.1%
Taylor expanded in i around 0 78.8%
*-commutative78.8%
Simplified78.8%
Final simplification74.2%
(FPCore (i n)
:precision binary64
(if (<= n -7e-192)
(* n (+ 100.0 (* i (+ 50.0 (* i 16.666666666666668)))))
(if (<= n 6.2e-214)
(/ 0.0 (/ i n))
(* 100.0 (* n (+ 1.0 (* i (+ 0.5 (* i 0.16666666666666666)))))))))
double code(double i, double n) {
double tmp;
if (n <= -7e-192) {
tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
} else if (n <= 6.2e-214) {
tmp = 0.0 / (i / n);
} else {
tmp = 100.0 * (n * (1.0 + (i * (0.5 + (i * 0.16666666666666666)))));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-7d-192)) then
tmp = n * (100.0d0 + (i * (50.0d0 + (i * 16.666666666666668d0))))
else if (n <= 6.2d-214) then
tmp = 0.0d0 / (i / n)
else
tmp = 100.0d0 * (n * (1.0d0 + (i * (0.5d0 + (i * 0.16666666666666666d0)))))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -7e-192) {
tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
} else if (n <= 6.2e-214) {
tmp = 0.0 / (i / n);
} else {
tmp = 100.0 * (n * (1.0 + (i * (0.5 + (i * 0.16666666666666666)))));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -7e-192: tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))) elif n <= 6.2e-214: tmp = 0.0 / (i / n) else: tmp = 100.0 * (n * (1.0 + (i * (0.5 + (i * 0.16666666666666666))))) return tmp
function code(i, n) tmp = 0.0 if (n <= -7e-192) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * 16.666666666666668))))); elseif (n <= 6.2e-214) tmp = Float64(0.0 / Float64(i / n)); else tmp = Float64(100.0 * Float64(n * Float64(1.0 + Float64(i * Float64(0.5 + Float64(i * 0.16666666666666666)))))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -7e-192) tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))); elseif (n <= 6.2e-214) tmp = 0.0 / (i / n); else tmp = 100.0 * (n * (1.0 + (i * (0.5 + (i * 0.16666666666666666))))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -7e-192], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 6.2e-214], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n * N[(1.0 + N[(i * N[(0.5 + N[(i * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -7 \cdot 10^{-192}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\
\mathbf{elif}\;n \leq 6.2 \cdot 10^{-214}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n \cdot \left(1 + i \cdot \left(0.5 + i \cdot 0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if n < -7.00000000000000029e-192Initial program 22.9%
Taylor expanded in n around inf 32.3%
*-commutative32.3%
associate-/l*32.2%
expm1-define86.0%
Simplified86.0%
Taylor expanded in n around 0 32.3%
*-commutative32.3%
expm1-define77.8%
associate-*r/86.0%
associate-*r*85.9%
associate-*l/85.9%
associate-/l*85.9%
Simplified85.9%
Taylor expanded in i around 0 62.1%
if -7.00000000000000029e-192 < n < 6.20000000000000008e-214Initial program 73.1%
associate-*r/73.1%
sub-neg73.1%
distribute-rgt-in73.1%
metadata-eval73.1%
metadata-eval73.1%
Simplified73.1%
Taylor expanded in i around 0 90.3%
+-commutative90.3%
Simplified90.3%
Taylor expanded in i around 0 90.3%
if 6.20000000000000008e-214 < n Initial program 22.9%
Taylor expanded in n around inf 38.3%
*-commutative38.3%
associate-/l*38.4%
expm1-define86.6%
Simplified86.6%
Taylor expanded in i around 0 73.6%
*-commutative73.6%
Simplified73.6%
Final simplification71.0%
(FPCore (i n) :precision binary64 (if (or (<= n -4.5e-191) (not (<= n 3.4e-215))) (* n (+ 100.0 (* i (+ 50.0 (* i 16.666666666666668))))) (/ 0.0 (/ i n))))
double code(double i, double n) {
double tmp;
if ((n <= -4.5e-191) || !(n <= 3.4e-215)) {
tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-4.5d-191)) .or. (.not. (n <= 3.4d-215))) then
tmp = n * (100.0d0 + (i * (50.0d0 + (i * 16.666666666666668d0))))
else
tmp = 0.0d0 / (i / n)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -4.5e-191) || !(n <= 3.4e-215)) {
tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -4.5e-191) or not (n <= 3.4e-215): tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))) else: tmp = 0.0 / (i / n) return tmp
function code(i, n) tmp = 0.0 if ((n <= -4.5e-191) || !(n <= 3.4e-215)) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * 16.666666666666668))))); else tmp = Float64(0.0 / Float64(i / n)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -4.5e-191) || ~((n <= 3.4e-215))) tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))); else tmp = 0.0 / (i / n); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -4.5e-191], N[Not[LessEqual[n, 3.4e-215]], $MachinePrecision]], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -4.5 \cdot 10^{-191} \lor \neg \left(n \leq 3.4 \cdot 10^{-215}\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -4.50000000000000008e-191 or 3.40000000000000001e-215 < n Initial program 22.9%
Taylor expanded in n around inf 35.6%
*-commutative35.6%
associate-/l*35.6%
expm1-define86.3%
Simplified86.3%
Taylor expanded in n around 0 35.6%
*-commutative35.6%
expm1-define76.4%
associate-*r/86.3%
associate-*r*86.3%
associate-*l/86.2%
associate-/l*85.4%
Simplified85.4%
Taylor expanded in i around 0 68.5%
if -4.50000000000000008e-191 < n < 3.40000000000000001e-215Initial program 73.1%
associate-*r/73.1%
sub-neg73.1%
distribute-rgt-in73.1%
metadata-eval73.1%
metadata-eval73.1%
Simplified73.1%
Taylor expanded in i around 0 90.3%
+-commutative90.3%
Simplified90.3%
Taylor expanded in i around 0 90.3%
Final simplification71.0%
(FPCore (i n) :precision binary64 (if (or (<= n -2.02e-191) (not (<= n 4.4e-214))) (* n (+ 100.0 (* i (* i 16.666666666666668)))) (/ 0.0 (/ i n))))
double code(double i, double n) {
double tmp;
if ((n <= -2.02e-191) || !(n <= 4.4e-214)) {
tmp = n * (100.0 + (i * (i * 16.666666666666668)));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-2.02d-191)) .or. (.not. (n <= 4.4d-214))) then
tmp = n * (100.0d0 + (i * (i * 16.666666666666668d0)))
else
tmp = 0.0d0 / (i / n)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -2.02e-191) || !(n <= 4.4e-214)) {
tmp = n * (100.0 + (i * (i * 16.666666666666668)));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -2.02e-191) or not (n <= 4.4e-214): tmp = n * (100.0 + (i * (i * 16.666666666666668))) else: tmp = 0.0 / (i / n) return tmp
function code(i, n) tmp = 0.0 if ((n <= -2.02e-191) || !(n <= 4.4e-214)) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(i * 16.666666666666668)))); else tmp = Float64(0.0 / Float64(i / n)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -2.02e-191) || ~((n <= 4.4e-214))) tmp = n * (100.0 + (i * (i * 16.666666666666668))); else tmp = 0.0 / (i / n); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -2.02e-191], N[Not[LessEqual[n, 4.4e-214]], $MachinePrecision]], N[(n * N[(100.0 + N[(i * N[(i * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.02 \cdot 10^{-191} \lor \neg \left(n \leq 4.4 \cdot 10^{-214}\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -2.02e-191 or 4.40000000000000003e-214 < n Initial program 22.9%
Taylor expanded in n around inf 35.6%
*-commutative35.6%
associate-/l*35.6%
expm1-define86.3%
Simplified86.3%
Taylor expanded in n around 0 35.6%
*-commutative35.6%
expm1-define76.4%
associate-*r/86.3%
associate-*r*86.3%
associate-*l/86.2%
associate-/l*85.4%
Simplified85.4%
Taylor expanded in i around 0 68.5%
Taylor expanded in i around inf 68.1%
*-commutative68.1%
Simplified68.1%
if -2.02e-191 < n < 4.40000000000000003e-214Initial program 73.1%
associate-*r/73.1%
sub-neg73.1%
distribute-rgt-in73.1%
metadata-eval73.1%
metadata-eval73.1%
Simplified73.1%
Taylor expanded in i around 0 90.3%
+-commutative90.3%
Simplified90.3%
Taylor expanded in i around 0 90.3%
Final simplification70.6%
(FPCore (i n) :precision binary64 (if (or (<= n -3.2e+20) (not (<= n 3.3e-43))) (* n (+ 100.0 (* i 50.0))) (* 100.0 (/ i (/ i n)))))
double code(double i, double n) {
double tmp;
if ((n <= -3.2e+20) || !(n <= 3.3e-43)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-3.2d+20)) .or. (.not. (n <= 3.3d-43))) then
tmp = n * (100.0d0 + (i * 50.0d0))
else
tmp = 100.0d0 * (i / (i / n))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -3.2e+20) || !(n <= 3.3e-43)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -3.2e+20) or not (n <= 3.3e-43): tmp = n * (100.0 + (i * 50.0)) else: tmp = 100.0 * (i / (i / n)) return tmp
function code(i, n) tmp = 0.0 if ((n <= -3.2e+20) || !(n <= 3.3e-43)) tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); else tmp = Float64(100.0 * Float64(i / Float64(i / n))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -3.2e+20) || ~((n <= 3.3e-43))) tmp = n * (100.0 + (i * 50.0)); else tmp = 100.0 * (i / (i / n)); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -3.2e+20], N[Not[LessEqual[n, 3.3e-43]], $MachinePrecision]], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -3.2 \cdot 10^{+20} \lor \neg \left(n \leq 3.3 \cdot 10^{-43}\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -3.2e20 or 3.30000000000000016e-43 < n Initial program 25.8%
Taylor expanded in n around inf 46.4%
*-commutative46.4%
associate-/l*46.4%
expm1-define94.2%
Simplified94.2%
Taylor expanded in i around 0 67.5%
+-commutative67.5%
associate-*r*67.5%
distribute-rgt-in67.5%
*-commutative67.5%
Simplified67.5%
if -3.2e20 < n < 3.30000000000000016e-43Initial program 33.3%
Taylor expanded in i around 0 67.6%
Final simplification67.5%
(FPCore (i n) :precision binary64 (if (or (<= n -1.35e-191) (not (<= n 1.15e-213))) (* n (+ 100.0 (* i 50.0))) (/ 0.0 (/ i n))))
double code(double i, double n) {
double tmp;
if ((n <= -1.35e-191) || !(n <= 1.15e-213)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-1.35d-191)) .or. (.not. (n <= 1.15d-213))) then
tmp = n * (100.0d0 + (i * 50.0d0))
else
tmp = 0.0d0 / (i / n)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -1.35e-191) || !(n <= 1.15e-213)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -1.35e-191) or not (n <= 1.15e-213): tmp = n * (100.0 + (i * 50.0)) else: tmp = 0.0 / (i / n) return tmp
function code(i, n) tmp = 0.0 if ((n <= -1.35e-191) || !(n <= 1.15e-213)) tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); else tmp = Float64(0.0 / Float64(i / n)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -1.35e-191) || ~((n <= 1.15e-213))) tmp = n * (100.0 + (i * 50.0)); else tmp = 0.0 / (i / n); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -1.35e-191], N[Not[LessEqual[n, 1.15e-213]], $MachinePrecision]], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.35 \cdot 10^{-191} \lor \neg \left(n \leq 1.15 \cdot 10^{-213}\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -1.34999999999999999e-191 or 1.15000000000000001e-213 < n Initial program 22.9%
Taylor expanded in n around inf 35.6%
*-commutative35.6%
associate-/l*35.6%
expm1-define86.3%
Simplified86.3%
Taylor expanded in i around 0 66.3%
+-commutative66.3%
associate-*r*66.3%
distribute-rgt-in66.3%
*-commutative66.3%
Simplified66.3%
if -1.34999999999999999e-191 < n < 1.15000000000000001e-213Initial program 73.1%
associate-*r/73.1%
sub-neg73.1%
distribute-rgt-in73.1%
metadata-eval73.1%
metadata-eval73.1%
Simplified73.1%
Taylor expanded in i around 0 90.3%
+-commutative90.3%
Simplified90.3%
Taylor expanded in i around 0 90.3%
Final simplification69.0%
(FPCore (i n) :precision binary64 (if (<= n -2e+39) (/ (* n (* i 100.0)) i) (if (<= n 1.3e-43) (* 100.0 (/ i (/ i n))) (* n (+ 100.0 (* i 50.0))))))
double code(double i, double n) {
double tmp;
if (n <= -2e+39) {
tmp = (n * (i * 100.0)) / i;
} else if (n <= 1.3e-43) {
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 <= (-2d+39)) then
tmp = (n * (i * 100.0d0)) / i
else if (n <= 1.3d-43) 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 <= -2e+39) {
tmp = (n * (i * 100.0)) / i;
} else if (n <= 1.3e-43) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -2e+39: tmp = (n * (i * 100.0)) / i elif n <= 1.3e-43: 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 <= -2e+39) tmp = Float64(Float64(n * Float64(i * 100.0)) / i); elseif (n <= 1.3e-43) 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 <= -2e+39) tmp = (n * (i * 100.0)) / i; elseif (n <= 1.3e-43) 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, -2e+39], N[(N[(n * N[(i * 100.0), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision], If[LessEqual[n, 1.3e-43], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2 \cdot 10^{+39}:\\
\;\;\;\;\frac{n \cdot \left(i \cdot 100\right)}{i}\\
\mathbf{elif}\;n \leq 1.3 \cdot 10^{-43}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if n < -1.99999999999999988e39Initial program 28.0%
associate-/r/28.5%
associate-*r*28.4%
*-commutative28.4%
associate-*r/28.5%
sub-neg28.5%
distribute-lft-in28.5%
metadata-eval28.5%
metadata-eval28.5%
metadata-eval28.5%
fma-define28.5%
metadata-eval28.5%
Simplified28.5%
Taylor expanded in n around inf 44.4%
Taylor expanded in i around 0 58.4%
*-commutative58.4%
*-commutative58.4%
associate-*l*58.4%
Simplified58.4%
if -1.99999999999999988e39 < n < 1.3e-43Initial program 32.6%
Taylor expanded in i around 0 68.2%
if 1.3e-43 < n Initial program 24.7%
Taylor expanded in n around inf 48.6%
*-commutative48.6%
associate-/l*48.6%
expm1-define95.6%
Simplified95.6%
Taylor expanded in i around 0 73.5%
+-commutative73.5%
associate-*r*73.5%
distribute-rgt-in73.5%
*-commutative73.5%
Simplified73.5%
Final simplification67.7%
(FPCore (i n) :precision binary64 (if (<= i -5e-15) (* 100.0 (/ i (/ i n))) (if (<= i 1.16e+26) (* n 100.0) (* 50.0 (* i n)))))
double code(double i, double n) {
double tmp;
if (i <= -5e-15) {
tmp = 100.0 * (i / (i / n));
} else if (i <= 1.16e+26) {
tmp = n * 100.0;
} else {
tmp = 50.0 * (i * n);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (i <= (-5d-15)) then
tmp = 100.0d0 * (i / (i / n))
else if (i <= 1.16d+26) then
tmp = n * 100.0d0
else
tmp = 50.0d0 * (i * n)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (i <= -5e-15) {
tmp = 100.0 * (i / (i / n));
} else if (i <= 1.16e+26) {
tmp = n * 100.0;
} else {
tmp = 50.0 * (i * n);
}
return tmp;
}
def code(i, n): tmp = 0 if i <= -5e-15: tmp = 100.0 * (i / (i / n)) elif i <= 1.16e+26: tmp = n * 100.0 else: tmp = 50.0 * (i * n) return tmp
function code(i, n) tmp = 0.0 if (i <= -5e-15) tmp = Float64(100.0 * Float64(i / Float64(i / n))); elseif (i <= 1.16e+26) tmp = Float64(n * 100.0); else tmp = Float64(50.0 * Float64(i * n)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (i <= -5e-15) tmp = 100.0 * (i / (i / n)); elseif (i <= 1.16e+26) tmp = n * 100.0; else tmp = 50.0 * (i * n); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, -5e-15], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.16e+26], N[(n * 100.0), $MachinePrecision], N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -5 \cdot 10^{-15}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{elif}\;i \leq 1.16 \cdot 10^{+26}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;50 \cdot \left(i \cdot n\right)\\
\end{array}
\end{array}
if i < -4.99999999999999999e-15Initial program 56.7%
Taylor expanded in i around 0 28.3%
if -4.99999999999999999e-15 < i < 1.15999999999999996e26Initial program 10.2%
Taylor expanded in i around 0 83.3%
*-commutative83.3%
Simplified83.3%
if 1.15999999999999996e26 < i Initial program 51.6%
Taylor expanded in n around inf 71.0%
*-commutative71.0%
associate-/l*71.0%
expm1-define71.0%
Simplified71.0%
Taylor expanded in i around 0 51.2%
+-commutative51.2%
associate-*r*51.2%
distribute-rgt-in51.2%
*-commutative51.2%
Simplified51.2%
Taylor expanded in i around inf 51.2%
Final simplification64.8%
(FPCore (i n) :precision binary64 (if (<= i 1.25e+26) (* n 100.0) (* 50.0 (* i n))))
double code(double i, double n) {
double tmp;
if (i <= 1.25e+26) {
tmp = n * 100.0;
} else {
tmp = 50.0 * (i * n);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (i <= 1.25d+26) then
tmp = n * 100.0d0
else
tmp = 50.0d0 * (i * n)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (i <= 1.25e+26) {
tmp = n * 100.0;
} else {
tmp = 50.0 * (i * n);
}
return tmp;
}
def code(i, n): tmp = 0 if i <= 1.25e+26: tmp = n * 100.0 else: tmp = 50.0 * (i * n) return tmp
function code(i, n) tmp = 0.0 if (i <= 1.25e+26) tmp = Float64(n * 100.0); else tmp = Float64(50.0 * Float64(i * n)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (i <= 1.25e+26) tmp = n * 100.0; else tmp = 50.0 * (i * n); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, 1.25e+26], N[(n * 100.0), $MachinePrecision], N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq 1.25 \cdot 10^{+26}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;50 \cdot \left(i \cdot n\right)\\
\end{array}
\end{array}
if i < 1.25e26Initial program 22.9%
Taylor expanded in i around 0 62.3%
*-commutative62.3%
Simplified62.3%
if 1.25e26 < i Initial program 51.6%
Taylor expanded in n around inf 71.0%
*-commutative71.0%
associate-/l*71.0%
expm1-define71.0%
Simplified71.0%
Taylor expanded in i around 0 51.2%
+-commutative51.2%
associate-*r*51.2%
distribute-rgt-in51.2%
*-commutative51.2%
Simplified51.2%
Taylor expanded in i around inf 51.2%
Final simplification60.1%
(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 28.6%
Taylor expanded in i around 0 60.3%
Taylor expanded in n around 0 2.9%
*-commutative2.9%
Simplified2.9%
Final simplification2.9%
(FPCore (i n) :precision binary64 (* n 100.0))
double code(double i, double n) {
return n * 100.0;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = n * 100.0d0
end function
public static double code(double i, double n) {
return n * 100.0;
}
def code(i, n): return n * 100.0
function code(i, n) return Float64(n * 100.0) end
function tmp = code(i, n) tmp = n * 100.0; end
code[i_, n_] := N[(n * 100.0), $MachinePrecision]
\begin{array}{l}
\\
n \cdot 100
\end{array}
Initial program 28.6%
Taylor expanded in i around 0 51.0%
*-commutative51.0%
Simplified51.0%
Final simplification51.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 2024055
(FPCore (i n)
:name "Compound Interest"
:precision binary64
:alt
(* 100.0 (/ (- (exp (* n (if (== (+ 1.0 (/ i n)) 1.0) (/ i n) (/ (* (/ i n) (log (+ 1.0 (/ i n)))) (- (+ (/ i n) 1.0) 1.0))))) 1.0) (/ i n)))
(* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))