
(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 14 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 -2e-52)
(* 100.0 (- (* n (/ t_0 i)) (/ n i)))
(if (<= t_1 0.0)
(* n (* 100.0 (/ (expm1 (* n (log1p (/ i n)))) i)))
(if (<= t_1 INFINITY)
(* 100.0 (- (* (/ n i) (pow (/ i n) n)) (/ n i)))
(* n 100.0))))))
double code(double i, double n) {
double t_0 = pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= -2e-52) {
tmp = 100.0 * ((n * (t_0 / i)) - (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 = 100.0 * (((n / i) * pow((i / n), n)) - (n / i));
} 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 <= -2e-52) {
tmp = 100.0 * ((n * (t_0 / i)) - (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 = 100.0 * (((n / i) * Math.pow((i / n), n)) - (n / i));
} 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 <= -2e-52: tmp = 100.0 * ((n * (t_0 / i)) - (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 = 100.0 * (((n / i) * math.pow((i / n), n)) - (n / i)) else: tmp = n * 100.0 return tmp
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) ^ n t_1 = Float64(Float64(t_0 + -1.0) / Float64(i / n)) tmp = 0.0 if (t_1 <= -2e-52) tmp = Float64(100.0 * Float64(Float64(n * Float64(t_0 / i)) - Float64(n / i))); elseif (t_1 <= 0.0) tmp = Float64(n * Float64(100.0 * Float64(expm1(Float64(n * log1p(Float64(i / n)))) / i))); elseif (t_1 <= Inf) tmp = Float64(100.0 * Float64(Float64(Float64(n / i) * (Float64(i / n) ^ n)) - Float64(n / i))); else tmp = Float64(n * 100.0); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-52], N[(100.0 * N[(N[(n * N[(t$95$0 / i), $MachinePrecision]), $MachinePrecision] - N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(n * N[(100.0 * 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[(100.0 * N[(N[(N[(n / i), $MachinePrecision] * N[Power[N[(i / n), $MachinePrecision], n], $MachinePrecision]), $MachinePrecision] - N[(n / i), $MachinePrecision]), $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 -2 \cdot 10^{-52}:\\
\;\;\;\;100 \cdot \left(n \cdot \frac{t\_0}{i} - \frac{n}{i}\right)\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{i}\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;100 \cdot \left(\frac{n}{i} \cdot {\left(\frac{i}{n}\right)}^{n} - \frac{n}{i}\right)\\
\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)) < -2e-52Initial program 99.6%
div-sub99.6%
clear-num100.0%
sub-neg100.0%
div-inv100.0%
clear-num100.0%
Applied egg-rr100.0%
sub-neg100.0%
Simplified100.0%
clear-num100.0%
un-div-inv100.0%
+-commutative100.0%
Applied egg-rr100.0%
associate-/r/100.0%
Applied egg-rr100.0%
if -2e-52 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < 0.0Initial program 19.4%
associate-*r/19.4%
sub-neg19.4%
distribute-rgt-in19.4%
metadata-eval19.4%
metadata-eval19.4%
Simplified19.4%
metadata-eval19.4%
metadata-eval19.4%
distribute-rgt-in19.4%
sub-neg19.4%
associate-*r/19.4%
associate-/r/19.4%
associate-*r*19.4%
add-exp-log19.4%
expm1-define19.4%
log-pow34.2%
log1p-define99.0%
Applied egg-rr99.0%
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.7%
div-sub99.7%
clear-num99.8%
sub-neg99.8%
div-inv99.8%
clear-num99.8%
Applied egg-rr99.8%
sub-neg99.8%
Simplified99.8%
Taylor expanded in i around inf 99.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%
associate-/r/1.8%
associate-*r*1.8%
*-commutative1.8%
associate-*r/1.8%
sub-neg1.8%
distribute-lft-in1.8%
metadata-eval1.8%
metadata-eval1.8%
metadata-eval1.8%
fma-define1.8%
metadata-eval1.8%
Simplified1.8%
Taylor expanded in i around 0 70.7%
*-commutative70.7%
Simplified70.7%
Final simplification93.1%
(FPCore (i n)
:precision binary64
(let* ((t_0 (pow (+ 1.0 (/ i n)) n)) (t_1 (/ (+ t_0 -1.0) (/ i n))))
(if (<= t_1 -2e-52)
(* 100.0 (- (* n (/ t_0 i)) (/ n i)))
(if (<= t_1 0.0)
(* n (/ (* 100.0 (expm1 (* n (log1p (/ i n))))) i))
(if (<= t_1 INFINITY)
(* 100.0 (- (* (/ n i) (pow (/ i n) n)) (/ n i)))
(* n 100.0))))))
double code(double i, double n) {
double t_0 = pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= -2e-52) {
tmp = 100.0 * ((n * (t_0 / i)) - (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 = 100.0 * (((n / i) * pow((i / n), n)) - (n / i));
} 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 <= -2e-52) {
tmp = 100.0 * ((n * (t_0 / i)) - (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 = 100.0 * (((n / i) * Math.pow((i / n), n)) - (n / i));
} 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 <= -2e-52: tmp = 100.0 * ((n * (t_0 / i)) - (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 = 100.0 * (((n / i) * math.pow((i / n), n)) - (n / i)) else: tmp = n * 100.0 return tmp
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) ^ n t_1 = Float64(Float64(t_0 + -1.0) / Float64(i / n)) tmp = 0.0 if (t_1 <= -2e-52) tmp = Float64(100.0 * Float64(Float64(n * Float64(t_0 / i)) - Float64(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(100.0 * Float64(Float64(Float64(n / i) * (Float64(i / n) ^ n)) - Float64(n / i))); else tmp = Float64(n * 100.0); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-52], N[(100.0 * N[(N[(n * N[(t$95$0 / i), $MachinePrecision]), $MachinePrecision] - N[(n / i), $MachinePrecision]), $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[(100.0 * N[(N[(N[(n / i), $MachinePrecision] * N[Power[N[(i / n), $MachinePrecision], n], $MachinePrecision]), $MachinePrecision] - N[(n / i), $MachinePrecision]), $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 -2 \cdot 10^{-52}:\\
\;\;\;\;100 \cdot \left(n \cdot \frac{t\_0}{i} - \frac{n}{i}\right)\\
\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:\\
\;\;\;\;100 \cdot \left(\frac{n}{i} \cdot {\left(\frac{i}{n}\right)}^{n} - \frac{n}{i}\right)\\
\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)) < -2e-52Initial program 99.6%
div-sub99.6%
clear-num100.0%
sub-neg100.0%
div-inv100.0%
clear-num100.0%
Applied egg-rr100.0%
sub-neg100.0%
Simplified100.0%
clear-num100.0%
un-div-inv100.0%
+-commutative100.0%
Applied egg-rr100.0%
associate-/r/100.0%
Applied egg-rr100.0%
if -2e-52 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < 0.0Initial program 19.4%
associate-/r/19.4%
associate-*r*19.4%
*-commutative19.4%
associate-*r/19.4%
sub-neg19.4%
distribute-lft-in19.4%
metadata-eval19.4%
metadata-eval19.4%
metadata-eval19.4%
fma-define19.4%
metadata-eval19.4%
Simplified19.4%
fma-undefine19.4%
metadata-eval19.4%
metadata-eval19.4%
distribute-lft-in19.4%
sub-neg19.4%
*-commutative19.4%
add-exp-log19.4%
expm1-define19.4%
log-pow34.2%
log1p-define98.9%
Applied egg-rr98.9%
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.7%
div-sub99.7%
clear-num99.8%
sub-neg99.8%
div-inv99.8%
clear-num99.8%
Applied egg-rr99.8%
sub-neg99.8%
Simplified99.8%
Taylor expanded in i around inf 99.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%
associate-/r/1.8%
associate-*r*1.8%
*-commutative1.8%
associate-*r/1.8%
sub-neg1.8%
distribute-lft-in1.8%
metadata-eval1.8%
metadata-eval1.8%
metadata-eval1.8%
fma-define1.8%
metadata-eval1.8%
Simplified1.8%
Taylor expanded in i around 0 70.7%
*-commutative70.7%
Simplified70.7%
Final simplification93.1%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* 100.0 (* n (/ (expm1 i) i)))))
(if (<= n -5.5e-211)
t_0
(if (<= n 2.75e-257)
(/ 0.0 (/ i n))
(if (<= n 1.35e-27) (* 100.0 (/ i (/ i n))) t_0)))))
double code(double i, double n) {
double t_0 = 100.0 * (n * (expm1(i) / i));
double tmp;
if (n <= -5.5e-211) {
tmp = t_0;
} else if (n <= 2.75e-257) {
tmp = 0.0 / (i / n);
} else if (n <= 1.35e-27) {
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 * (n * (Math.expm1(i) / i));
double tmp;
if (n <= -5.5e-211) {
tmp = t_0;
} else if (n <= 2.75e-257) {
tmp = 0.0 / (i / n);
} else if (n <= 1.35e-27) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = 100.0 * (n * (math.expm1(i) / i)) tmp = 0 if n <= -5.5e-211: tmp = t_0 elif n <= 2.75e-257: tmp = 0.0 / (i / n) elif n <= 1.35e-27: tmp = 100.0 * (i / (i / n)) else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(100.0 * Float64(n * Float64(expm1(i) / i))) tmp = 0.0 if (n <= -5.5e-211) tmp = t_0; elseif (n <= 2.75e-257) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 1.35e-27) 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 * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -5.5e-211], t$95$0, If[LessEqual[n, 2.75e-257], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.35e-27], 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 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\
\mathbf{if}\;n \leq -5.5 \cdot 10^{-211}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 2.75 \cdot 10^{-257}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.35 \cdot 10^{-27}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -5.49999999999999973e-211 or 1.34999999999999994e-27 < n Initial program 22.4%
Taylor expanded in n around inf 32.9%
*-commutative32.9%
associate-/l*32.9%
expm1-define85.0%
Simplified85.0%
if -5.49999999999999973e-211 < n < 2.75000000000000012e-257Initial program 57.9%
associate-*r/57.9%
sub-neg57.9%
distribute-rgt-in57.9%
metadata-eval57.9%
metadata-eval57.9%
Simplified57.9%
Taylor expanded in i around 0 84.9%
if 2.75000000000000012e-257 < n < 1.34999999999999994e-27Initial program 10.8%
Taylor expanded in i around 0 68.2%
Final simplification82.3%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* n (/ (* 100.0 (expm1 i)) i))))
(if (<= n -3.4e-211)
t_0
(if (<= n 9e-257)
(/ 0.0 (/ i n))
(if (<= n 1.9e-27) (* 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 <= -3.4e-211) {
tmp = t_0;
} else if (n <= 9e-257) {
tmp = 0.0 / (i / n);
} else if (n <= 1.9e-27) {
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 <= -3.4e-211) {
tmp = t_0;
} else if (n <= 9e-257) {
tmp = 0.0 / (i / n);
} else if (n <= 1.9e-27) {
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 <= -3.4e-211: tmp = t_0 elif n <= 9e-257: tmp = 0.0 / (i / n) elif n <= 1.9e-27: tmp = 100.0 * (i / (i / n)) else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(n * Float64(Float64(100.0 * expm1(i)) / i)) tmp = 0.0 if (n <= -3.4e-211) tmp = t_0; elseif (n <= 9e-257) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 1.9e-27) 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[(N[(100.0 * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -3.4e-211], t$95$0, If[LessEqual[n, 9e-257], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.9e-27], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{i}\\
\mathbf{if}\;n \leq -3.4 \cdot 10^{-211}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 9 \cdot 10^{-257}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.9 \cdot 10^{-27}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -3.4000000000000001e-211 or 1.9e-27 < n Initial program 22.4%
associate-/r/22.8%
associate-*r*22.8%
*-commutative22.8%
associate-*r/22.8%
sub-neg22.8%
distribute-lft-in22.8%
metadata-eval22.8%
metadata-eval22.8%
metadata-eval22.8%
fma-define22.8%
metadata-eval22.8%
Simplified22.8%
Taylor expanded in n around inf 32.9%
sub-neg32.9%
metadata-eval32.9%
metadata-eval32.9%
distribute-lft-in32.9%
metadata-eval32.9%
sub-neg32.9%
expm1-define85.0%
Simplified85.0%
if -3.4000000000000001e-211 < n < 9.0000000000000005e-257Initial program 57.9%
associate-*r/57.9%
sub-neg57.9%
distribute-rgt-in57.9%
metadata-eval57.9%
metadata-eval57.9%
Simplified57.9%
Taylor expanded in i around 0 84.9%
if 9.0000000000000005e-257 < n < 1.9e-27Initial program 10.8%
Taylor expanded in i around 0 68.2%
Final simplification82.2%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* 100.0 (/ (expm1 i) (/ i n)))))
(if (<= i -4.2e-9)
t_0
(if (<= i 1.05e-21)
(* 100.0 (+ n (* i (* n (+ 0.5 (* 0.5 (/ -1.0 n)))))))
(if (<= i 7.8e+221) t_0 (* 100.0 (- (* (/ n i) (+ 1.0 i)) (/ n i))))))))
double code(double i, double n) {
double t_0 = 100.0 * (expm1(i) / (i / n));
double tmp;
if (i <= -4.2e-9) {
tmp = t_0;
} else if (i <= 1.05e-21) {
tmp = 100.0 * (n + (i * (n * (0.5 + (0.5 * (-1.0 / n))))));
} else if (i <= 7.8e+221) {
tmp = t_0;
} else {
tmp = 100.0 * (((n / i) * (1.0 + i)) - (n / i));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = 100.0 * (Math.expm1(i) / (i / n));
double tmp;
if (i <= -4.2e-9) {
tmp = t_0;
} else if (i <= 1.05e-21) {
tmp = 100.0 * (n + (i * (n * (0.5 + (0.5 * (-1.0 / n))))));
} else if (i <= 7.8e+221) {
tmp = t_0;
} else {
tmp = 100.0 * (((n / i) * (1.0 + i)) - (n / i));
}
return tmp;
}
def code(i, n): t_0 = 100.0 * (math.expm1(i) / (i / n)) tmp = 0 if i <= -4.2e-9: tmp = t_0 elif i <= 1.05e-21: tmp = 100.0 * (n + (i * (n * (0.5 + (0.5 * (-1.0 / n)))))) elif i <= 7.8e+221: tmp = t_0 else: tmp = 100.0 * (((n / i) * (1.0 + i)) - (n / i)) return tmp
function code(i, n) t_0 = Float64(100.0 * Float64(expm1(i) / Float64(i / n))) tmp = 0.0 if (i <= -4.2e-9) tmp = t_0; elseif (i <= 1.05e-21) tmp = Float64(100.0 * Float64(n + Float64(i * Float64(n * Float64(0.5 + Float64(0.5 * Float64(-1.0 / n))))))); elseif (i <= 7.8e+221) tmp = t_0; else tmp = Float64(100.0 * Float64(Float64(Float64(n / i) * Float64(1.0 + i)) - Float64(n / i))); 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, -4.2e-9], t$95$0, If[LessEqual[i, 1.05e-21], N[(100.0 * N[(n + N[(i * N[(n * N[(0.5 + N[(0.5 * N[(-1.0 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 7.8e+221], t$95$0, N[(100.0 * N[(N[(N[(n / i), $MachinePrecision] * N[(1.0 + i), $MachinePrecision]), $MachinePrecision] - N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\
\mathbf{if}\;i \leq -4.2 \cdot 10^{-9}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;i \leq 1.05 \cdot 10^{-21}:\\
\;\;\;\;100 \cdot \left(n + i \cdot \left(n \cdot \left(0.5 + 0.5 \cdot \frac{-1}{n}\right)\right)\right)\\
\mathbf{elif}\;i \leq 7.8 \cdot 10^{+221}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(\frac{n}{i} \cdot \left(1 + i\right) - \frac{n}{i}\right)\\
\end{array}
\end{array}
if i < -4.20000000000000039e-9 or 1.05000000000000006e-21 < i < 7.8e221Initial program 45.2%
Taylor expanded in n around inf 64.1%
expm1-define66.8%
Simplified66.8%
if -4.20000000000000039e-9 < i < 1.05000000000000006e-21Initial program 9.3%
Taylor expanded in i around 0 83.4%
if 7.8e221 < i Initial program 35.0%
div-sub35.0%
clear-num35.2%
sub-neg35.2%
div-inv35.2%
clear-num35.1%
Applied egg-rr35.1%
sub-neg35.1%
Simplified35.1%
Taylor expanded in i around 0 52.1%
+-commutative52.1%
Simplified52.1%
Final simplification75.1%
(FPCore (i n)
:precision binary64
(let* ((t_0
(*
n
(+
100.0
(*
i
(+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667)))))))))
(if (<= n -1.15e-161)
t_0
(if (<= n 9.8e-259)
(/ 0.0 (/ i n))
(if (<= n 1.9e-27) (* 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 + (i * 4.166666666666667))))));
double tmp;
if (n <= -1.15e-161) {
tmp = t_0;
} else if (n <= 9.8e-259) {
tmp = 0.0 / (i / n);
} else if (n <= 1.9e-27) {
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 + (i * 4.166666666666667d0))))))
if (n <= (-1.15d-161)) then
tmp = t_0
else if (n <= 9.8d-259) then
tmp = 0.0d0 / (i / n)
else if (n <= 1.9d-27) 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 + (i * 4.166666666666667))))));
double tmp;
if (n <= -1.15e-161) {
tmp = t_0;
} else if (n <= 9.8e-259) {
tmp = 0.0 / (i / n);
} else if (n <= 1.9e-27) {
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 + (i * 4.166666666666667)))))) tmp = 0 if n <= -1.15e-161: tmp = t_0 elif n <= 9.8e-259: tmp = 0.0 / (i / n) elif n <= 1.9e-27: 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 * Float64(16.666666666666668 + Float64(i * 4.166666666666667))))))) tmp = 0.0 if (n <= -1.15e-161) tmp = t_0; elseif (n <= 9.8e-259) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 1.9e-27) 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 + (i * 4.166666666666667)))))); tmp = 0.0; if (n <= -1.15e-161) tmp = t_0; elseif (n <= 9.8e-259) tmp = 0.0 / (i / n); elseif (n <= 1.9e-27) 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 * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.15e-161], t$95$0, If[LessEqual[n, 9.8e-259], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.9e-27], 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 \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\\
\mathbf{if}\;n \leq -1.15 \cdot 10^{-161}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 9.8 \cdot 10^{-259}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.9 \cdot 10^{-27}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -1.15e-161 or 1.9e-27 < n Initial program 21.0%
associate-*r/21.0%
sub-neg21.0%
distribute-rgt-in21.0%
metadata-eval21.0%
metadata-eval21.0%
Simplified21.0%
metadata-eval21.0%
metadata-eval21.0%
distribute-rgt-in21.0%
sub-neg21.0%
associate-*r/21.0%
associate-/r/21.4%
associate-*r*21.3%
add-exp-log21.3%
expm1-define21.3%
log-pow19.5%
log1p-define70.7%
Applied egg-rr70.7%
clear-num70.7%
un-div-inv70.8%
Applied egg-rr70.8%
associate-/r/70.8%
Simplified70.8%
Taylor expanded in n around inf 32.4%
expm1-define84.9%
Simplified84.9%
Taylor expanded in i around 0 70.9%
*-commutative70.9%
Simplified70.9%
if -1.15e-161 < n < 9.80000000000000045e-259Initial program 58.2%
associate-*r/58.2%
sub-neg58.2%
distribute-rgt-in58.2%
metadata-eval58.2%
metadata-eval58.2%
Simplified58.2%
Taylor expanded in i around 0 79.5%
if 9.80000000000000045e-259 < n < 1.9e-27Initial program 10.8%
Taylor expanded in i around 0 68.2%
Final simplification71.6%
(FPCore (i n)
:precision binary64
(if (<= n -6e-162)
(* 100.0 (+ n (* i (+ (* 0.16666666666666666 (* i n)) (* n 0.5)))))
(if (<= n 9e-257)
(/ 0.0 (/ i n))
(if (<= n 1.9e-27)
(* 100.0 (/ i (/ i n)))
(* n (* (/ 100.0 i) (* i (+ 1.0 (* i 0.5)))))))))
double code(double i, double n) {
double tmp;
if (n <= -6e-162) {
tmp = 100.0 * (n + (i * ((0.16666666666666666 * (i * n)) + (n * 0.5))));
} else if (n <= 9e-257) {
tmp = 0.0 / (i / n);
} else if (n <= 1.9e-27) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * ((100.0 / i) * (i * (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 <= (-6d-162)) then
tmp = 100.0d0 * (n + (i * ((0.16666666666666666d0 * (i * n)) + (n * 0.5d0))))
else if (n <= 9d-257) then
tmp = 0.0d0 / (i / n)
else if (n <= 1.9d-27) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = n * ((100.0d0 / i) * (i * (1.0d0 + (i * 0.5d0))))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -6e-162) {
tmp = 100.0 * (n + (i * ((0.16666666666666666 * (i * n)) + (n * 0.5))));
} else if (n <= 9e-257) {
tmp = 0.0 / (i / n);
} else if (n <= 1.9e-27) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * ((100.0 / i) * (i * (1.0 + (i * 0.5))));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -6e-162: tmp = 100.0 * (n + (i * ((0.16666666666666666 * (i * n)) + (n * 0.5)))) elif n <= 9e-257: tmp = 0.0 / (i / n) elif n <= 1.9e-27: tmp = 100.0 * (i / (i / n)) else: tmp = n * ((100.0 / i) * (i * (1.0 + (i * 0.5)))) return tmp
function code(i, n) tmp = 0.0 if (n <= -6e-162) tmp = Float64(100.0 * Float64(n + Float64(i * Float64(Float64(0.16666666666666666 * Float64(i * n)) + Float64(n * 0.5))))); elseif (n <= 9e-257) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 1.9e-27) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(n * Float64(Float64(100.0 / i) * Float64(i * Float64(1.0 + Float64(i * 0.5))))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -6e-162) tmp = 100.0 * (n + (i * ((0.16666666666666666 * (i * n)) + (n * 0.5)))); elseif (n <= 9e-257) tmp = 0.0 / (i / n); elseif (n <= 1.9e-27) tmp = 100.0 * (i / (i / n)); else tmp = n * ((100.0 / i) * (i * (1.0 + (i * 0.5)))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -6e-162], N[(100.0 * N[(n + N[(i * N[(N[(0.16666666666666666 * N[(i * n), $MachinePrecision]), $MachinePrecision] + N[(n * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 9e-257], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.9e-27], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(N[(100.0 / i), $MachinePrecision] * N[(i * N[(1.0 + N[(i * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -6 \cdot 10^{-162}:\\
\;\;\;\;100 \cdot \left(n + i \cdot \left(0.16666666666666666 \cdot \left(i \cdot n\right) + n \cdot 0.5\right)\right)\\
\mathbf{elif}\;n \leq 9 \cdot 10^{-257}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.9 \cdot 10^{-27}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(\frac{100}{i} \cdot \left(i \cdot \left(1 + i \cdot 0.5\right)\right)\right)\\
\end{array}
\end{array}
if n < -5.99999999999999997e-162Initial program 21.4%
Taylor expanded in n around inf 35.2%
expm1-define63.3%
Simplified63.3%
Taylor expanded in i around 0 61.1%
if -5.99999999999999997e-162 < n < 9.0000000000000005e-257Initial program 58.2%
associate-*r/58.2%
sub-neg58.2%
distribute-rgt-in58.2%
metadata-eval58.2%
metadata-eval58.2%
Simplified58.2%
Taylor expanded in i around 0 79.5%
if 9.0000000000000005e-257 < n < 1.9e-27Initial program 10.8%
Taylor expanded in i around 0 68.2%
if 1.9e-27 < n Initial program 20.2%
associate-*r/20.2%
sub-neg20.2%
distribute-rgt-in20.2%
metadata-eval20.2%
metadata-eval20.2%
Simplified20.2%
metadata-eval20.2%
metadata-eval20.2%
distribute-rgt-in20.2%
sub-neg20.2%
associate-*r/20.2%
associate-/r/20.7%
associate-*r*20.7%
add-exp-log20.7%
expm1-define20.7%
log-pow14.9%
log1p-define68.5%
Applied egg-rr68.5%
clear-num68.5%
un-div-inv68.6%
Applied egg-rr68.6%
associate-/r/68.5%
Simplified68.5%
Taylor expanded in n around inf 26.6%
expm1-define90.7%
Simplified90.7%
Taylor expanded in i around 0 81.9%
*-commutative81.9%
Simplified81.9%
Final simplification69.8%
(FPCore (i n)
:precision binary64
(if (<= n -1.8e-162)
(* n (+ 100.0 (* i (+ 50.0 (* i 16.666666666666668)))))
(if (<= n 8.6e-257)
(/ 0.0 (/ i n))
(if (<= n 1.9e-27)
(* 100.0 (/ i (/ i n)))
(* n (* (/ 100.0 i) (* i (+ 1.0 (* i 0.5)))))))))
double code(double i, double n) {
double tmp;
if (n <= -1.8e-162) {
tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
} else if (n <= 8.6e-257) {
tmp = 0.0 / (i / n);
} else if (n <= 1.9e-27) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * ((100.0 / i) * (i * (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.8d-162)) then
tmp = n * (100.0d0 + (i * (50.0d0 + (i * 16.666666666666668d0))))
else if (n <= 8.6d-257) then
tmp = 0.0d0 / (i / n)
else if (n <= 1.9d-27) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = n * ((100.0d0 / i) * (i * (1.0d0 + (i * 0.5d0))))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -1.8e-162) {
tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
} else if (n <= 8.6e-257) {
tmp = 0.0 / (i / n);
} else if (n <= 1.9e-27) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * ((100.0 / i) * (i * (1.0 + (i * 0.5))));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.8e-162: tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))) elif n <= 8.6e-257: tmp = 0.0 / (i / n) elif n <= 1.9e-27: tmp = 100.0 * (i / (i / n)) else: tmp = n * ((100.0 / i) * (i * (1.0 + (i * 0.5)))) return tmp
function code(i, n) tmp = 0.0 if (n <= -1.8e-162) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * 16.666666666666668))))); elseif (n <= 8.6e-257) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 1.9e-27) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(n * Float64(Float64(100.0 / i) * Float64(i * Float64(1.0 + Float64(i * 0.5))))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -1.8e-162) tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))); elseif (n <= 8.6e-257) tmp = 0.0 / (i / n); elseif (n <= 1.9e-27) tmp = 100.0 * (i / (i / n)); else tmp = n * ((100.0 / i) * (i * (1.0 + (i * 0.5)))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.8e-162], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 8.6e-257], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.9e-27], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(N[(100.0 / i), $MachinePrecision] * N[(i * N[(1.0 + N[(i * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.8 \cdot 10^{-162}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\
\mathbf{elif}\;n \leq 8.6 \cdot 10^{-257}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.9 \cdot 10^{-27}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(\frac{100}{i} \cdot \left(i \cdot \left(1 + i \cdot 0.5\right)\right)\right)\\
\end{array}
\end{array}
if n < -1.7999999999999999e-162Initial program 21.4%
associate-*r/21.4%
sub-neg21.4%
distribute-rgt-in21.4%
metadata-eval21.4%
metadata-eval21.4%
Simplified21.4%
metadata-eval21.4%
metadata-eval21.4%
distribute-rgt-in21.4%
sub-neg21.4%
associate-*r/21.4%
associate-/r/21.7%
associate-*r*21.7%
add-exp-log21.7%
expm1-define21.7%
log-pow22.0%
log1p-define72.0%
Applied egg-rr72.0%
clear-num71.9%
un-div-inv72.0%
Applied egg-rr72.0%
associate-/r/72.0%
Simplified72.0%
Taylor expanded in n around inf 35.7%
expm1-define81.8%
Simplified81.8%
Taylor expanded in i around 0 61.1%
*-commutative61.1%
Simplified61.1%
if -1.7999999999999999e-162 < n < 8.59999999999999995e-257Initial program 58.2%
associate-*r/58.2%
sub-neg58.2%
distribute-rgt-in58.2%
metadata-eval58.2%
metadata-eval58.2%
Simplified58.2%
Taylor expanded in i around 0 79.5%
if 8.59999999999999995e-257 < n < 1.9e-27Initial program 10.8%
Taylor expanded in i around 0 68.2%
if 1.9e-27 < n Initial program 20.2%
associate-*r/20.2%
sub-neg20.2%
distribute-rgt-in20.2%
metadata-eval20.2%
metadata-eval20.2%
Simplified20.2%
metadata-eval20.2%
metadata-eval20.2%
distribute-rgt-in20.2%
sub-neg20.2%
associate-*r/20.2%
associate-/r/20.7%
associate-*r*20.7%
add-exp-log20.7%
expm1-define20.7%
log-pow14.9%
log1p-define68.5%
Applied egg-rr68.5%
clear-num68.5%
un-div-inv68.6%
Applied egg-rr68.6%
associate-/r/68.5%
Simplified68.5%
Taylor expanded in n around inf 26.6%
expm1-define90.7%
Simplified90.7%
Taylor expanded in i around 0 81.9%
*-commutative81.9%
Simplified81.9%
Final simplification69.8%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* n (+ 100.0 (* i (+ 50.0 (* i 16.666666666666668)))))))
(if (<= n -1.6e-162)
t_0
(if (<= n 9.5e-258)
(/ 0.0 (/ i n))
(if (<= n 1.35e-27) (* 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 <= -1.6e-162) {
tmp = t_0;
} else if (n <= 9.5e-258) {
tmp = 0.0 / (i / n);
} else if (n <= 1.35e-27) {
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 <= (-1.6d-162)) then
tmp = t_0
else if (n <= 9.5d-258) then
tmp = 0.0d0 / (i / n)
else if (n <= 1.35d-27) 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 <= -1.6e-162) {
tmp = t_0;
} else if (n <= 9.5e-258) {
tmp = 0.0 / (i / n);
} else if (n <= 1.35e-27) {
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 <= -1.6e-162: tmp = t_0 elif n <= 9.5e-258: tmp = 0.0 / (i / n) elif n <= 1.35e-27: 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 <= -1.6e-162) tmp = t_0; elseif (n <= 9.5e-258) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 1.35e-27) 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 <= -1.6e-162) tmp = t_0; elseif (n <= 9.5e-258) tmp = 0.0 / (i / n); elseif (n <= 1.35e-27) 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, -1.6e-162], t$95$0, If[LessEqual[n, 9.5e-258], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.35e-27], 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 -1.6 \cdot 10^{-162}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 9.5 \cdot 10^{-258}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.35 \cdot 10^{-27}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -1.59999999999999988e-162 or 1.34999999999999994e-27 < n Initial program 21.0%
associate-*r/21.0%
sub-neg21.0%
distribute-rgt-in21.0%
metadata-eval21.0%
metadata-eval21.0%
Simplified21.0%
metadata-eval21.0%
metadata-eval21.0%
distribute-rgt-in21.0%
sub-neg21.0%
associate-*r/21.0%
associate-/r/21.4%
associate-*r*21.3%
add-exp-log21.3%
expm1-define21.3%
log-pow19.5%
log1p-define70.7%
Applied egg-rr70.7%
clear-num70.7%
un-div-inv70.8%
Applied egg-rr70.8%
associate-/r/70.8%
Simplified70.8%
Taylor expanded in n around inf 32.4%
expm1-define84.9%
Simplified84.9%
Taylor expanded in i around 0 67.5%
*-commutative67.5%
Simplified67.5%
if -1.59999999999999988e-162 < n < 9.5000000000000009e-258Initial program 58.2%
associate-*r/58.2%
sub-neg58.2%
distribute-rgt-in58.2%
metadata-eval58.2%
metadata-eval58.2%
Simplified58.2%
Taylor expanded in i around 0 79.5%
if 9.5000000000000009e-258 < n < 1.34999999999999994e-27Initial program 10.8%
Taylor expanded in i around 0 68.2%
Final simplification69.1%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* n (+ 100.0 (* i 50.0)))))
(if (<= n -5e-162)
t_0
(if (<= n 9e-257)
(/ 0.0 (/ i n))
(if (<= n 5.2e-26) (* 100.0 (/ i (/ i n))) t_0)))))
double code(double i, double n) {
double t_0 = n * (100.0 + (i * 50.0));
double tmp;
if (n <= -5e-162) {
tmp = t_0;
} else if (n <= 9e-257) {
tmp = 0.0 / (i / n);
} else if (n <= 5.2e-26) {
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))
if (n <= (-5d-162)) then
tmp = t_0
else if (n <= 9d-257) then
tmp = 0.0d0 / (i / n)
else if (n <= 5.2d-26) 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));
double tmp;
if (n <= -5e-162) {
tmp = t_0;
} else if (n <= 9e-257) {
tmp = 0.0 / (i / n);
} else if (n <= 5.2e-26) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = n * (100.0 + (i * 50.0)) tmp = 0 if n <= -5e-162: tmp = t_0 elif n <= 9e-257: tmp = 0.0 / (i / n) elif n <= 5.2e-26: 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 * 50.0))) tmp = 0.0 if (n <= -5e-162) tmp = t_0; elseif (n <= 9e-257) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 5.2e-26) 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)); tmp = 0.0; if (n <= -5e-162) tmp = t_0; elseif (n <= 9e-257) tmp = 0.0 / (i / n); elseif (n <= 5.2e-26) 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 * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -5e-162], t$95$0, If[LessEqual[n, 9e-257], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5.2e-26], 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 50\right)\\
\mathbf{if}\;n \leq -5 \cdot 10^{-162}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 9 \cdot 10^{-257}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 5.2 \cdot 10^{-26}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -5.00000000000000014e-162 or 5.2000000000000002e-26 < n Initial program 21.1%
associate-*r/21.2%
sub-neg21.2%
distribute-rgt-in21.2%
metadata-eval21.2%
metadata-eval21.2%
Simplified21.2%
metadata-eval21.2%
metadata-eval21.2%
distribute-rgt-in21.2%
sub-neg21.2%
associate-*r/21.1%
associate-/r/21.6%
associate-*r*21.5%
add-exp-log21.5%
expm1-define21.5%
log-pow19.3%
log1p-define70.4%
Applied egg-rr70.4%
clear-num70.4%
un-div-inv70.5%
Applied egg-rr70.5%
associate-/r/70.4%
Simplified70.4%
Taylor expanded in n around inf 32.8%
expm1-define85.0%
Simplified85.0%
Taylor expanded in i around 0 66.4%
if -5.00000000000000014e-162 < n < 9.0000000000000005e-257Initial program 58.2%
associate-*r/58.2%
sub-neg58.2%
distribute-rgt-in58.2%
metadata-eval58.2%
metadata-eval58.2%
Simplified58.2%
Taylor expanded in i around 0 79.5%
if 9.0000000000000005e-257 < n < 5.2000000000000002e-26Initial program 10.4%
Taylor expanded in i around 0 68.5%
Final simplification68.4%
(FPCore (i n) :precision binary64 (if (or (<= n -9.5e+73) (not (<= n 5.2e-26))) (* n (+ 100.0 (* i 50.0))) (* 100.0 (/ i (/ i n)))))
double code(double i, double n) {
double tmp;
if ((n <= -9.5e+73) || !(n <= 5.2e-26)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-9.5d+73)) .or. (.not. (n <= 5.2d-26))) then
tmp = n * (100.0d0 + (i * 50.0d0))
else
tmp = 100.0d0 * (i / (i / n))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -9.5e+73) || !(n <= 5.2e-26)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -9.5e+73) or not (n <= 5.2e-26): tmp = n * (100.0 + (i * 50.0)) else: tmp = 100.0 * (i / (i / n)) return tmp
function code(i, n) tmp = 0.0 if ((n <= -9.5e+73) || !(n <= 5.2e-26)) tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); else tmp = Float64(100.0 * Float64(i / Float64(i / n))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -9.5e+73) || ~((n <= 5.2e-26))) tmp = n * (100.0 + (i * 50.0)); else tmp = 100.0 * (i / (i / n)); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -9.5e+73], N[Not[LessEqual[n, 5.2e-26]], $MachinePrecision]], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -9.5 \cdot 10^{+73} \lor \neg \left(n \leq 5.2 \cdot 10^{-26}\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -9.4999999999999996e73 or 5.2000000000000002e-26 < n Initial program 18.2%
associate-*r/18.2%
sub-neg18.2%
distribute-rgt-in18.2%
metadata-eval18.2%
metadata-eval18.2%
Simplified18.2%
metadata-eval18.2%
metadata-eval18.2%
distribute-rgt-in18.2%
sub-neg18.2%
associate-*r/18.2%
associate-/r/18.7%
associate-*r*18.7%
add-exp-log18.7%
expm1-define18.7%
log-pow9.9%
log1p-define64.0%
Applied egg-rr64.0%
clear-num64.0%
un-div-inv64.0%
Applied egg-rr64.0%
associate-/r/64.0%
Simplified64.0%
Taylor expanded in n around inf 35.7%
expm1-define90.4%
Simplified90.4%
Taylor expanded in i around 0 71.8%
if -9.4999999999999996e73 < n < 5.2000000000000002e-26Initial program 31.3%
Taylor expanded in i around 0 58.9%
Final simplification66.0%
(FPCore (i n) :precision binary64 (if (or (<= i -5e-7) (not (<= i 6200000000000.0))) (* 100.0 (/ i (/ i n))) (* 100.0 (+ n (* i -0.5)))))
double code(double i, double n) {
double tmp;
if ((i <= -5e-7) || !(i <= 6200000000000.0)) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = 100.0 * (n + (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 ((i <= (-5d-7)) .or. (.not. (i <= 6200000000000.0d0))) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = 100.0d0 * (n + (i * (-0.5d0)))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((i <= -5e-7) || !(i <= 6200000000000.0)) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = 100.0 * (n + (i * -0.5));
}
return tmp;
}
def code(i, n): tmp = 0 if (i <= -5e-7) or not (i <= 6200000000000.0): tmp = 100.0 * (i / (i / n)) else: tmp = 100.0 * (n + (i * -0.5)) return tmp
function code(i, n) tmp = 0.0 if ((i <= -5e-7) || !(i <= 6200000000000.0)) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(100.0 * Float64(n + Float64(i * -0.5))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((i <= -5e-7) || ~((i <= 6200000000000.0))) tmp = 100.0 * (i / (i / n)); else tmp = 100.0 * (n + (i * -0.5)); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[i, -5e-7], N[Not[LessEqual[i, 6200000000000.0]], $MachinePrecision]], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -5 \cdot 10^{-7} \lor \neg \left(i \leq 6200000000000\right):\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n + i \cdot -0.5\right)\\
\end{array}
\end{array}
if i < -4.99999999999999977e-7 or 6.2e12 < i Initial program 46.1%
Taylor expanded in i around 0 27.8%
if -4.99999999999999977e-7 < i < 6.2e12Initial program 9.0%
Taylor expanded in i around 0 83.3%
associate-*r*82.9%
*-commutative82.9%
associate-*r/82.9%
metadata-eval82.9%
Simplified82.9%
Taylor expanded in n around 0 82.1%
*-commutative82.1%
Simplified82.1%
Final simplification60.0%
(FPCore (i n) :precision binary64 (* n 100.0))
double code(double i, double n) {
return n * 100.0;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = n * 100.0d0
end function
public static double code(double i, double n) {
return n * 100.0;
}
def code(i, n): return n * 100.0
function code(i, n) return Float64(n * 100.0) end
function tmp = code(i, n) tmp = n * 100.0; end
code[i_, n_] := N[(n * 100.0), $MachinePrecision]
\begin{array}{l}
\\
n \cdot 100
\end{array}
Initial program 24.1%
associate-/r/24.5%
associate-*r*24.5%
*-commutative24.5%
associate-*r/24.5%
sub-neg24.5%
distribute-lft-in24.5%
metadata-eval24.5%
metadata-eval24.5%
metadata-eval24.5%
fma-define24.5%
metadata-eval24.5%
Simplified24.5%
Taylor expanded in i around 0 50.5%
*-commutative50.5%
Simplified50.5%
(FPCore (i n) :precision binary64 (* i -50.0))
double code(double i, double n) {
return i * -50.0;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = i * (-50.0d0)
end function
public static double code(double i, double n) {
return i * -50.0;
}
def code(i, n): return i * -50.0
function code(i, n) return Float64(i * -50.0) end
function tmp = code(i, n) tmp = i * -50.0; end
code[i_, n_] := N[(i * -50.0), $MachinePrecision]
\begin{array}{l}
\\
i \cdot -50
\end{array}
Initial program 24.1%
Taylor expanded in i around 0 57.3%
associate-*r*57.1%
*-commutative57.1%
associate-*r/57.1%
metadata-eval57.1%
Simplified57.1%
Taylor expanded in n around 0 3.0%
*-commutative3.0%
Simplified3.0%
(FPCore (i n)
:precision binary64
(let* ((t_0 (+ 1.0 (/ i n))))
(*
100.0
(/
(-
(exp
(*
n
(if (== t_0 1.0)
(/ i n)
(/ (* (/ i n) (log t_0)) (- (+ (/ i n) 1.0) 1.0)))))
1.0)
(/ i n)))))
double code(double i, double n) {
double t_0 = 1.0 + (i / n);
double tmp;
if (t_0 == 1.0) {
tmp = i / n;
} else {
tmp = ((i / n) * log(t_0)) / (((i / n) + 1.0) - 1.0);
}
return 100.0 * ((exp((n * tmp)) - 1.0) / (i / n));
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (i / n)
if (t_0 == 1.0d0) then
tmp = i / n
else
tmp = ((i / n) * log(t_0)) / (((i / n) + 1.0d0) - 1.0d0)
end if
code = 100.0d0 * ((exp((n * tmp)) - 1.0d0) / (i / n))
end function
public static double code(double i, double n) {
double t_0 = 1.0 + (i / n);
double tmp;
if (t_0 == 1.0) {
tmp = i / n;
} else {
tmp = ((i / n) * Math.log(t_0)) / (((i / n) + 1.0) - 1.0);
}
return 100.0 * ((Math.exp((n * tmp)) - 1.0) / (i / n));
}
def code(i, n): t_0 = 1.0 + (i / n) tmp = 0 if t_0 == 1.0: tmp = i / n else: tmp = ((i / n) * math.log(t_0)) / (((i / n) + 1.0) - 1.0) return 100.0 * ((math.exp((n * tmp)) - 1.0) / (i / n))
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) tmp = 0.0 if (t_0 == 1.0) tmp = Float64(i / n); else tmp = Float64(Float64(Float64(i / n) * log(t_0)) / Float64(Float64(Float64(i / n) + 1.0) - 1.0)); end return Float64(100.0 * Float64(Float64(exp(Float64(n * tmp)) - 1.0) / Float64(i / n))) end
function tmp_2 = code(i, n) t_0 = 1.0 + (i / n); tmp = 0.0; if (t_0 == 1.0) tmp = i / n; else tmp = ((i / n) * log(t_0)) / (((i / n) + 1.0) - 1.0); end tmp_2 = 100.0 * ((exp((n * tmp)) - 1.0) / (i / n)); end
code[i_, n_] := Block[{t$95$0 = N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision]}, N[(100.0 * N[(N[(N[Exp[N[(n * If[Equal[t$95$0, 1.0], N[(i / n), $MachinePrecision], N[(N[(N[(i / n), $MachinePrecision] * N[Log[t$95$0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(i / n), $MachinePrecision] + 1.0), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]], $MachinePrecision] - 1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{i}{n}\\
100 \cdot \frac{e^{n \cdot \begin{array}{l}
\mathbf{if}\;t\_0 = 1:\\
\;\;\;\;\frac{i}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{i}{n} \cdot \log t\_0}{\left(\frac{i}{n} + 1\right) - 1}\\
\end{array}} - 1}{\frac{i}{n}}
\end{array}
\end{array}
herbie shell --seed 2024157
(FPCore (i n)
:name "Compound Interest"
:precision binary64
:alt
(! :herbie-platform default (let ((lnbase (if (== (+ 1 (/ i n)) 1) (/ i n) (/ (* (/ i n) (log (+ 1 (/ i n)))) (- (+ (/ i n) 1) 1))))) (* 100 (/ (- (exp (* n lnbase)) 1) (/ i n)))))
(* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))