
(FPCore (i n) :precision binary64 (* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))
double code(double i, double n) {
return 100.0 * ((pow((1.0 + (i / n)), n) - 1.0) / (i / n));
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = 100.0d0 * ((((1.0d0 + (i / n)) ** n) - 1.0d0) / (i / n))
end function
public static double code(double i, double n) {
return 100.0 * ((Math.pow((1.0 + (i / n)), n) - 1.0) / (i / n));
}
def code(i, n): return 100.0 * ((math.pow((1.0 + (i / n)), n) - 1.0) / (i / n))
function code(i, n) return Float64(100.0 * Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) - 1.0) / Float64(i / n))) end
function tmp = code(i, n) tmp = 100.0 * ((((1.0 + (i / n)) ^ n) - 1.0) / (i / n)); end
code[i_, n_] := N[(100.0 * N[(N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] - 1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (i n) :precision binary64 (* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))
double code(double i, double n) {
return 100.0 * ((pow((1.0 + (i / n)), n) - 1.0) / (i / n));
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = 100.0d0 * ((((1.0d0 + (i / n)) ** n) - 1.0d0) / (i / n))
end function
public static double code(double i, double n) {
return 100.0 * ((Math.pow((1.0 + (i / n)), n) - 1.0) / (i / n));
}
def code(i, n): return 100.0 * ((math.pow((1.0 + (i / n)), n) - 1.0) / (i / n))
function code(i, n) return Float64(100.0 * Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) - 1.0) / Float64(i / n))) end
function tmp = code(i, n) tmp = 100.0 * ((((1.0 + (i / n)) ^ n) - 1.0) / (i / n)); end
code[i_, n_] := N[(100.0 * N[(N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] - 1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\end{array}
(FPCore (i n)
:precision binary64
(let* ((t_0 (pow (+ 1.0 (/ i n)) n)) (t_1 (/ (+ t_0 -1.0) (/ i n))))
(if (<= t_1 (- INFINITY))
(/
(*
i
(+
100.0
(* i (+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667)))))))
(/ i n))
(if (<= t_1 0.0)
(/ (* 100.0 (expm1 (* n (log1p (/ i n))))) (/ i n))
(if (<= t_1 INFINITY)
(/ (+ (* t_0 100.0) -100.0) (/ i n))
(* n 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 <= -((double) INFINITY)) {
tmp = (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))))) / (i / n);
} else if (t_1 <= 0.0) {
tmp = (100.0 * expm1((n * log1p((i / n))))) / (i / n);
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((t_0 * 100.0) + -100.0) / (i / n);
} else {
tmp = n * 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 <= -Double.POSITIVE_INFINITY) {
tmp = (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))))) / (i / n);
} else if (t_1 <= 0.0) {
tmp = (100.0 * Math.expm1((n * Math.log1p((i / n))))) / (i / n);
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = ((t_0 * 100.0) + -100.0) / (i / n);
} else {
tmp = n * 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 <= -math.inf: tmp = (i * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))))) / (i / n) elif t_1 <= 0.0: tmp = (100.0 * math.expm1((n * math.log1p((i / n))))) / (i / n) elif t_1 <= math.inf: tmp = ((t_0 * 100.0) + -100.0) / (i / n) else: tmp = n * 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 <= Float64(-Inf)) tmp = Float64(Float64(i * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667))))))) / Float64(i / n)); elseif (t_1 <= 0.0) tmp = Float64(Float64(100.0 * expm1(Float64(n * log1p(Float64(i / n))))) / Float64(i / n)); elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(t_0 * 100.0) + -100.0) / Float64(i / n)); else tmp = Float64(n * 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, (-Infinity)], N[(N[(i * 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[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(100.0 * N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[(t$95$0 * 100.0), $MachinePrecision] + -100.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(n * 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 -\infty:\\
\;\;\;\;\frac{i \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)}{\frac{i}{n}}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{100 \cdot \mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{i}{n}}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{t\_0 \cdot 100 + -100}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < -inf.0Initial program 100.0%
Taylor expanded in n around inf 22.9%
expm1-define22.9%
Simplified22.9%
associate-*r/22.9%
Applied egg-rr22.9%
Taylor expanded in i around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < 0.0Initial program 27.0%
*-commutative27.0%
frac-2neg27.0%
associate-*l/27.1%
add-exp-log27.1%
expm1-define27.1%
log-pow39.0%
log1p-define99.5%
distribute-neg-frac299.5%
Applied egg-rr99.5%
if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < +inf.0Initial program 99.4%
associate-*r/99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) Initial program 0.0%
Taylor expanded in i around 0 72.5%
*-commutative72.5%
Simplified72.5%
Final simplification95.2%
(FPCore (i n)
:precision binary64
(let* ((t_0 (pow (+ 1.0 (/ i n)) n))
(t_1 (+ (* t_0 100.0) -100.0))
(t_2 (/ (+ t_0 -1.0) (/ i n))))
(if (<= t_2 -4e-103)
(* n (/ t_1 i))
(if (<= t_2 0.0)
(* 100.0 (* n (/ (expm1 (* n (log1p (/ i n)))) i)))
(if (<= t_2 INFINITY) (/ t_1 (/ 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 * 100.0) + -100.0;
double t_2 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_2 <= -4e-103) {
tmp = n * (t_1 / i);
} else if (t_2 <= 0.0) {
tmp = 100.0 * (n * (expm1((n * log1p((i / n)))) / i));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_1 / (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 * 100.0) + -100.0;
double t_2 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_2 <= -4e-103) {
tmp = n * (t_1 / i);
} else if (t_2 <= 0.0) {
tmp = 100.0 * (n * (Math.expm1((n * Math.log1p((i / n)))) / i));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_1 / (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 * 100.0) + -100.0 t_2 = (t_0 + -1.0) / (i / n) tmp = 0 if t_2 <= -4e-103: tmp = n * (t_1 / i) elif t_2 <= 0.0: tmp = 100.0 * (n * (math.expm1((n * math.log1p((i / n)))) / i)) elif t_2 <= math.inf: tmp = t_1 / (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 * 100.0) + -100.0) t_2 = Float64(Float64(t_0 + -1.0) / Float64(i / n)) tmp = 0.0 if (t_2 <= -4e-103) tmp = Float64(n * Float64(t_1 / i)); elseif (t_2 <= 0.0) tmp = Float64(100.0 * Float64(n * Float64(expm1(Float64(n * log1p(Float64(i / n)))) / i))); elseif (t_2 <= Inf) tmp = Float64(t_1 / 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 * 100.0), $MachinePrecision] + -100.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-103], N[(n * N[(t$95$1 / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 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$2, Infinity], N[(t$95$1 / 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 := t\_0 \cdot 100 + -100\\
t_2 := \frac{t\_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-103}:\\
\;\;\;\;n \cdot \frac{t\_1}{i}\\
\mathbf{elif}\;t\_2 \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\_2 \leq \infty:\\
\;\;\;\;\frac{t\_1}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < -3.99999999999999983e-103Initial program 99.3%
associate-/r/99.2%
associate-*r*99.6%
*-commutative99.6%
associate-*r/99.7%
sub-neg99.7%
distribute-lft-in99.6%
metadata-eval99.6%
metadata-eval99.6%
metadata-eval99.6%
fma-define99.7%
metadata-eval99.7%
Simplified99.7%
fma-undefine99.6%
*-commutative99.6%
Applied egg-rr99.6%
if -3.99999999999999983e-103 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < 0.0Initial program 23.5%
associate-/r/23.5%
add-exp-log23.5%
expm1-define23.5%
log-pow35.9%
log1p-define99.5%
Applied egg-rr99.5%
if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < +inf.0Initial program 99.4%
associate-*r/99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) Initial program 0.0%
Taylor expanded in i around 0 72.5%
*-commutative72.5%
Simplified72.5%
Final simplification95.2%
(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 -4e-103)
(* n (/ (fma 100.0 t_0 -100.0) i))
(if (<= t_1 0.0)
(* 100.0 (* n (/ (expm1 (* n (log1p (/ i n)))) i)))
(if (<= t_1 INFINITY)
(/ (+ (* t_0 100.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 <= -4e-103) {
tmp = n * (fma(100.0, t_0, -100.0) / i);
} else if (t_1 <= 0.0) {
tmp = 100.0 * (n * (expm1((n * log1p((i / n)))) / i));
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((t_0 * 100.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 <= -4e-103) tmp = Float64(n * Float64(fma(100.0, t_0, -100.0) / i)); elseif (t_1 <= 0.0) tmp = Float64(100.0 * Float64(n * Float64(expm1(Float64(n * log1p(Float64(i / n)))) / i))); elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(t_0 * 100.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, -4e-103], N[(n * N[(N[(100.0 * t$95$0 + -100.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 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$1, Infinity], N[(N[(N[(t$95$0 * 100.0), $MachinePrecision] + -100.0), $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 -4 \cdot 10^{-103}:\\
\;\;\;\;n \cdot \frac{\mathsf{fma}\left(100, t\_0, -100\right)}{i}\\
\mathbf{elif}\;t\_1 \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\_1 \leq \infty:\\
\;\;\;\;\frac{t\_0 \cdot 100 + -100}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < -3.99999999999999983e-103Initial program 99.3%
associate-/r/99.2%
associate-*r*99.6%
*-commutative99.6%
associate-*r/99.7%
sub-neg99.7%
distribute-lft-in99.6%
metadata-eval99.6%
metadata-eval99.6%
metadata-eval99.6%
fma-define99.7%
metadata-eval99.7%
Simplified99.7%
if -3.99999999999999983e-103 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < 0.0Initial program 23.5%
associate-/r/23.5%
add-exp-log23.5%
expm1-define23.5%
log-pow35.9%
log1p-define99.5%
Applied egg-rr99.5%
if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < +inf.0Initial program 99.4%
associate-*r/99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) Initial program 0.0%
Taylor expanded in i around 0 72.5%
*-commutative72.5%
Simplified72.5%
Final simplification95.2%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* 100.0 (/ (expm1 i) (/ i n)))))
(if (<= i -3.6e-81)
t_0
(if (<= i 7e-36)
(* 100.0 (* n (+ 1.0 (+ (* (/ i n) -0.5) (* i 0.5)))))
(if (<= i 1.6e+221) t_0 0.0)))))
double code(double i, double n) {
double t_0 = 100.0 * (expm1(i) / (i / n));
double tmp;
if (i <= -3.6e-81) {
tmp = t_0;
} else if (i <= 7e-36) {
tmp = 100.0 * (n * (1.0 + (((i / n) * -0.5) + (i * 0.5))));
} else if (i <= 1.6e+221) {
tmp = t_0;
} else {
tmp = 0.0;
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = 100.0 * (Math.expm1(i) / (i / n));
double tmp;
if (i <= -3.6e-81) {
tmp = t_0;
} else if (i <= 7e-36) {
tmp = 100.0 * (n * (1.0 + (((i / n) * -0.5) + (i * 0.5))));
} else if (i <= 1.6e+221) {
tmp = t_0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(i, n): t_0 = 100.0 * (math.expm1(i) / (i / n)) tmp = 0 if i <= -3.6e-81: tmp = t_0 elif i <= 7e-36: tmp = 100.0 * (n * (1.0 + (((i / n) * -0.5) + (i * 0.5)))) elif i <= 1.6e+221: tmp = t_0 else: tmp = 0.0 return tmp
function code(i, n) t_0 = Float64(100.0 * Float64(expm1(i) / Float64(i / n))) tmp = 0.0 if (i <= -3.6e-81) tmp = t_0; elseif (i <= 7e-36) tmp = Float64(100.0 * Float64(n * Float64(1.0 + Float64(Float64(Float64(i / n) * -0.5) + Float64(i * 0.5))))); elseif (i <= 1.6e+221) tmp = t_0; else tmp = 0.0; end return tmp end
code[i_, n_] := Block[{t$95$0 = N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -3.6e-81], t$95$0, If[LessEqual[i, 7e-36], N[(100.0 * N[(n * N[(1.0 + N[(N[(N[(i / n), $MachinePrecision] * -0.5), $MachinePrecision] + N[(i * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.6e+221], t$95$0, 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\
\mathbf{if}\;i \leq -3.6 \cdot 10^{-81}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;i \leq 7 \cdot 10^{-36}:\\
\;\;\;\;100 \cdot \left(n \cdot \left(1 + \left(\frac{i}{n} \cdot -0.5 + i \cdot 0.5\right)\right)\right)\\
\mathbf{elif}\;i \leq 1.6 \cdot 10^{+221}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if i < -3.5999999999999999e-81 or 6.9999999999999999e-36 < i < 1.6e221Initial program 51.0%
Taylor expanded in n around inf 56.6%
expm1-define61.5%
Simplified61.5%
if -3.5999999999999999e-81 < i < 6.9999999999999999e-36Initial program 8.0%
Taylor expanded in i around 0 87.4%
associate-*r*86.8%
associate-*r/86.8%
metadata-eval86.8%
Simplified86.8%
Taylor expanded in n around inf 87.4%
if 1.6e221 < i Initial program 38.5%
associate-*r/38.5%
sub-neg38.5%
distribute-rgt-in38.5%
metadata-eval38.5%
metadata-eval38.5%
Simplified38.5%
Taylor expanded in i around 0 59.6%
Taylor expanded in i around 0 59.6%
Final simplification73.9%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* n (* 100.0 (/ (expm1 i) i)))))
(if (<= n -1.02e-194)
t_0
(if (<= n 5.9e-149)
0.0
(if (<= n 7.5e-25) (* 100.0 (/ i (/ i n))) t_0)))))
double code(double i, double n) {
double t_0 = n * (100.0 * (expm1(i) / i));
double tmp;
if (n <= -1.02e-194) {
tmp = t_0;
} else if (n <= 5.9e-149) {
tmp = 0.0;
} else if (n <= 7.5e-25) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = n * (100.0 * (Math.expm1(i) / i));
double tmp;
if (n <= -1.02e-194) {
tmp = t_0;
} else if (n <= 5.9e-149) {
tmp = 0.0;
} else if (n <= 7.5e-25) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = n * (100.0 * (math.expm1(i) / i)) tmp = 0 if n <= -1.02e-194: tmp = t_0 elif n <= 5.9e-149: tmp = 0.0 elif n <= 7.5e-25: tmp = 100.0 * (i / (i / n)) else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(n * Float64(100.0 * Float64(expm1(i) / i))) tmp = 0.0 if (n <= -1.02e-194) tmp = t_0; elseif (n <= 5.9e-149) tmp = 0.0; elseif (n <= 7.5e-25) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = t_0; end return tmp end
code[i_, n_] := Block[{t$95$0 = N[(n * N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.02e-194], t$95$0, If[LessEqual[n, 5.9e-149], 0.0, If[LessEqual[n, 7.5e-25], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\
\mathbf{if}\;n \leq -1.02 \cdot 10^{-194}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 5.9 \cdot 10^{-149}:\\
\;\;\;\;0\\
\mathbf{elif}\;n \leq 7.5 \cdot 10^{-25}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -1.02e-194 or 7.49999999999999989e-25 < n Initial program 26.3%
associate-/r/26.6%
associate-*r*26.7%
*-commutative26.7%
associate-*r/26.7%
sub-neg26.7%
distribute-lft-in26.7%
metadata-eval26.7%
metadata-eval26.7%
metadata-eval26.7%
fma-define26.7%
metadata-eval26.7%
Simplified26.7%
Taylor expanded in n around inf 33.4%
div-sub33.6%
associate-*r/33.7%
metadata-eval33.7%
associate-*r/33.6%
distribute-lft-out--33.6%
div-sub33.4%
*-commutative33.4%
expm1-define83.9%
Simplified83.9%
if -1.02e-194 < n < 5.9000000000000002e-149Initial program 52.1%
associate-*r/52.1%
sub-neg52.1%
distribute-rgt-in52.1%
metadata-eval52.1%
metadata-eval52.1%
Simplified52.1%
Taylor expanded in i around 0 69.1%
Taylor expanded in i around 0 69.1%
if 5.9000000000000002e-149 < n < 7.49999999999999989e-25Initial program 9.5%
Taylor expanded in i around 0 70.1%
Final simplification79.7%
(FPCore (i n)
:precision binary64
(if (<= n -2.4e-194)
(* n (* 100.0 (/ (expm1 i) i)))
(if (<= n 1.75e-145)
0.0
(if (<= n 1.95)
(* 100.0 (/ i (/ i n)))
(* n (/ (* 100.0 (expm1 i)) i))))))
double code(double i, double n) {
double tmp;
if (n <= -2.4e-194) {
tmp = n * (100.0 * (expm1(i) / i));
} else if (n <= 1.75e-145) {
tmp = 0.0;
} else if (n <= 1.95) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * ((100.0 * expm1(i)) / i);
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (n <= -2.4e-194) {
tmp = n * (100.0 * (Math.expm1(i) / i));
} else if (n <= 1.75e-145) {
tmp = 0.0;
} else if (n <= 1.95) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * ((100.0 * Math.expm1(i)) / i);
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -2.4e-194: tmp = n * (100.0 * (math.expm1(i) / i)) elif n <= 1.75e-145: tmp = 0.0 elif n <= 1.95: tmp = 100.0 * (i / (i / n)) else: tmp = n * ((100.0 * math.expm1(i)) / i) return tmp
function code(i, n) tmp = 0.0 if (n <= -2.4e-194) tmp = Float64(n * Float64(100.0 * Float64(expm1(i) / i))); elseif (n <= 1.75e-145) tmp = 0.0; elseif (n <= 1.95) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(n * Float64(Float64(100.0 * expm1(i)) / i)); end return tmp end
code[i_, n_] := If[LessEqual[n, -2.4e-194], N[(n * N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.75e-145], 0.0, If[LessEqual[n, 1.95], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(N[(100.0 * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.4 \cdot 10^{-194}:\\
\;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\
\mathbf{elif}\;n \leq 1.75 \cdot 10^{-145}:\\
\;\;\;\;0\\
\mathbf{elif}\;n \leq 1.95:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{i}\\
\end{array}
\end{array}
if n < -2.4e-194Initial program 30.1%
associate-/r/30.3%
associate-*r*30.3%
*-commutative30.3%
associate-*r/30.4%
sub-neg30.4%
distribute-lft-in30.3%
metadata-eval30.3%
metadata-eval30.3%
metadata-eval30.3%
fma-define30.4%
metadata-eval30.4%
Simplified30.4%
Taylor expanded in n around inf 32.6%
div-sub32.6%
associate-*r/32.5%
metadata-eval32.5%
associate-*r/32.5%
distribute-lft-out--32.5%
div-sub32.5%
*-commutative32.5%
expm1-define80.3%
Simplified80.3%
if -2.4e-194 < n < 1.74999999999999998e-145Initial program 52.1%
associate-*r/52.1%
sub-neg52.1%
distribute-rgt-in52.1%
metadata-eval52.1%
metadata-eval52.1%
Simplified52.1%
Taylor expanded in i around 0 69.1%
Taylor expanded in i around 0 69.1%
if 1.74999999999999998e-145 < n < 1.94999999999999996Initial program 9.1%
Taylor expanded in i around 0 72.1%
if 1.94999999999999996 < n Initial program 20.8%
associate-/r/21.2%
associate-*r*21.2%
*-commutative21.2%
associate-*r/21.2%
sub-neg21.2%
distribute-lft-in21.2%
metadata-eval21.2%
metadata-eval21.2%
metadata-eval21.2%
fma-define21.2%
metadata-eval21.2%
Simplified21.2%
Taylor expanded in n around inf 35.6%
sub-neg35.6%
metadata-eval35.6%
metadata-eval35.6%
distribute-lft-in35.7%
metadata-eval35.7%
sub-neg35.7%
expm1-define89.5%
Simplified89.5%
Final simplification79.7%
(FPCore (i n)
:precision binary64
(let* ((t_0
(*
100.0
(+
n
(*
i
(+
(* n 0.5)
(*
i
(+
(* 0.041666666666666664 (* i n))
(* n 0.16666666666666666)))))))))
(if (<= n -9.5e-194)
t_0
(if (<= n 1.65e-148)
0.0
(if (<= n 7.5e-25) (* 100.0 (/ i (/ i n))) t_0)))))
double code(double i, double n) {
double t_0 = 100.0 * (n + (i * ((n * 0.5) + (i * ((0.041666666666666664 * (i * n)) + (n * 0.16666666666666666))))));
double tmp;
if (n <= -9.5e-194) {
tmp = t_0;
} else if (n <= 1.65e-148) {
tmp = 0.0;
} else if (n <= 7.5e-25) {
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 + (i * ((n * 0.5d0) + (i * ((0.041666666666666664d0 * (i * n)) + (n * 0.16666666666666666d0))))))
if (n <= (-9.5d-194)) then
tmp = t_0
else if (n <= 1.65d-148) then
tmp = 0.0d0
else if (n <= 7.5d-25) 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 + (i * ((n * 0.5) + (i * ((0.041666666666666664 * (i * n)) + (n * 0.16666666666666666))))));
double tmp;
if (n <= -9.5e-194) {
tmp = t_0;
} else if (n <= 1.65e-148) {
tmp = 0.0;
} else if (n <= 7.5e-25) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = 100.0 * (n + (i * ((n * 0.5) + (i * ((0.041666666666666664 * (i * n)) + (n * 0.16666666666666666)))))) tmp = 0 if n <= -9.5e-194: tmp = t_0 elif n <= 1.65e-148: tmp = 0.0 elif n <= 7.5e-25: tmp = 100.0 * (i / (i / n)) else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(100.0 * Float64(n + Float64(i * Float64(Float64(n * 0.5) + Float64(i * Float64(Float64(0.041666666666666664 * Float64(i * n)) + Float64(n * 0.16666666666666666))))))) tmp = 0.0 if (n <= -9.5e-194) tmp = t_0; elseif (n <= 1.65e-148) tmp = 0.0; elseif (n <= 7.5e-25) 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 + (i * ((n * 0.5) + (i * ((0.041666666666666664 * (i * n)) + (n * 0.16666666666666666)))))); tmp = 0.0; if (n <= -9.5e-194) tmp = t_0; elseif (n <= 1.65e-148) tmp = 0.0; elseif (n <= 7.5e-25) 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[(i * N[(N[(n * 0.5), $MachinePrecision] + N[(i * N[(N[(0.041666666666666664 * N[(i * n), $MachinePrecision]), $MachinePrecision] + N[(n * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -9.5e-194], t$95$0, If[LessEqual[n, 1.65e-148], 0.0, If[LessEqual[n, 7.5e-25], 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 + i \cdot \left(n \cdot 0.5 + i \cdot \left(0.041666666666666664 \cdot \left(i \cdot n\right) + n \cdot 0.16666666666666666\right)\right)\right)\\
\mathbf{if}\;n \leq -9.5 \cdot 10^{-194}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 1.65 \cdot 10^{-148}:\\
\;\;\;\;0\\
\mathbf{elif}\;n \leq 7.5 \cdot 10^{-25}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -9.50000000000000009e-194 or 7.49999999999999989e-25 < n Initial program 26.3%
Taylor expanded in n around inf 33.0%
expm1-define69.0%
Simplified69.0%
Taylor expanded in i around 0 65.4%
if -9.50000000000000009e-194 < n < 1.64999999999999987e-148Initial program 52.1%
associate-*r/52.1%
sub-neg52.1%
distribute-rgt-in52.1%
metadata-eval52.1%
metadata-eval52.1%
Simplified52.1%
Taylor expanded in i around 0 69.1%
Taylor expanded in i around 0 69.1%
if 1.64999999999999987e-148 < n < 7.49999999999999989e-25Initial program 9.5%
Taylor expanded in i around 0 70.1%
Final simplification66.6%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* n (+ 100.0 (* i (+ 50.0 (* i 16.666666666666668)))))))
(if (<= n -5.5e-194)
t_0
(if (<= n 6e-149) 0.0 (if (<= n 7.5e-25) (* 100.0 (/ i (/ i n))) t_0)))))
double code(double i, double n) {
double t_0 = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
double tmp;
if (n <= -5.5e-194) {
tmp = t_0;
} else if (n <= 6e-149) {
tmp = 0.0;
} else if (n <= 7.5e-25) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = n * (100.0d0 + (i * (50.0d0 + (i * 16.666666666666668d0))))
if (n <= (-5.5d-194)) then
tmp = t_0
else if (n <= 6d-149) then
tmp = 0.0d0
else if (n <= 7.5d-25) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
double tmp;
if (n <= -5.5e-194) {
tmp = t_0;
} else if (n <= 6e-149) {
tmp = 0.0;
} else if (n <= 7.5e-25) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))) tmp = 0 if n <= -5.5e-194: tmp = t_0 elif n <= 6e-149: tmp = 0.0 elif n <= 7.5e-25: tmp = 100.0 * (i / (i / n)) else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * 16.666666666666668))))) tmp = 0.0 if (n <= -5.5e-194) tmp = t_0; elseif (n <= 6e-149) tmp = 0.0; elseif (n <= 7.5e-25) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = t_0; end return tmp end
function tmp_2 = code(i, n) t_0 = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))); tmp = 0.0; if (n <= -5.5e-194) tmp = t_0; elseif (n <= 6e-149) tmp = 0.0; elseif (n <= 7.5e-25) tmp = 100.0 * (i / (i / n)); else tmp = t_0; end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -5.5e-194], t$95$0, If[LessEqual[n, 6e-149], 0.0, If[LessEqual[n, 7.5e-25], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \left(100 + i \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\
\mathbf{if}\;n \leq -5.5 \cdot 10^{-194}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 6 \cdot 10^{-149}:\\
\;\;\;\;0\\
\mathbf{elif}\;n \leq 7.5 \cdot 10^{-25}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -5.49999999999999941e-194 or 7.49999999999999989e-25 < n Initial program 26.3%
Taylor expanded in n around inf 33.0%
expm1-define69.0%
Simplified69.0%
associate-*r/68.9%
Applied egg-rr68.9%
Taylor expanded in i around 0 47.1%
*-commutative47.1%
Simplified47.1%
Taylor expanded in n around 0 62.1%
if -5.49999999999999941e-194 < n < 6.0000000000000003e-149Initial program 52.1%
associate-*r/52.1%
sub-neg52.1%
distribute-rgt-in52.1%
metadata-eval52.1%
metadata-eval52.1%
Simplified52.1%
Taylor expanded in i around 0 69.1%
Taylor expanded in i around 0 69.1%
if 6.0000000000000003e-149 < n < 7.49999999999999989e-25Initial program 9.5%
Taylor expanded in i around 0 70.1%
Final simplification64.3%
(FPCore (i n)
:precision binary64
(if (<= n -5.5e-194)
(* n (+ 100.0 (* i (+ 50.0 (* i 16.666666666666668)))))
(if (<= n 5.9e-149)
0.0
(if (<= n 1.5)
(* 100.0 (/ i (/ i n)))
(* n (/ (* i (+ 100.0 (* i 50.0))) i))))))
double code(double i, double n) {
double tmp;
if (n <= -5.5e-194) {
tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
} else if (n <= 5.9e-149) {
tmp = 0.0;
} else if (n <= 1.5) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * ((i * (100.0 + (i * 50.0))) / i);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-5.5d-194)) then
tmp = n * (100.0d0 + (i * (50.0d0 + (i * 16.666666666666668d0))))
else if (n <= 5.9d-149) then
tmp = 0.0d0
else if (n <= 1.5d0) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = n * ((i * (100.0d0 + (i * 50.0d0))) / i)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -5.5e-194) {
tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
} else if (n <= 5.9e-149) {
tmp = 0.0;
} else if (n <= 1.5) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * ((i * (100.0 + (i * 50.0))) / i);
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -5.5e-194: tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))) elif n <= 5.9e-149: tmp = 0.0 elif n <= 1.5: tmp = 100.0 * (i / (i / n)) else: tmp = n * ((i * (100.0 + (i * 50.0))) / i) return tmp
function code(i, n) tmp = 0.0 if (n <= -5.5e-194) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * 16.666666666666668))))); elseif (n <= 5.9e-149) tmp = 0.0; elseif (n <= 1.5) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(n * Float64(Float64(i * Float64(100.0 + Float64(i * 50.0))) / i)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -5.5e-194) tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))); elseif (n <= 5.9e-149) tmp = 0.0; elseif (n <= 1.5) tmp = 100.0 * (i / (i / n)); else tmp = n * ((i * (100.0 + (i * 50.0))) / i); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -5.5e-194], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5.9e-149], 0.0, If[LessEqual[n, 1.5], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(N[(i * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -5.5 \cdot 10^{-194}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\
\mathbf{elif}\;n \leq 5.9 \cdot 10^{-149}:\\
\;\;\;\;0\\
\mathbf{elif}\;n \leq 1.5:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \frac{i \cdot \left(100 + i \cdot 50\right)}{i}\\
\end{array}
\end{array}
if n < -5.49999999999999941e-194Initial program 30.1%
Taylor expanded in n around inf 32.3%
expm1-define68.7%
Simplified68.7%
associate-*r/68.6%
Applied egg-rr68.6%
Taylor expanded in i around 0 45.7%
*-commutative45.7%
Simplified45.7%
Taylor expanded in n around 0 57.4%
if -5.49999999999999941e-194 < n < 5.9000000000000002e-149Initial program 52.1%
associate-*r/52.1%
sub-neg52.1%
distribute-rgt-in52.1%
metadata-eval52.1%
metadata-eval52.1%
Simplified52.1%
Taylor expanded in i around 0 69.1%
Taylor expanded in i around 0 69.1%
if 5.9000000000000002e-149 < n < 1.5Initial program 9.1%
Taylor expanded in i around 0 72.1%
if 1.5 < n Initial program 20.8%
associate-/r/21.2%
associate-*r*21.2%
*-commutative21.2%
associate-*r/21.2%
sub-neg21.2%
distribute-lft-in21.2%
metadata-eval21.2%
metadata-eval21.2%
metadata-eval21.2%
fma-define21.2%
metadata-eval21.2%
Simplified21.2%
Taylor expanded in i around 0 75.4%
*-commutative75.4%
associate-*r/75.4%
metadata-eval75.4%
Simplified75.4%
Taylor expanded in n around inf 75.4%
*-commutative75.4%
Simplified75.4%
Final simplification66.0%
(FPCore (i n)
:precision binary64
(if (<= n -3e-194)
(* 100.0 (+ n (* i (+ (* n 0.5) (* (* i n) 0.16666666666666666)))))
(if (<= n 4.4e-148)
0.0
(if (<= n 1.6)
(* 100.0 (/ i (/ i n)))
(* n (/ (* i (+ 100.0 (* i 50.0))) i))))))
double code(double i, double n) {
double tmp;
if (n <= -3e-194) {
tmp = 100.0 * (n + (i * ((n * 0.5) + ((i * n) * 0.16666666666666666))));
} else if (n <= 4.4e-148) {
tmp = 0.0;
} else if (n <= 1.6) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * ((i * (100.0 + (i * 50.0))) / i);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-3d-194)) then
tmp = 100.0d0 * (n + (i * ((n * 0.5d0) + ((i * n) * 0.16666666666666666d0))))
else if (n <= 4.4d-148) then
tmp = 0.0d0
else if (n <= 1.6d0) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = n * ((i * (100.0d0 + (i * 50.0d0))) / i)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -3e-194) {
tmp = 100.0 * (n + (i * ((n * 0.5) + ((i * n) * 0.16666666666666666))));
} else if (n <= 4.4e-148) {
tmp = 0.0;
} else if (n <= 1.6) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * ((i * (100.0 + (i * 50.0))) / i);
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -3e-194: tmp = 100.0 * (n + (i * ((n * 0.5) + ((i * n) * 0.16666666666666666)))) elif n <= 4.4e-148: tmp = 0.0 elif n <= 1.6: tmp = 100.0 * (i / (i / n)) else: tmp = n * ((i * (100.0 + (i * 50.0))) / i) return tmp
function code(i, n) tmp = 0.0 if (n <= -3e-194) tmp = Float64(100.0 * Float64(n + Float64(i * Float64(Float64(n * 0.5) + Float64(Float64(i * n) * 0.16666666666666666))))); elseif (n <= 4.4e-148) tmp = 0.0; elseif (n <= 1.6) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(n * Float64(Float64(i * Float64(100.0 + Float64(i * 50.0))) / i)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -3e-194) tmp = 100.0 * (n + (i * ((n * 0.5) + ((i * n) * 0.16666666666666666)))); elseif (n <= 4.4e-148) tmp = 0.0; elseif (n <= 1.6) tmp = 100.0 * (i / (i / n)); else tmp = n * ((i * (100.0 + (i * 50.0))) / i); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -3e-194], N[(100.0 * N[(n + N[(i * N[(N[(n * 0.5), $MachinePrecision] + N[(N[(i * n), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 4.4e-148], 0.0, If[LessEqual[n, 1.6], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(N[(i * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -3 \cdot 10^{-194}:\\
\;\;\;\;100 \cdot \left(n + i \cdot \left(n \cdot 0.5 + \left(i \cdot n\right) \cdot 0.16666666666666666\right)\right)\\
\mathbf{elif}\;n \leq 4.4 \cdot 10^{-148}:\\
\;\;\;\;0\\
\mathbf{elif}\;n \leq 1.6:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \frac{i \cdot \left(100 + i \cdot 50\right)}{i}\\
\end{array}
\end{array}
if n < -3e-194Initial program 30.1%
Taylor expanded in n around inf 32.3%
expm1-define68.7%
Simplified68.7%
Taylor expanded in i around 0 57.4%
if -3e-194 < n < 4.40000000000000034e-148Initial program 52.1%
associate-*r/52.1%
sub-neg52.1%
distribute-rgt-in52.1%
metadata-eval52.1%
metadata-eval52.1%
Simplified52.1%
Taylor expanded in i around 0 69.1%
Taylor expanded in i around 0 69.1%
if 4.40000000000000034e-148 < n < 1.6000000000000001Initial program 9.1%
Taylor expanded in i around 0 72.1%
if 1.6000000000000001 < n Initial program 20.8%
associate-/r/21.2%
associate-*r*21.2%
*-commutative21.2%
associate-*r/21.2%
sub-neg21.2%
distribute-lft-in21.2%
metadata-eval21.2%
metadata-eval21.2%
metadata-eval21.2%
fma-define21.2%
metadata-eval21.2%
Simplified21.2%
Taylor expanded in i around 0 75.4%
*-commutative75.4%
associate-*r/75.4%
metadata-eval75.4%
Simplified75.4%
Taylor expanded in n around inf 75.4%
*-commutative75.4%
Simplified75.4%
Final simplification66.0%
(FPCore (i n) :precision binary64 (if (<= n -2e-194) (* n (+ 100.0 (* i 50.0))) (if (<= n 1.28e-126) 0.0 (* 100.0 (+ n (* 0.5 (* i n)))))))
double code(double i, double n) {
double tmp;
if (n <= -2e-194) {
tmp = n * (100.0 + (i * 50.0));
} else if (n <= 1.28e-126) {
tmp = 0.0;
} else {
tmp = 100.0 * (n + (0.5 * (i * n)));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-2d-194)) then
tmp = n * (100.0d0 + (i * 50.0d0))
else if (n <= 1.28d-126) then
tmp = 0.0d0
else
tmp = 100.0d0 * (n + (0.5d0 * (i * n)))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -2e-194) {
tmp = n * (100.0 + (i * 50.0));
} else if (n <= 1.28e-126) {
tmp = 0.0;
} else {
tmp = 100.0 * (n + (0.5 * (i * n)));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -2e-194: tmp = n * (100.0 + (i * 50.0)) elif n <= 1.28e-126: tmp = 0.0 else: tmp = 100.0 * (n + (0.5 * (i * n))) return tmp
function code(i, n) tmp = 0.0 if (n <= -2e-194) tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); elseif (n <= 1.28e-126) tmp = 0.0; else tmp = Float64(100.0 * Float64(n + Float64(0.5 * Float64(i * n)))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -2e-194) tmp = n * (100.0 + (i * 50.0)); elseif (n <= 1.28e-126) tmp = 0.0; else tmp = 100.0 * (n + (0.5 * (i * n))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -2e-194], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.28e-126], 0.0, N[(100.0 * N[(n + N[(0.5 * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2 \cdot 10^{-194}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{elif}\;n \leq 1.28 \cdot 10^{-126}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n + 0.5 \cdot \left(i \cdot n\right)\right)\\
\end{array}
\end{array}
if n < -2.00000000000000004e-194Initial program 30.1%
associate-/r/30.3%
associate-*r*30.3%
*-commutative30.3%
associate-*r/30.4%
sub-neg30.4%
distribute-lft-in30.3%
metadata-eval30.3%
metadata-eval30.3%
metadata-eval30.3%
fma-define30.4%
metadata-eval30.4%
Simplified30.4%
Taylor expanded in i around 0 55.8%
*-commutative55.8%
associate-*r/55.8%
metadata-eval55.8%
Simplified55.8%
Taylor expanded in n around inf 55.8%
*-commutative55.8%
Simplified55.8%
if -2.00000000000000004e-194 < n < 1.28000000000000007e-126Initial program 50.1%
associate-*r/50.1%
sub-neg50.1%
distribute-rgt-in50.1%
metadata-eval50.1%
metadata-eval50.1%
Simplified50.1%
Taylor expanded in i around 0 67.8%
Taylor expanded in i around 0 67.8%
if 1.28000000000000007e-126 < n Initial program 16.8%
Taylor expanded in i around 0 66.1%
associate-*r*66.1%
associate-*r/66.1%
metadata-eval66.1%
Simplified66.1%
Taylor expanded in n around inf 66.2%
Final simplification62.0%
(FPCore (i n) :precision binary64 (if (or (<= n -5.2e-194) (not (<= n 1.02e-126))) (* n (+ 100.0 (* i 50.0))) 0.0))
double code(double i, double n) {
double tmp;
if ((n <= -5.2e-194) || !(n <= 1.02e-126)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-5.2d-194)) .or. (.not. (n <= 1.02d-126))) then
tmp = n * (100.0d0 + (i * 50.0d0))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -5.2e-194) || !(n <= 1.02e-126)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 0.0;
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -5.2e-194) or not (n <= 1.02e-126): tmp = n * (100.0 + (i * 50.0)) else: tmp = 0.0 return tmp
function code(i, n) tmp = 0.0 if ((n <= -5.2e-194) || !(n <= 1.02e-126)) tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); else tmp = 0.0; end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -5.2e-194) || ~((n <= 1.02e-126))) tmp = n * (100.0 + (i * 50.0)); else tmp = 0.0; end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -5.2e-194], N[Not[LessEqual[n, 1.02e-126]], $MachinePrecision]], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -5.2 \cdot 10^{-194} \lor \neg \left(n \leq 1.02 \cdot 10^{-126}\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if n < -5.20000000000000003e-194 or 1.02000000000000004e-126 < n Initial program 24.0%
associate-/r/24.3%
associate-*r*24.3%
*-commutative24.3%
associate-*r/24.4%
sub-neg24.4%
distribute-lft-in24.3%
metadata-eval24.3%
metadata-eval24.3%
metadata-eval24.3%
fma-define24.4%
metadata-eval24.4%
Simplified24.4%
Taylor expanded in i around 0 62.6%
*-commutative62.6%
associate-*r/62.6%
metadata-eval62.6%
Simplified62.6%
Taylor expanded in n around inf 60.6%
*-commutative60.6%
Simplified60.6%
if -5.20000000000000003e-194 < n < 1.02000000000000004e-126Initial program 50.1%
associate-*r/50.1%
sub-neg50.1%
distribute-rgt-in50.1%
metadata-eval50.1%
metadata-eval50.1%
Simplified50.1%
Taylor expanded in i around 0 67.8%
Taylor expanded in i around 0 67.8%
Final simplification62.0%
(FPCore (i n) :precision binary64 (if (<= i -2.35e-28) 0.0 (if (<= i 5e+31) (* 100.0 (+ n (* i -0.5))) 0.0)))
double code(double i, double n) {
double tmp;
if (i <= -2.35e-28) {
tmp = 0.0;
} else if (i <= 5e+31) {
tmp = 100.0 * (n + (i * -0.5));
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (i <= (-2.35d-28)) then
tmp = 0.0d0
else if (i <= 5d+31) then
tmp = 100.0d0 * (n + (i * (-0.5d0)))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (i <= -2.35e-28) {
tmp = 0.0;
} else if (i <= 5e+31) {
tmp = 100.0 * (n + (i * -0.5));
} else {
tmp = 0.0;
}
return tmp;
}
def code(i, n): tmp = 0 if i <= -2.35e-28: tmp = 0.0 elif i <= 5e+31: tmp = 100.0 * (n + (i * -0.5)) else: tmp = 0.0 return tmp
function code(i, n) tmp = 0.0 if (i <= -2.35e-28) tmp = 0.0; elseif (i <= 5e+31) tmp = Float64(100.0 * Float64(n + Float64(i * -0.5))); else tmp = 0.0; end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (i <= -2.35e-28) tmp = 0.0; elseif (i <= 5e+31) tmp = 100.0 * (n + (i * -0.5)); else tmp = 0.0; end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, -2.35e-28], 0.0, If[LessEqual[i, 5e+31], N[(100.0 * N[(n + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.35 \cdot 10^{-28}:\\
\;\;\;\;0\\
\mathbf{elif}\;i \leq 5 \cdot 10^{+31}:\\
\;\;\;\;100 \cdot \left(n + i \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if i < -2.3499999999999998e-28 or 5.00000000000000027e31 < i Initial program 55.0%
associate-*r/55.1%
sub-neg55.1%
distribute-rgt-in55.1%
metadata-eval55.1%
metadata-eval55.1%
Simplified55.1%
Taylor expanded in i around 0 33.2%
Taylor expanded in i around 0 33.2%
if -2.3499999999999998e-28 < i < 5.00000000000000027e31Initial program 9.8%
Taylor expanded in i around 0 82.3%
associate-*r*81.8%
associate-*r/81.8%
metadata-eval81.8%
Simplified81.8%
Taylor expanded in n around 0 81.5%
*-commutative81.5%
Simplified81.5%
Final simplification60.7%
(FPCore (i n) :precision binary64 (if (<= i -2.35e-28) 0.0 (if (<= i 1.05e+33) (* n 100.0) 0.0)))
double code(double i, double n) {
double tmp;
if (i <= -2.35e-28) {
tmp = 0.0;
} else if (i <= 1.05e+33) {
tmp = n * 100.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (i <= (-2.35d-28)) then
tmp = 0.0d0
else if (i <= 1.05d+33) then
tmp = n * 100.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (i <= -2.35e-28) {
tmp = 0.0;
} else if (i <= 1.05e+33) {
tmp = n * 100.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(i, n): tmp = 0 if i <= -2.35e-28: tmp = 0.0 elif i <= 1.05e+33: tmp = n * 100.0 else: tmp = 0.0 return tmp
function code(i, n) tmp = 0.0 if (i <= -2.35e-28) tmp = 0.0; elseif (i <= 1.05e+33) tmp = Float64(n * 100.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (i <= -2.35e-28) tmp = 0.0; elseif (i <= 1.05e+33) tmp = n * 100.0; else tmp = 0.0; end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, -2.35e-28], 0.0, If[LessEqual[i, 1.05e+33], N[(n * 100.0), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.35 \cdot 10^{-28}:\\
\;\;\;\;0\\
\mathbf{elif}\;i \leq 1.05 \cdot 10^{+33}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if i < -2.3499999999999998e-28 or 1.05e33 < i Initial program 55.0%
associate-*r/55.1%
sub-neg55.1%
distribute-rgt-in55.1%
metadata-eval55.1%
metadata-eval55.1%
Simplified55.1%
Taylor expanded in i around 0 33.2%
Taylor expanded in i around 0 33.2%
if -2.3499999999999998e-28 < i < 1.05e33Initial program 9.8%
Taylor expanded in i around 0 81.1%
*-commutative81.1%
Simplified81.1%
Final simplification60.5%
(FPCore (i n) :precision binary64 0.0)
double code(double i, double n) {
return 0.0;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = 0.0d0
end function
public static double code(double i, double n) {
return 0.0;
}
def code(i, n): return 0.0
function code(i, n) return 0.0 end
function tmp = code(i, n) tmp = 0.0; end
code[i_, n_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 29.2%
associate-*r/29.3%
sub-neg29.3%
distribute-rgt-in29.3%
metadata-eval29.3%
metadata-eval29.3%
Simplified29.3%
Taylor expanded in i around 0 19.5%
Taylor expanded in i around 0 19.7%
Final simplification19.7%
(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 2024078
(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))))