
(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 19 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 -4e-6)
(* 100.0 (/ (- (* n t_0) n) i))
(if (<= t_1 0.0)
(/ (* 100.0 (expm1 (* n (log1p (/ i n))))) (/ i n))
(if (<= t_1 INFINITY)
(* t_1 100.0)
(* 100.0 (/ 1.0 (+ (* (/ i n) -0.5) (/ 1.0 n)))))))))
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-6) {
tmp = 100.0 * (((n * t_0) - n) / i);
} else if (t_1 <= 0.0) {
tmp = (100.0 * expm1((n * log1p((i / n))))) / (i / n);
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1 * 100.0;
} else {
tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n)));
}
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 <= -4e-6) {
tmp = 100.0 * (((n * t_0) - n) / i);
} 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_1 * 100.0;
} else {
tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n)));
}
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 <= -4e-6: tmp = 100.0 * (((n * t_0) - n) / i) elif t_1 <= 0.0: tmp = (100.0 * math.expm1((n * math.log1p((i / n))))) / (i / n) elif t_1 <= math.inf: tmp = t_1 * 100.0 else: tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n))) 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-6) tmp = Float64(100.0 * Float64(Float64(Float64(n * t_0) - n) / i)); 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(t_1 * 100.0); else tmp = Float64(100.0 * Float64(1.0 / Float64(Float64(Float64(i / n) * -0.5) + Float64(1.0 / n)))); 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-6], N[(100.0 * N[(N[(N[(n * t$95$0), $MachinePrecision] - n), $MachinePrecision] / i), $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[(t$95$1 * 100.0), $MachinePrecision], N[(100.0 * N[(1.0 / N[(N[(N[(i / n), $MachinePrecision] * -0.5), $MachinePrecision] + N[(1.0 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{-6}:\\
\;\;\;\;100 \cdot \frac{n \cdot t_0 - n}{i}\\
\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:\\
\;\;\;\;t_1 \cdot 100\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{i}{n} \cdot -0.5 + \frac{1}{n}}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -3.99999999999999982e-6Initial program 99.8%
div-sub99.8%
clear-num100.0%
sub-neg100.0%
div-inv100.0%
clear-num100.0%
Applied egg-rr100.0%
sub-neg100.0%
Simplified100.0%
associate-*r/100.0%
sub-div100.0%
+-commutative100.0%
Applied egg-rr100.0%
if -3.99999999999999982e-6 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -0.0Initial program 26.3%
associate-*r/26.3%
*-commutative26.3%
add-exp-log26.3%
expm1-def26.3%
log-pow34.8%
log1p-udef99.6%
Applied egg-rr99.6%
if -0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 100.0%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
Taylor expanded in n around inf 0.0%
expm1-def9.1%
Simplified9.1%
clear-num9.1%
inv-pow9.1%
Applied egg-rr9.1%
unpow-19.1%
associate-/l/65.4%
*-commutative65.4%
Simplified65.4%
Taylor expanded in i around 0 99.9%
Final simplification99.7%
(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))
(* 100.0 (/ (- (* n t_0) n) i))
(if (<= t_1 0.0)
(* 100.0 (/ n (/ i (expm1 i))))
(if (<= t_1 INFINITY)
(* t_1 100.0)
(* 100.0 (/ 1.0 (+ (* (/ i n) -0.5) (/ 1.0 n)))))))))
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 = 100.0 * (((n * t_0) - n) / i);
} else if (t_1 <= 0.0) {
tmp = 100.0 * (n / (i / expm1(i)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1 * 100.0;
} else {
tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n)));
}
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 = 100.0 * (((n * t_0) - n) / i);
} else if (t_1 <= 0.0) {
tmp = 100.0 * (n / (i / Math.expm1(i)));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1 * 100.0;
} else {
tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n)));
}
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 = 100.0 * (((n * t_0) - n) / i) elif t_1 <= 0.0: tmp = 100.0 * (n / (i / math.expm1(i))) elif t_1 <= math.inf: tmp = t_1 * 100.0 else: tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n))) 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(100.0 * Float64(Float64(Float64(n * t_0) - n) / i)); elseif (t_1 <= 0.0) tmp = Float64(100.0 * Float64(n / Float64(i / expm1(i)))); elseif (t_1 <= Inf) tmp = Float64(t_1 * 100.0); else tmp = Float64(100.0 * Float64(1.0 / Float64(Float64(Float64(i / n) * -0.5) + Float64(1.0 / n)))); 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[(100.0 * N[(N[(N[(n * t$95$0), $MachinePrecision] - n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(100.0 * N[(n / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(t$95$1 * 100.0), $MachinePrecision], N[(100.0 * N[(1.0 / N[(N[(N[(i / n), $MachinePrecision] * -0.5), $MachinePrecision] + N[(1.0 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;100 \cdot \frac{n \cdot t_0 - n}{i}\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_1 \cdot 100\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{i}{n} \cdot -0.5 + \frac{1}{n}}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -inf.0Initial program 100.0%
div-sub100.0%
clear-num100.0%
sub-neg100.0%
div-inv100.0%
clear-num100.0%
Applied egg-rr100.0%
sub-neg100.0%
Simplified100.0%
associate-*r/100.0%
sub-div100.0%
+-commutative100.0%
Applied egg-rr100.0%
if -inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -0.0Initial program 27.1%
Taylor expanded in n around inf 47.2%
*-commutative47.2%
associate-/l*47.2%
expm1-def82.2%
Simplified82.2%
if -0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 100.0%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
Taylor expanded in n around inf 0.0%
expm1-def9.1%
Simplified9.1%
clear-num9.1%
inv-pow9.1%
Applied egg-rr9.1%
unpow-19.1%
associate-/l/65.4%
*-commutative65.4%
Simplified65.4%
Taylor expanded in i around 0 99.9%
Final simplification87.7%
(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))
(* 100.0 (/ (- (* n t_0) n) i))
(if (<= t_1 0.0)
(* 100.0 (* n (/ (expm1 (* n (log1p (/ i n)))) i)))
(if (<= t_1 INFINITY)
(* t_1 100.0)
(* 100.0 (/ 1.0 (+ (* (/ i n) -0.5) (/ 1.0 n)))))))))
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 = 100.0 * (((n * t_0) - n) / 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_1 * 100.0;
} else {
tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n)));
}
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 = 100.0 * (((n * t_0) - n) / i);
} else if (t_1 <= 0.0) {
tmp = 100.0 * (n * (Math.expm1((n * Math.log1p((i / n)))) / i));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1 * 100.0;
} else {
tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n)));
}
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 = 100.0 * (((n * t_0) - n) / i) elif t_1 <= 0.0: tmp = 100.0 * (n * (math.expm1((n * math.log1p((i / n)))) / i)) elif t_1 <= math.inf: tmp = t_1 * 100.0 else: tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n))) 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(100.0 * Float64(Float64(Float64(n * t_0) - n) / 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(t_1 * 100.0); else tmp = Float64(100.0 * Float64(1.0 / Float64(Float64(Float64(i / n) * -0.5) + Float64(1.0 / n)))); 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[(100.0 * N[(N[(N[(n * t$95$0), $MachinePrecision] - n), $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[(t$95$1 * 100.0), $MachinePrecision], N[(100.0 * N[(1.0 / N[(N[(N[(i / n), $MachinePrecision] * -0.5), $MachinePrecision] + N[(1.0 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;100 \cdot \frac{n \cdot t_0 - n}{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:\\
\;\;\;\;t_1 \cdot 100\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{i}{n} \cdot -0.5 + \frac{1}{n}}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -inf.0Initial program 100.0%
div-sub100.0%
clear-num100.0%
sub-neg100.0%
div-inv100.0%
clear-num100.0%
Applied egg-rr100.0%
sub-neg100.0%
Simplified100.0%
associate-*r/100.0%
sub-div100.0%
+-commutative100.0%
Applied egg-rr100.0%
if -inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -0.0Initial program 27.1%
associate-/r/27.1%
add-exp-log27.1%
expm1-def27.1%
log-pow35.5%
log1p-udef98.4%
Applied egg-rr98.4%
if -0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 100.0%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
Taylor expanded in n around inf 0.0%
expm1-def9.1%
Simplified9.1%
clear-num9.1%
inv-pow9.1%
Applied egg-rr9.1%
unpow-19.1%
associate-/l/65.4%
*-commutative65.4%
Simplified65.4%
Taylor expanded in i around 0 99.9%
Final simplification98.9%
(FPCore (i n)
:precision binary64
(let* ((t_0 (pow (+ 1.0 (/ i n)) n)) (t_1 (/ (+ t_0 -1.0) (/ i n))))
(if (<= t_1 -4e-6)
(* 100.0 (/ (- (* n t_0) n) i))
(if (<= t_1 0.0)
(* n (/ (* 100.0 (expm1 (* n (log1p (/ i n))))) i))
(if (<= t_1 INFINITY)
(* t_1 100.0)
(* 100.0 (/ 1.0 (+ (* (/ i n) -0.5) (/ 1.0 n)))))))))
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-6) {
tmp = 100.0 * (((n * t_0) - n) / i);
} else if (t_1 <= 0.0) {
tmp = n * ((100.0 * expm1((n * log1p((i / n))))) / i);
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1 * 100.0;
} else {
tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n)));
}
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 <= -4e-6) {
tmp = 100.0 * (((n * t_0) - n) / i);
} else if (t_1 <= 0.0) {
tmp = n * ((100.0 * Math.expm1((n * Math.log1p((i / n))))) / i);
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1 * 100.0;
} else {
tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n)));
}
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 <= -4e-6: tmp = 100.0 * (((n * t_0) - n) / i) elif t_1 <= 0.0: tmp = n * ((100.0 * math.expm1((n * math.log1p((i / n))))) / i) elif t_1 <= math.inf: tmp = t_1 * 100.0 else: tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n))) 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-6) tmp = Float64(100.0 * Float64(Float64(Float64(n * t_0) - n) / i)); elseif (t_1 <= 0.0) tmp = Float64(n * Float64(Float64(100.0 * expm1(Float64(n * log1p(Float64(i / n))))) / i)); elseif (t_1 <= Inf) tmp = Float64(t_1 * 100.0); else tmp = Float64(100.0 * Float64(1.0 / Float64(Float64(Float64(i / n) * -0.5) + Float64(1.0 / n)))); 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-6], N[(100.0 * N[(N[(N[(n * t$95$0), $MachinePrecision] - n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(n * N[(N[(100.0 * N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(t$95$1 * 100.0), $MachinePrecision], N[(100.0 * N[(1.0 / N[(N[(N[(i / n), $MachinePrecision] * -0.5), $MachinePrecision] + N[(1.0 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{-6}:\\
\;\;\;\;100 \cdot \frac{n \cdot t_0 - n}{i}\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{i}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_1 \cdot 100\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{i}{n} \cdot -0.5 + \frac{1}{n}}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -3.99999999999999982e-6Initial program 99.8%
div-sub99.8%
clear-num100.0%
sub-neg100.0%
div-inv100.0%
clear-num100.0%
Applied egg-rr100.0%
sub-neg100.0%
Simplified100.0%
associate-*r/100.0%
sub-div100.0%
+-commutative100.0%
Applied egg-rr100.0%
if -3.99999999999999982e-6 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -0.0Initial program 26.3%
associate-/r/26.3%
associate-*r*26.2%
*-commutative26.2%
associate-*r/26.2%
sub-neg26.2%
distribute-lft-in26.2%
metadata-eval26.2%
metadata-eval26.2%
metadata-eval26.2%
fma-def26.2%
metadata-eval26.2%
Simplified26.2%
fma-udef26.2%
metadata-eval26.2%
metadata-eval26.2%
distribute-lft-in26.2%
sub-neg26.2%
*-commutative26.2%
add-exp-log26.2%
expm1-def26.2%
log-pow34.8%
log1p-udef98.4%
Applied egg-rr98.4%
if -0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 100.0%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
Taylor expanded in n around inf 0.0%
expm1-def9.1%
Simplified9.1%
clear-num9.1%
inv-pow9.1%
Applied egg-rr9.1%
unpow-19.1%
associate-/l/65.4%
*-commutative65.4%
Simplified65.4%
Taylor expanded in i around 0 99.9%
Final simplification98.9%
(FPCore (i n)
:precision binary64
(if (<= n -2.8e-235)
(* 100.0 (* n (/ (expm1 i) i)))
(if (<= n 0.98)
(/
(* (pow n 2.0) 10000.0)
(- (* n 100.0) (* 100.0 (* (* i n) (+ 0.5 (/ -0.5 n))))))
(* 100.0 (/ n (/ i (expm1 i)))))))
double code(double i, double n) {
double tmp;
if (n <= -2.8e-235) {
tmp = 100.0 * (n * (expm1(i) / i));
} else if (n <= 0.98) {
tmp = (pow(n, 2.0) * 10000.0) / ((n * 100.0) - (100.0 * ((i * n) * (0.5 + (-0.5 / n)))));
} else {
tmp = 100.0 * (n / (i / expm1(i)));
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (n <= -2.8e-235) {
tmp = 100.0 * (n * (Math.expm1(i) / i));
} else if (n <= 0.98) {
tmp = (Math.pow(n, 2.0) * 10000.0) / ((n * 100.0) - (100.0 * ((i * n) * (0.5 + (-0.5 / n)))));
} else {
tmp = 100.0 * (n / (i / Math.expm1(i)));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -2.8e-235: tmp = 100.0 * (n * (math.expm1(i) / i)) elif n <= 0.98: tmp = (math.pow(n, 2.0) * 10000.0) / ((n * 100.0) - (100.0 * ((i * n) * (0.5 + (-0.5 / n))))) else: tmp = 100.0 * (n / (i / math.expm1(i))) return tmp
function code(i, n) tmp = 0.0 if (n <= -2.8e-235) tmp = Float64(100.0 * Float64(n * Float64(expm1(i) / i))); elseif (n <= 0.98) tmp = Float64(Float64((n ^ 2.0) * 10000.0) / Float64(Float64(n * 100.0) - Float64(100.0 * Float64(Float64(i * n) * Float64(0.5 + Float64(-0.5 / n)))))); else tmp = Float64(100.0 * Float64(n / Float64(i / expm1(i)))); end return tmp end
code[i_, n_] := If[LessEqual[n, -2.8e-235], N[(100.0 * N[(n * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 0.98], N[(N[(N[Power[n, 2.0], $MachinePrecision] * 10000.0), $MachinePrecision] / N[(N[(n * 100.0), $MachinePrecision] - N[(100.0 * N[(N[(i * n), $MachinePrecision] * N[(0.5 + N[(-0.5 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.8 \cdot 10^{-235}:\\
\;\;\;\;100 \cdot \left(n \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\
\mathbf{elif}\;n \leq 0.98:\\
\;\;\;\;\frac{{n}^{2} \cdot 10000}{n \cdot 100 - 100 \cdot \left(\left(i \cdot n\right) \cdot \left(0.5 + \frac{-0.5}{n}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\end{array}
\end{array}
if n < -2.79999999999999995e-235Initial program 28.4%
Taylor expanded in n around inf 36.2%
expm1-def70.8%
Simplified70.8%
associate-/r/83.9%
Applied egg-rr83.9%
if -2.79999999999999995e-235 < n < 0.97999999999999998Initial program 39.7%
Taylor expanded in i around 0 28.0%
associate-*r*29.0%
associate-*r/29.0%
metadata-eval29.0%
Simplified29.0%
distribute-lft-in29.0%
flip-+42.5%
Applied egg-rr42.5%
Simplified45.2%
Taylor expanded in i around 0 87.7%
*-commutative87.7%
Simplified87.7%
if 0.97999999999999998 < n Initial program 30.2%
Taylor expanded in n around inf 48.9%
*-commutative48.9%
associate-/l*48.9%
expm1-def93.4%
Simplified93.4%
Final simplification88.2%
(FPCore (i n)
:precision binary64
(if (<= n -2.6e-239)
(* 100.0 (* n (/ (expm1 i) i)))
(if (<= n 3.8e-210)
0.0
(if (<= n 7000000000.0)
(* 100.0 (/ i (/ i n)))
(if (<= n 5.8e+29)
(* 100.0 (/ (- (* n (pow (+ 1.0 (/ i n)) n)) n) i))
(* 100.0 (/ n (/ i (expm1 i)))))))))
double code(double i, double n) {
double tmp;
if (n <= -2.6e-239) {
tmp = 100.0 * (n * (expm1(i) / i));
} else if (n <= 3.8e-210) {
tmp = 0.0;
} else if (n <= 7000000000.0) {
tmp = 100.0 * (i / (i / n));
} else if (n <= 5.8e+29) {
tmp = 100.0 * (((n * pow((1.0 + (i / n)), n)) - n) / i);
} else {
tmp = 100.0 * (n / (i / expm1(i)));
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (n <= -2.6e-239) {
tmp = 100.0 * (n * (Math.expm1(i) / i));
} else if (n <= 3.8e-210) {
tmp = 0.0;
} else if (n <= 7000000000.0) {
tmp = 100.0 * (i / (i / n));
} else if (n <= 5.8e+29) {
tmp = 100.0 * (((n * Math.pow((1.0 + (i / n)), n)) - n) / i);
} else {
tmp = 100.0 * (n / (i / Math.expm1(i)));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -2.6e-239: tmp = 100.0 * (n * (math.expm1(i) / i)) elif n <= 3.8e-210: tmp = 0.0 elif n <= 7000000000.0: tmp = 100.0 * (i / (i / n)) elif n <= 5.8e+29: tmp = 100.0 * (((n * math.pow((1.0 + (i / n)), n)) - n) / i) else: tmp = 100.0 * (n / (i / math.expm1(i))) return tmp
function code(i, n) tmp = 0.0 if (n <= -2.6e-239) tmp = Float64(100.0 * Float64(n * Float64(expm1(i) / i))); elseif (n <= 3.8e-210) tmp = 0.0; elseif (n <= 7000000000.0) tmp = Float64(100.0 * Float64(i / Float64(i / n))); elseif (n <= 5.8e+29) tmp = Float64(100.0 * Float64(Float64(Float64(n * (Float64(1.0 + Float64(i / n)) ^ n)) - n) / i)); else tmp = Float64(100.0 * Float64(n / Float64(i / expm1(i)))); end return tmp end
code[i_, n_] := If[LessEqual[n, -2.6e-239], N[(100.0 * N[(n * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 3.8e-210], 0.0, If[LessEqual[n, 7000000000.0], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5.8e+29], N[(100.0 * N[(N[(N[(n * N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]), $MachinePrecision] - n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.6 \cdot 10^{-239}:\\
\;\;\;\;100 \cdot \left(n \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\
\mathbf{elif}\;n \leq 3.8 \cdot 10^{-210}:\\
\;\;\;\;0\\
\mathbf{elif}\;n \leq 7000000000:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 5.8 \cdot 10^{+29}:\\
\;\;\;\;100 \cdot \frac{n \cdot {\left(1 + \frac{i}{n}\right)}^{n} - n}{i}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\end{array}
\end{array}
if n < -2.60000000000000003e-239Initial program 28.4%
Taylor expanded in n around inf 36.2%
expm1-def70.8%
Simplified70.8%
associate-/r/83.9%
Applied egg-rr83.9%
if -2.60000000000000003e-239 < n < 3.80000000000000003e-210Initial program 69.0%
Taylor expanded in i around 0 94.8%
Taylor expanded in i around 0 94.8%
if 3.80000000000000003e-210 < n < 7e9Initial program 6.3%
Taylor expanded in i around 0 79.9%
if 7e9 < n < 5.7999999999999999e29Initial program 78.4%
div-sub78.4%
clear-num78.4%
sub-neg78.4%
div-inv78.4%
clear-num78.4%
Applied egg-rr78.4%
sub-neg78.4%
Simplified78.4%
associate-*r/78.4%
sub-div78.4%
+-commutative78.4%
Applied egg-rr78.4%
if 5.7999999999999999e29 < n Initial program 25.3%
Taylor expanded in n around inf 50.4%
*-commutative50.4%
associate-/l*50.4%
expm1-def96.2%
Simplified96.2%
Final simplification88.5%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* 100.0 (* (expm1 i) (/ n i)))))
(if (<= i -2.2e-8)
t_0
(if (<= i 2.5e-175)
(* 100.0 (+ n (* (* i n) (- 0.5 (/ 0.5 n)))))
(if (<= i 0.0012) (/ 100.0 (/ i (* i n))) t_0)))))
double code(double i, double n) {
double t_0 = 100.0 * (expm1(i) * (n / i));
double tmp;
if (i <= -2.2e-8) {
tmp = t_0;
} else if (i <= 2.5e-175) {
tmp = 100.0 * (n + ((i * n) * (0.5 - (0.5 / n))));
} else if (i <= 0.0012) {
tmp = 100.0 / (i / (i * n));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = 100.0 * (Math.expm1(i) * (n / i));
double tmp;
if (i <= -2.2e-8) {
tmp = t_0;
} else if (i <= 2.5e-175) {
tmp = 100.0 * (n + ((i * n) * (0.5 - (0.5 / n))));
} else if (i <= 0.0012) {
tmp = 100.0 / (i / (i * n));
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = 100.0 * (math.expm1(i) * (n / i)) tmp = 0 if i <= -2.2e-8: tmp = t_0 elif i <= 2.5e-175: tmp = 100.0 * (n + ((i * n) * (0.5 - (0.5 / n)))) elif i <= 0.0012: tmp = 100.0 / (i / (i * n)) else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(100.0 * Float64(expm1(i) * Float64(n / i))) tmp = 0.0 if (i <= -2.2e-8) tmp = t_0; elseif (i <= 2.5e-175) tmp = Float64(100.0 * Float64(n + Float64(Float64(i * n) * Float64(0.5 - Float64(0.5 / n))))); elseif (i <= 0.0012) 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[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] * N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -2.2e-8], t$95$0, If[LessEqual[i, 2.5e-175], N[(100.0 * N[(n + N[(N[(i * n), $MachinePrecision] * N[(0.5 - N[(0.5 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 0.0012], 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(\mathsf{expm1}\left(i\right) \cdot \frac{n}{i}\right)\\
\mathbf{if}\;i \leq -2.2 \cdot 10^{-8}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;i \leq 2.5 \cdot 10^{-175}:\\
\;\;\;\;100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)\\
\mathbf{elif}\;i \leq 0.0012:\\
\;\;\;\;\frac{100}{\frac{i}{i \cdot n}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if i < -2.1999999999999998e-8 or 0.00119999999999999989 < i Initial program 51.4%
Taylor expanded in n around inf 69.6%
expm1-def69.6%
Simplified69.6%
div-inv69.6%
clear-num69.8%
Applied egg-rr69.8%
if -2.1999999999999998e-8 < i < 2.5e-175Initial program 9.2%
Taylor expanded in i around 0 87.8%
associate-*r*88.1%
associate-*r/88.1%
metadata-eval88.1%
Simplified88.1%
if 2.5e-175 < i < 0.00119999999999999989Initial program 26.8%
Taylor expanded in n around inf 24.5%
expm1-def46.3%
Simplified46.3%
clear-num46.2%
inv-pow46.2%
Applied egg-rr46.2%
unpow-146.2%
associate-/l/80.9%
*-commutative80.9%
Simplified80.9%
un-div-inv81.0%
*-commutative81.0%
Applied egg-rr81.0%
Taylor expanded in i around 0 81.0%
*-commutative81.0%
Simplified81.0%
Final simplification78.3%
(FPCore (i n) :precision binary64 (if (or (<= n -2.8e-236) (not (<= n 4.5e-141))) (* 100.0 (* n (/ (expm1 i) i))) 0.0))
double code(double i, double n) {
double tmp;
if ((n <= -2.8e-236) || !(n <= 4.5e-141)) {
tmp = 100.0 * (n * (expm1(i) / i));
} else {
tmp = 0.0;
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((n <= -2.8e-236) || !(n <= 4.5e-141)) {
tmp = 100.0 * (n * (Math.expm1(i) / i));
} else {
tmp = 0.0;
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -2.8e-236) or not (n <= 4.5e-141): tmp = 100.0 * (n * (math.expm1(i) / i)) else: tmp = 0.0 return tmp
function code(i, n) tmp = 0.0 if ((n <= -2.8e-236) || !(n <= 4.5e-141)) tmp = Float64(100.0 * Float64(n * Float64(expm1(i) / i))); else tmp = 0.0; end return tmp end
code[i_, n_] := If[Or[LessEqual[n, -2.8e-236], N[Not[LessEqual[n, 4.5e-141]], $MachinePrecision]], N[(100.0 * N[(n * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.8 \cdot 10^{-236} \lor \neg \left(n \leq 4.5 \cdot 10^{-141}\right):\\
\;\;\;\;100 \cdot \left(n \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if n < -2.79999999999999986e-236 or 4.5e-141 < n Initial program 27.0%
Taylor expanded in n around inf 38.0%
expm1-def73.4%
Simplified73.4%
associate-/r/86.8%
Applied egg-rr86.8%
if -2.79999999999999986e-236 < n < 4.5e-141Initial program 55.5%
Taylor expanded in i around 0 87.3%
Taylor expanded in i around 0 87.3%
Final simplification86.9%
(FPCore (i n) :precision binary64 (if (<= n -2.8e-236) (* 100.0 (* n (/ (expm1 i) i))) (if (<= n 7.8e-144) 0.0 (* 100.0 (/ n (/ i (expm1 i)))))))
double code(double i, double n) {
double tmp;
if (n <= -2.8e-236) {
tmp = 100.0 * (n * (expm1(i) / i));
} else if (n <= 7.8e-144) {
tmp = 0.0;
} else {
tmp = 100.0 * (n / (i / expm1(i)));
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (n <= -2.8e-236) {
tmp = 100.0 * (n * (Math.expm1(i) / i));
} else if (n <= 7.8e-144) {
tmp = 0.0;
} else {
tmp = 100.0 * (n / (i / Math.expm1(i)));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -2.8e-236: tmp = 100.0 * (n * (math.expm1(i) / i)) elif n <= 7.8e-144: tmp = 0.0 else: tmp = 100.0 * (n / (i / math.expm1(i))) return tmp
function code(i, n) tmp = 0.0 if (n <= -2.8e-236) tmp = Float64(100.0 * Float64(n * Float64(expm1(i) / i))); elseif (n <= 7.8e-144) tmp = 0.0; else tmp = Float64(100.0 * Float64(n / Float64(i / expm1(i)))); end return tmp end
code[i_, n_] := If[LessEqual[n, -2.8e-236], N[(100.0 * N[(n * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 7.8e-144], 0.0, N[(100.0 * N[(n / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.8 \cdot 10^{-236}:\\
\;\;\;\;100 \cdot \left(n \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\
\mathbf{elif}\;n \leq 7.8 \cdot 10^{-144}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\end{array}
\end{array}
if n < -2.79999999999999986e-236Initial program 28.4%
Taylor expanded in n around inf 36.2%
expm1-def70.8%
Simplified70.8%
associate-/r/83.9%
Applied egg-rr83.9%
if -2.79999999999999986e-236 < n < 7.8000000000000003e-144Initial program 55.5%
Taylor expanded in i around 0 87.3%
Taylor expanded in i around 0 87.3%
if 7.8000000000000003e-144 < n Initial program 25.8%
Taylor expanded in n around inf 40.0%
*-commutative40.0%
associate-/l*40.0%
expm1-def89.4%
Simplified89.4%
Final simplification86.9%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* (+ 0.5 (/ -0.5 n)) (* 100.0 (* i n)))))
(if (<= n -2.6e-236)
(* 100.0 (/ 1.0 (+ (* (/ i n) -0.5) (/ 1.0 n))))
(if (<= n 6.5e-138)
0.0
(if (<= n 6.5e+124)
(/ (- (* (* n 100.0) (* n 100.0)) (* t_0 t_0)) (- (* n 100.0) t_0))
(* n (+ 100.0 (* i 50.0))))))))
double code(double i, double n) {
double t_0 = (0.5 + (-0.5 / n)) * (100.0 * (i * n));
double tmp;
if (n <= -2.6e-236) {
tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n)));
} else if (n <= 6.5e-138) {
tmp = 0.0;
} else if (n <= 6.5e+124) {
tmp = (((n * 100.0) * (n * 100.0)) - (t_0 * t_0)) / ((n * 100.0) - t_0);
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = (0.5d0 + ((-0.5d0) / n)) * (100.0d0 * (i * n))
if (n <= (-2.6d-236)) then
tmp = 100.0d0 * (1.0d0 / (((i / n) * (-0.5d0)) + (1.0d0 / n)))
else if (n <= 6.5d-138) then
tmp = 0.0d0
else if (n <= 6.5d+124) then
tmp = (((n * 100.0d0) * (n * 100.0d0)) - (t_0 * t_0)) / ((n * 100.0d0) - t_0)
else
tmp = n * (100.0d0 + (i * 50.0d0))
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = (0.5 + (-0.5 / n)) * (100.0 * (i * n));
double tmp;
if (n <= -2.6e-236) {
tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n)));
} else if (n <= 6.5e-138) {
tmp = 0.0;
} else if (n <= 6.5e+124) {
tmp = (((n * 100.0) * (n * 100.0)) - (t_0 * t_0)) / ((n * 100.0) - t_0);
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): t_0 = (0.5 + (-0.5 / n)) * (100.0 * (i * n)) tmp = 0 if n <= -2.6e-236: tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n))) elif n <= 6.5e-138: tmp = 0.0 elif n <= 6.5e+124: tmp = (((n * 100.0) * (n * 100.0)) - (t_0 * t_0)) / ((n * 100.0) - t_0) else: tmp = n * (100.0 + (i * 50.0)) return tmp
function code(i, n) t_0 = Float64(Float64(0.5 + Float64(-0.5 / n)) * Float64(100.0 * Float64(i * n))) tmp = 0.0 if (n <= -2.6e-236) tmp = Float64(100.0 * Float64(1.0 / Float64(Float64(Float64(i / n) * -0.5) + Float64(1.0 / n)))); elseif (n <= 6.5e-138) tmp = 0.0; elseif (n <= 6.5e+124) tmp = Float64(Float64(Float64(Float64(n * 100.0) * Float64(n * 100.0)) - Float64(t_0 * t_0)) / Float64(Float64(n * 100.0) - t_0)); else tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); end return tmp end
function tmp_2 = code(i, n) t_0 = (0.5 + (-0.5 / n)) * (100.0 * (i * n)); tmp = 0.0; if (n <= -2.6e-236) tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n))); elseif (n <= 6.5e-138) tmp = 0.0; elseif (n <= 6.5e+124) tmp = (((n * 100.0) * (n * 100.0)) - (t_0 * t_0)) / ((n * 100.0) - t_0); else tmp = n * (100.0 + (i * 50.0)); end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(N[(0.5 + N[(-0.5 / n), $MachinePrecision]), $MachinePrecision] * N[(100.0 * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -2.6e-236], N[(100.0 * N[(1.0 / N[(N[(N[(i / n), $MachinePrecision] * -0.5), $MachinePrecision] + N[(1.0 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 6.5e-138], 0.0, If[LessEqual[n, 6.5e+124], N[(N[(N[(N[(n * 100.0), $MachinePrecision] * N[(n * 100.0), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(N[(n * 100.0), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(0.5 + \frac{-0.5}{n}\right) \cdot \left(100 \cdot \left(i \cdot n\right)\right)\\
\mathbf{if}\;n \leq -2.6 \cdot 10^{-236}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{i}{n} \cdot -0.5 + \frac{1}{n}}\\
\mathbf{elif}\;n \leq 6.5 \cdot 10^{-138}:\\
\;\;\;\;0\\
\mathbf{elif}\;n \leq 6.5 \cdot 10^{+124}:\\
\;\;\;\;\frac{\left(n \cdot 100\right) \cdot \left(n \cdot 100\right) - t_0 \cdot t_0}{n \cdot 100 - t_0}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if n < -2.6e-236Initial program 28.4%
Taylor expanded in n around inf 36.2%
expm1-def70.8%
Simplified70.8%
clear-num70.7%
inv-pow70.7%
Applied egg-rr70.7%
unpow-170.7%
associate-/l/73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in i around 0 62.6%
if -2.6e-236 < n < 6.4999999999999999e-138Initial program 54.4%
Taylor expanded in i around 0 85.5%
Taylor expanded in i around 0 85.5%
if 6.4999999999999999e-138 < n < 6.50000000000000008e124Initial program 26.8%
Taylor expanded in i around 0 60.8%
associate-*r*60.8%
associate-*r/60.8%
metadata-eval60.8%
Simplified60.8%
distribute-rgt-in60.8%
flip-+74.4%
Applied egg-rr74.4%
if 6.50000000000000008e124 < n Initial program 25.0%
Taylor expanded in n around inf 54.1%
expm1-def70.4%
Simplified70.4%
associate-/r/95.9%
Applied egg-rr95.9%
Taylor expanded in i around 0 70.4%
+-commutative70.4%
associate-*r*70.4%
distribute-rgt-out70.4%
Simplified70.4%
Final simplification71.0%
(FPCore (i n)
:precision binary64
(if (<= n -2.4e-65)
(* 100.0 (+ n (* i -0.5)))
(if (<= n -2.8e-236)
(* 100.0 (/ i (/ i n)))
(if (<= n 2.95e-145)
0.0
(if (<= n 1.42e+163)
(* n 100.0)
(if (<= n 2.3e+193) (* (* i n) 50.0) (/ 100.0 (/ 1.0 n))))))))
double code(double i, double n) {
double tmp;
if (n <= -2.4e-65) {
tmp = 100.0 * (n + (i * -0.5));
} else if (n <= -2.8e-236) {
tmp = 100.0 * (i / (i / n));
} else if (n <= 2.95e-145) {
tmp = 0.0;
} else if (n <= 1.42e+163) {
tmp = n * 100.0;
} else if (n <= 2.3e+193) {
tmp = (i * n) * 50.0;
} else {
tmp = 100.0 / (1.0 / 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.4d-65)) then
tmp = 100.0d0 * (n + (i * (-0.5d0)))
else if (n <= (-2.8d-236)) then
tmp = 100.0d0 * (i / (i / n))
else if (n <= 2.95d-145) then
tmp = 0.0d0
else if (n <= 1.42d+163) then
tmp = n * 100.0d0
else if (n <= 2.3d+193) then
tmp = (i * n) * 50.0d0
else
tmp = 100.0d0 / (1.0d0 / n)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -2.4e-65) {
tmp = 100.0 * (n + (i * -0.5));
} else if (n <= -2.8e-236) {
tmp = 100.0 * (i / (i / n));
} else if (n <= 2.95e-145) {
tmp = 0.0;
} else if (n <= 1.42e+163) {
tmp = n * 100.0;
} else if (n <= 2.3e+193) {
tmp = (i * n) * 50.0;
} else {
tmp = 100.0 / (1.0 / n);
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -2.4e-65: tmp = 100.0 * (n + (i * -0.5)) elif n <= -2.8e-236: tmp = 100.0 * (i / (i / n)) elif n <= 2.95e-145: tmp = 0.0 elif n <= 1.42e+163: tmp = n * 100.0 elif n <= 2.3e+193: tmp = (i * n) * 50.0 else: tmp = 100.0 / (1.0 / n) return tmp
function code(i, n) tmp = 0.0 if (n <= -2.4e-65) tmp = Float64(100.0 * Float64(n + Float64(i * -0.5))); elseif (n <= -2.8e-236) tmp = Float64(100.0 * Float64(i / Float64(i / n))); elseif (n <= 2.95e-145) tmp = 0.0; elseif (n <= 1.42e+163) tmp = Float64(n * 100.0); elseif (n <= 2.3e+193) tmp = Float64(Float64(i * n) * 50.0); else tmp = Float64(100.0 / Float64(1.0 / n)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -2.4e-65) tmp = 100.0 * (n + (i * -0.5)); elseif (n <= -2.8e-236) tmp = 100.0 * (i / (i / n)); elseif (n <= 2.95e-145) tmp = 0.0; elseif (n <= 1.42e+163) tmp = n * 100.0; elseif (n <= 2.3e+193) tmp = (i * n) * 50.0; else tmp = 100.0 / (1.0 / n); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -2.4e-65], N[(100.0 * N[(n + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -2.8e-236], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.95e-145], 0.0, If[LessEqual[n, 1.42e+163], N[(n * 100.0), $MachinePrecision], If[LessEqual[n, 2.3e+193], N[(N[(i * n), $MachinePrecision] * 50.0), $MachinePrecision], N[(100.0 / N[(1.0 / n), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.4 \cdot 10^{-65}:\\
\;\;\;\;100 \cdot \left(n + i \cdot -0.5\right)\\
\mathbf{elif}\;n \leq -2.8 \cdot 10^{-236}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 2.95 \cdot 10^{-145}:\\
\;\;\;\;0\\
\mathbf{elif}\;n \leq 1.42 \cdot 10^{+163}:\\
\;\;\;\;n \cdot 100\\
\mathbf{elif}\;n \leq 2.3 \cdot 10^{+193}:\\
\;\;\;\;\left(i \cdot n\right) \cdot 50\\
\mathbf{else}:\\
\;\;\;\;\frac{100}{\frac{1}{n}}\\
\end{array}
\end{array}
if n < -2.4000000000000002e-65Initial program 26.5%
Taylor expanded in i around 0 58.5%
associate-*r*58.5%
associate-*r/58.5%
metadata-eval58.5%
Simplified58.5%
Taylor expanded in n around 0 54.3%
*-commutative54.3%
Simplified54.3%
if -2.4000000000000002e-65 < n < -2.79999999999999986e-236Initial program 33.8%
Taylor expanded in i around 0 77.9%
if -2.79999999999999986e-236 < n < 2.9499999999999999e-145Initial program 55.5%
Taylor expanded in i around 0 87.3%
Taylor expanded in i around 0 87.3%
if 2.9499999999999999e-145 < n < 1.4199999999999999e163Initial program 26.4%
Taylor expanded in i around 0 60.3%
*-commutative60.3%
Simplified60.3%
if 1.4199999999999999e163 < n < 2.30000000000000013e193Initial program 44.0%
Taylor expanded in i around 0 64.5%
associate-*r*64.5%
associate-*r/64.5%
metadata-eval64.5%
Simplified64.5%
Taylor expanded in n around inf 64.5%
associate-*r*64.5%
*-commutative64.5%
*-commutative64.5%
Simplified64.5%
Taylor expanded in i around inf 50.6%
*-commutative50.6%
Simplified50.6%
if 2.30000000000000013e193 < n Initial program 15.3%
Taylor expanded in n around inf 46.5%
expm1-def63.7%
Simplified63.7%
clear-num63.7%
inv-pow63.7%
Applied egg-rr63.7%
unpow-163.7%
associate-/l/95.8%
*-commutative95.8%
Simplified95.8%
un-div-inv96.0%
*-commutative96.0%
Applied egg-rr96.0%
Taylor expanded in i around 0 53.1%
Final simplification63.7%
(FPCore (i n)
:precision binary64
(if (<= n -1.22e+85)
(* n (+ 100.0 (* i 50.0)))
(if (<= n -9e-236)
(* 100.0 (/ i (/ i n)))
(if (<= n 9e-145) 0.0 (* (* n 100.0) (+ 1.0 (* i 0.5)))))))
double code(double i, double n) {
double tmp;
if (n <= -1.22e+85) {
tmp = n * (100.0 + (i * 50.0));
} else if (n <= -9e-236) {
tmp = 100.0 * (i / (i / n));
} else if (n <= 9e-145) {
tmp = 0.0;
} else {
tmp = (n * 100.0) * (1.0 + (i * 0.5));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-1.22d+85)) then
tmp = n * (100.0d0 + (i * 50.0d0))
else if (n <= (-9d-236)) then
tmp = 100.0d0 * (i / (i / n))
else if (n <= 9d-145) then
tmp = 0.0d0
else
tmp = (n * 100.0d0) * (1.0d0 + (i * 0.5d0))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -1.22e+85) {
tmp = n * (100.0 + (i * 50.0));
} else if (n <= -9e-236) {
tmp = 100.0 * (i / (i / n));
} else if (n <= 9e-145) {
tmp = 0.0;
} else {
tmp = (n * 100.0) * (1.0 + (i * 0.5));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.22e+85: tmp = n * (100.0 + (i * 50.0)) elif n <= -9e-236: tmp = 100.0 * (i / (i / n)) elif n <= 9e-145: tmp = 0.0 else: tmp = (n * 100.0) * (1.0 + (i * 0.5)) return tmp
function code(i, n) tmp = 0.0 if (n <= -1.22e+85) tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); elseif (n <= -9e-236) tmp = Float64(100.0 * Float64(i / Float64(i / n))); elseif (n <= 9e-145) tmp = 0.0; else tmp = Float64(Float64(n * 100.0) * Float64(1.0 + Float64(i * 0.5))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -1.22e+85) tmp = n * (100.0 + (i * 50.0)); elseif (n <= -9e-236) tmp = 100.0 * (i / (i / n)); elseif (n <= 9e-145) tmp = 0.0; else tmp = (n * 100.0) * (1.0 + (i * 0.5)); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.22e+85], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -9e-236], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 9e-145], 0.0, N[(N[(n * 100.0), $MachinePrecision] * N[(1.0 + N[(i * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.22 \cdot 10^{+85}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{elif}\;n \leq -9 \cdot 10^{-236}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 9 \cdot 10^{-145}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \left(1 + i \cdot 0.5\right)\\
\end{array}
\end{array}
if n < -1.22e85Initial program 25.9%
Taylor expanded in n around inf 46.1%
expm1-def59.1%
Simplified59.1%
associate-/r/88.6%
Applied egg-rr88.6%
Taylor expanded in i around 0 55.1%
+-commutative55.1%
associate-*r*55.1%
distribute-rgt-out55.1%
Simplified55.1%
if -1.22e85 < n < -8.99999999999999997e-236Initial program 30.3%
Taylor expanded in i around 0 69.8%
if -8.99999999999999997e-236 < n < 9.0000000000000001e-145Initial program 55.5%
Taylor expanded in i around 0 87.3%
Taylor expanded in i around 0 87.3%
if 9.0000000000000001e-145 < n Initial program 25.8%
Taylor expanded in i around 0 64.6%
associate-*r*64.6%
associate-*r/64.6%
metadata-eval64.6%
Simplified64.6%
Taylor expanded in n around inf 64.7%
associate-*r*64.7%
*-commutative64.7%
*-commutative64.7%
Simplified64.7%
Final simplification68.0%
(FPCore (i n) :precision binary64 (if (<= n -2.6e-239) (* 100.0 (/ 1.0 (+ (* (/ i n) -0.5) (/ 1.0 n)))) (if (<= n 1.02e-143) 0.0 (* (* n 100.0) (+ 1.0 (* i 0.5))))))
double code(double i, double n) {
double tmp;
if (n <= -2.6e-239) {
tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n)));
} else if (n <= 1.02e-143) {
tmp = 0.0;
} else {
tmp = (n * 100.0) * (1.0 + (i * 0.5));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-2.6d-239)) then
tmp = 100.0d0 * (1.0d0 / (((i / n) * (-0.5d0)) + (1.0d0 / n)))
else if (n <= 1.02d-143) then
tmp = 0.0d0
else
tmp = (n * 100.0d0) * (1.0d0 + (i * 0.5d0))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -2.6e-239) {
tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n)));
} else if (n <= 1.02e-143) {
tmp = 0.0;
} else {
tmp = (n * 100.0) * (1.0 + (i * 0.5));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -2.6e-239: tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n))) elif n <= 1.02e-143: tmp = 0.0 else: tmp = (n * 100.0) * (1.0 + (i * 0.5)) return tmp
function code(i, n) tmp = 0.0 if (n <= -2.6e-239) tmp = Float64(100.0 * Float64(1.0 / Float64(Float64(Float64(i / n) * -0.5) + Float64(1.0 / n)))); elseif (n <= 1.02e-143) tmp = 0.0; else tmp = Float64(Float64(n * 100.0) * Float64(1.0 + Float64(i * 0.5))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -2.6e-239) tmp = 100.0 * (1.0 / (((i / n) * -0.5) + (1.0 / n))); elseif (n <= 1.02e-143) tmp = 0.0; else tmp = (n * 100.0) * (1.0 + (i * 0.5)); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -2.6e-239], N[(100.0 * N[(1.0 / N[(N[(N[(i / n), $MachinePrecision] * -0.5), $MachinePrecision] + N[(1.0 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.02e-143], 0.0, N[(N[(n * 100.0), $MachinePrecision] * N[(1.0 + N[(i * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.6 \cdot 10^{-239}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{i}{n} \cdot -0.5 + \frac{1}{n}}\\
\mathbf{elif}\;n \leq 1.02 \cdot 10^{-143}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \left(1 + i \cdot 0.5\right)\\
\end{array}
\end{array}
if n < -2.60000000000000003e-239Initial program 28.4%
Taylor expanded in n around inf 36.2%
expm1-def70.8%
Simplified70.8%
clear-num70.7%
inv-pow70.7%
Applied egg-rr70.7%
unpow-170.7%
associate-/l/73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in i around 0 62.6%
if -2.60000000000000003e-239 < n < 1.02e-143Initial program 55.5%
Taylor expanded in i around 0 87.3%
Taylor expanded in i around 0 87.3%
if 1.02e-143 < n Initial program 25.8%
Taylor expanded in i around 0 64.6%
associate-*r*64.6%
associate-*r/64.6%
metadata-eval64.6%
Simplified64.6%
Taylor expanded in n around inf 64.7%
associate-*r*64.7%
*-commutative64.7%
*-commutative64.7%
Simplified64.7%
Final simplification67.8%
(FPCore (i n)
:precision binary64
(if (<= n -5.5e-197)
(* n 100.0)
(if (<= n 7.5e-143)
0.0
(if (or (<= n 1.35e+164) (not (<= n 1.18e+194)))
(* n 100.0)
(* (* i n) 50.0)))))
double code(double i, double n) {
double tmp;
if (n <= -5.5e-197) {
tmp = n * 100.0;
} else if (n <= 7.5e-143) {
tmp = 0.0;
} else if ((n <= 1.35e+164) || !(n <= 1.18e+194)) {
tmp = n * 100.0;
} else {
tmp = (i * n) * 50.0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-5.5d-197)) then
tmp = n * 100.0d0
else if (n <= 7.5d-143) then
tmp = 0.0d0
else if ((n <= 1.35d+164) .or. (.not. (n <= 1.18d+194))) then
tmp = n * 100.0d0
else
tmp = (i * n) * 50.0d0
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -5.5e-197) {
tmp = n * 100.0;
} else if (n <= 7.5e-143) {
tmp = 0.0;
} else if ((n <= 1.35e+164) || !(n <= 1.18e+194)) {
tmp = n * 100.0;
} else {
tmp = (i * n) * 50.0;
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -5.5e-197: tmp = n * 100.0 elif n <= 7.5e-143: tmp = 0.0 elif (n <= 1.35e+164) or not (n <= 1.18e+194): tmp = n * 100.0 else: tmp = (i * n) * 50.0 return tmp
function code(i, n) tmp = 0.0 if (n <= -5.5e-197) tmp = Float64(n * 100.0); elseif (n <= 7.5e-143) tmp = 0.0; elseif ((n <= 1.35e+164) || !(n <= 1.18e+194)) tmp = Float64(n * 100.0); else tmp = Float64(Float64(i * n) * 50.0); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -5.5e-197) tmp = n * 100.0; elseif (n <= 7.5e-143) tmp = 0.0; elseif ((n <= 1.35e+164) || ~((n <= 1.18e+194))) tmp = n * 100.0; else tmp = (i * n) * 50.0; end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -5.5e-197], N[(n * 100.0), $MachinePrecision], If[LessEqual[n, 7.5e-143], 0.0, If[Or[LessEqual[n, 1.35e+164], N[Not[LessEqual[n, 1.18e+194]], $MachinePrecision]], N[(n * 100.0), $MachinePrecision], N[(N[(i * n), $MachinePrecision] * 50.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -5.5 \cdot 10^{-197}:\\
\;\;\;\;n \cdot 100\\
\mathbf{elif}\;n \leq 7.5 \cdot 10^{-143}:\\
\;\;\;\;0\\
\mathbf{elif}\;n \leq 1.35 \cdot 10^{+164} \lor \neg \left(n \leq 1.18 \cdot 10^{+194}\right):\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot n\right) \cdot 50\\
\end{array}
\end{array}
if n < -5.50000000000000037e-197 or 7.5000000000000003e-143 < n < 1.35000000000000003e164 or 1.1799999999999999e194 < n Initial program 24.9%
Taylor expanded in i around 0 56.6%
*-commutative56.6%
Simplified56.6%
if -5.50000000000000037e-197 < n < 7.5000000000000003e-143Initial program 54.4%
Taylor expanded in i around 0 81.3%
Taylor expanded in i around 0 81.3%
if 1.35000000000000003e164 < n < 1.1799999999999999e194Initial program 44.0%
Taylor expanded in i around 0 64.5%
associate-*r*64.5%
associate-*r/64.5%
metadata-eval64.5%
Simplified64.5%
Taylor expanded in n around inf 64.5%
associate-*r*64.5%
*-commutative64.5%
*-commutative64.5%
Simplified64.5%
Taylor expanded in i around inf 50.6%
*-commutative50.6%
Simplified50.6%
Final simplification61.3%
(FPCore (i n)
:precision binary64
(if (<= n -5.2e-197)
(* n 100.0)
(if (<= n 9e-142)
0.0
(if (<= n 8.4e+163)
(* n 100.0)
(if (<= n 2.05e+193) (* (* i n) 50.0) (/ 100.0 (/ 1.0 n)))))))
double code(double i, double n) {
double tmp;
if (n <= -5.2e-197) {
tmp = n * 100.0;
} else if (n <= 9e-142) {
tmp = 0.0;
} else if (n <= 8.4e+163) {
tmp = n * 100.0;
} else if (n <= 2.05e+193) {
tmp = (i * n) * 50.0;
} else {
tmp = 100.0 / (1.0 / n);
}
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-197)) then
tmp = n * 100.0d0
else if (n <= 9d-142) then
tmp = 0.0d0
else if (n <= 8.4d+163) then
tmp = n * 100.0d0
else if (n <= 2.05d+193) then
tmp = (i * n) * 50.0d0
else
tmp = 100.0d0 / (1.0d0 / n)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -5.2e-197) {
tmp = n * 100.0;
} else if (n <= 9e-142) {
tmp = 0.0;
} else if (n <= 8.4e+163) {
tmp = n * 100.0;
} else if (n <= 2.05e+193) {
tmp = (i * n) * 50.0;
} else {
tmp = 100.0 / (1.0 / n);
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -5.2e-197: tmp = n * 100.0 elif n <= 9e-142: tmp = 0.0 elif n <= 8.4e+163: tmp = n * 100.0 elif n <= 2.05e+193: tmp = (i * n) * 50.0 else: tmp = 100.0 / (1.0 / n) return tmp
function code(i, n) tmp = 0.0 if (n <= -5.2e-197) tmp = Float64(n * 100.0); elseif (n <= 9e-142) tmp = 0.0; elseif (n <= 8.4e+163) tmp = Float64(n * 100.0); elseif (n <= 2.05e+193) tmp = Float64(Float64(i * n) * 50.0); else tmp = Float64(100.0 / Float64(1.0 / n)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -5.2e-197) tmp = n * 100.0; elseif (n <= 9e-142) tmp = 0.0; elseif (n <= 8.4e+163) tmp = n * 100.0; elseif (n <= 2.05e+193) tmp = (i * n) * 50.0; else tmp = 100.0 / (1.0 / n); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -5.2e-197], N[(n * 100.0), $MachinePrecision], If[LessEqual[n, 9e-142], 0.0, If[LessEqual[n, 8.4e+163], N[(n * 100.0), $MachinePrecision], If[LessEqual[n, 2.05e+193], N[(N[(i * n), $MachinePrecision] * 50.0), $MachinePrecision], N[(100.0 / N[(1.0 / n), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -5.2 \cdot 10^{-197}:\\
\;\;\;\;n \cdot 100\\
\mathbf{elif}\;n \leq 9 \cdot 10^{-142}:\\
\;\;\;\;0\\
\mathbf{elif}\;n \leq 8.4 \cdot 10^{+163}:\\
\;\;\;\;n \cdot 100\\
\mathbf{elif}\;n \leq 2.05 \cdot 10^{+193}:\\
\;\;\;\;\left(i \cdot n\right) \cdot 50\\
\mathbf{else}:\\
\;\;\;\;\frac{100}{\frac{1}{n}}\\
\end{array}
\end{array}
if n < -5.2000000000000003e-197 or 9.00000000000000037e-142 < n < 8.4000000000000001e163Initial program 26.5%
Taylor expanded in i around 0 57.2%
*-commutative57.2%
Simplified57.2%
if -5.2000000000000003e-197 < n < 9.00000000000000037e-142Initial program 54.4%
Taylor expanded in i around 0 81.3%
Taylor expanded in i around 0 81.3%
if 8.4000000000000001e163 < n < 2.0499999999999999e193Initial program 44.0%
Taylor expanded in i around 0 64.5%
associate-*r*64.5%
associate-*r/64.5%
metadata-eval64.5%
Simplified64.5%
Taylor expanded in n around inf 64.5%
associate-*r*64.5%
*-commutative64.5%
*-commutative64.5%
Simplified64.5%
Taylor expanded in i around inf 50.6%
*-commutative50.6%
Simplified50.6%
if 2.0499999999999999e193 < n Initial program 15.3%
Taylor expanded in n around inf 46.5%
expm1-def63.7%
Simplified63.7%
clear-num63.7%
inv-pow63.7%
Applied egg-rr63.7%
unpow-163.7%
associate-/l/95.8%
*-commutative95.8%
Simplified95.8%
un-div-inv96.0%
*-commutative96.0%
Applied egg-rr96.0%
Taylor expanded in i around 0 53.1%
Final simplification61.3%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* n (+ 100.0 (* i 50.0)))))
(if (<= n -3.5e+86)
t_0
(if (<= n -2.75e-235)
(* 100.0 (/ i (/ i n)))
(if (<= n 1.5e-144) 0.0 t_0)))))
double code(double i, double n) {
double t_0 = n * (100.0 + (i * 50.0));
double tmp;
if (n <= -3.5e+86) {
tmp = t_0;
} else if (n <= -2.75e-235) {
tmp = 100.0 * (i / (i / n));
} else if (n <= 1.5e-144) {
tmp = 0.0;
} 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))
if (n <= (-3.5d+86)) then
tmp = t_0
else if (n <= (-2.75d-235)) then
tmp = 100.0d0 * (i / (i / n))
else if (n <= 1.5d-144) then
tmp = 0.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = n * (100.0 + (i * 50.0));
double tmp;
if (n <= -3.5e+86) {
tmp = t_0;
} else if (n <= -2.75e-235) {
tmp = 100.0 * (i / (i / n));
} else if (n <= 1.5e-144) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = n * (100.0 + (i * 50.0)) tmp = 0 if n <= -3.5e+86: tmp = t_0 elif n <= -2.75e-235: tmp = 100.0 * (i / (i / n)) elif n <= 1.5e-144: tmp = 0.0 else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(n * Float64(100.0 + Float64(i * 50.0))) tmp = 0.0 if (n <= -3.5e+86) tmp = t_0; elseif (n <= -2.75e-235) tmp = Float64(100.0 * Float64(i / Float64(i / n))); elseif (n <= 1.5e-144) tmp = 0.0; else tmp = t_0; end return tmp end
function tmp_2 = code(i, n) t_0 = n * (100.0 + (i * 50.0)); tmp = 0.0; if (n <= -3.5e+86) tmp = t_0; elseif (n <= -2.75e-235) tmp = 100.0 * (i / (i / n)); elseif (n <= 1.5e-144) tmp = 0.0; else tmp = t_0; end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -3.5e+86], t$95$0, If[LessEqual[n, -2.75e-235], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.5e-144], 0.0, t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{if}\;n \leq -3.5 \cdot 10^{+86}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq -2.75 \cdot 10^{-235}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.5 \cdot 10^{-144}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if n < -3.50000000000000019e86 or 1.4999999999999999e-144 < n Initial program 25.8%
Taylor expanded in n around inf 41.4%
expm1-def71.1%
Simplified71.1%
associate-/r/89.2%
Applied egg-rr89.2%
Taylor expanded in i around 0 61.9%
+-commutative61.9%
associate-*r*61.9%
distribute-rgt-out61.9%
Simplified61.9%
if -3.50000000000000019e86 < n < -2.7499999999999999e-235Initial program 30.3%
Taylor expanded in i around 0 69.8%
if -2.7499999999999999e-235 < n < 1.4999999999999999e-144Initial program 55.5%
Taylor expanded in i around 0 87.3%
Taylor expanded in i around 0 87.3%
Final simplification68.0%
(FPCore (i n) :precision binary64 (if (<= n -7e-236) (/ 100.0 (+ (* (/ i n) -0.5) (/ 1.0 n))) (if (<= n 1.25e-144) 0.0 (* (* n 100.0) (+ 1.0 (* i 0.5))))))
double code(double i, double n) {
double tmp;
if (n <= -7e-236) {
tmp = 100.0 / (((i / n) * -0.5) + (1.0 / n));
} else if (n <= 1.25e-144) {
tmp = 0.0;
} else {
tmp = (n * 100.0) * (1.0 + (i * 0.5));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-7d-236)) then
tmp = 100.0d0 / (((i / n) * (-0.5d0)) + (1.0d0 / n))
else if (n <= 1.25d-144) then
tmp = 0.0d0
else
tmp = (n * 100.0d0) * (1.0d0 + (i * 0.5d0))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -7e-236) {
tmp = 100.0 / (((i / n) * -0.5) + (1.0 / n));
} else if (n <= 1.25e-144) {
tmp = 0.0;
} else {
tmp = (n * 100.0) * (1.0 + (i * 0.5));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -7e-236: tmp = 100.0 / (((i / n) * -0.5) + (1.0 / n)) elif n <= 1.25e-144: tmp = 0.0 else: tmp = (n * 100.0) * (1.0 + (i * 0.5)) return tmp
function code(i, n) tmp = 0.0 if (n <= -7e-236) tmp = Float64(100.0 / Float64(Float64(Float64(i / n) * -0.5) + Float64(1.0 / n))); elseif (n <= 1.25e-144) tmp = 0.0; else tmp = Float64(Float64(n * 100.0) * Float64(1.0 + Float64(i * 0.5))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -7e-236) tmp = 100.0 / (((i / n) * -0.5) + (1.0 / n)); elseif (n <= 1.25e-144) tmp = 0.0; else tmp = (n * 100.0) * (1.0 + (i * 0.5)); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -7e-236], N[(100.0 / N[(N[(N[(i / n), $MachinePrecision] * -0.5), $MachinePrecision] + N[(1.0 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.25e-144], 0.0, N[(N[(n * 100.0), $MachinePrecision] * N[(1.0 + N[(i * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -7 \cdot 10^{-236}:\\
\;\;\;\;\frac{100}{\frac{i}{n} \cdot -0.5 + \frac{1}{n}}\\
\mathbf{elif}\;n \leq 1.25 \cdot 10^{-144}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \left(1 + i \cdot 0.5\right)\\
\end{array}
\end{array}
if n < -6.99999999999999988e-236Initial program 28.4%
Taylor expanded in n around inf 36.2%
expm1-def70.8%
Simplified70.8%
clear-num70.7%
inv-pow70.7%
Applied egg-rr70.7%
unpow-170.7%
associate-/l/73.8%
*-commutative73.8%
Simplified73.8%
un-div-inv73.8%
*-commutative73.8%
Applied egg-rr73.8%
Taylor expanded in i around 0 62.5%
if -6.99999999999999988e-236 < n < 1.2499999999999999e-144Initial program 55.5%
Taylor expanded in i around 0 87.3%
Taylor expanded in i around 0 87.3%
if 1.2499999999999999e-144 < n Initial program 25.8%
Taylor expanded in i around 0 64.6%
associate-*r*64.6%
associate-*r/64.6%
metadata-eval64.6%
Simplified64.6%
Taylor expanded in n around inf 64.7%
associate-*r*64.7%
*-commutative64.7%
*-commutative64.7%
Simplified64.7%
Final simplification67.7%
(FPCore (i n) :precision binary64 (if (or (<= n -4.4e-197) (not (<= n 5.5e-145))) (* n 100.0) 0.0))
double code(double i, double n) {
double tmp;
if ((n <= -4.4e-197) || !(n <= 5.5e-145)) {
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 ((n <= (-4.4d-197)) .or. (.not. (n <= 5.5d-145))) 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 ((n <= -4.4e-197) || !(n <= 5.5e-145)) {
tmp = n * 100.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -4.4e-197) or not (n <= 5.5e-145): tmp = n * 100.0 else: tmp = 0.0 return tmp
function code(i, n) tmp = 0.0 if ((n <= -4.4e-197) || !(n <= 5.5e-145)) tmp = Float64(n * 100.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -4.4e-197) || ~((n <= 5.5e-145))) tmp = n * 100.0; else tmp = 0.0; end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -4.4e-197], N[Not[LessEqual[n, 5.5e-145]], $MachinePrecision]], N[(n * 100.0), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -4.4 \cdot 10^{-197} \lor \neg \left(n \leq 5.5 \cdot 10^{-145}\right):\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if n < -4.4000000000000001e-197 or 5.50000000000000015e-145 < n Initial program 26.2%
Taylor expanded in i around 0 54.0%
*-commutative54.0%
Simplified54.0%
if -4.4000000000000001e-197 < n < 5.50000000000000015e-145Initial program 54.4%
Taylor expanded in i around 0 81.3%
Taylor expanded in i around 0 81.3%
Final simplification59.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 31.9%
Taylor expanded in i around 0 21.3%
Taylor expanded in i around 0 21.5%
Final simplification21.5%
(FPCore (i n)
:precision binary64
(let* ((t_0 (+ 1.0 (/ i n))))
(*
100.0
(/
(-
(exp
(*
n
(if (== t_0 1.0)
(/ i n)
(/ (* (/ i n) (log t_0)) (- (+ (/ i n) 1.0) 1.0)))))
1.0)
(/ i n)))))
double code(double i, double n) {
double t_0 = 1.0 + (i / n);
double tmp;
if (t_0 == 1.0) {
tmp = i / n;
} else {
tmp = ((i / n) * log(t_0)) / (((i / n) + 1.0) - 1.0);
}
return 100.0 * ((exp((n * tmp)) - 1.0) / (i / n));
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (i / n)
if (t_0 == 1.0d0) then
tmp = i / n
else
tmp = ((i / n) * log(t_0)) / (((i / n) + 1.0d0) - 1.0d0)
end if
code = 100.0d0 * ((exp((n * tmp)) - 1.0d0) / (i / n))
end function
public static double code(double i, double n) {
double t_0 = 1.0 + (i / n);
double tmp;
if (t_0 == 1.0) {
tmp = i / n;
} else {
tmp = ((i / n) * Math.log(t_0)) / (((i / n) + 1.0) - 1.0);
}
return 100.0 * ((Math.exp((n * tmp)) - 1.0) / (i / n));
}
def code(i, n): t_0 = 1.0 + (i / n) tmp = 0 if t_0 == 1.0: tmp = i / n else: tmp = ((i / n) * math.log(t_0)) / (((i / n) + 1.0) - 1.0) return 100.0 * ((math.exp((n * tmp)) - 1.0) / (i / n))
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) tmp = 0.0 if (t_0 == 1.0) tmp = Float64(i / n); else tmp = Float64(Float64(Float64(i / n) * log(t_0)) / Float64(Float64(Float64(i / n) + 1.0) - 1.0)); end return Float64(100.0 * Float64(Float64(exp(Float64(n * tmp)) - 1.0) / Float64(i / n))) end
function tmp_2 = code(i, n) t_0 = 1.0 + (i / n); tmp = 0.0; if (t_0 == 1.0) tmp = i / n; else tmp = ((i / n) * log(t_0)) / (((i / n) + 1.0) - 1.0); end tmp_2 = 100.0 * ((exp((n * tmp)) - 1.0) / (i / n)); end
code[i_, n_] := Block[{t$95$0 = N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision]}, N[(100.0 * N[(N[(N[Exp[N[(n * If[Equal[t$95$0, 1.0], N[(i / n), $MachinePrecision], N[(N[(N[(i / n), $MachinePrecision] * N[Log[t$95$0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(i / n), $MachinePrecision] + 1.0), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]], $MachinePrecision] - 1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{i}{n}\\
100 \cdot \frac{e^{n \cdot \begin{array}{l}
\mathbf{if}\;t_0 = 1:\\
\;\;\;\;\frac{i}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{i}{n} \cdot \log t_0}{\left(\frac{i}{n} + 1\right) - 1}\\
\end{array}} - 1}{\frac{i}{n}}
\end{array}
\end{array}
herbie shell --seed 2023321
(FPCore (i n)
:name "Compound Interest"
:precision binary64
:herbie-target
(* 100.0 (/ (- (exp (* n (if (== (+ 1.0 (/ i n)) 1.0) (/ i n) (/ (* (/ i n) (log (+ 1.0 (/ i n)))) (- (+ (/ i n) 1.0) 1.0))))) 1.0) (/ i n)))
(* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))