
(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)))
(t_2 (* n (/ (+ (* t_0 100.0) -100.0) i))))
(if (<= t_1 -1e-144)
t_2
(if (<= t_1 1e-261)
(/ (* 100.0 (expm1 (* n (log1p (/ i n))))) (/ i n))
(if (<= t_1 INFINITY)
t_2
(/ (* n 100.0) (+ 1.0 (* i (+ (/ 0.5 n) -0.5)))))))))
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 t_2 = n * (((t_0 * 100.0) + -100.0) / i);
double tmp;
if (t_1 <= -1e-144) {
tmp = t_2;
} else if (t_1 <= 1e-261) {
tmp = (100.0 * expm1((n * log1p((i / n))))) / (i / n);
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = Math.pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double t_2 = n * (((t_0 * 100.0) + -100.0) / i);
double tmp;
if (t_1 <= -1e-144) {
tmp = t_2;
} else if (t_1 <= 1e-261) {
tmp = (100.0 * Math.expm1((n * Math.log1p((i / n))))) / (i / n);
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
return tmp;
}
def code(i, n): t_0 = math.pow((1.0 + (i / n)), n) t_1 = (t_0 + -1.0) / (i / n) t_2 = n * (((t_0 * 100.0) + -100.0) / i) tmp = 0 if t_1 <= -1e-144: tmp = t_2 elif t_1 <= 1e-261: tmp = (100.0 * math.expm1((n * math.log1p((i / n))))) / (i / n) elif t_1 <= math.inf: tmp = t_2 else: tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))) 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)) t_2 = Float64(n * Float64(Float64(Float64(t_0 * 100.0) + -100.0) / i)) tmp = 0.0 if (t_1 <= -1e-144) tmp = t_2; elseif (t_1 <= 1e-261) tmp = Float64(Float64(100.0 * expm1(Float64(n * log1p(Float64(i / n))))) / Float64(i / n)); elseif (t_1 <= Inf) tmp = t_2; else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * Float64(Float64(0.5 / n) + -0.5)))); 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]}, Block[{t$95$2 = N[(n * N[(N[(N[(t$95$0 * 100.0), $MachinePrecision] + -100.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-144], t$95$2, If[LessEqual[t$95$1, 1e-261], 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], t$95$2, N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $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}}\\
t_2 := n \cdot \frac{t\_0 \cdot 100 + -100}{i}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-144}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{-261}:\\
\;\;\;\;\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\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot \left(\frac{0.5}{n} + -0.5\right)}\\
\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)) < -9.9999999999999995e-145 or 9.99999999999999984e-262 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < +inf.0Initial program 99.6%
associate-/r/99.7%
associate-*r*99.6%
*-commutative99.6%
associate-*r/99.9%
sub-neg99.9%
distribute-lft-in99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
fma-define99.9%
metadata-eval99.9%
Simplified99.9%
fma-undefine99.9%
*-commutative99.9%
Applied egg-rr99.9%
if -9.9999999999999995e-145 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < 9.99999999999999984e-262Initial program 22.1%
*-commutative22.1%
frac-2neg22.1%
associate-*l/22.1%
add-exp-log22.1%
expm1-define22.1%
log-pow34.4%
log1p-define99.6%
distribute-neg-frac299.6%
Applied egg-rr99.6%
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/0.0%
sub-neg0.0%
distribute-rgt-in0.0%
metadata-eval0.0%
metadata-eval0.0%
Simplified0.0%
metadata-eval0.0%
metadata-eval0.0%
distribute-rgt-in0.0%
sub-neg0.0%
associate-*r/0.0%
*-commutative0.0%
associate-/r/1.9%
associate-*l*1.9%
add-exp-log1.9%
expm1-define1.9%
log-pow1.9%
log1p-define1.9%
Applied egg-rr1.9%
*-commutative1.9%
clear-num1.9%
un-div-inv1.9%
Applied egg-rr1.9%
Taylor expanded in i around 0 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
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))
(* t_1 100.0)
(if (<= t_1 1e-261)
(* (expm1 (* n (log1p (/ i n)))) (* 100.0 (/ n i)))
(if (<= t_1 INFINITY)
(* n (/ (+ (* t_0 100.0) -100.0) i))
(/ (* n 100.0) (+ 1.0 (* i (+ (/ 0.5 n) -0.5)))))))))
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 = t_1 * 100.0;
} else if (t_1 <= 1e-261) {
tmp = expm1((n * log1p((i / n)))) * (100.0 * (n / i));
} else if (t_1 <= ((double) INFINITY)) {
tmp = n * (((t_0 * 100.0) + -100.0) / i);
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = Math.pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_1 * 100.0;
} else if (t_1 <= 1e-261) {
tmp = Math.expm1((n * Math.log1p((i / n)))) * (100.0 * (n / i));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = n * (((t_0 * 100.0) + -100.0) / i);
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
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 = t_1 * 100.0 elif t_1 <= 1e-261: tmp = math.expm1((n * math.log1p((i / n)))) * (100.0 * (n / i)) elif t_1 <= math.inf: tmp = n * (((t_0 * 100.0) + -100.0) / i) else: tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))) 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(t_1 * 100.0); elseif (t_1 <= 1e-261) tmp = Float64(expm1(Float64(n * log1p(Float64(i / n)))) * Float64(100.0 * Float64(n / i))); elseif (t_1 <= Inf) tmp = Float64(n * Float64(Float64(Float64(t_0 * 100.0) + -100.0) / i)); else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * Float64(Float64(0.5 / n) + -0.5)))); 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[(t$95$1 * 100.0), $MachinePrecision], If[LessEqual[t$95$1, 1e-261], N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] * N[(100.0 * N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(n * N[(N[(N[(t$95$0 * 100.0), $MachinePrecision] + -100.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $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:\\
\;\;\;\;t\_1 \cdot 100\\
\mathbf{elif}\;t\_1 \leq 10^{-261}:\\
\;\;\;\;\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot \left(100 \cdot \frac{n}{i}\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;n \cdot \frac{t\_0 \cdot 100 + -100}{i}\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot \left(\frac{0.5}{n} + -0.5\right)}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < -inf.0Initial program 100.0%
if -inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < 9.99999999999999984e-262Initial program 24.5%
associate-*r/24.5%
sub-neg24.5%
distribute-rgt-in24.5%
metadata-eval24.5%
metadata-eval24.5%
Simplified24.5%
metadata-eval24.5%
metadata-eval24.5%
distribute-rgt-in24.5%
sub-neg24.5%
associate-*r/24.5%
*-commutative24.5%
div-inv24.5%
clear-num24.5%
associate-*l*24.5%
add-exp-log24.5%
expm1-define24.5%
log-pow36.4%
log1p-define97.2%
Applied egg-rr97.2%
if 9.99999999999999984e-262 < (/.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%
associate-/r/99.7%
associate-*r*99.7%
*-commutative99.7%
associate-*r/99.9%
sub-neg99.9%
distribute-lft-in99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
fma-define99.9%
metadata-eval99.9%
Simplified99.9%
fma-undefine99.9%
*-commutative99.9%
Applied egg-rr99.9%
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/0.0%
sub-neg0.0%
distribute-rgt-in0.0%
metadata-eval0.0%
metadata-eval0.0%
Simplified0.0%
metadata-eval0.0%
metadata-eval0.0%
distribute-rgt-in0.0%
sub-neg0.0%
associate-*r/0.0%
*-commutative0.0%
associate-/r/1.9%
associate-*l*1.9%
add-exp-log1.9%
expm1-define1.9%
log-pow1.9%
log1p-define1.9%
Applied egg-rr1.9%
*-commutative1.9%
clear-num1.9%
un-div-inv1.9%
Applied egg-rr1.9%
Taylor expanded in i around 0 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Final simplification97.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 (- INFINITY))
(* t_1 100.0)
(if (<= t_1 1e-261)
(* 100.0 (* (expm1 (* n (log1p (/ i n)))) (/ n i)))
(if (<= t_1 INFINITY)
(* n (/ (+ (* t_0 100.0) -100.0) i))
(/ (* n 100.0) (+ 1.0 (* i (+ (/ 0.5 n) -0.5)))))))))
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 = t_1 * 100.0;
} else if (t_1 <= 1e-261) {
tmp = 100.0 * (expm1((n * log1p((i / n)))) * (n / i));
} else if (t_1 <= ((double) INFINITY)) {
tmp = n * (((t_0 * 100.0) + -100.0) / i);
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = Math.pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_1 * 100.0;
} else if (t_1 <= 1e-261) {
tmp = 100.0 * (Math.expm1((n * Math.log1p((i / n)))) * (n / i));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = n * (((t_0 * 100.0) + -100.0) / i);
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
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 = t_1 * 100.0 elif t_1 <= 1e-261: tmp = 100.0 * (math.expm1((n * math.log1p((i / n)))) * (n / i)) elif t_1 <= math.inf: tmp = n * (((t_0 * 100.0) + -100.0) / i) else: tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))) 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(t_1 * 100.0); elseif (t_1 <= 1e-261) tmp = Float64(100.0 * Float64(expm1(Float64(n * log1p(Float64(i / n)))) * Float64(n / i))); elseif (t_1 <= Inf) tmp = Float64(n * Float64(Float64(Float64(t_0 * 100.0) + -100.0) / i)); else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * Float64(Float64(0.5 / n) + -0.5)))); 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[(t$95$1 * 100.0), $MachinePrecision], If[LessEqual[t$95$1, 1e-261], N[(100.0 * N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] * N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(n * N[(N[(N[(t$95$0 * 100.0), $MachinePrecision] + -100.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $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:\\
\;\;\;\;t\_1 \cdot 100\\
\mathbf{elif}\;t\_1 \leq 10^{-261}:\\
\;\;\;\;100 \cdot \left(\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot \frac{n}{i}\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;n \cdot \frac{t\_0 \cdot 100 + -100}{i}\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot \left(\frac{0.5}{n} + -0.5\right)}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < -inf.0Initial program 100.0%
if -inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < 9.99999999999999984e-262Initial program 24.5%
associate-*r/24.5%
sub-neg24.5%
distribute-rgt-in24.5%
metadata-eval24.5%
metadata-eval24.5%
Simplified24.5%
metadata-eval24.5%
metadata-eval24.5%
distribute-rgt-in24.5%
sub-neg24.5%
associate-*r/24.5%
*-commutative24.5%
div-inv24.5%
add-exp-log24.5%
expm1-define24.5%
log-pow36.4%
log1p-define98.2%
clear-num98.3%
Applied egg-rr98.3%
if 9.99999999999999984e-262 < (/.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%
associate-/r/99.7%
associate-*r*99.7%
*-commutative99.7%
associate-*r/99.9%
sub-neg99.9%
distribute-lft-in99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
fma-define99.9%
metadata-eval99.9%
Simplified99.9%
fma-undefine99.9%
*-commutative99.9%
Applied egg-rr99.9%
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/0.0%
sub-neg0.0%
distribute-rgt-in0.0%
metadata-eval0.0%
metadata-eval0.0%
Simplified0.0%
metadata-eval0.0%
metadata-eval0.0%
distribute-rgt-in0.0%
sub-neg0.0%
associate-*r/0.0%
*-commutative0.0%
associate-/r/1.9%
associate-*l*1.9%
add-exp-log1.9%
expm1-define1.9%
log-pow1.9%
log1p-define1.9%
Applied egg-rr1.9%
*-commutative1.9%
clear-num1.9%
un-div-inv1.9%
Applied egg-rr1.9%
Taylor expanded in i around 0 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Final simplification98.7%
(FPCore (i n)
:precision binary64
(let* ((t_0 (pow (+ 1.0 (/ i n)) n))
(t_1 (/ (+ t_0 -1.0) (/ i n)))
(t_2 (* n (/ (+ (* t_0 100.0) -100.0) i))))
(if (<= t_1 -2e-225)
t_2
(if (<= t_1 1e-261)
(* (/ (expm1 (* n (log1p (/ i n)))) i) (* n 100.0))
(if (<= t_1 INFINITY)
t_2
(/ (* n 100.0) (+ 1.0 (* i (+ (/ 0.5 n) -0.5)))))))))
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 t_2 = n * (((t_0 * 100.0) + -100.0) / i);
double tmp;
if (t_1 <= -2e-225) {
tmp = t_2;
} else if (t_1 <= 1e-261) {
tmp = (expm1((n * log1p((i / n)))) / i) * (n * 100.0);
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = Math.pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double t_2 = n * (((t_0 * 100.0) + -100.0) / i);
double tmp;
if (t_1 <= -2e-225) {
tmp = t_2;
} else if (t_1 <= 1e-261) {
tmp = (Math.expm1((n * Math.log1p((i / n)))) / i) * (n * 100.0);
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
return tmp;
}
def code(i, n): t_0 = math.pow((1.0 + (i / n)), n) t_1 = (t_0 + -1.0) / (i / n) t_2 = n * (((t_0 * 100.0) + -100.0) / i) tmp = 0 if t_1 <= -2e-225: tmp = t_2 elif t_1 <= 1e-261: tmp = (math.expm1((n * math.log1p((i / n)))) / i) * (n * 100.0) elif t_1 <= math.inf: tmp = t_2 else: tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))) 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)) t_2 = Float64(n * Float64(Float64(Float64(t_0 * 100.0) + -100.0) / i)) tmp = 0.0 if (t_1 <= -2e-225) tmp = t_2; elseif (t_1 <= 1e-261) tmp = Float64(Float64(expm1(Float64(n * log1p(Float64(i / n)))) / i) * Float64(n * 100.0)); elseif (t_1 <= Inf) tmp = t_2; else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * Float64(Float64(0.5 / n) + -0.5)))); 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]}, Block[{t$95$2 = N[(n * N[(N[(N[(t$95$0 * 100.0), $MachinePrecision] + -100.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-225], t$95$2, If[LessEqual[t$95$1, 1e-261], N[(N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] / i), $MachinePrecision] * N[(n * 100.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$2, N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $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}}\\
t_2 := n \cdot \frac{t\_0 \cdot 100 + -100}{i}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-225}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{-261}:\\
\;\;\;\;\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{i} \cdot \left(n \cdot 100\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot \left(\frac{0.5}{n} + -0.5\right)}\\
\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)) < -1.9999999999999999e-225 or 9.99999999999999984e-262 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < +inf.0Initial program 99.6%
associate-/r/99.7%
associate-*r*99.6%
*-commutative99.6%
associate-*r/99.8%
sub-neg99.8%
distribute-lft-in99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
fma-undefine99.8%
*-commutative99.8%
Applied egg-rr99.8%
if -1.9999999999999999e-225 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < 9.99999999999999984e-262Initial program 21.3%
associate-*r/21.3%
sub-neg21.3%
distribute-rgt-in21.3%
metadata-eval21.3%
metadata-eval21.3%
Simplified21.3%
metadata-eval21.3%
metadata-eval21.3%
distribute-rgt-in21.3%
sub-neg21.3%
associate-*r/21.3%
*-commutative21.3%
associate-/r/21.3%
associate-*l*21.2%
add-exp-log21.2%
expm1-define21.2%
log-pow33.7%
log1p-define99.4%
Applied egg-rr99.4%
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/0.0%
sub-neg0.0%
distribute-rgt-in0.0%
metadata-eval0.0%
metadata-eval0.0%
Simplified0.0%
metadata-eval0.0%
metadata-eval0.0%
distribute-rgt-in0.0%
sub-neg0.0%
associate-*r/0.0%
*-commutative0.0%
associate-/r/1.9%
associate-*l*1.9%
add-exp-log1.9%
expm1-define1.9%
log-pow1.9%
log1p-define1.9%
Applied egg-rr1.9%
*-commutative1.9%
clear-num1.9%
un-div-inv1.9%
Applied egg-rr1.9%
Taylor expanded in i around 0 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Final simplification99.6%
(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-6)
(* t_1 100.0)
(if (<= t_1 1e-261)
(/ (* n 100.0) (/ i (expm1 (* n (log1p (/ i n))))))
(if (<= t_1 INFINITY)
(* n (/ (+ (* t_0 100.0) -100.0) i))
(/ (* n 100.0) (+ 1.0 (* i (+ (/ 0.5 n) -0.5)))))))))
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-6) {
tmp = t_1 * 100.0;
} else if (t_1 <= 1e-261) {
tmp = (n * 100.0) / (i / expm1((n * log1p((i / n)))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = n * (((t_0 * 100.0) + -100.0) / i);
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = Math.pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= -2e-6) {
tmp = t_1 * 100.0;
} else if (t_1 <= 1e-261) {
tmp = (n * 100.0) / (i / Math.expm1((n * Math.log1p((i / n)))));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = n * (((t_0 * 100.0) + -100.0) / i);
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
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-6: tmp = t_1 * 100.0 elif t_1 <= 1e-261: tmp = (n * 100.0) / (i / math.expm1((n * math.log1p((i / n))))) elif t_1 <= math.inf: tmp = n * (((t_0 * 100.0) + -100.0) / i) else: tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))) 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-6) tmp = Float64(t_1 * 100.0); elseif (t_1 <= 1e-261) tmp = Float64(Float64(n * 100.0) / Float64(i / expm1(Float64(n * log1p(Float64(i / n)))))); elseif (t_1 <= Inf) tmp = Float64(n * Float64(Float64(Float64(t_0 * 100.0) + -100.0) / i)); else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * Float64(Float64(0.5 / n) + -0.5)))); 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-6], N[(t$95$1 * 100.0), $MachinePrecision], If[LessEqual[t$95$1, 1e-261], N[(N[(n * 100.0), $MachinePrecision] / N[(i / N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(n * N[(N[(N[(t$95$0 * 100.0), $MachinePrecision] + -100.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $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 -2 \cdot 10^{-6}:\\
\;\;\;\;t\_1 \cdot 100\\
\mathbf{elif}\;t\_1 \leq 10^{-261}:\\
\;\;\;\;\frac{n \cdot 100}{\frac{i}{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;n \cdot \frac{t\_0 \cdot 100 + -100}{i}\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot \left(\frac{0.5}{n} + -0.5\right)}\\
\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)) < -1.99999999999999991e-6Initial program 100.0%
if -1.99999999999999991e-6 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < 9.99999999999999984e-262Initial program 23.7%
associate-*r/23.7%
sub-neg23.7%
distribute-rgt-in23.7%
metadata-eval23.7%
metadata-eval23.7%
Simplified23.7%
metadata-eval23.7%
metadata-eval23.7%
distribute-rgt-in23.7%
sub-neg23.7%
associate-*r/23.7%
*-commutative23.7%
associate-/r/23.8%
associate-*l*23.7%
add-exp-log23.7%
expm1-define23.7%
log-pow35.7%
log1p-define99.4%
Applied egg-rr99.4%
*-commutative99.4%
clear-num99.4%
un-div-inv99.5%
Applied egg-rr99.5%
if 9.99999999999999984e-262 < (/.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%
associate-/r/99.7%
associate-*r*99.7%
*-commutative99.7%
associate-*r/99.9%
sub-neg99.9%
distribute-lft-in99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
fma-define99.9%
metadata-eval99.9%
Simplified99.9%
fma-undefine99.9%
*-commutative99.9%
Applied egg-rr99.9%
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/0.0%
sub-neg0.0%
distribute-rgt-in0.0%
metadata-eval0.0%
metadata-eval0.0%
Simplified0.0%
metadata-eval0.0%
metadata-eval0.0%
distribute-rgt-in0.0%
sub-neg0.0%
associate-*r/0.0%
*-commutative0.0%
associate-/r/1.9%
associate-*l*1.9%
add-exp-log1.9%
expm1-define1.9%
log-pow1.9%
log1p-define1.9%
Applied egg-rr1.9%
*-commutative1.9%
clear-num1.9%
un-div-inv1.9%
Applied egg-rr1.9%
Taylor expanded in i around 0 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Final simplification99.6%
(FPCore (i n) :precision binary64 (if (or (<= i -0.00068) (not (<= i 0.00021))) (* 100.0 (/ (expm1 i) (/ i n))) (/ (* n 100.0) (+ 1.0 (* i (+ (/ 0.5 n) -0.5))))))
double code(double i, double n) {
double tmp;
if ((i <= -0.00068) || !(i <= 0.00021)) {
tmp = 100.0 * (expm1(i) / (i / n));
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((i <= -0.00068) || !(i <= 0.00021)) {
tmp = 100.0 * (Math.expm1(i) / (i / n));
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
return tmp;
}
def code(i, n): tmp = 0 if (i <= -0.00068) or not (i <= 0.00021): tmp = 100.0 * (math.expm1(i) / (i / n)) else: tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))) return tmp
function code(i, n) tmp = 0.0 if ((i <= -0.00068) || !(i <= 0.00021)) tmp = Float64(100.0 * Float64(expm1(i) / Float64(i / n))); else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * Float64(Float64(0.5 / n) + -0.5)))); end return tmp end
code[i_, n_] := If[Or[LessEqual[i, -0.00068], N[Not[LessEqual[i, 0.00021]], $MachinePrecision]], N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -0.00068 \lor \neg \left(i \leq 0.00021\right):\\
\;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot \left(\frac{0.5}{n} + -0.5\right)}\\
\end{array}
\end{array}
if i < -6.8e-4 or 2.1000000000000001e-4 < i Initial program 54.5%
Taylor expanded in n around inf 66.2%
expm1-define66.2%
Simplified66.2%
if -6.8e-4 < i < 2.1000000000000001e-4Initial program 8.4%
associate-*r/8.4%
sub-neg8.4%
distribute-rgt-in8.4%
metadata-eval8.4%
metadata-eval8.4%
Simplified8.4%
metadata-eval8.4%
metadata-eval8.4%
distribute-rgt-in8.4%
sub-neg8.4%
associate-*r/8.4%
*-commutative8.4%
associate-/r/8.8%
associate-*l*8.8%
add-exp-log8.8%
expm1-define8.8%
log-pow21.1%
log1p-define78.2%
Applied egg-rr78.2%
*-commutative78.2%
clear-num78.2%
un-div-inv78.2%
Applied egg-rr78.2%
Taylor expanded in i around 0 89.6%
sub-neg89.6%
associate-*r/89.6%
metadata-eval89.6%
metadata-eval89.6%
Simplified89.6%
Final simplification79.3%
(FPCore (i n) :precision binary64 (if (or (<= n -9e+42) (not (<= n 6e-5))) (* 100.0 (/ (* n (expm1 i)) i)) (/ (* n 100.0) (+ 1.0 (* i (+ (/ 0.5 n) -0.5))))))
double code(double i, double n) {
double tmp;
if ((n <= -9e+42) || !(n <= 6e-5)) {
tmp = 100.0 * ((n * expm1(i)) / i);
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((n <= -9e+42) || !(n <= 6e-5)) {
tmp = 100.0 * ((n * Math.expm1(i)) / i);
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -9e+42) or not (n <= 6e-5): tmp = 100.0 * ((n * math.expm1(i)) / i) else: tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))) return tmp
function code(i, n) tmp = 0.0 if ((n <= -9e+42) || !(n <= 6e-5)) tmp = Float64(100.0 * Float64(Float64(n * expm1(i)) / i)); else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * Float64(Float64(0.5 / n) + -0.5)))); end return tmp end
code[i_, n_] := If[Or[LessEqual[n, -9e+42], N[Not[LessEqual[n, 6e-5]], $MachinePrecision]], N[(100.0 * N[(N[(n * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -9 \cdot 10^{+42} \lor \neg \left(n \leq 6 \cdot 10^{-5}\right):\\
\;\;\;\;100 \cdot \frac{n \cdot \mathsf{expm1}\left(i\right)}{i}\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot \left(\frac{0.5}{n} + -0.5\right)}\\
\end{array}
\end{array}
if n < -9.00000000000000025e42 or 6.00000000000000015e-5 < n Initial program 24.9%
associate-*r/24.9%
sub-neg24.9%
distribute-rgt-in24.9%
metadata-eval24.9%
metadata-eval24.9%
Simplified24.9%
metadata-eval24.9%
metadata-eval24.9%
distribute-rgt-in24.9%
sub-neg24.9%
associate-*r/24.9%
*-commutative24.9%
associate-/r/25.3%
associate-*l*25.3%
add-exp-log25.3%
expm1-define25.3%
log-pow15.9%
log1p-define68.9%
Applied egg-rr68.9%
Taylor expanded in n around inf 44.4%
associate-*r/44.4%
expm1-define90.4%
Simplified90.4%
associate-/l*90.6%
Applied egg-rr90.6%
if -9.00000000000000025e42 < n < 6.00000000000000015e-5Initial program 33.4%
associate-*r/33.3%
sub-neg33.3%
distribute-rgt-in33.3%
metadata-eval33.3%
metadata-eval33.3%
Simplified33.3%
metadata-eval33.3%
metadata-eval33.3%
distribute-rgt-in33.3%
sub-neg33.3%
associate-*r/33.4%
*-commutative33.4%
associate-/r/33.5%
associate-*l*33.4%
add-exp-log33.4%
expm1-define33.4%
log-pow51.1%
log1p-define90.5%
Applied egg-rr90.5%
*-commutative90.5%
clear-num90.5%
un-div-inv90.5%
Applied egg-rr90.5%
Taylor expanded in i around 0 80.8%
sub-neg80.8%
associate-*r/80.8%
metadata-eval80.8%
metadata-eval80.8%
Simplified80.8%
Final simplification86.1%
(FPCore (i n)
:precision binary64
(if (or (<= n -1.2e+115) (not (<= n 6e-5)))
(/
(*
i
(+
(* n 100.0)
(*
i
(+
(* n 50.0)
(* i (* n (+ 16.666666666666668 (* i 4.166666666666667))))))))
i)
(/ (* n 100.0) (+ 1.0 (* i (+ (/ 0.5 n) -0.5))))))
double code(double i, double n) {
double tmp;
if ((n <= -1.2e+115) || !(n <= 6e-5)) {
tmp = (i * ((n * 100.0) + (i * ((n * 50.0) + (i * (n * (16.666666666666668 + (i * 4.166666666666667)))))))) / i;
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -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.2d+115)) .or. (.not. (n <= 6d-5))) then
tmp = (i * ((n * 100.0d0) + (i * ((n * 50.0d0) + (i * (n * (16.666666666666668d0 + (i * 4.166666666666667d0)))))))) / i
else
tmp = (n * 100.0d0) / (1.0d0 + (i * ((0.5d0 / n) + (-0.5d0))))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -1.2e+115) || !(n <= 6e-5)) {
tmp = (i * ((n * 100.0) + (i * ((n * 50.0) + (i * (n * (16.666666666666668 + (i * 4.166666666666667)))))))) / i;
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -1.2e+115) or not (n <= 6e-5): tmp = (i * ((n * 100.0) + (i * ((n * 50.0) + (i * (n * (16.666666666666668 + (i * 4.166666666666667)))))))) / i else: tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))) return tmp
function code(i, n) tmp = 0.0 if ((n <= -1.2e+115) || !(n <= 6e-5)) tmp = Float64(Float64(i * Float64(Float64(n * 100.0) + Float64(i * Float64(Float64(n * 50.0) + Float64(i * Float64(n * Float64(16.666666666666668 + Float64(i * 4.166666666666667)))))))) / i); else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * Float64(Float64(0.5 / n) + -0.5)))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -1.2e+115) || ~((n <= 6e-5))) tmp = (i * ((n * 100.0) + (i * ((n * 50.0) + (i * (n * (16.666666666666668 + (i * 4.166666666666667)))))))) / i; else tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -1.2e+115], N[Not[LessEqual[n, 6e-5]], $MachinePrecision]], N[(N[(i * N[(N[(n * 100.0), $MachinePrecision] + N[(i * N[(N[(n * 50.0), $MachinePrecision] + N[(i * N[(n * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.2 \cdot 10^{+115} \lor \neg \left(n \leq 6 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{i \cdot \left(n \cdot 100 + i \cdot \left(n \cdot 50 + i \cdot \left(n \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\right)}{i}\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot \left(\frac{0.5}{n} + -0.5\right)}\\
\end{array}
\end{array}
if n < -1.2e115 or 6.00000000000000015e-5 < n Initial program 21.3%
associate-*r/21.3%
sub-neg21.3%
distribute-rgt-in21.3%
metadata-eval21.3%
metadata-eval21.3%
Simplified21.3%
metadata-eval21.3%
metadata-eval21.3%
distribute-rgt-in21.3%
sub-neg21.3%
associate-*r/21.3%
*-commutative21.3%
associate-/r/21.8%
associate-*l*21.8%
add-exp-log21.8%
expm1-define21.8%
log-pow15.1%
log1p-define68.7%
Applied egg-rr68.7%
Taylor expanded in n around inf 45.0%
associate-*r/44.9%
expm1-define93.1%
Simplified93.1%
Taylor expanded in i around 0 75.6%
Taylor expanded in n around 0 75.6%
*-commutative75.6%
Simplified75.6%
if -1.2e115 < n < 6.00000000000000015e-5Initial program 35.2%
associate-*r/35.2%
sub-neg35.2%
distribute-rgt-in35.2%
metadata-eval35.2%
metadata-eval35.2%
Simplified35.2%
metadata-eval35.2%
metadata-eval35.2%
distribute-rgt-in35.2%
sub-neg35.2%
associate-*r/35.2%
*-commutative35.2%
associate-/r/35.3%
associate-*l*35.3%
add-exp-log35.3%
expm1-define35.3%
log-pow46.7%
log1p-define87.5%
Applied egg-rr87.5%
*-commutative87.5%
clear-num87.5%
un-div-inv87.5%
Applied egg-rr87.5%
Taylor expanded in i around 0 75.5%
sub-neg75.5%
associate-*r/75.5%
metadata-eval75.5%
metadata-eval75.5%
Simplified75.5%
Final simplification75.5%
(FPCore (i n)
:precision binary64
(if (or (<= n -9e+223) (not (<= n 6e-5)))
(*
n
(+
100.0
(* i (+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667)))))))
(/ (* n 100.0) (+ 1.0 (* i (+ (/ 0.5 n) -0.5))))))
double code(double i, double n) {
double tmp;
if ((n <= -9e+223) || !(n <= 6e-5)) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -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 <= (-9d+223)) .or. (.not. (n <= 6d-5))) then
tmp = n * (100.0d0 + (i * (50.0d0 + (i * (16.666666666666668d0 + (i * 4.166666666666667d0))))))
else
tmp = (n * 100.0d0) / (1.0d0 + (i * ((0.5d0 / n) + (-0.5d0))))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -9e+223) || !(n <= 6e-5)) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -9e+223) or not (n <= 6e-5): tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))) else: tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))) return tmp
function code(i, n) tmp = 0.0 if ((n <= -9e+223) || !(n <= 6e-5)) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667))))))); else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * Float64(Float64(0.5 / n) + -0.5)))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -9e+223) || ~((n <= 6e-5))) tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))); else tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -9e+223], N[Not[LessEqual[n, 6e-5]], $MachinePrecision]], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -9 \cdot 10^{+223} \lor \neg \left(n \leq 6 \cdot 10^{-5}\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot \left(\frac{0.5}{n} + -0.5\right)}\\
\end{array}
\end{array}
if n < -9e223 or 6.00000000000000015e-5 < n Initial program 22.0%
associate-*r/22.0%
sub-neg22.0%
distribute-rgt-in22.0%
metadata-eval22.0%
metadata-eval22.0%
Simplified22.0%
metadata-eval22.0%
metadata-eval22.0%
distribute-rgt-in22.0%
sub-neg22.0%
associate-*r/22.0%
*-commutative22.0%
associate-/r/22.5%
associate-*l*22.4%
add-exp-log22.4%
expm1-define22.4%
log-pow16.2%
log1p-define67.5%
Applied egg-rr67.5%
Taylor expanded in n around inf 45.5%
associate-*r/45.5%
expm1-define93.5%
Simplified93.5%
Taylor expanded in i around 0 79.0%
Taylor expanded in n around 0 77.3%
*-commutative77.3%
Simplified77.3%
if -9e223 < n < 6.00000000000000015e-5Initial program 32.8%
associate-*r/32.8%
sub-neg32.8%
distribute-rgt-in32.8%
metadata-eval32.8%
metadata-eval32.8%
Simplified32.8%
metadata-eval32.8%
metadata-eval32.8%
distribute-rgt-in32.8%
sub-neg32.8%
associate-*r/32.8%
*-commutative32.8%
associate-/r/33.0%
associate-*l*32.9%
add-exp-log32.9%
expm1-define32.9%
log-pow41.5%
log1p-define85.5%
Applied egg-rr85.5%
*-commutative85.5%
clear-num85.5%
un-div-inv85.6%
Applied egg-rr85.6%
Taylor expanded in i around 0 73.0%
sub-neg73.0%
associate-*r/73.0%
metadata-eval73.0%
metadata-eval73.0%
Simplified73.0%
Final simplification74.6%
(FPCore (i n)
:precision binary64
(if (<= n -2.9e+223)
(+ (* n 100.0) (* i (+ (* n 50.0) (* 16.666666666666668 (* i n)))))
(if (<= n 6e-5)
(/ (* n 100.0) (+ 1.0 (* i (+ (/ 0.5 n) -0.5))))
(*
n
(+
100.0
(* i (+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667))))))))))
double code(double i, double n) {
double tmp;
if (n <= -2.9e+223) {
tmp = (n * 100.0) + (i * ((n * 50.0) + (16.666666666666668 * (i * n))));
} else if (n <= 6e-5) {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
} else {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-2.9d+223)) then
tmp = (n * 100.0d0) + (i * ((n * 50.0d0) + (16.666666666666668d0 * (i * n))))
else if (n <= 6d-5) then
tmp = (n * 100.0d0) / (1.0d0 + (i * ((0.5d0 / n) + (-0.5d0))))
else
tmp = n * (100.0d0 + (i * (50.0d0 + (i * (16.666666666666668d0 + (i * 4.166666666666667d0))))))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -2.9e+223) {
tmp = (n * 100.0) + (i * ((n * 50.0) + (16.666666666666668 * (i * n))));
} else if (n <= 6e-5) {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
} else {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -2.9e+223: tmp = (n * 100.0) + (i * ((n * 50.0) + (16.666666666666668 * (i * n)))) elif n <= 6e-5: tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))) else: tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))) return tmp
function code(i, n) tmp = 0.0 if (n <= -2.9e+223) tmp = Float64(Float64(n * 100.0) + Float64(i * Float64(Float64(n * 50.0) + Float64(16.666666666666668 * Float64(i * n))))); elseif (n <= 6e-5) tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * Float64(Float64(0.5 / n) + -0.5)))); else tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667))))))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -2.9e+223) tmp = (n * 100.0) + (i * ((n * 50.0) + (16.666666666666668 * (i * n)))); elseif (n <= 6e-5) tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))); else tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -2.9e+223], N[(N[(n * 100.0), $MachinePrecision] + N[(i * N[(N[(n * 50.0), $MachinePrecision] + N[(16.666666666666668 * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 6e-5], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.9 \cdot 10^{+223}:\\
\;\;\;\;n \cdot 100 + i \cdot \left(n \cdot 50 + 16.666666666666668 \cdot \left(i \cdot n\right)\right)\\
\mathbf{elif}\;n \leq 6 \cdot 10^{-5}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot \left(\frac{0.5}{n} + -0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\\
\end{array}
\end{array}
if n < -2.9000000000000002e223Initial program 8.8%
associate-*r/8.8%
sub-neg8.8%
distribute-rgt-in8.8%
metadata-eval8.8%
metadata-eval8.8%
Simplified8.8%
metadata-eval8.8%
metadata-eval8.8%
distribute-rgt-in8.8%
sub-neg8.8%
associate-*r/8.8%
*-commutative8.8%
associate-/r/9.3%
associate-*l*9.3%
add-exp-log9.3%
expm1-define9.3%
log-pow9.3%
log1p-define68.7%
Applied egg-rr68.7%
Taylor expanded in n around inf 58.4%
associate-*r/58.3%
expm1-define99.8%
Simplified99.8%
Taylor expanded in i around 0 67.1%
if -2.9000000000000002e223 < n < 6.00000000000000015e-5Initial program 32.8%
associate-*r/32.8%
sub-neg32.8%
distribute-rgt-in32.8%
metadata-eval32.8%
metadata-eval32.8%
Simplified32.8%
metadata-eval32.8%
metadata-eval32.8%
distribute-rgt-in32.8%
sub-neg32.8%
associate-*r/32.8%
*-commutative32.8%
associate-/r/33.0%
associate-*l*32.9%
add-exp-log32.9%
expm1-define32.9%
log-pow41.5%
log1p-define85.5%
Applied egg-rr85.5%
*-commutative85.5%
clear-num85.5%
un-div-inv85.6%
Applied egg-rr85.6%
Taylor expanded in i around 0 73.0%
sub-neg73.0%
associate-*r/73.0%
metadata-eval73.0%
metadata-eval73.0%
Simplified73.0%
if 6.00000000000000015e-5 < n Initial program 26.9%
associate-*r/26.8%
sub-neg26.8%
distribute-rgt-in26.8%
metadata-eval26.8%
metadata-eval26.8%
Simplified26.8%
metadata-eval26.8%
metadata-eval26.8%
distribute-rgt-in26.8%
sub-neg26.8%
associate-*r/26.9%
*-commutative26.9%
associate-/r/27.3%
associate-*l*27.3%
add-exp-log27.3%
expm1-define27.3%
log-pow18.8%
log1p-define67.0%
Applied egg-rr67.0%
Taylor expanded in n around inf 40.7%
associate-*r/40.7%
expm1-define91.2%
Simplified91.2%
Taylor expanded in i around 0 84.0%
Taylor expanded in n around 0 81.6%
*-commutative81.6%
Simplified81.6%
Final simplification74.7%
(FPCore (i n) :precision binary64 (if (or (<= n -9e+223) (not (<= n 6e-5))) (/ (* i (+ (* n 100.0) (* 50.0 (* i n)))) i) (/ (* n 100.0) (+ 1.0 (* i (+ (/ 0.5 n) -0.5))))))
double code(double i, double n) {
double tmp;
if ((n <= -9e+223) || !(n <= 6e-5)) {
tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i;
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -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 <= (-9d+223)) .or. (.not. (n <= 6d-5))) then
tmp = (i * ((n * 100.0d0) + (50.0d0 * (i * n)))) / i
else
tmp = (n * 100.0d0) / (1.0d0 + (i * ((0.5d0 / n) + (-0.5d0))))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -9e+223) || !(n <= 6e-5)) {
tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i;
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -9e+223) or not (n <= 6e-5): tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i else: tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))) return tmp
function code(i, n) tmp = 0.0 if ((n <= -9e+223) || !(n <= 6e-5)) tmp = Float64(Float64(i * Float64(Float64(n * 100.0) + Float64(50.0 * Float64(i * n)))) / i); else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * Float64(Float64(0.5 / n) + -0.5)))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -9e+223) || ~((n <= 6e-5))) tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i; else tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -9e+223], N[Not[LessEqual[n, 6e-5]], $MachinePrecision]], N[(N[(i * N[(N[(n * 100.0), $MachinePrecision] + N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -9 \cdot 10^{+223} \lor \neg \left(n \leq 6 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{i \cdot \left(n \cdot 100 + 50 \cdot \left(i \cdot n\right)\right)}{i}\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot \left(\frac{0.5}{n} + -0.5\right)}\\
\end{array}
\end{array}
if n < -9e223 or 6.00000000000000015e-5 < n Initial program 22.0%
associate-*r/22.0%
sub-neg22.0%
distribute-rgt-in22.0%
metadata-eval22.0%
metadata-eval22.0%
Simplified22.0%
metadata-eval22.0%
metadata-eval22.0%
distribute-rgt-in22.0%
sub-neg22.0%
associate-*r/22.0%
*-commutative22.0%
associate-/r/22.5%
associate-*l*22.4%
add-exp-log22.4%
expm1-define22.4%
log-pow16.2%
log1p-define67.5%
Applied egg-rr67.5%
Taylor expanded in n around inf 45.5%
associate-*r/45.5%
expm1-define93.5%
Simplified93.5%
Taylor expanded in i around 0 74.7%
if -9e223 < n < 6.00000000000000015e-5Initial program 32.8%
associate-*r/32.8%
sub-neg32.8%
distribute-rgt-in32.8%
metadata-eval32.8%
metadata-eval32.8%
Simplified32.8%
metadata-eval32.8%
metadata-eval32.8%
distribute-rgt-in32.8%
sub-neg32.8%
associate-*r/32.8%
*-commutative32.8%
associate-/r/33.0%
associate-*l*32.9%
add-exp-log32.9%
expm1-define32.9%
log-pow41.5%
log1p-define85.5%
Applied egg-rr85.5%
*-commutative85.5%
clear-num85.5%
un-div-inv85.6%
Applied egg-rr85.6%
Taylor expanded in i around 0 73.0%
sub-neg73.0%
associate-*r/73.0%
metadata-eval73.0%
metadata-eval73.0%
Simplified73.0%
Final simplification73.6%
(FPCore (i n)
:precision binary64
(if (<= n -6.5e-178)
(* n (+ 100.0 (* i 50.0)))
(if (<= n 1.5e-121)
(/ 0.0 (/ i n))
(/ (* i (+ (* n 100.0) (* 50.0 (* i n)))) i))))
double code(double i, double n) {
double tmp;
if (n <= -6.5e-178) {
tmp = n * (100.0 + (i * 50.0));
} else if (n <= 1.5e-121) {
tmp = 0.0 / (i / n);
} else {
tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-6.5d-178)) then
tmp = n * (100.0d0 + (i * 50.0d0))
else if (n <= 1.5d-121) then
tmp = 0.0d0 / (i / n)
else
tmp = (i * ((n * 100.0d0) + (50.0d0 * (i * n)))) / i
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -6.5e-178) {
tmp = n * (100.0 + (i * 50.0));
} else if (n <= 1.5e-121) {
tmp = 0.0 / (i / n);
} else {
tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i;
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -6.5e-178: tmp = n * (100.0 + (i * 50.0)) elif n <= 1.5e-121: tmp = 0.0 / (i / n) else: tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i return tmp
function code(i, n) tmp = 0.0 if (n <= -6.5e-178) tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); elseif (n <= 1.5e-121) tmp = Float64(0.0 / Float64(i / n)); else tmp = Float64(Float64(i * Float64(Float64(n * 100.0) + Float64(50.0 * Float64(i * n)))) / i); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -6.5e-178) tmp = n * (100.0 + (i * 50.0)); elseif (n <= 1.5e-121) tmp = 0.0 / (i / n); else tmp = (i * ((n * 100.0) + (50.0 * (i * n)))) / i; end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -6.5e-178], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.5e-121], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(N[(i * N[(N[(n * 100.0), $MachinePrecision] + N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -6.5 \cdot 10^{-178}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{elif}\;n \leq 1.5 \cdot 10^{-121}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;\frac{i \cdot \left(n \cdot 100 + 50 \cdot \left(i \cdot n\right)\right)}{i}\\
\end{array}
\end{array}
if n < -6.5000000000000002e-178Initial program 20.4%
associate-*r/20.4%
sub-neg20.4%
distribute-rgt-in20.4%
metadata-eval20.4%
metadata-eval20.4%
Simplified20.4%
Taylor expanded in i around 0 7.0%
*-commutative7.0%
associate-*r/7.0%
metadata-eval7.0%
Simplified7.0%
Taylor expanded in n around inf 58.1%
*-commutative58.1%
Simplified58.1%
if -6.5000000000000002e-178 < n < 1.5e-121Initial program 56.8%
associate-*r/56.8%
sub-neg56.8%
distribute-rgt-in56.8%
metadata-eval56.8%
metadata-eval56.8%
Simplified56.8%
Taylor expanded in i around 0 71.9%
if 1.5e-121 < n Initial program 22.7%
associate-*r/22.6%
sub-neg22.6%
distribute-rgt-in22.6%
metadata-eval22.6%
metadata-eval22.6%
Simplified22.6%
metadata-eval22.6%
metadata-eval22.6%
distribute-rgt-in22.6%
sub-neg22.6%
associate-*r/22.7%
*-commutative22.7%
associate-/r/23.0%
associate-*l*23.0%
add-exp-log23.0%
expm1-define23.0%
log-pow21.8%
log1p-define74.3%
Applied egg-rr74.3%
Taylor expanded in n around inf 32.4%
associate-*r/32.4%
expm1-define82.4%
Simplified82.4%
Taylor expanded in i around 0 72.6%
Final simplification66.1%
(FPCore (i n) :precision binary64 (if (or (<= n -21000.0) (not (<= n 1.55e-43))) (* n (+ 100.0 (* i 50.0))) (* 100.0 (/ i (/ i n)))))
double code(double i, double n) {
double tmp;
if ((n <= -21000.0) || !(n <= 1.55e-43)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-21000.0d0)) .or. (.not. (n <= 1.55d-43))) then
tmp = n * (100.0d0 + (i * 50.0d0))
else
tmp = 100.0d0 * (i / (i / n))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -21000.0) || !(n <= 1.55e-43)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -21000.0) or not (n <= 1.55e-43): tmp = n * (100.0 + (i * 50.0)) else: tmp = 100.0 * (i / (i / n)) return tmp
function code(i, n) tmp = 0.0 if ((n <= -21000.0) || !(n <= 1.55e-43)) tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); else tmp = Float64(100.0 * Float64(i / Float64(i / n))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -21000.0) || ~((n <= 1.55e-43))) tmp = n * (100.0 + (i * 50.0)); else tmp = 100.0 * (i / (i / n)); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -21000.0], N[Not[LessEqual[n, 1.55e-43]], $MachinePrecision]], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -21000 \lor \neg \left(n \leq 1.55 \cdot 10^{-43}\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -21000 or 1.55e-43 < n Initial program 24.1%
associate-*r/24.0%
sub-neg24.0%
distribute-rgt-in24.0%
metadata-eval24.0%
metadata-eval24.0%
Simplified24.0%
Taylor expanded in i around 0 13.6%
*-commutative13.6%
associate-*r/13.6%
metadata-eval13.6%
Simplified13.6%
Taylor expanded in n around inf 63.0%
*-commutative63.0%
Simplified63.0%
if -21000 < n < 1.55e-43Initial program 36.2%
Taylor expanded in i around 0 61.9%
Final simplification62.6%
(FPCore (i n) :precision binary64 (if (or (<= n -5.8e-178) (not (<= n 1.95e-128))) (* n (+ 100.0 (* i 50.0))) (/ 0.0 (/ i n))))
double code(double i, double n) {
double tmp;
if ((n <= -5.8e-178) || !(n <= 1.95e-128)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-5.8d-178)) .or. (.not. (n <= 1.95d-128))) then
tmp = n * (100.0d0 + (i * 50.0d0))
else
tmp = 0.0d0 / (i / n)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -5.8e-178) || !(n <= 1.95e-128)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -5.8e-178) or not (n <= 1.95e-128): tmp = n * (100.0 + (i * 50.0)) else: tmp = 0.0 / (i / n) return tmp
function code(i, n) tmp = 0.0 if ((n <= -5.8e-178) || !(n <= 1.95e-128)) tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); else tmp = Float64(0.0 / Float64(i / n)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -5.8e-178) || ~((n <= 1.95e-128))) tmp = n * (100.0 + (i * 50.0)); else tmp = 0.0 / (i / n); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -5.8e-178], N[Not[LessEqual[n, 1.95e-128]], $MachinePrecision]], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -5.8 \cdot 10^{-178} \lor \neg \left(n \leq 1.95 \cdot 10^{-128}\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -5.7999999999999995e-178 or 1.94999999999999998e-128 < n Initial program 21.4%
associate-*r/21.4%
sub-neg21.4%
distribute-rgt-in21.4%
metadata-eval21.4%
metadata-eval21.4%
Simplified21.4%
Taylor expanded in i around 0 11.3%
*-commutative11.3%
associate-*r/11.3%
metadata-eval11.3%
Simplified11.3%
Taylor expanded in n around inf 63.6%
*-commutative63.6%
Simplified63.6%
if -5.7999999999999995e-178 < n < 1.94999999999999998e-128Initial program 56.8%
associate-*r/56.8%
sub-neg56.8%
distribute-rgt-in56.8%
metadata-eval56.8%
metadata-eval56.8%
Simplified56.8%
Taylor expanded in i around 0 71.9%
Final simplification65.3%
(FPCore (i n) :precision binary64 (if (<= i -1.45e-76) (* 100.0 (/ i (/ i n))) (if (<= i 0.0002) (* 100.0 (+ n (* i -0.5))) (* 50.0 (* i n)))))
double code(double i, double n) {
double tmp;
if (i <= -1.45e-76) {
tmp = 100.0 * (i / (i / n));
} else if (i <= 0.0002) {
tmp = 100.0 * (n + (i * -0.5));
} else {
tmp = 50.0 * (i * n);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (i <= (-1.45d-76)) then
tmp = 100.0d0 * (i / (i / n))
else if (i <= 0.0002d0) then
tmp = 100.0d0 * (n + (i * (-0.5d0)))
else
tmp = 50.0d0 * (i * n)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (i <= -1.45e-76) {
tmp = 100.0 * (i / (i / n));
} else if (i <= 0.0002) {
tmp = 100.0 * (n + (i * -0.5));
} else {
tmp = 50.0 * (i * n);
}
return tmp;
}
def code(i, n): tmp = 0 if i <= -1.45e-76: tmp = 100.0 * (i / (i / n)) elif i <= 0.0002: tmp = 100.0 * (n + (i * -0.5)) else: tmp = 50.0 * (i * n) return tmp
function code(i, n) tmp = 0.0 if (i <= -1.45e-76) tmp = Float64(100.0 * Float64(i / Float64(i / n))); elseif (i <= 0.0002) tmp = Float64(100.0 * Float64(n + Float64(i * -0.5))); else tmp = Float64(50.0 * Float64(i * n)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (i <= -1.45e-76) tmp = 100.0 * (i / (i / n)); elseif (i <= 0.0002) tmp = 100.0 * (n + (i * -0.5)); else tmp = 50.0 * (i * n); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, -1.45e-76], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 0.0002], N[(100.0 * N[(n + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -1.45 \cdot 10^{-76}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{elif}\;i \leq 0.0002:\\
\;\;\;\;100 \cdot \left(n + i \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;50 \cdot \left(i \cdot n\right)\\
\end{array}
\end{array}
if i < -1.4500000000000001e-76Initial program 55.5%
Taylor expanded in i around 0 36.9%
if -1.4500000000000001e-76 < i < 2.0000000000000001e-4Initial program 8.1%
Taylor expanded in i around 0 85.5%
associate-*r*85.2%
associate-*r/85.2%
metadata-eval85.2%
Simplified85.2%
Taylor expanded in n around 0 85.4%
*-commutative85.4%
Simplified85.4%
if 2.0000000000000001e-4 < i Initial program 43.0%
Taylor expanded in i around 0 24.7%
associate-*r*24.7%
associate-*r/24.7%
metadata-eval24.7%
Simplified24.7%
Taylor expanded in n around inf 25.2%
Taylor expanded in i around inf 25.2%
*-commutative25.2%
Simplified25.2%
Final simplification58.7%
(FPCore (i n) :precision binary64 (if (<= n -4e+35) (/ (* 100.0 (* i n)) i) (if (<= n 1.3e-43) (* 100.0 (/ i (/ i n))) (* n (+ 100.0 (* i 50.0))))))
double code(double i, double n) {
double tmp;
if (n <= -4e+35) {
tmp = (100.0 * (i * n)) / i;
} else if (n <= 1.3e-43) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-4d+35)) then
tmp = (100.0d0 * (i * n)) / i
else if (n <= 1.3d-43) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = n * (100.0d0 + (i * 50.0d0))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -4e+35) {
tmp = (100.0 * (i * n)) / i;
} else if (n <= 1.3e-43) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -4e+35: tmp = (100.0 * (i * n)) / i elif n <= 1.3e-43: tmp = 100.0 * (i / (i / n)) else: tmp = n * (100.0 + (i * 50.0)) return tmp
function code(i, n) tmp = 0.0 if (n <= -4e+35) tmp = Float64(Float64(100.0 * Float64(i * n)) / i); elseif (n <= 1.3e-43) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -4e+35) tmp = (100.0 * (i * n)) / i; elseif (n <= 1.3e-43) tmp = 100.0 * (i / (i / n)); else tmp = n * (100.0 + (i * 50.0)); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -4e+35], N[(N[(100.0 * N[(i * n), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision], If[LessEqual[n, 1.3e-43], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -4 \cdot 10^{+35}:\\
\;\;\;\;\frac{100 \cdot \left(i \cdot n\right)}{i}\\
\mathbf{elif}\;n \leq 1.3 \cdot 10^{-43}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if n < -3.9999999999999999e35Initial program 21.9%
associate-*r/22.0%
sub-neg22.0%
distribute-rgt-in22.0%
metadata-eval22.0%
metadata-eval22.0%
Simplified22.0%
metadata-eval22.0%
metadata-eval22.0%
distribute-rgt-in22.0%
sub-neg22.0%
associate-*r/21.9%
*-commutative21.9%
associate-/r/22.4%
associate-*l*22.3%
add-exp-log22.3%
expm1-define22.3%
log-pow12.6%
log1p-define70.7%
Applied egg-rr70.7%
Taylor expanded in n around inf 46.2%
associate-*r/46.2%
expm1-define90.0%
Simplified90.0%
Taylor expanded in i around 0 54.4%
*-commutative54.4%
Simplified54.4%
if -3.9999999999999999e35 < n < 1.3e-43Initial program 35.8%
Taylor expanded in i around 0 62.5%
if 1.3e-43 < n Initial program 25.4%
associate-*r/25.4%
sub-neg25.4%
distribute-rgt-in25.4%
metadata-eval25.4%
metadata-eval25.4%
Simplified25.4%
Taylor expanded in i around 0 18.6%
*-commutative18.6%
associate-*r/18.6%
metadata-eval18.6%
Simplified18.6%
Taylor expanded in n around inf 70.9%
*-commutative70.9%
Simplified70.9%
Final simplification62.8%
(FPCore (i n) :precision binary64 (if (<= i 0.0002) (* n 100.0) (* 50.0 (* i n))))
double code(double i, double n) {
double tmp;
if (i <= 0.0002) {
tmp = n * 100.0;
} else {
tmp = 50.0 * (i * n);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (i <= 0.0002d0) then
tmp = n * 100.0d0
else
tmp = 50.0d0 * (i * n)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (i <= 0.0002) {
tmp = n * 100.0;
} else {
tmp = 50.0 * (i * n);
}
return tmp;
}
def code(i, n): tmp = 0 if i <= 0.0002: tmp = n * 100.0 else: tmp = 50.0 * (i * n) return tmp
function code(i, n) tmp = 0.0 if (i <= 0.0002) tmp = Float64(n * 100.0); else tmp = Float64(50.0 * Float64(i * n)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (i <= 0.0002) tmp = n * 100.0; else tmp = 50.0 * (i * n); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, 0.0002], N[(n * 100.0), $MachinePrecision], N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq 0.0002:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;50 \cdot \left(i \cdot n\right)\\
\end{array}
\end{array}
if i < 2.0000000000000001e-4Initial program 24.5%
Taylor expanded in i around 0 61.6%
*-commutative61.6%
Simplified61.6%
if 2.0000000000000001e-4 < i Initial program 43.0%
Taylor expanded in i around 0 24.7%
associate-*r*24.7%
associate-*r/24.7%
metadata-eval24.7%
Simplified24.7%
Taylor expanded in n around inf 25.2%
Taylor expanded in i around inf 25.2%
*-commutative25.2%
Simplified25.2%
Final simplification53.2%
(FPCore (i n) :precision binary64 (* i -50.0))
double code(double i, double n) {
return i * -50.0;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = i * (-50.0d0)
end function
public static double code(double i, double n) {
return i * -50.0;
}
def code(i, n): return i * -50.0
function code(i, n) return Float64(i * -50.0) end
function tmp = code(i, n) tmp = i * -50.0; end
code[i_, n_] := N[(i * -50.0), $MachinePrecision]
\begin{array}{l}
\\
i \cdot -50
\end{array}
Initial program 28.7%
associate-*r/28.7%
sub-neg28.7%
distribute-rgt-in28.7%
metadata-eval28.7%
metadata-eval28.7%
Simplified28.7%
Taylor expanded in i around 0 9.8%
*-commutative9.8%
associate-*r/9.8%
metadata-eval9.8%
Simplified9.8%
Taylor expanded in n around 0 2.9%
*-commutative2.9%
Simplified2.9%
Final simplification2.9%
(FPCore (i n) :precision binary64 (* n 100.0))
double code(double i, double n) {
return n * 100.0;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = n * 100.0d0
end function
public static double code(double i, double n) {
return n * 100.0;
}
def code(i, n): return n * 100.0
function code(i, n) return Float64(n * 100.0) end
function tmp = code(i, n) tmp = n * 100.0; end
code[i_, n_] := N[(n * 100.0), $MachinePrecision]
\begin{array}{l}
\\
n \cdot 100
\end{array}
Initial program 28.7%
Taylor expanded in i around 0 48.5%
*-commutative48.5%
Simplified48.5%
Final simplification48.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 2024079
(FPCore (i n)
:name "Compound Interest"
:precision binary64
:alt
(* 100.0 (/ (- (exp (* n (if (== (+ 1.0 (/ i n)) 1.0) (/ i n) (/ (* (/ i n) (log (+ 1.0 (/ i n)))) (- (+ (/ i n) 1.0) 1.0))))) 1.0) (/ i n)))
(* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))