
(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 26 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)) (t_2 (/ t_1 (/ i n))))
(if (<= t_2 -4e-167)
(* n (/ (fma 100.0 t_0 -100.0) i))
(if (<= t_2 0.0)
(* 100.0 (/ (expm1 (* n (log1p (/ i n)))) (/ i n)))
(if (<= t_2 INFINITY)
(* (/ t_1 i) (* n 100.0))
(/ (* n 100.0) (+ 1.0 (* i -0.5))))))))
double code(double i, double n) {
double t_0 = pow((1.0 + (i / n)), n);
double t_1 = t_0 + -1.0;
double t_2 = t_1 / (i / n);
double tmp;
if (t_2 <= -4e-167) {
tmp = n * (fma(100.0, t_0, -100.0) / i);
} else if (t_2 <= 0.0) {
tmp = 100.0 * (expm1((n * log1p((i / n)))) / (i / n));
} else if (t_2 <= ((double) INFINITY)) {
tmp = (t_1 / i) * (n * 100.0);
} else {
tmp = (n * 100.0) / (1.0 + (i * -0.5));
}
return tmp;
}
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) ^ n t_1 = Float64(t_0 + -1.0) t_2 = Float64(t_1 / Float64(i / n)) tmp = 0.0 if (t_2 <= -4e-167) tmp = Float64(n * Float64(fma(100.0, t_0, -100.0) / i)); elseif (t_2 <= 0.0) tmp = Float64(100.0 * Float64(expm1(Float64(n * log1p(Float64(i / n)))) / Float64(i / n))); elseif (t_2 <= Inf) tmp = Float64(Float64(t_1 / i) * Float64(n * 100.0)); else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * -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[(t$95$0 + -1.0), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-167], N[(n * N[(N[(100.0 * t$95$0 + -100.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(100.0 * N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(t$95$1 / i), $MachinePrecision] * N[(n * 100.0), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := t_0 + -1\\
t_2 := \frac{t_1}{\frac{i}{n}}\\
\mathbf{if}\;t_2 \leq -4 \cdot 10^{-167}:\\
\;\;\;\;n \cdot \frac{\mathsf{fma}\left(100, t_0, -100\right)}{i}\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{i}{n}}\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\frac{t_1}{i} \cdot \left(n \cdot 100\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot -0.5}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -4.00000000000000001e-167Initial program 99.7%
associate-/r/99.7%
associate-*r*99.6%
*-commutative99.6%
associate-*r/100.0%
sub-neg100.0%
distribute-lft-in100.0%
fma-def100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
if -4.00000000000000001e-167 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -0.0Initial program 20.2%
*-un-lft-identity20.2%
pow-to-exp20.2%
expm1-def32.3%
*-commutative32.3%
log1p-udef99.8%
Applied egg-rr99.8%
*-lft-identity99.8%
Simplified99.8%
if -0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 99.6%
*-commutative99.6%
associate-/r/99.8%
associate-*l*99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
Taylor expanded in n around inf 1.9%
*-commutative1.9%
associate-/l*1.9%
expm1-def81.1%
Simplified81.1%
associate-*l/81.1%
Applied egg-rr81.1%
Taylor expanded in i around 0 99.7%
*-commutative99.7%
Simplified99.7%
Final simplification99.8%
(FPCore (i n)
:precision binary64
(let* ((t_0 (/ (+ (pow (+ 1.0 (/ i n)) n) -1.0) (/ i n))) (t_1 (* t_0 100.0)))
(if (<= t_0 -2e-64)
t_1
(if (<= t_0 0.0)
(/ 1.0 (/ 0.01 (/ n (/ i (expm1 i)))))
(if (<= t_0 INFINITY) t_1 (/ (* n 100.0) (+ 1.0 (* i -0.5))))))))
double code(double i, double n) {
double t_0 = (pow((1.0 + (i / n)), n) + -1.0) / (i / n);
double t_1 = t_0 * 100.0;
double tmp;
if (t_0 <= -2e-64) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = 1.0 / (0.01 / (n / (i / expm1(i))));
} else if (t_0 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (n * 100.0) / (1.0 + (i * -0.5));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = (Math.pow((1.0 + (i / n)), n) + -1.0) / (i / n);
double t_1 = t_0 * 100.0;
double tmp;
if (t_0 <= -2e-64) {
tmp = t_1;
} else if (t_0 <= 0.0) {
tmp = 1.0 / (0.01 / (n / (i / Math.expm1(i))));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (n * 100.0) / (1.0 + (i * -0.5));
}
return tmp;
}
def code(i, n): t_0 = (math.pow((1.0 + (i / n)), n) + -1.0) / (i / n) t_1 = t_0 * 100.0 tmp = 0 if t_0 <= -2e-64: tmp = t_1 elif t_0 <= 0.0: tmp = 1.0 / (0.01 / (n / (i / math.expm1(i)))) elif t_0 <= math.inf: tmp = t_1 else: tmp = (n * 100.0) / (1.0 + (i * -0.5)) return tmp
function code(i, n) t_0 = Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) + -1.0) / Float64(i / n)) t_1 = Float64(t_0 * 100.0) tmp = 0.0 if (t_0 <= -2e-64) tmp = t_1; elseif (t_0 <= 0.0) tmp = Float64(1.0 / Float64(0.01 / Float64(n / Float64(i / expm1(i))))); elseif (t_0 <= Inf) tmp = t_1; else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * -0.5))); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[(N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * 100.0), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-64], t$95$1, If[LessEqual[t$95$0, 0.0], N[(1.0 / N[(0.01 / N[(n / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], t$95$1, N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}}\\
t_1 := t_0 \cdot 100\\
\mathbf{if}\;t_0 \leq -2 \cdot 10^{-64}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_0 \leq 0:\\
\;\;\;\;\frac{1}{\frac{0.01}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}}}\\
\mathbf{elif}\;t_0 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot -0.5}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -1.99999999999999993e-64 or -0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 99.7%
if -1.99999999999999993e-64 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -0.0Initial program 22.4%
Taylor expanded in n around inf 32.3%
*-commutative32.3%
associate-/l*32.3%
expm1-def79.4%
Simplified79.4%
associate-*l/79.4%
Applied egg-rr79.4%
Taylor expanded in n around 0 32.3%
*-commutative32.3%
expm1-def72.0%
associate-/l*79.4%
associate-/r/79.3%
associate-/l/79.2%
Simplified79.2%
clear-num79.4%
inv-pow79.4%
*-un-lft-identity79.4%
times-frac79.5%
metadata-eval79.5%
Applied egg-rr79.5%
unpow-179.5%
associate-/l*79.5%
Simplified79.5%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
Taylor expanded in n around inf 1.9%
*-commutative1.9%
associate-/l*1.9%
expm1-def81.1%
Simplified81.1%
associate-*l/81.1%
Applied egg-rr81.1%
Taylor expanded in i around 0 99.7%
*-commutative99.7%
Simplified99.7%
Final simplification85.5%
(FPCore (i n)
:precision binary64
(let* ((t_0 (+ (pow (+ 1.0 (/ i n)) n) -1.0)) (t_1 (/ t_0 (/ i n))))
(if (<= t_1 -2e-64)
(* t_1 100.0)
(if (<= t_1 0.0)
(/ 1.0 (/ 0.01 (/ n (/ i (expm1 i)))))
(if (<= t_1 INFINITY)
(* (/ t_0 i) (* n 100.0))
(/ (* n 100.0) (+ 1.0 (* i -0.5))))))))
double code(double i, double n) {
double t_0 = pow((1.0 + (i / n)), n) + -1.0;
double t_1 = t_0 / (i / n);
double tmp;
if (t_1 <= -2e-64) {
tmp = t_1 * 100.0;
} else if (t_1 <= 0.0) {
tmp = 1.0 / (0.01 / (n / (i / expm1(i))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (t_0 / i) * (n * 100.0);
} else {
tmp = (n * 100.0) / (1.0 + (i * -0.5));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = Math.pow((1.0 + (i / n)), n) + -1.0;
double t_1 = t_0 / (i / n);
double tmp;
if (t_1 <= -2e-64) {
tmp = t_1 * 100.0;
} else if (t_1 <= 0.0) {
tmp = 1.0 / (0.01 / (n / (i / Math.expm1(i))));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (t_0 / i) * (n * 100.0);
} else {
tmp = (n * 100.0) / (1.0 + (i * -0.5));
}
return tmp;
}
def code(i, n): t_0 = math.pow((1.0 + (i / n)), n) + -1.0 t_1 = t_0 / (i / n) tmp = 0 if t_1 <= -2e-64: tmp = t_1 * 100.0 elif t_1 <= 0.0: tmp = 1.0 / (0.01 / (n / (i / math.expm1(i)))) elif t_1 <= math.inf: tmp = (t_0 / i) * (n * 100.0) else: tmp = (n * 100.0) / (1.0 + (i * -0.5)) return tmp
function code(i, n) t_0 = Float64((Float64(1.0 + Float64(i / n)) ^ n) + -1.0) t_1 = Float64(t_0 / Float64(i / n)) tmp = 0.0 if (t_1 <= -2e-64) tmp = Float64(t_1 * 100.0); elseif (t_1 <= 0.0) tmp = Float64(1.0 / Float64(0.01 / Float64(n / Float64(i / expm1(i))))); elseif (t_1 <= Inf) tmp = Float64(Float64(t_0 / i) * Float64(n * 100.0)); else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * -0.5))); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] + -1.0), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-64], N[(t$95$1 * 100.0), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(1.0 / N[(0.01 / N[(n / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(t$95$0 / i), $MachinePrecision] * N[(n * 100.0), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n} + -1\\
t_1 := \frac{t_0}{\frac{i}{n}}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{-64}:\\
\;\;\;\;t_1 \cdot 100\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{1}{\frac{0.01}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}}}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;\frac{t_0}{i} \cdot \left(n \cdot 100\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot -0.5}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -1.99999999999999993e-64Initial program 100.0%
if -1.99999999999999993e-64 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -0.0Initial program 22.4%
Taylor expanded in n around inf 32.3%
*-commutative32.3%
associate-/l*32.3%
expm1-def79.4%
Simplified79.4%
associate-*l/79.4%
Applied egg-rr79.4%
Taylor expanded in n around 0 32.3%
*-commutative32.3%
expm1-def72.0%
associate-/l*79.4%
associate-/r/79.3%
associate-/l/79.2%
Simplified79.2%
clear-num79.4%
inv-pow79.4%
*-un-lft-identity79.4%
times-frac79.5%
metadata-eval79.5%
Applied egg-rr79.5%
unpow-179.5%
associate-/l*79.5%
Simplified79.5%
if -0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 99.6%
*-commutative99.6%
associate-/r/99.8%
associate-*l*99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
Taylor expanded in n around inf 1.9%
*-commutative1.9%
associate-/l*1.9%
expm1-def81.1%
Simplified81.1%
associate-*l/81.1%
Applied egg-rr81.1%
Taylor expanded in i around 0 99.7%
*-commutative99.7%
Simplified99.7%
Final simplification85.5%
(FPCore (i n)
:precision binary64
(let* ((t_0 (pow (+ 1.0 (/ i n)) n)) (t_1 (+ t_0 -1.0)) (t_2 (/ t_1 (/ i n))))
(if (<= t_2 -5e-210)
(/ (+ -100.0 (* t_0 100.0)) (/ i n))
(if (<= t_2 0.0)
(* 100.0 (/ (expm1 (* n (log1p (/ i n)))) (/ i n)))
(if (<= t_2 INFINITY)
(* (/ t_1 i) (* n 100.0))
(/ (* n 100.0) (+ 1.0 (* i -0.5))))))))
double code(double i, double n) {
double t_0 = pow((1.0 + (i / n)), n);
double t_1 = t_0 + -1.0;
double t_2 = t_1 / (i / n);
double tmp;
if (t_2 <= -5e-210) {
tmp = (-100.0 + (t_0 * 100.0)) / (i / n);
} else if (t_2 <= 0.0) {
tmp = 100.0 * (expm1((n * log1p((i / n)))) / (i / n));
} else if (t_2 <= ((double) INFINITY)) {
tmp = (t_1 / i) * (n * 100.0);
} else {
tmp = (n * 100.0) / (1.0 + (i * -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;
double t_2 = t_1 / (i / n);
double tmp;
if (t_2 <= -5e-210) {
tmp = (-100.0 + (t_0 * 100.0)) / (i / n);
} else if (t_2 <= 0.0) {
tmp = 100.0 * (Math.expm1((n * Math.log1p((i / n)))) / (i / n));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = (t_1 / i) * (n * 100.0);
} else {
tmp = (n * 100.0) / (1.0 + (i * -0.5));
}
return tmp;
}
def code(i, n): t_0 = math.pow((1.0 + (i / n)), n) t_1 = t_0 + -1.0 t_2 = t_1 / (i / n) tmp = 0 if t_2 <= -5e-210: tmp = (-100.0 + (t_0 * 100.0)) / (i / n) elif t_2 <= 0.0: tmp = 100.0 * (math.expm1((n * math.log1p((i / n)))) / (i / n)) elif t_2 <= math.inf: tmp = (t_1 / i) * (n * 100.0) else: tmp = (n * 100.0) / (1.0 + (i * -0.5)) return tmp
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) ^ n t_1 = Float64(t_0 + -1.0) t_2 = Float64(t_1 / Float64(i / n)) tmp = 0.0 if (t_2 <= -5e-210) tmp = Float64(Float64(-100.0 + Float64(t_0 * 100.0)) / Float64(i / n)); elseif (t_2 <= 0.0) tmp = Float64(100.0 * Float64(expm1(Float64(n * log1p(Float64(i / n)))) / Float64(i / n))); elseif (t_2 <= Inf) tmp = Float64(Float64(t_1 / i) * Float64(n * 100.0)); else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * -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[(t$95$0 + -1.0), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-210], N[(N[(-100.0 + N[(t$95$0 * 100.0), $MachinePrecision]), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(100.0 * N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(t$95$1 / i), $MachinePrecision] * N[(n * 100.0), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := t_0 + -1\\
t_2 := \frac{t_1}{\frac{i}{n}}\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{-210}:\\
\;\;\;\;\frac{-100 + t_0 \cdot 100}{\frac{i}{n}}\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{i}{n}}\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\frac{t_1}{i} \cdot \left(n \cdot 100\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot -0.5}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -5.0000000000000002e-210Initial program 99.7%
associate-*r/99.8%
sub-neg99.8%
distribute-lft-in99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
fma-udef99.8%
*-commutative99.8%
Applied egg-rr99.8%
if -5.0000000000000002e-210 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -0.0Initial program 18.8%
*-un-lft-identity18.8%
pow-to-exp18.8%
expm1-def31.2%
*-commutative31.2%
log1p-udef99.8%
Applied egg-rr99.8%
*-lft-identity99.8%
Simplified99.8%
if -0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 99.6%
*-commutative99.6%
associate-/r/99.8%
associate-*l*99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
Taylor expanded in n around inf 1.9%
*-commutative1.9%
associate-/l*1.9%
expm1-def81.1%
Simplified81.1%
associate-*l/81.1%
Applied egg-rr81.1%
Taylor expanded in i around 0 99.7%
*-commutative99.7%
Simplified99.7%
Final simplification99.8%
(FPCore (i n)
:precision binary64
(if (<= n -4.8e-237)
(* 100.0 (/ n (/ i (expm1 i))))
(if (<= n 2.2e-257)
0.0
(if (<= n 3.2e-94)
(* 100.0 (/ i (/ i n)))
(if (<= n 1.95e-36)
(* 100.0 (* (log (/ i n)) (* n (/ n i))))
(* (* n 100.0) (/ (expm1 i) i)))))))
double code(double i, double n) {
double tmp;
if (n <= -4.8e-237) {
tmp = 100.0 * (n / (i / expm1(i)));
} else if (n <= 2.2e-257) {
tmp = 0.0;
} else if (n <= 3.2e-94) {
tmp = 100.0 * (i / (i / n));
} else if (n <= 1.95e-36) {
tmp = 100.0 * (log((i / n)) * (n * (n / i)));
} else {
tmp = (n * 100.0) * (expm1(i) / i);
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (n <= -4.8e-237) {
tmp = 100.0 * (n / (i / Math.expm1(i)));
} else if (n <= 2.2e-257) {
tmp = 0.0;
} else if (n <= 3.2e-94) {
tmp = 100.0 * (i / (i / n));
} else if (n <= 1.95e-36) {
tmp = 100.0 * (Math.log((i / n)) * (n * (n / i)));
} else {
tmp = (n * 100.0) * (Math.expm1(i) / i);
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -4.8e-237: tmp = 100.0 * (n / (i / math.expm1(i))) elif n <= 2.2e-257: tmp = 0.0 elif n <= 3.2e-94: tmp = 100.0 * (i / (i / n)) elif n <= 1.95e-36: tmp = 100.0 * (math.log((i / n)) * (n * (n / i))) else: tmp = (n * 100.0) * (math.expm1(i) / i) return tmp
function code(i, n) tmp = 0.0 if (n <= -4.8e-237) tmp = Float64(100.0 * Float64(n / Float64(i / expm1(i)))); elseif (n <= 2.2e-257) tmp = 0.0; elseif (n <= 3.2e-94) tmp = Float64(100.0 * Float64(i / Float64(i / n))); elseif (n <= 1.95e-36) tmp = Float64(100.0 * Float64(log(Float64(i / n)) * Float64(n * Float64(n / i)))); else tmp = Float64(Float64(n * 100.0) * Float64(expm1(i) / i)); end return tmp end
code[i_, n_] := If[LessEqual[n, -4.8e-237], N[(100.0 * N[(n / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.2e-257], 0.0, If[LessEqual[n, 3.2e-94], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.95e-36], N[(100.0 * N[(N[Log[N[(i / n), $MachinePrecision]], $MachinePrecision] * N[(n * N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -4.8 \cdot 10^{-237}:\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{elif}\;n \leq 2.2 \cdot 10^{-257}:\\
\;\;\;\;0\\
\mathbf{elif}\;n \leq 3.2 \cdot 10^{-94}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 1.95 \cdot 10^{-36}:\\
\;\;\;\;100 \cdot \left(\log \left(\frac{i}{n}\right) \cdot \left(n \cdot \frac{n}{i}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\
\end{array}
\end{array}
if n < -4.8e-237Initial program 29.6%
Taylor expanded in n around inf 32.8%
*-commutative32.8%
associate-/l*32.8%
expm1-def84.3%
Simplified84.3%
if -4.8e-237 < n < 2.19999999999999988e-257Initial program 79.5%
associate-*r/79.5%
sub-neg79.5%
distribute-lft-in79.5%
fma-def79.5%
metadata-eval79.5%
metadata-eval79.5%
Simplified79.5%
Taylor expanded in n around inf 68.2%
Taylor expanded in i around 0 85.7%
Taylor expanded in i around 0 85.7%
if 2.19999999999999988e-257 < n < 3.19999999999999997e-94Initial program 10.0%
Taylor expanded in i around 0 80.2%
if 3.19999999999999997e-94 < n < 1.95e-36Initial program 17.6%
associate-*r/17.6%
sub-neg17.6%
distribute-lft-in17.6%
fma-def17.6%
metadata-eval17.6%
metadata-eval17.6%
Simplified17.6%
fma-udef17.6%
*-commutative17.6%
Applied egg-rr17.6%
Taylor expanded in n around 0 63.9%
mul-1-neg63.9%
log-rec63.9%
+-commutative63.9%
log-rec63.9%
unsub-neg63.9%
log-div63.9%
Simplified63.9%
Taylor expanded in n around 0 63.6%
associate-/l*63.5%
unpow263.5%
mul-1-neg63.5%
log-rec63.5%
+-commutative63.5%
log-rec63.5%
sub-neg63.5%
log-div63.5%
associate-*l/63.5%
associate-/l*63.9%
associate-*l/63.9%
associate-*r/64.0%
*-commutative64.0%
associate-*l*63.9%
Simplified63.9%
if 1.95e-36 < n Initial program 20.8%
*-commutative20.8%
associate-/r/21.2%
associate-*l*21.2%
sub-neg21.2%
metadata-eval21.2%
Simplified21.2%
Taylor expanded in n around inf 32.0%
expm1-def93.4%
Simplified93.4%
Final simplification85.5%
(FPCore (i n) :precision binary64 (if (or (<= i -1.45e+85) (not (<= i 7e+106))) (* 100.0 (/ (+ -1.0 (pow (/ i n) n)) (/ i n))) (/ 1.0 (/ 0.01 (/ n (/ i (expm1 i)))))))
double code(double i, double n) {
double tmp;
if ((i <= -1.45e+85) || !(i <= 7e+106)) {
tmp = 100.0 * ((-1.0 + pow((i / n), n)) / (i / n));
} else {
tmp = 1.0 / (0.01 / (n / (i / expm1(i))));
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((i <= -1.45e+85) || !(i <= 7e+106)) {
tmp = 100.0 * ((-1.0 + Math.pow((i / n), n)) / (i / n));
} else {
tmp = 1.0 / (0.01 / (n / (i / Math.expm1(i))));
}
return tmp;
}
def code(i, n): tmp = 0 if (i <= -1.45e+85) or not (i <= 7e+106): tmp = 100.0 * ((-1.0 + math.pow((i / n), n)) / (i / n)) else: tmp = 1.0 / (0.01 / (n / (i / math.expm1(i)))) return tmp
function code(i, n) tmp = 0.0 if ((i <= -1.45e+85) || !(i <= 7e+106)) tmp = Float64(100.0 * Float64(Float64(-1.0 + (Float64(i / n) ^ n)) / Float64(i / n))); else tmp = Float64(1.0 / Float64(0.01 / Float64(n / Float64(i / expm1(i))))); end return tmp end
code[i_, n_] := If[Or[LessEqual[i, -1.45e+85], N[Not[LessEqual[i, 7e+106]], $MachinePrecision]], N[(100.0 * N[(N[(-1.0 + N[Power[N[(i / n), $MachinePrecision], n], $MachinePrecision]), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(0.01 / N[(n / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -1.45 \cdot 10^{+85} \lor \neg \left(i \leq 7 \cdot 10^{+106}\right):\\
\;\;\;\;100 \cdot \frac{-1 + {\left(\frac{i}{n}\right)}^{n}}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{0.01}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}}}\\
\end{array}
\end{array}
if i < -1.44999999999999999e85 or 6.99999999999999962e106 < i Initial program 67.0%
Taylor expanded in i around inf 76.3%
if -1.44999999999999999e85 < i < 6.99999999999999962e106Initial program 10.8%
Taylor expanded in n around inf 19.3%
*-commutative19.3%
associate-/l*19.3%
expm1-def86.4%
Simplified86.4%
associate-*l/86.4%
Applied egg-rr86.4%
Taylor expanded in n around 0 19.3%
*-commutative19.3%
expm1-def79.1%
associate-/l*86.4%
associate-/r/86.3%
associate-/l/86.2%
Simplified86.2%
clear-num86.4%
inv-pow86.4%
*-un-lft-identity86.4%
times-frac86.4%
metadata-eval86.4%
Applied egg-rr86.4%
unpow-186.4%
associate-/l*86.5%
Simplified86.5%
Final simplification83.5%
(FPCore (i n)
:precision binary64
(let* ((t_0 (+ -1.0 (pow (/ i n) n))))
(if (<= i -8e+84)
(* 100.0 (/ t_0 (/ i n)))
(if (<= i 2.8e+108)
(/ 1.0 (/ 0.01 (/ n (/ i (expm1 i)))))
(* (* n 100.0) (/ t_0 i))))))
double code(double i, double n) {
double t_0 = -1.0 + pow((i / n), n);
double tmp;
if (i <= -8e+84) {
tmp = 100.0 * (t_0 / (i / n));
} else if (i <= 2.8e+108) {
tmp = 1.0 / (0.01 / (n / (i / expm1(i))));
} else {
tmp = (n * 100.0) * (t_0 / i);
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = -1.0 + Math.pow((i / n), n);
double tmp;
if (i <= -8e+84) {
tmp = 100.0 * (t_0 / (i / n));
} else if (i <= 2.8e+108) {
tmp = 1.0 / (0.01 / (n / (i / Math.expm1(i))));
} else {
tmp = (n * 100.0) * (t_0 / i);
}
return tmp;
}
def code(i, n): t_0 = -1.0 + math.pow((i / n), n) tmp = 0 if i <= -8e+84: tmp = 100.0 * (t_0 / (i / n)) elif i <= 2.8e+108: tmp = 1.0 / (0.01 / (n / (i / math.expm1(i)))) else: tmp = (n * 100.0) * (t_0 / i) return tmp
function code(i, n) t_0 = Float64(-1.0 + (Float64(i / n) ^ n)) tmp = 0.0 if (i <= -8e+84) tmp = Float64(100.0 * Float64(t_0 / Float64(i / n))); elseif (i <= 2.8e+108) tmp = Float64(1.0 / Float64(0.01 / Float64(n / Float64(i / expm1(i))))); else tmp = Float64(Float64(n * 100.0) * Float64(t_0 / i)); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[(-1.0 + N[Power[N[(i / n), $MachinePrecision], n], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -8e+84], N[(100.0 * N[(t$95$0 / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 2.8e+108], N[(1.0 / N[(0.01 / N[(n / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] * N[(t$95$0 / i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 + {\left(\frac{i}{n}\right)}^{n}\\
\mathbf{if}\;i \leq -8 \cdot 10^{+84}:\\
\;\;\;\;100 \cdot \frac{t_0}{\frac{i}{n}}\\
\mathbf{elif}\;i \leq 2.8 \cdot 10^{+108}:\\
\;\;\;\;\frac{1}{\frac{0.01}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}}}\\
\mathbf{else}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \frac{t_0}{i}\\
\end{array}
\end{array}
if i < -8.00000000000000046e84Initial program 85.7%
Taylor expanded in i around inf 88.6%
if -8.00000000000000046e84 < i < 2.7999999999999998e108Initial program 10.8%
Taylor expanded in n around inf 19.3%
*-commutative19.3%
associate-/l*19.3%
expm1-def86.4%
Simplified86.4%
associate-*l/86.4%
Applied egg-rr86.4%
Taylor expanded in n around 0 19.3%
*-commutative19.3%
expm1-def79.1%
associate-/l*86.4%
associate-/r/86.3%
associate-/l/86.2%
Simplified86.2%
clear-num86.4%
inv-pow86.4%
*-un-lft-identity86.4%
times-frac86.4%
metadata-eval86.4%
Applied egg-rr86.4%
unpow-186.4%
associate-/l*86.5%
Simplified86.5%
if 2.7999999999999998e108 < i Initial program 51.9%
*-commutative51.9%
associate-/r/52.4%
associate-*l*52.4%
sub-neg52.4%
metadata-eval52.4%
Simplified52.4%
Taylor expanded in i around inf 66.8%
Final simplification83.6%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* 100.0 (/ (expm1 i) (/ i n)))))
(if (<= i -1.5e-8)
t_0
(if (<= i 2.1e-36)
(* n (+ 100.0 (* (* i 100.0) (- 0.5 (/ 0.5 n)))))
(if (<= i 2.55e+242) t_0 (fabs (* (/ n i) -200.0)))))))
double code(double i, double n) {
double t_0 = 100.0 * (expm1(i) / (i / n));
double tmp;
if (i <= -1.5e-8) {
tmp = t_0;
} else if (i <= 2.1e-36) {
tmp = n * (100.0 + ((i * 100.0) * (0.5 - (0.5 / n))));
} else if (i <= 2.55e+242) {
tmp = t_0;
} else {
tmp = fabs(((n / i) * -200.0));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = 100.0 * (Math.expm1(i) / (i / n));
double tmp;
if (i <= -1.5e-8) {
tmp = t_0;
} else if (i <= 2.1e-36) {
tmp = n * (100.0 + ((i * 100.0) * (0.5 - (0.5 / n))));
} else if (i <= 2.55e+242) {
tmp = t_0;
} else {
tmp = Math.abs(((n / i) * -200.0));
}
return tmp;
}
def code(i, n): t_0 = 100.0 * (math.expm1(i) / (i / n)) tmp = 0 if i <= -1.5e-8: tmp = t_0 elif i <= 2.1e-36: tmp = n * (100.0 + ((i * 100.0) * (0.5 - (0.5 / n)))) elif i <= 2.55e+242: tmp = t_0 else: tmp = math.fabs(((n / i) * -200.0)) return tmp
function code(i, n) t_0 = Float64(100.0 * Float64(expm1(i) / Float64(i / n))) tmp = 0.0 if (i <= -1.5e-8) tmp = t_0; elseif (i <= 2.1e-36) tmp = Float64(n * Float64(100.0 + Float64(Float64(i * 100.0) * Float64(0.5 - Float64(0.5 / n))))); elseif (i <= 2.55e+242) tmp = t_0; else tmp = abs(Float64(Float64(n / i) * -200.0)); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.5e-8], t$95$0, If[LessEqual[i, 2.1e-36], N[(n * N[(100.0 + N[(N[(i * 100.0), $MachinePrecision] * N[(0.5 - N[(0.5 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 2.55e+242], t$95$0, N[Abs[N[(N[(n / i), $MachinePrecision] * -200.0), $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 -1.5 \cdot 10^{-8}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;i \leq 2.1 \cdot 10^{-36}:\\
\;\;\;\;n \cdot \left(100 + \left(i \cdot 100\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)\\
\mathbf{elif}\;i \leq 2.55 \cdot 10^{+242}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{n}{i} \cdot -200\right|\\
\end{array}
\end{array}
if i < -1.49999999999999987e-8 or 2.09999999999999991e-36 < i < 2.54999999999999998e242Initial program 55.4%
Taylor expanded in n around inf 62.3%
expm1-def65.4%
Simplified65.4%
if -1.49999999999999987e-8 < i < 2.09999999999999991e-36Initial program 6.8%
associate-/r/7.3%
associate-*r*7.3%
*-commutative7.3%
associate-*r/7.3%
sub-neg7.3%
distribute-lft-in7.3%
fma-def7.3%
metadata-eval7.3%
metadata-eval7.3%
Simplified7.3%
Taylor expanded in i around 0 89.7%
associate-*r*89.7%
*-commutative89.7%
associate-*r/89.7%
metadata-eval89.7%
Simplified89.7%
if 2.54999999999999998e242 < i Initial program 45.0%
Taylor expanded in n around inf 19.3%
*-commutative19.3%
associate-/l*19.3%
expm1-def19.3%
Simplified19.3%
Taylor expanded in i around 0 59.8%
*-commutative59.8%
Simplified59.8%
Taylor expanded in i around inf 59.8%
add-sqr-sqrt59.7%
sqrt-unprod59.0%
pow259.0%
Applied egg-rr59.0%
unpow259.0%
rem-sqrt-square60.1%
*-commutative60.1%
Simplified60.1%
Final simplification79.1%
(FPCore (i n)
:precision binary64
(if (<= i -4.3e-8)
(* 100.0 (/ (expm1 i) (/ i n)))
(if (<= i 1.02e-33)
(* n (+ 100.0 (* (* i 100.0) (- 0.5 (/ 0.5 n)))))
(if (<= i 2.9e+242)
(* (expm1 i) (* n (/ 100.0 i)))
(fabs (* (/ n i) -200.0))))))
double code(double i, double n) {
double tmp;
if (i <= -4.3e-8) {
tmp = 100.0 * (expm1(i) / (i / n));
} else if (i <= 1.02e-33) {
tmp = n * (100.0 + ((i * 100.0) * (0.5 - (0.5 / n))));
} else if (i <= 2.9e+242) {
tmp = expm1(i) * (n * (100.0 / i));
} else {
tmp = fabs(((n / i) * -200.0));
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (i <= -4.3e-8) {
tmp = 100.0 * (Math.expm1(i) / (i / n));
} else if (i <= 1.02e-33) {
tmp = n * (100.0 + ((i * 100.0) * (0.5 - (0.5 / n))));
} else if (i <= 2.9e+242) {
tmp = Math.expm1(i) * (n * (100.0 / i));
} else {
tmp = Math.abs(((n / i) * -200.0));
}
return tmp;
}
def code(i, n): tmp = 0 if i <= -4.3e-8: tmp = 100.0 * (math.expm1(i) / (i / n)) elif i <= 1.02e-33: tmp = n * (100.0 + ((i * 100.0) * (0.5 - (0.5 / n)))) elif i <= 2.9e+242: tmp = math.expm1(i) * (n * (100.0 / i)) else: tmp = math.fabs(((n / i) * -200.0)) return tmp
function code(i, n) tmp = 0.0 if (i <= -4.3e-8) tmp = Float64(100.0 * Float64(expm1(i) / Float64(i / n))); elseif (i <= 1.02e-33) tmp = Float64(n * Float64(100.0 + Float64(Float64(i * 100.0) * Float64(0.5 - Float64(0.5 / n))))); elseif (i <= 2.9e+242) tmp = Float64(expm1(i) * Float64(n * Float64(100.0 / i))); else tmp = abs(Float64(Float64(n / i) * -200.0)); end return tmp end
code[i_, n_] := If[LessEqual[i, -4.3e-8], N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.02e-33], N[(n * N[(100.0 + N[(N[(i * 100.0), $MachinePrecision] * N[(0.5 - N[(0.5 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 2.9e+242], N[(N[(Exp[i] - 1), $MachinePrecision] * N[(n * N[(100.0 / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(N[(n / i), $MachinePrecision] * -200.0), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -4.3 \cdot 10^{-8}:\\
\;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\
\mathbf{elif}\;i \leq 1.02 \cdot 10^{-33}:\\
\;\;\;\;n \cdot \left(100 + \left(i \cdot 100\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)\\
\mathbf{elif}\;i \leq 2.9 \cdot 10^{+242}:\\
\;\;\;\;\mathsf{expm1}\left(i\right) \cdot \left(n \cdot \frac{100}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{n}{i} \cdot -200\right|\\
\end{array}
\end{array}
if i < -4.3000000000000001e-8Initial program 69.0%
Taylor expanded in n around inf 72.8%
expm1-def73.3%
Simplified73.3%
if -4.3000000000000001e-8 < i < 1.02e-33Initial program 6.8%
associate-/r/7.3%
associate-*r*7.3%
*-commutative7.3%
associate-*r/7.3%
sub-neg7.3%
distribute-lft-in7.3%
fma-def7.3%
metadata-eval7.3%
metadata-eval7.3%
Simplified7.3%
Taylor expanded in i around 0 89.8%
associate-*r*89.8%
*-commutative89.8%
associate-*r/89.8%
metadata-eval89.8%
Simplified89.8%
if 1.02e-33 < i < 2.89999999999999997e242Initial program 42.0%
Taylor expanded in n around inf 52.5%
*-commutative52.5%
associate-/l*52.5%
expm1-def56.4%
Simplified56.4%
associate-*l/56.4%
Applied egg-rr56.4%
Taylor expanded in n around 0 52.5%
*-commutative52.5%
expm1-def56.4%
associate-/l*56.4%
associate-/r/56.3%
associate-/l/56.3%
Simplified56.3%
Taylor expanded in n around 0 52.5%
associate-*r/52.5%
expm1-def56.3%
*-commutative56.3%
associate-*r*56.4%
associate-*r/56.2%
*-commutative56.2%
associate-*r*56.3%
associate-*l/56.3%
*-commutative56.3%
associate-*l/56.3%
Simplified56.3%
if 2.89999999999999997e242 < i Initial program 45.0%
Taylor expanded in n around inf 19.3%
*-commutative19.3%
associate-/l*19.3%
expm1-def19.3%
Simplified19.3%
Taylor expanded in i around 0 59.8%
*-commutative59.8%
Simplified59.8%
Taylor expanded in i around inf 59.8%
add-sqr-sqrt59.7%
sqrt-unprod59.0%
pow259.0%
Applied egg-rr59.0%
unpow259.0%
rem-sqrt-square60.1%
*-commutative60.1%
Simplified60.1%
Final simplification79.1%
(FPCore (i n) :precision binary64 (if (or (<= n -2.4e-229) (not (<= n 3.4e-213))) (* 100.0 (/ n (/ i (expm1 i)))) 0.0))
double code(double i, double n) {
double tmp;
if ((n <= -2.4e-229) || !(n <= 3.4e-213)) {
tmp = 100.0 * (n / (i / expm1(i)));
} else {
tmp = 0.0;
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((n <= -2.4e-229) || !(n <= 3.4e-213)) {
tmp = 100.0 * (n / (i / Math.expm1(i)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -2.4e-229) or not (n <= 3.4e-213): tmp = 100.0 * (n / (i / math.expm1(i))) else: tmp = 0.0 return tmp
function code(i, n) tmp = 0.0 if ((n <= -2.4e-229) || !(n <= 3.4e-213)) tmp = Float64(100.0 * Float64(n / Float64(i / expm1(i)))); else tmp = 0.0; end return tmp end
code[i_, n_] := If[Or[LessEqual[n, -2.4e-229], N[Not[LessEqual[n, 3.4e-213]], $MachinePrecision]], N[(100.0 * N[(n / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.4 \cdot 10^{-229} \lor \neg \left(n \leq 3.4 \cdot 10^{-213}\right):\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if n < -2.4e-229 or 3.4000000000000002e-213 < n Initial program 24.1%
Taylor expanded in n around inf 27.6%
*-commutative27.6%
associate-/l*27.6%
expm1-def82.0%
Simplified82.0%
if -2.4e-229 < n < 3.4000000000000002e-213Initial program 60.5%
associate-*r/60.5%
sub-neg60.5%
distribute-lft-in60.5%
fma-def60.5%
metadata-eval60.5%
metadata-eval60.5%
Simplified60.5%
Taylor expanded in n around inf 52.0%
Taylor expanded in i around 0 89.1%
Taylor expanded in i around 0 89.1%
Final simplification82.6%
(FPCore (i n) :precision binary64 (if (<= n -9.5e-226) (* 100.0 (/ n (/ i (expm1 i)))) (if (<= n 3.4e-213) 0.0 (* (* n 100.0) (/ (expm1 i) i)))))
double code(double i, double n) {
double tmp;
if (n <= -9.5e-226) {
tmp = 100.0 * (n / (i / expm1(i)));
} else if (n <= 3.4e-213) {
tmp = 0.0;
} else {
tmp = (n * 100.0) * (expm1(i) / i);
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (n <= -9.5e-226) {
tmp = 100.0 * (n / (i / Math.expm1(i)));
} else if (n <= 3.4e-213) {
tmp = 0.0;
} else {
tmp = (n * 100.0) * (Math.expm1(i) / i);
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -9.5e-226: tmp = 100.0 * (n / (i / math.expm1(i))) elif n <= 3.4e-213: tmp = 0.0 else: tmp = (n * 100.0) * (math.expm1(i) / i) return tmp
function code(i, n) tmp = 0.0 if (n <= -9.5e-226) tmp = Float64(100.0 * Float64(n / Float64(i / expm1(i)))); elseif (n <= 3.4e-213) tmp = 0.0; else tmp = Float64(Float64(n * 100.0) * Float64(expm1(i) / i)); end return tmp end
code[i_, n_] := If[LessEqual[n, -9.5e-226], N[(100.0 * N[(n / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 3.4e-213], 0.0, N[(N[(n * 100.0), $MachinePrecision] * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -9.5 \cdot 10^{-226}:\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{elif}\;n \leq 3.4 \cdot 10^{-213}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\
\end{array}
\end{array}
if n < -9.5000000000000007e-226Initial program 29.6%
Taylor expanded in n around inf 32.8%
*-commutative32.8%
associate-/l*32.8%
expm1-def84.3%
Simplified84.3%
if -9.5000000000000007e-226 < n < 3.4000000000000002e-213Initial program 60.5%
associate-*r/60.5%
sub-neg60.5%
distribute-lft-in60.5%
fma-def60.5%
metadata-eval60.5%
metadata-eval60.5%
Simplified60.5%
Taylor expanded in n around inf 52.0%
Taylor expanded in i around 0 89.1%
Taylor expanded in i around 0 89.1%
if 3.4000000000000002e-213 < n Initial program 18.5%
*-commutative18.5%
associate-/r/18.8%
associate-*l*18.8%
sub-neg18.8%
metadata-eval18.8%
Simplified18.8%
Taylor expanded in n around inf 22.3%
expm1-def79.7%
Simplified79.7%
Final simplification82.6%
(FPCore (i n)
:precision binary64
(let* ((t_0 (/ (* n 100.0) (+ 1.0 (* i -0.5))))
(t_1 (- 0.5 (/ 0.5 n)))
(t_2 (* i (* n t_1))))
(if (<= n -2.5e+198)
(* n (+ 100.0 (* 100.0 (* i (+ 0.5 (* i 0.16666666666666666))))))
(if (<= n -1.65e-236)
t_0
(if (<= n 5e-260)
0.0
(if (<= n 9.2e-25)
t_0
(if (<= n 6.7e+143)
(* 100.0 (/ (- (* n n) (* t_2 t_2)) (- n t_2)))
(* n (+ 100.0 (* (* i 100.0) t_1))))))))))
double code(double i, double n) {
double t_0 = (n * 100.0) / (1.0 + (i * -0.5));
double t_1 = 0.5 - (0.5 / n);
double t_2 = i * (n * t_1);
double tmp;
if (n <= -2.5e+198) {
tmp = n * (100.0 + (100.0 * (i * (0.5 + (i * 0.16666666666666666)))));
} else if (n <= -1.65e-236) {
tmp = t_0;
} else if (n <= 5e-260) {
tmp = 0.0;
} else if (n <= 9.2e-25) {
tmp = t_0;
} else if (n <= 6.7e+143) {
tmp = 100.0 * (((n * n) - (t_2 * t_2)) / (n - t_2));
} else {
tmp = n * (100.0 + ((i * 100.0) * t_1));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (n * 100.0d0) / (1.0d0 + (i * (-0.5d0)))
t_1 = 0.5d0 - (0.5d0 / n)
t_2 = i * (n * t_1)
if (n <= (-2.5d+198)) then
tmp = n * (100.0d0 + (100.0d0 * (i * (0.5d0 + (i * 0.16666666666666666d0)))))
else if (n <= (-1.65d-236)) then
tmp = t_0
else if (n <= 5d-260) then
tmp = 0.0d0
else if (n <= 9.2d-25) then
tmp = t_0
else if (n <= 6.7d+143) then
tmp = 100.0d0 * (((n * n) - (t_2 * t_2)) / (n - t_2))
else
tmp = n * (100.0d0 + ((i * 100.0d0) * t_1))
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = (n * 100.0) / (1.0 + (i * -0.5));
double t_1 = 0.5 - (0.5 / n);
double t_2 = i * (n * t_1);
double tmp;
if (n <= -2.5e+198) {
tmp = n * (100.0 + (100.0 * (i * (0.5 + (i * 0.16666666666666666)))));
} else if (n <= -1.65e-236) {
tmp = t_0;
} else if (n <= 5e-260) {
tmp = 0.0;
} else if (n <= 9.2e-25) {
tmp = t_0;
} else if (n <= 6.7e+143) {
tmp = 100.0 * (((n * n) - (t_2 * t_2)) / (n - t_2));
} else {
tmp = n * (100.0 + ((i * 100.0) * t_1));
}
return tmp;
}
def code(i, n): t_0 = (n * 100.0) / (1.0 + (i * -0.5)) t_1 = 0.5 - (0.5 / n) t_2 = i * (n * t_1) tmp = 0 if n <= -2.5e+198: tmp = n * (100.0 + (100.0 * (i * (0.5 + (i * 0.16666666666666666))))) elif n <= -1.65e-236: tmp = t_0 elif n <= 5e-260: tmp = 0.0 elif n <= 9.2e-25: tmp = t_0 elif n <= 6.7e+143: tmp = 100.0 * (((n * n) - (t_2 * t_2)) / (n - t_2)) else: tmp = n * (100.0 + ((i * 100.0) * t_1)) return tmp
function code(i, n) t_0 = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * -0.5))) t_1 = Float64(0.5 - Float64(0.5 / n)) t_2 = Float64(i * Float64(n * t_1)) tmp = 0.0 if (n <= -2.5e+198) tmp = Float64(n * Float64(100.0 + Float64(100.0 * Float64(i * Float64(0.5 + Float64(i * 0.16666666666666666)))))); elseif (n <= -1.65e-236) tmp = t_0; elseif (n <= 5e-260) tmp = 0.0; elseif (n <= 9.2e-25) tmp = t_0; elseif (n <= 6.7e+143) tmp = Float64(100.0 * Float64(Float64(Float64(n * n) - Float64(t_2 * t_2)) / Float64(n - t_2))); else tmp = Float64(n * Float64(100.0 + Float64(Float64(i * 100.0) * t_1))); end return tmp end
function tmp_2 = code(i, n) t_0 = (n * 100.0) / (1.0 + (i * -0.5)); t_1 = 0.5 - (0.5 / n); t_2 = i * (n * t_1); tmp = 0.0; if (n <= -2.5e+198) tmp = n * (100.0 + (100.0 * (i * (0.5 + (i * 0.16666666666666666))))); elseif (n <= -1.65e-236) tmp = t_0; elseif (n <= 5e-260) tmp = 0.0; elseif (n <= 9.2e-25) tmp = t_0; elseif (n <= 6.7e+143) tmp = 100.0 * (((n * n) - (t_2 * t_2)) / (n - t_2)); else tmp = n * (100.0 + ((i * 100.0) * t_1)); end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 - N[(0.5 / n), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(n * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -2.5e+198], N[(n * N[(100.0 + N[(100.0 * N[(i * N[(0.5 + N[(i * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -1.65e-236], t$95$0, If[LessEqual[n, 5e-260], 0.0, If[LessEqual[n, 9.2e-25], t$95$0, If[LessEqual[n, 6.7e+143], N[(100.0 * N[(N[(N[(n * n), $MachinePrecision] - N[(t$95$2 * t$95$2), $MachinePrecision]), $MachinePrecision] / N[(n - t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 + N[(N[(i * 100.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{n \cdot 100}{1 + i \cdot -0.5}\\
t_1 := 0.5 - \frac{0.5}{n}\\
t_2 := i \cdot \left(n \cdot t_1\right)\\
\mathbf{if}\;n \leq -2.5 \cdot 10^{+198}:\\
\;\;\;\;n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 + i \cdot 0.16666666666666666\right)\right)\right)\\
\mathbf{elif}\;n \leq -1.65 \cdot 10^{-236}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq 5 \cdot 10^{-260}:\\
\;\;\;\;0\\
\mathbf{elif}\;n \leq 9.2 \cdot 10^{-25}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq 6.7 \cdot 10^{+143}:\\
\;\;\;\;100 \cdot \frac{n \cdot n - t_2 \cdot t_2}{n - t_2}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + \left(i \cdot 100\right) \cdot t_1\right)\\
\end{array}
\end{array}
if n < -2.50000000000000024e198Initial program 11.4%
associate-/r/12.2%
associate-*r*12.2%
*-commutative12.2%
associate-*r/12.2%
sub-neg12.2%
distribute-lft-in12.2%
fma-def12.2%
metadata-eval12.2%
metadata-eval12.2%
Simplified12.2%
Taylor expanded in i around 0 89.6%
distribute-lft-out89.6%
associate-*r/89.6%
metadata-eval89.6%
unpow289.6%
associate--l+89.6%
associate-*r/89.6%
metadata-eval89.6%
unpow289.6%
associate-*r/89.6%
metadata-eval89.6%
Simplified89.6%
Taylor expanded in n around inf 89.6%
*-commutative89.6%
unpow289.6%
Simplified89.6%
Taylor expanded in n around inf 89.6%
+-commutative89.6%
*-commutative89.6%
*-commutative89.6%
unpow289.6%
associate-*r*89.6%
distribute-lft-out89.6%
Simplified89.6%
if -2.50000000000000024e198 < n < -1.6500000000000001e-236 or 5.0000000000000003e-260 < n < 9.1999999999999997e-25Initial program 27.7%
Taylor expanded in n around inf 21.8%
*-commutative21.8%
associate-/l*21.8%
expm1-def69.6%
Simplified69.6%
associate-*l/69.6%
Applied egg-rr69.6%
Taylor expanded in i around 0 64.4%
*-commutative64.4%
Simplified64.4%
if -1.6500000000000001e-236 < n < 5.0000000000000003e-260Initial program 79.5%
associate-*r/79.5%
sub-neg79.5%
distribute-lft-in79.5%
fma-def79.5%
metadata-eval79.5%
metadata-eval79.5%
Simplified79.5%
Taylor expanded in n around inf 68.2%
Taylor expanded in i around 0 85.7%
Taylor expanded in i around 0 85.7%
if 9.1999999999999997e-25 < n < 6.7000000000000002e143Initial program 25.9%
Taylor expanded in i around 0 70.7%
associate-*r*70.7%
*-commutative70.7%
associate-*r/70.7%
metadata-eval70.7%
Simplified70.7%
flip-+90.0%
associate-*l*90.0%
associate-*l*90.0%
associate-*l*90.0%
Applied egg-rr90.0%
if 6.7000000000000002e143 < n Initial program 17.7%
associate-/r/18.3%
associate-*r*18.3%
*-commutative18.3%
associate-*r/18.3%
sub-neg18.3%
distribute-lft-in18.3%
fma-def18.3%
metadata-eval18.3%
metadata-eval18.3%
Simplified18.3%
Taylor expanded in i around 0 82.8%
associate-*r*82.8%
*-commutative82.8%
associate-*r/82.8%
metadata-eval82.8%
Simplified82.8%
Final simplification74.8%
(FPCore (i n)
:precision binary64
(if (<= n -9.5e+198)
(* n (+ 100.0 (* 100.0 (* i (+ 0.5 (* i 0.16666666666666666))))))
(if (<= n -4.5e-225)
(/ (* n 100.0) (+ 1.0 (* i -0.5)))
(if (<= n 3e-213)
0.0
(* n (/ (* 100.0 (+ i (* (- 0.5 (/ 0.5 n)) (* i i)))) i))))))
double code(double i, double n) {
double tmp;
if (n <= -9.5e+198) {
tmp = n * (100.0 + (100.0 * (i * (0.5 + (i * 0.16666666666666666)))));
} else if (n <= -4.5e-225) {
tmp = (n * 100.0) / (1.0 + (i * -0.5));
} else if (n <= 3e-213) {
tmp = 0.0;
} else {
tmp = n * ((100.0 * (i + ((0.5 - (0.5 / n)) * (i * i)))) / i);
}
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+198)) then
tmp = n * (100.0d0 + (100.0d0 * (i * (0.5d0 + (i * 0.16666666666666666d0)))))
else if (n <= (-4.5d-225)) then
tmp = (n * 100.0d0) / (1.0d0 + (i * (-0.5d0)))
else if (n <= 3d-213) then
tmp = 0.0d0
else
tmp = n * ((100.0d0 * (i + ((0.5d0 - (0.5d0 / n)) * (i * i)))) / i)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -9.5e+198) {
tmp = n * (100.0 + (100.0 * (i * (0.5 + (i * 0.16666666666666666)))));
} else if (n <= -4.5e-225) {
tmp = (n * 100.0) / (1.0 + (i * -0.5));
} else if (n <= 3e-213) {
tmp = 0.0;
} else {
tmp = n * ((100.0 * (i + ((0.5 - (0.5 / n)) * (i * i)))) / i);
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -9.5e+198: tmp = n * (100.0 + (100.0 * (i * (0.5 + (i * 0.16666666666666666))))) elif n <= -4.5e-225: tmp = (n * 100.0) / (1.0 + (i * -0.5)) elif n <= 3e-213: tmp = 0.0 else: tmp = n * ((100.0 * (i + ((0.5 - (0.5 / n)) * (i * i)))) / i) return tmp
function code(i, n) tmp = 0.0 if (n <= -9.5e+198) tmp = Float64(n * Float64(100.0 + Float64(100.0 * Float64(i * Float64(0.5 + Float64(i * 0.16666666666666666)))))); elseif (n <= -4.5e-225) tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * -0.5))); elseif (n <= 3e-213) tmp = 0.0; else tmp = Float64(n * Float64(Float64(100.0 * Float64(i + Float64(Float64(0.5 - Float64(0.5 / n)) * Float64(i * i)))) / i)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -9.5e+198) tmp = n * (100.0 + (100.0 * (i * (0.5 + (i * 0.16666666666666666))))); elseif (n <= -4.5e-225) tmp = (n * 100.0) / (1.0 + (i * -0.5)); elseif (n <= 3e-213) tmp = 0.0; else tmp = n * ((100.0 * (i + ((0.5 - (0.5 / n)) * (i * i)))) / i); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -9.5e+198], N[(n * N[(100.0 + N[(100.0 * N[(i * N[(0.5 + N[(i * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -4.5e-225], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 3e-213], 0.0, N[(n * N[(N[(100.0 * N[(i + N[(N[(0.5 - N[(0.5 / n), $MachinePrecision]), $MachinePrecision] * N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -9.5 \cdot 10^{+198}:\\
\;\;\;\;n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 + i \cdot 0.16666666666666666\right)\right)\right)\\
\mathbf{elif}\;n \leq -4.5 \cdot 10^{-225}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot -0.5}\\
\mathbf{elif}\;n \leq 3 \cdot 10^{-213}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;n \cdot \frac{100 \cdot \left(i + \left(0.5 - \frac{0.5}{n}\right) \cdot \left(i \cdot i\right)\right)}{i}\\
\end{array}
\end{array}
if n < -9.5e198Initial program 11.4%
associate-/r/12.2%
associate-*r*12.2%
*-commutative12.2%
associate-*r/12.2%
sub-neg12.2%
distribute-lft-in12.2%
fma-def12.2%
metadata-eval12.2%
metadata-eval12.2%
Simplified12.2%
Taylor expanded in i around 0 89.6%
distribute-lft-out89.6%
associate-*r/89.6%
metadata-eval89.6%
unpow289.6%
associate--l+89.6%
associate-*r/89.6%
metadata-eval89.6%
unpow289.6%
associate-*r/89.6%
metadata-eval89.6%
Simplified89.6%
Taylor expanded in n around inf 89.6%
*-commutative89.6%
unpow289.6%
Simplified89.6%
Taylor expanded in n around inf 89.6%
+-commutative89.6%
*-commutative89.6%
*-commutative89.6%
unpow289.6%
associate-*r*89.6%
distribute-lft-out89.6%
Simplified89.6%
if -9.5e198 < n < -4.5e-225Initial program 35.2%
Taylor expanded in n around inf 31.0%
*-commutative31.0%
associate-/l*31.0%
expm1-def80.6%
Simplified80.6%
associate-*l/80.6%
Applied egg-rr80.6%
Taylor expanded in i around 0 63.7%
*-commutative63.7%
Simplified63.7%
if -4.5e-225 < n < 2.99999999999999986e-213Initial program 60.5%
associate-*r/60.5%
sub-neg60.5%
distribute-lft-in60.5%
fma-def60.5%
metadata-eval60.5%
metadata-eval60.5%
Simplified60.5%
Taylor expanded in n around inf 52.0%
Taylor expanded in i around 0 89.1%
Taylor expanded in i around 0 89.1%
if 2.99999999999999986e-213 < n Initial program 18.5%
associate-/r/18.8%
associate-*r*18.8%
*-commutative18.8%
associate-*r/18.8%
sub-neg18.8%
distribute-lft-in18.8%
fma-def18.8%
metadata-eval18.8%
metadata-eval18.8%
Simplified18.8%
Taylor expanded in i around 0 71.0%
distribute-lft-out71.0%
unpow271.0%
associate-*r/71.0%
metadata-eval71.0%
Simplified71.0%
Final simplification71.9%
(FPCore (i n)
:precision binary64
(let* ((t_0
(* n (+ 100.0 (* 100.0 (* i (+ 0.5 (* i 0.16666666666666666))))))))
(if (<= n -5.5e+198)
t_0
(if (<= n -5.2e-232)
(/ (* n 100.0) (+ 1.0 (* i -0.5)))
(if (<= n 3.4e-213) 0.0 t_0)))))
double code(double i, double n) {
double t_0 = n * (100.0 + (100.0 * (i * (0.5 + (i * 0.16666666666666666)))));
double tmp;
if (n <= -5.5e+198) {
tmp = t_0;
} else if (n <= -5.2e-232) {
tmp = (n * 100.0) / (1.0 + (i * -0.5));
} else if (n <= 3.4e-213) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = n * (100.0d0 + (100.0d0 * (i * (0.5d0 + (i * 0.16666666666666666d0)))))
if (n <= (-5.5d+198)) then
tmp = t_0
else if (n <= (-5.2d-232)) then
tmp = (n * 100.0d0) / (1.0d0 + (i * (-0.5d0)))
else if (n <= 3.4d-213) then
tmp = 0.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = n * (100.0 + (100.0 * (i * (0.5 + (i * 0.16666666666666666)))));
double tmp;
if (n <= -5.5e+198) {
tmp = t_0;
} else if (n <= -5.2e-232) {
tmp = (n * 100.0) / (1.0 + (i * -0.5));
} else if (n <= 3.4e-213) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = n * (100.0 + (100.0 * (i * (0.5 + (i * 0.16666666666666666))))) tmp = 0 if n <= -5.5e+198: tmp = t_0 elif n <= -5.2e-232: tmp = (n * 100.0) / (1.0 + (i * -0.5)) elif n <= 3.4e-213: tmp = 0.0 else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(n * Float64(100.0 + Float64(100.0 * Float64(i * Float64(0.5 + Float64(i * 0.16666666666666666)))))) tmp = 0.0 if (n <= -5.5e+198) tmp = t_0; elseif (n <= -5.2e-232) tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * -0.5))); elseif (n <= 3.4e-213) tmp = 0.0; else tmp = t_0; end return tmp end
function tmp_2 = code(i, n) t_0 = n * (100.0 + (100.0 * (i * (0.5 + (i * 0.16666666666666666))))); tmp = 0.0; if (n <= -5.5e+198) tmp = t_0; elseif (n <= -5.2e-232) tmp = (n * 100.0) / (1.0 + (i * -0.5)); elseif (n <= 3.4e-213) tmp = 0.0; else tmp = t_0; end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(n * N[(100.0 + N[(100.0 * N[(i * N[(0.5 + N[(i * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -5.5e+198], t$95$0, If[LessEqual[n, -5.2e-232], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 3.4e-213], 0.0, t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 + i \cdot 0.16666666666666666\right)\right)\right)\\
\mathbf{if}\;n \leq -5.5 \cdot 10^{+198}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq -5.2 \cdot 10^{-232}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot -0.5}\\
\mathbf{elif}\;n \leq 3.4 \cdot 10^{-213}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if n < -5.5000000000000004e198 or 3.4000000000000002e-213 < n Initial program 17.1%
associate-/r/17.5%
associate-*r*17.5%
*-commutative17.5%
associate-*r/17.5%
sub-neg17.5%
distribute-lft-in17.5%
fma-def17.5%
metadata-eval17.5%
metadata-eval17.5%
Simplified17.5%
Taylor expanded in i around 0 69.8%
distribute-lft-out69.8%
associate-*r/69.8%
metadata-eval69.8%
unpow269.8%
associate--l+69.8%
associate-*r/69.8%
metadata-eval69.8%
unpow269.8%
associate-*r/69.8%
metadata-eval69.8%
Simplified69.8%
Taylor expanded in n around inf 73.9%
*-commutative73.9%
unpow273.9%
Simplified73.9%
Taylor expanded in n around inf 74.0%
+-commutative74.0%
*-commutative74.0%
*-commutative74.0%
unpow274.0%
associate-*r*74.0%
distribute-lft-out74.0%
Simplified74.0%
if -5.5000000000000004e198 < n < -5.19999999999999992e-232Initial program 35.2%
Taylor expanded in n around inf 31.0%
*-commutative31.0%
associate-/l*31.0%
expm1-def80.6%
Simplified80.6%
associate-*l/80.6%
Applied egg-rr80.6%
Taylor expanded in i around 0 63.7%
*-commutative63.7%
Simplified63.7%
if -5.19999999999999992e-232 < n < 3.4000000000000002e-213Initial program 60.5%
associate-*r/60.5%
sub-neg60.5%
distribute-lft-in60.5%
fma-def60.5%
metadata-eval60.5%
metadata-eval60.5%
Simplified60.5%
Taylor expanded in n around inf 52.0%
Taylor expanded in i around 0 89.1%
Taylor expanded in i around 0 89.1%
Final simplification71.6%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* 100.0 (+ n (* 0.5 (* i n))))))
(if (<= n -3.6e+198)
t_0
(if (<= n -5.4e-227)
(/ n (+ 0.01 (* i -0.005)))
(if (<= n 9.5e-215) 0.0 t_0)))))
double code(double i, double n) {
double t_0 = 100.0 * (n + (0.5 * (i * n)));
double tmp;
if (n <= -3.6e+198) {
tmp = t_0;
} else if (n <= -5.4e-227) {
tmp = n / (0.01 + (i * -0.005));
} else if (n <= 9.5e-215) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = 100.0d0 * (n + (0.5d0 * (i * n)))
if (n <= (-3.6d+198)) then
tmp = t_0
else if (n <= (-5.4d-227)) then
tmp = n / (0.01d0 + (i * (-0.005d0)))
else if (n <= 9.5d-215) then
tmp = 0.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = 100.0 * (n + (0.5 * (i * n)));
double tmp;
if (n <= -3.6e+198) {
tmp = t_0;
} else if (n <= -5.4e-227) {
tmp = n / (0.01 + (i * -0.005));
} else if (n <= 9.5e-215) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = 100.0 * (n + (0.5 * (i * n))) tmp = 0 if n <= -3.6e+198: tmp = t_0 elif n <= -5.4e-227: tmp = n / (0.01 + (i * -0.005)) elif n <= 9.5e-215: tmp = 0.0 else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(100.0 * Float64(n + Float64(0.5 * Float64(i * n)))) tmp = 0.0 if (n <= -3.6e+198) tmp = t_0; elseif (n <= -5.4e-227) tmp = Float64(n / Float64(0.01 + Float64(i * -0.005))); elseif (n <= 9.5e-215) tmp = 0.0; else tmp = t_0; end return tmp end
function tmp_2 = code(i, n) t_0 = 100.0 * (n + (0.5 * (i * n))); tmp = 0.0; if (n <= -3.6e+198) tmp = t_0; elseif (n <= -5.4e-227) tmp = n / (0.01 + (i * -0.005)); elseif (n <= 9.5e-215) tmp = 0.0; else tmp = t_0; end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(100.0 * N[(n + N[(0.5 * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -3.6e+198], t$95$0, If[LessEqual[n, -5.4e-227], N[(n / N[(0.01 + N[(i * -0.005), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 9.5e-215], 0.0, t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 100 \cdot \left(n + 0.5 \cdot \left(i \cdot n\right)\right)\\
\mathbf{if}\;n \leq -3.6 \cdot 10^{+198}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq -5.4 \cdot 10^{-227}:\\
\;\;\;\;\frac{n}{0.01 + i \cdot -0.005}\\
\mathbf{elif}\;n \leq 9.5 \cdot 10^{-215}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if n < -3.6000000000000002e198 or 9.5000000000000007e-215 < n Initial program 17.1%
Taylor expanded in n around inf 25.4%
*-commutative25.4%
associate-/l*25.4%
expm1-def82.9%
Simplified82.9%
Taylor expanded in i around 0 73.0%
*-commutative73.0%
Simplified73.0%
if -3.6000000000000002e198 < n < -5.3999999999999999e-227Initial program 35.2%
Taylor expanded in n around inf 31.0%
*-commutative31.0%
associate-/l*31.0%
expm1-def80.6%
Simplified80.6%
associate-*l/80.6%
Applied egg-rr80.6%
Taylor expanded in n around 0 31.0%
*-commutative31.0%
expm1-def73.1%
associate-/l*80.6%
associate-/r/80.4%
associate-/l/80.3%
Simplified80.3%
Taylor expanded in i around 0 63.6%
*-commutative63.6%
Simplified63.6%
if -5.3999999999999999e-227 < n < 9.5000000000000007e-215Initial program 60.5%
associate-*r/60.5%
sub-neg60.5%
distribute-lft-in60.5%
fma-def60.5%
metadata-eval60.5%
metadata-eval60.5%
Simplified60.5%
Taylor expanded in n around inf 52.0%
Taylor expanded in i around 0 89.1%
Taylor expanded in i around 0 89.1%
Final simplification71.0%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* 100.0 (+ n (* 0.5 (* i n))))))
(if (<= n -5e+199)
t_0
(if (<= n -1.35e-227)
(* 100.0 (/ n (+ 1.0 (* i -0.5))))
(if (<= n 1e-213) 0.0 t_0)))))
double code(double i, double n) {
double t_0 = 100.0 * (n + (0.5 * (i * n)));
double tmp;
if (n <= -5e+199) {
tmp = t_0;
} else if (n <= -1.35e-227) {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
} else if (n <= 1e-213) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = 100.0d0 * (n + (0.5d0 * (i * n)))
if (n <= (-5d+199)) then
tmp = t_0
else if (n <= (-1.35d-227)) then
tmp = 100.0d0 * (n / (1.0d0 + (i * (-0.5d0))))
else if (n <= 1d-213) then
tmp = 0.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = 100.0 * (n + (0.5 * (i * n)));
double tmp;
if (n <= -5e+199) {
tmp = t_0;
} else if (n <= -1.35e-227) {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
} else if (n <= 1e-213) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = 100.0 * (n + (0.5 * (i * n))) tmp = 0 if n <= -5e+199: tmp = t_0 elif n <= -1.35e-227: tmp = 100.0 * (n / (1.0 + (i * -0.5))) elif n <= 1e-213: tmp = 0.0 else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(100.0 * Float64(n + Float64(0.5 * Float64(i * n)))) tmp = 0.0 if (n <= -5e+199) tmp = t_0; elseif (n <= -1.35e-227) tmp = Float64(100.0 * Float64(n / Float64(1.0 + Float64(i * -0.5)))); elseif (n <= 1e-213) tmp = 0.0; else tmp = t_0; end return tmp end
function tmp_2 = code(i, n) t_0 = 100.0 * (n + (0.5 * (i * n))); tmp = 0.0; if (n <= -5e+199) tmp = t_0; elseif (n <= -1.35e-227) tmp = 100.0 * (n / (1.0 + (i * -0.5))); elseif (n <= 1e-213) tmp = 0.0; else tmp = t_0; end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(100.0 * N[(n + N[(0.5 * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -5e+199], t$95$0, If[LessEqual[n, -1.35e-227], N[(100.0 * N[(n / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1e-213], 0.0, t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 100 \cdot \left(n + 0.5 \cdot \left(i \cdot n\right)\right)\\
\mathbf{if}\;n \leq -5 \cdot 10^{+199}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq -1.35 \cdot 10^{-227}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{elif}\;n \leq 10^{-213}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if n < -4.9999999999999998e199 or 9.9999999999999995e-214 < n Initial program 17.1%
Taylor expanded in n around inf 25.4%
*-commutative25.4%
associate-/l*25.4%
expm1-def82.9%
Simplified82.9%
Taylor expanded in i around 0 73.0%
*-commutative73.0%
Simplified73.0%
if -4.9999999999999998e199 < n < -1.35e-227Initial program 35.2%
Taylor expanded in n around inf 31.0%
*-commutative31.0%
associate-/l*31.0%
expm1-def80.6%
Simplified80.6%
Taylor expanded in i around 0 63.7%
*-commutative63.7%
Simplified63.7%
if -1.35e-227 < n < 9.9999999999999995e-214Initial program 60.5%
associate-*r/60.5%
sub-neg60.5%
distribute-lft-in60.5%
fma-def60.5%
metadata-eval60.5%
metadata-eval60.5%
Simplified60.5%
Taylor expanded in n around inf 52.0%
Taylor expanded in i around 0 89.1%
Taylor expanded in i around 0 89.1%
Final simplification71.0%
(FPCore (i n)
:precision binary64
(if (<= n -1.9e+205)
(+ (* n 100.0) (* (* i n) 50.0))
(if (<= n -6.5e-234)
(* 100.0 (/ n (+ 1.0 (* i -0.5))))
(if (<= n 7.5e-214) 0.0 (* 100.0 (+ n (* 0.5 (* i n))))))))
double code(double i, double n) {
double tmp;
if (n <= -1.9e+205) {
tmp = (n * 100.0) + ((i * n) * 50.0);
} else if (n <= -6.5e-234) {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
} else if (n <= 7.5e-214) {
tmp = 0.0;
} else {
tmp = 100.0 * (n + (0.5 * (i * n)));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-1.9d+205)) then
tmp = (n * 100.0d0) + ((i * n) * 50.0d0)
else if (n <= (-6.5d-234)) then
tmp = 100.0d0 * (n / (1.0d0 + (i * (-0.5d0))))
else if (n <= 7.5d-214) then
tmp = 0.0d0
else
tmp = 100.0d0 * (n + (0.5d0 * (i * n)))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -1.9e+205) {
tmp = (n * 100.0) + ((i * n) * 50.0);
} else if (n <= -6.5e-234) {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
} else if (n <= 7.5e-214) {
tmp = 0.0;
} else {
tmp = 100.0 * (n + (0.5 * (i * n)));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.9e+205: tmp = (n * 100.0) + ((i * n) * 50.0) elif n <= -6.5e-234: tmp = 100.0 * (n / (1.0 + (i * -0.5))) elif n <= 7.5e-214: tmp = 0.0 else: tmp = 100.0 * (n + (0.5 * (i * n))) return tmp
function code(i, n) tmp = 0.0 if (n <= -1.9e+205) tmp = Float64(Float64(n * 100.0) + Float64(Float64(i * n) * 50.0)); elseif (n <= -6.5e-234) tmp = Float64(100.0 * Float64(n / Float64(1.0 + Float64(i * -0.5)))); elseif (n <= 7.5e-214) tmp = 0.0; else tmp = Float64(100.0 * Float64(n + Float64(0.5 * Float64(i * n)))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -1.9e+205) tmp = (n * 100.0) + ((i * n) * 50.0); elseif (n <= -6.5e-234) tmp = 100.0 * (n / (1.0 + (i * -0.5))); elseif (n <= 7.5e-214) tmp = 0.0; else tmp = 100.0 * (n + (0.5 * (i * n))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.9e+205], N[(N[(n * 100.0), $MachinePrecision] + N[(N[(i * n), $MachinePrecision] * 50.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -6.5e-234], N[(100.0 * N[(n / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 7.5e-214], 0.0, N[(100.0 * N[(n + N[(0.5 * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.9 \cdot 10^{+205}:\\
\;\;\;\;n \cdot 100 + \left(i \cdot n\right) \cdot 50\\
\mathbf{elif}\;n \leq -6.5 \cdot 10^{-234}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{elif}\;n \leq 7.5 \cdot 10^{-214}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n + 0.5 \cdot \left(i \cdot n\right)\right)\\
\end{array}
\end{array}
if n < -1.9e205Initial program 11.4%
Taylor expanded in n around inf 38.6%
*-commutative38.6%
associate-/l*38.6%
expm1-def96.3%
Simplified96.3%
Taylor expanded in i around 0 86.1%
if -1.9e205 < n < -6.4999999999999994e-234Initial program 35.2%
Taylor expanded in n around inf 31.0%
*-commutative31.0%
associate-/l*31.0%
expm1-def80.6%
Simplified80.6%
Taylor expanded in i around 0 63.7%
*-commutative63.7%
Simplified63.7%
if -6.4999999999999994e-234 < n < 7.49999999999999966e-214Initial program 60.5%
associate-*r/60.5%
sub-neg60.5%
distribute-lft-in60.5%
fma-def60.5%
metadata-eval60.5%
metadata-eval60.5%
Simplified60.5%
Taylor expanded in n around inf 52.0%
Taylor expanded in i around 0 89.1%
Taylor expanded in i around 0 89.1%
if 7.49999999999999966e-214 < n Initial program 18.5%
Taylor expanded in n around inf 22.3%
*-commutative22.3%
associate-/l*22.3%
expm1-def79.7%
Simplified79.7%
Taylor expanded in i around 0 69.9%
*-commutative69.9%
Simplified69.9%
Final simplification71.0%
(FPCore (i n)
:precision binary64
(if (<= n -2.85e+200)
(+ (* n 100.0) (* (* i n) 50.0))
(if (<= n -1.3e-232)
(/ (* n 100.0) (+ 1.0 (* i -0.5)))
(if (<= n 2.2e-213) 0.0 (* 100.0 (+ n (* 0.5 (* i n))))))))
double code(double i, double n) {
double tmp;
if (n <= -2.85e+200) {
tmp = (n * 100.0) + ((i * n) * 50.0);
} else if (n <= -1.3e-232) {
tmp = (n * 100.0) / (1.0 + (i * -0.5));
} else if (n <= 2.2e-213) {
tmp = 0.0;
} else {
tmp = 100.0 * (n + (0.5 * (i * n)));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-2.85d+200)) then
tmp = (n * 100.0d0) + ((i * n) * 50.0d0)
else if (n <= (-1.3d-232)) then
tmp = (n * 100.0d0) / (1.0d0 + (i * (-0.5d0)))
else if (n <= 2.2d-213) then
tmp = 0.0d0
else
tmp = 100.0d0 * (n + (0.5d0 * (i * n)))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -2.85e+200) {
tmp = (n * 100.0) + ((i * n) * 50.0);
} else if (n <= -1.3e-232) {
tmp = (n * 100.0) / (1.0 + (i * -0.5));
} else if (n <= 2.2e-213) {
tmp = 0.0;
} else {
tmp = 100.0 * (n + (0.5 * (i * n)));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -2.85e+200: tmp = (n * 100.0) + ((i * n) * 50.0) elif n <= -1.3e-232: tmp = (n * 100.0) / (1.0 + (i * -0.5)) elif n <= 2.2e-213: tmp = 0.0 else: tmp = 100.0 * (n + (0.5 * (i * n))) return tmp
function code(i, n) tmp = 0.0 if (n <= -2.85e+200) tmp = Float64(Float64(n * 100.0) + Float64(Float64(i * n) * 50.0)); elseif (n <= -1.3e-232) tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * -0.5))); elseif (n <= 2.2e-213) tmp = 0.0; else tmp = Float64(100.0 * Float64(n + Float64(0.5 * Float64(i * n)))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -2.85e+200) tmp = (n * 100.0) + ((i * n) * 50.0); elseif (n <= -1.3e-232) tmp = (n * 100.0) / (1.0 + (i * -0.5)); elseif (n <= 2.2e-213) tmp = 0.0; else tmp = 100.0 * (n + (0.5 * (i * n))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -2.85e+200], N[(N[(n * 100.0), $MachinePrecision] + N[(N[(i * n), $MachinePrecision] * 50.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -1.3e-232], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.2e-213], 0.0, N[(100.0 * N[(n + N[(0.5 * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.85 \cdot 10^{+200}:\\
\;\;\;\;n \cdot 100 + \left(i \cdot n\right) \cdot 50\\
\mathbf{elif}\;n \leq -1.3 \cdot 10^{-232}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot -0.5}\\
\mathbf{elif}\;n \leq 2.2 \cdot 10^{-213}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n + 0.5 \cdot \left(i \cdot n\right)\right)\\
\end{array}
\end{array}
if n < -2.85000000000000003e200Initial program 11.4%
Taylor expanded in n around inf 38.6%
*-commutative38.6%
associate-/l*38.6%
expm1-def96.3%
Simplified96.3%
Taylor expanded in i around 0 86.1%
if -2.85000000000000003e200 < n < -1.29999999999999998e-232Initial program 35.2%
Taylor expanded in n around inf 31.0%
*-commutative31.0%
associate-/l*31.0%
expm1-def80.6%
Simplified80.6%
associate-*l/80.6%
Applied egg-rr80.6%
Taylor expanded in i around 0 63.7%
*-commutative63.7%
Simplified63.7%
if -1.29999999999999998e-232 < n < 2.2000000000000001e-213Initial program 60.5%
associate-*r/60.5%
sub-neg60.5%
distribute-lft-in60.5%
fma-def60.5%
metadata-eval60.5%
metadata-eval60.5%
Simplified60.5%
Taylor expanded in n around inf 52.0%
Taylor expanded in i around 0 89.1%
Taylor expanded in i around 0 89.1%
if 2.2000000000000001e-213 < n Initial program 18.5%
Taylor expanded in n around inf 22.3%
*-commutative22.3%
associate-/l*22.3%
expm1-def79.7%
Simplified79.7%
Taylor expanded in i around 0 69.9%
*-commutative69.9%
Simplified69.9%
Final simplification71.0%
(FPCore (i n)
:precision binary64
(if (<= n -3.7e+202)
(* n (+ 100.0 (* 100.0 (* i (* i 0.16666666666666666)))))
(if (<= n -4e-225)
(/ (* n 100.0) (+ 1.0 (* i -0.5)))
(if (<= n 1.05e-213) 0.0 (* 100.0 (+ n (* 0.5 (* i n))))))))
double code(double i, double n) {
double tmp;
if (n <= -3.7e+202) {
tmp = n * (100.0 + (100.0 * (i * (i * 0.16666666666666666))));
} else if (n <= -4e-225) {
tmp = (n * 100.0) / (1.0 + (i * -0.5));
} else if (n <= 1.05e-213) {
tmp = 0.0;
} else {
tmp = 100.0 * (n + (0.5 * (i * n)));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-3.7d+202)) then
tmp = n * (100.0d0 + (100.0d0 * (i * (i * 0.16666666666666666d0))))
else if (n <= (-4d-225)) then
tmp = (n * 100.0d0) / (1.0d0 + (i * (-0.5d0)))
else if (n <= 1.05d-213) then
tmp = 0.0d0
else
tmp = 100.0d0 * (n + (0.5d0 * (i * n)))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -3.7e+202) {
tmp = n * (100.0 + (100.0 * (i * (i * 0.16666666666666666))));
} else if (n <= -4e-225) {
tmp = (n * 100.0) / (1.0 + (i * -0.5));
} else if (n <= 1.05e-213) {
tmp = 0.0;
} else {
tmp = 100.0 * (n + (0.5 * (i * n)));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -3.7e+202: tmp = n * (100.0 + (100.0 * (i * (i * 0.16666666666666666)))) elif n <= -4e-225: tmp = (n * 100.0) / (1.0 + (i * -0.5)) elif n <= 1.05e-213: tmp = 0.0 else: tmp = 100.0 * (n + (0.5 * (i * n))) return tmp
function code(i, n) tmp = 0.0 if (n <= -3.7e+202) tmp = Float64(n * Float64(100.0 + Float64(100.0 * Float64(i * Float64(i * 0.16666666666666666))))); elseif (n <= -4e-225) tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * -0.5))); elseif (n <= 1.05e-213) tmp = 0.0; else tmp = Float64(100.0 * Float64(n + Float64(0.5 * Float64(i * n)))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -3.7e+202) tmp = n * (100.0 + (100.0 * (i * (i * 0.16666666666666666)))); elseif (n <= -4e-225) tmp = (n * 100.0) / (1.0 + (i * -0.5)); elseif (n <= 1.05e-213) tmp = 0.0; else tmp = 100.0 * (n + (0.5 * (i * n))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -3.7e+202], N[(n * N[(100.0 + N[(100.0 * N[(i * N[(i * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -4e-225], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.05e-213], 0.0, N[(100.0 * N[(n + N[(0.5 * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -3.7 \cdot 10^{+202}:\\
\;\;\;\;n \cdot \left(100 + 100 \cdot \left(i \cdot \left(i \cdot 0.16666666666666666\right)\right)\right)\\
\mathbf{elif}\;n \leq -4 \cdot 10^{-225}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot -0.5}\\
\mathbf{elif}\;n \leq 1.05 \cdot 10^{-213}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n + 0.5 \cdot \left(i \cdot n\right)\right)\\
\end{array}
\end{array}
if n < -3.6999999999999999e202Initial program 11.4%
associate-/r/12.2%
associate-*r*12.2%
*-commutative12.2%
associate-*r/12.2%
sub-neg12.2%
distribute-lft-in12.2%
fma-def12.2%
metadata-eval12.2%
metadata-eval12.2%
Simplified12.2%
Taylor expanded in i around 0 89.6%
distribute-lft-out89.6%
associate-*r/89.6%
metadata-eval89.6%
unpow289.6%
associate--l+89.6%
associate-*r/89.6%
metadata-eval89.6%
unpow289.6%
associate-*r/89.6%
metadata-eval89.6%
Simplified89.6%
Taylor expanded in n around inf 89.6%
*-commutative89.6%
unpow289.6%
Simplified89.6%
Taylor expanded in i around inf 88.5%
*-commutative88.5%
unpow288.5%
associate-*r*88.5%
Simplified88.5%
if -3.6999999999999999e202 < n < -3.9999999999999998e-225Initial program 35.2%
Taylor expanded in n around inf 31.0%
*-commutative31.0%
associate-/l*31.0%
expm1-def80.6%
Simplified80.6%
associate-*l/80.6%
Applied egg-rr80.6%
Taylor expanded in i around 0 63.7%
*-commutative63.7%
Simplified63.7%
if -3.9999999999999998e-225 < n < 1.0499999999999999e-213Initial program 60.5%
associate-*r/60.5%
sub-neg60.5%
distribute-lft-in60.5%
fma-def60.5%
metadata-eval60.5%
metadata-eval60.5%
Simplified60.5%
Taylor expanded in n around inf 52.0%
Taylor expanded in i around 0 89.1%
Taylor expanded in i around 0 89.1%
if 1.0499999999999999e-213 < n Initial program 18.5%
Taylor expanded in n around inf 22.3%
*-commutative22.3%
associate-/l*22.3%
expm1-def79.7%
Simplified79.7%
Taylor expanded in i around 0 69.9%
*-commutative69.9%
Simplified69.9%
Final simplification71.3%
(FPCore (i n)
:precision binary64
(if (<= i -2600000000.0)
0.0
(if (<= i 2.8e+45)
(* n 100.0)
(if (<= i 2.3e+247)
(* 16.666666666666668 (* n (* i i)))
(* (/ n i) -200.0)))))
double code(double i, double n) {
double tmp;
if (i <= -2600000000.0) {
tmp = 0.0;
} else if (i <= 2.8e+45) {
tmp = n * 100.0;
} else if (i <= 2.3e+247) {
tmp = 16.666666666666668 * (n * (i * i));
} else {
tmp = (n / i) * -200.0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (i <= (-2600000000.0d0)) then
tmp = 0.0d0
else if (i <= 2.8d+45) then
tmp = n * 100.0d0
else if (i <= 2.3d+247) then
tmp = 16.666666666666668d0 * (n * (i * i))
else
tmp = (n / i) * (-200.0d0)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (i <= -2600000000.0) {
tmp = 0.0;
} else if (i <= 2.8e+45) {
tmp = n * 100.0;
} else if (i <= 2.3e+247) {
tmp = 16.666666666666668 * (n * (i * i));
} else {
tmp = (n / i) * -200.0;
}
return tmp;
}
def code(i, n): tmp = 0 if i <= -2600000000.0: tmp = 0.0 elif i <= 2.8e+45: tmp = n * 100.0 elif i <= 2.3e+247: tmp = 16.666666666666668 * (n * (i * i)) else: tmp = (n / i) * -200.0 return tmp
function code(i, n) tmp = 0.0 if (i <= -2600000000.0) tmp = 0.0; elseif (i <= 2.8e+45) tmp = Float64(n * 100.0); elseif (i <= 2.3e+247) tmp = Float64(16.666666666666668 * Float64(n * Float64(i * i))); else tmp = Float64(Float64(n / i) * -200.0); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (i <= -2600000000.0) tmp = 0.0; elseif (i <= 2.8e+45) tmp = n * 100.0; elseif (i <= 2.3e+247) tmp = 16.666666666666668 * (n * (i * i)); else tmp = (n / i) * -200.0; end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, -2600000000.0], 0.0, If[LessEqual[i, 2.8e+45], N[(n * 100.0), $MachinePrecision], If[LessEqual[i, 2.3e+247], N[(16.666666666666668 * N[(n * N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n / i), $MachinePrecision] * -200.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2600000000:\\
\;\;\;\;0\\
\mathbf{elif}\;i \leq 2.8 \cdot 10^{+45}:\\
\;\;\;\;n \cdot 100\\
\mathbf{elif}\;i \leq 2.3 \cdot 10^{+247}:\\
\;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{n}{i} \cdot -200\\
\end{array}
\end{array}
if i < -2.6e9Initial program 73.3%
associate-*r/73.3%
sub-neg73.3%
distribute-lft-in73.3%
fma-def73.3%
metadata-eval73.3%
metadata-eval73.3%
Simplified73.3%
Taylor expanded in n around inf 71.6%
Taylor expanded in i around 0 30.4%
Taylor expanded in i around 0 30.4%
if -2.6e9 < i < 2.7999999999999999e45Initial program 7.6%
Taylor expanded in i around 0 83.5%
*-commutative83.5%
Simplified83.5%
if 2.7999999999999999e45 < i < 2.29999999999999991e247Initial program 48.6%
associate-/r/48.8%
associate-*r*48.8%
*-commutative48.8%
associate-*r/48.8%
sub-neg48.8%
distribute-lft-in48.8%
fma-def48.8%
metadata-eval48.8%
metadata-eval48.8%
Simplified48.8%
Taylor expanded in i around 0 46.1%
distribute-lft-out46.1%
associate-*r/46.1%
metadata-eval46.1%
unpow246.1%
associate--l+46.1%
associate-*r/46.1%
metadata-eval46.1%
unpow246.1%
associate-*r/46.1%
metadata-eval46.1%
Simplified46.1%
Taylor expanded in i around inf 46.2%
associate-*r*46.2%
unpow246.2%
associate--l+46.2%
associate-*r/46.2%
metadata-eval46.2%
unpow246.2%
associate-*r/46.2%
metadata-eval46.2%
associate-*l*46.2%
associate-*r*46.2%
unpow246.2%
metadata-eval46.2%
associate-*r/46.2%
metadata-eval46.2%
associate-*r/46.2%
Simplified46.2%
Taylor expanded in n around inf 46.4%
unpow246.4%
Simplified46.4%
if 2.29999999999999991e247 < i Initial program 43.9%
Taylor expanded in n around inf 12.3%
*-commutative12.3%
associate-/l*12.3%
expm1-def12.3%
Simplified12.3%
Taylor expanded in i around 0 61.9%
*-commutative61.9%
Simplified61.9%
Taylor expanded in i around inf 61.9%
Final simplification67.5%
(FPCore (i n)
:precision binary64
(if (<= i -380000.0)
0.0
(if (<= i 1.9e-9)
(* 100.0 (+ n (* i -0.5)))
(if (<= i 1.15e+250)
(* 16.666666666666668 (* n (* i i)))
(* (/ n i) -200.0)))))
double code(double i, double n) {
double tmp;
if (i <= -380000.0) {
tmp = 0.0;
} else if (i <= 1.9e-9) {
tmp = 100.0 * (n + (i * -0.5));
} else if (i <= 1.15e+250) {
tmp = 16.666666666666668 * (n * (i * i));
} else {
tmp = (n / i) * -200.0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (i <= (-380000.0d0)) then
tmp = 0.0d0
else if (i <= 1.9d-9) then
tmp = 100.0d0 * (n + (i * (-0.5d0)))
else if (i <= 1.15d+250) then
tmp = 16.666666666666668d0 * (n * (i * i))
else
tmp = (n / i) * (-200.0d0)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (i <= -380000.0) {
tmp = 0.0;
} else if (i <= 1.9e-9) {
tmp = 100.0 * (n + (i * -0.5));
} else if (i <= 1.15e+250) {
tmp = 16.666666666666668 * (n * (i * i));
} else {
tmp = (n / i) * -200.0;
}
return tmp;
}
def code(i, n): tmp = 0 if i <= -380000.0: tmp = 0.0 elif i <= 1.9e-9: tmp = 100.0 * (n + (i * -0.5)) elif i <= 1.15e+250: tmp = 16.666666666666668 * (n * (i * i)) else: tmp = (n / i) * -200.0 return tmp
function code(i, n) tmp = 0.0 if (i <= -380000.0) tmp = 0.0; elseif (i <= 1.9e-9) tmp = Float64(100.0 * Float64(n + Float64(i * -0.5))); elseif (i <= 1.15e+250) tmp = Float64(16.666666666666668 * Float64(n * Float64(i * i))); else tmp = Float64(Float64(n / i) * -200.0); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (i <= -380000.0) tmp = 0.0; elseif (i <= 1.9e-9) tmp = 100.0 * (n + (i * -0.5)); elseif (i <= 1.15e+250) tmp = 16.666666666666668 * (n * (i * i)); else tmp = (n / i) * -200.0; end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, -380000.0], 0.0, If[LessEqual[i, 1.9e-9], N[(100.0 * N[(n + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.15e+250], N[(16.666666666666668 * N[(n * N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n / i), $MachinePrecision] * -200.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -380000:\\
\;\;\;\;0\\
\mathbf{elif}\;i \leq 1.9 \cdot 10^{-9}:\\
\;\;\;\;100 \cdot \left(n + i \cdot -0.5\right)\\
\mathbf{elif}\;i \leq 1.15 \cdot 10^{+250}:\\
\;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{n}{i} \cdot -200\\
\end{array}
\end{array}
if i < -3.8e5Initial program 73.3%
associate-*r/73.3%
sub-neg73.3%
distribute-lft-in73.3%
fma-def73.3%
metadata-eval73.3%
metadata-eval73.3%
Simplified73.3%
Taylor expanded in n around inf 71.6%
Taylor expanded in i around 0 30.4%
Taylor expanded in i around 0 30.4%
if -3.8e5 < i < 1.90000000000000006e-9Initial program 6.6%
Taylor expanded in i around 0 88.3%
associate-*r*88.3%
*-commutative88.3%
associate-*r/88.3%
metadata-eval88.3%
Simplified88.3%
Taylor expanded in n around 0 87.4%
*-commutative87.4%
Simplified87.4%
if 1.90000000000000006e-9 < i < 1.1500000000000001e250Initial program 44.9%
associate-/r/45.0%
associate-*r*45.1%
*-commutative45.1%
associate-*r/45.0%
sub-neg45.0%
distribute-lft-in45.0%
fma-def45.0%
metadata-eval45.0%
metadata-eval45.0%
Simplified45.0%
Taylor expanded in i around 0 40.7%
distribute-lft-out40.7%
associate-*r/40.7%
metadata-eval40.7%
unpow240.7%
associate--l+40.7%
associate-*r/40.7%
metadata-eval40.7%
unpow240.7%
associate-*r/40.7%
metadata-eval40.7%
Simplified40.7%
Taylor expanded in i around inf 38.9%
associate-*r*38.9%
unpow238.9%
associate--l+38.9%
associate-*r/38.9%
metadata-eval38.9%
unpow238.9%
associate-*r/38.9%
metadata-eval38.9%
associate-*l*38.9%
associate-*r*38.9%
unpow238.9%
metadata-eval38.9%
associate-*r/38.9%
metadata-eval38.9%
associate-*r/38.9%
Simplified38.9%
Taylor expanded in n around inf 40.1%
unpow240.1%
Simplified40.1%
if 1.1500000000000001e250 < i Initial program 43.9%
Taylor expanded in n around inf 12.3%
*-commutative12.3%
associate-/l*12.3%
expm1-def12.3%
Simplified12.3%
Taylor expanded in i around 0 61.9%
*-commutative61.9%
Simplified61.9%
Taylor expanded in i around inf 61.9%
Final simplification67.6%
(FPCore (i n)
:precision binary64
(if (<= i -6000000000.0)
0.0
(if (<= i 1.9e-9)
(* 100.0 (+ n (* i -0.5)))
(if (<= i 5.2e+250)
(* n (* (* i i) 16.666666666666668))
(* (/ n i) -200.0)))))
double code(double i, double n) {
double tmp;
if (i <= -6000000000.0) {
tmp = 0.0;
} else if (i <= 1.9e-9) {
tmp = 100.0 * (n + (i * -0.5));
} else if (i <= 5.2e+250) {
tmp = n * ((i * i) * 16.666666666666668);
} else {
tmp = (n / i) * -200.0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (i <= (-6000000000.0d0)) then
tmp = 0.0d0
else if (i <= 1.9d-9) then
tmp = 100.0d0 * (n + (i * (-0.5d0)))
else if (i <= 5.2d+250) then
tmp = n * ((i * i) * 16.666666666666668d0)
else
tmp = (n / i) * (-200.0d0)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (i <= -6000000000.0) {
tmp = 0.0;
} else if (i <= 1.9e-9) {
tmp = 100.0 * (n + (i * -0.5));
} else if (i <= 5.2e+250) {
tmp = n * ((i * i) * 16.666666666666668);
} else {
tmp = (n / i) * -200.0;
}
return tmp;
}
def code(i, n): tmp = 0 if i <= -6000000000.0: tmp = 0.0 elif i <= 1.9e-9: tmp = 100.0 * (n + (i * -0.5)) elif i <= 5.2e+250: tmp = n * ((i * i) * 16.666666666666668) else: tmp = (n / i) * -200.0 return tmp
function code(i, n) tmp = 0.0 if (i <= -6000000000.0) tmp = 0.0; elseif (i <= 1.9e-9) tmp = Float64(100.0 * Float64(n + Float64(i * -0.5))); elseif (i <= 5.2e+250) tmp = Float64(n * Float64(Float64(i * i) * 16.666666666666668)); else tmp = Float64(Float64(n / i) * -200.0); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (i <= -6000000000.0) tmp = 0.0; elseif (i <= 1.9e-9) tmp = 100.0 * (n + (i * -0.5)); elseif (i <= 5.2e+250) tmp = n * ((i * i) * 16.666666666666668); else tmp = (n / i) * -200.0; end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, -6000000000.0], 0.0, If[LessEqual[i, 1.9e-9], N[(100.0 * N[(n + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 5.2e+250], N[(n * N[(N[(i * i), $MachinePrecision] * 16.666666666666668), $MachinePrecision]), $MachinePrecision], N[(N[(n / i), $MachinePrecision] * -200.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -6000000000:\\
\;\;\;\;0\\
\mathbf{elif}\;i \leq 1.9 \cdot 10^{-9}:\\
\;\;\;\;100 \cdot \left(n + i \cdot -0.5\right)\\
\mathbf{elif}\;i \leq 5.2 \cdot 10^{+250}:\\
\;\;\;\;n \cdot \left(\left(i \cdot i\right) \cdot 16.666666666666668\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{n}{i} \cdot -200\\
\end{array}
\end{array}
if i < -6e9Initial program 73.3%
associate-*r/73.3%
sub-neg73.3%
distribute-lft-in73.3%
fma-def73.3%
metadata-eval73.3%
metadata-eval73.3%
Simplified73.3%
Taylor expanded in n around inf 71.6%
Taylor expanded in i around 0 30.4%
Taylor expanded in i around 0 30.4%
if -6e9 < i < 1.90000000000000006e-9Initial program 6.6%
Taylor expanded in i around 0 88.3%
associate-*r*88.3%
*-commutative88.3%
associate-*r/88.3%
metadata-eval88.3%
Simplified88.3%
Taylor expanded in n around 0 87.4%
*-commutative87.4%
Simplified87.4%
if 1.90000000000000006e-9 < i < 5.20000000000000023e250Initial program 44.9%
associate-/r/45.0%
associate-*r*45.1%
*-commutative45.1%
associate-*r/45.0%
sub-neg45.0%
distribute-lft-in45.0%
fma-def45.0%
metadata-eval45.0%
metadata-eval45.0%
Simplified45.0%
Taylor expanded in i around 0 40.7%
distribute-lft-out40.7%
associate-*r/40.7%
metadata-eval40.7%
unpow240.7%
associate--l+40.7%
associate-*r/40.7%
metadata-eval40.7%
unpow240.7%
associate-*r/40.7%
metadata-eval40.7%
Simplified40.7%
Taylor expanded in i around inf 38.9%
associate-*r*38.9%
unpow238.9%
associate--l+38.9%
associate-*r/38.9%
metadata-eval38.9%
unpow238.9%
associate-*r/38.9%
metadata-eval38.9%
associate-*l*38.9%
associate-*r*38.9%
unpow238.9%
metadata-eval38.9%
associate-*r/38.9%
metadata-eval38.9%
associate-*r/38.9%
Simplified38.9%
Taylor expanded in n around inf 40.1%
*-commutative40.1%
associate-*l*40.1%
unpow240.1%
Simplified40.1%
if 5.20000000000000023e250 < i Initial program 43.9%
Taylor expanded in n around inf 12.3%
*-commutative12.3%
associate-/l*12.3%
expm1-def12.3%
Simplified12.3%
Taylor expanded in i around 0 61.9%
*-commutative61.9%
Simplified61.9%
Taylor expanded in i around inf 61.9%
Final simplification67.6%
(FPCore (i n) :precision binary64 (if (or (<= i 1.9) (not (<= i 4.3e+250))) (/ n (+ 0.01 (* i -0.005))) (* (* i 0.16666666666666666) (* i (* n 100.0)))))
double code(double i, double n) {
double tmp;
if ((i <= 1.9) || !(i <= 4.3e+250)) {
tmp = n / (0.01 + (i * -0.005));
} else {
tmp = (i * 0.16666666666666666) * (i * (n * 100.0));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((i <= 1.9d0) .or. (.not. (i <= 4.3d+250))) then
tmp = n / (0.01d0 + (i * (-0.005d0)))
else
tmp = (i * 0.16666666666666666d0) * (i * (n * 100.0d0))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((i <= 1.9) || !(i <= 4.3e+250)) {
tmp = n / (0.01 + (i * -0.005));
} else {
tmp = (i * 0.16666666666666666) * (i * (n * 100.0));
}
return tmp;
}
def code(i, n): tmp = 0 if (i <= 1.9) or not (i <= 4.3e+250): tmp = n / (0.01 + (i * -0.005)) else: tmp = (i * 0.16666666666666666) * (i * (n * 100.0)) return tmp
function code(i, n) tmp = 0.0 if ((i <= 1.9) || !(i <= 4.3e+250)) tmp = Float64(n / Float64(0.01 + Float64(i * -0.005))); else tmp = Float64(Float64(i * 0.16666666666666666) * Float64(i * Float64(n * 100.0))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((i <= 1.9) || ~((i <= 4.3e+250))) tmp = n / (0.01 + (i * -0.005)); else tmp = (i * 0.16666666666666666) * (i * (n * 100.0)); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[i, 1.9], N[Not[LessEqual[i, 4.3e+250]], $MachinePrecision]], N[(n / N[(0.01 + N[(i * -0.005), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(i * 0.16666666666666666), $MachinePrecision] * N[(i * N[(n * 100.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq 1.9 \lor \neg \left(i \leq 4.3 \cdot 10^{+250}\right):\\
\;\;\;\;\frac{n}{0.01 + i \cdot -0.005}\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot 0.16666666666666666\right) \cdot \left(i \cdot \left(n \cdot 100\right)\right)\\
\end{array}
\end{array}
if i < 1.8999999999999999 or 4.3e250 < i Initial program 23.4%
Taylor expanded in n around inf 23.9%
*-commutative23.9%
associate-/l*23.9%
expm1-def81.5%
Simplified81.5%
associate-*l/81.5%
Applied egg-rr81.5%
Taylor expanded in n around 0 23.9%
*-commutative23.9%
expm1-def75.2%
associate-/l*81.5%
associate-/r/81.4%
associate-/l/81.3%
Simplified81.3%
Taylor expanded in i around 0 73.1%
*-commutative73.1%
Simplified73.1%
if 1.8999999999999999 < i < 4.3e250Initial program 44.6%
associate-/r/44.8%
associate-*r*44.8%
*-commutative44.8%
associate-*r/44.8%
sub-neg44.8%
distribute-lft-in44.8%
fma-def44.8%
metadata-eval44.8%
metadata-eval44.8%
Simplified44.8%
Taylor expanded in i around 0 40.3%
distribute-lft-out40.3%
associate-*r/40.3%
metadata-eval40.3%
unpow240.3%
associate--l+40.3%
associate-*r/40.3%
metadata-eval40.3%
unpow240.3%
associate-*r/40.3%
metadata-eval40.3%
Simplified40.3%
Taylor expanded in i around inf 40.4%
associate-*r*40.4%
unpow240.4%
associate--l+40.4%
associate-*r/40.4%
metadata-eval40.4%
unpow240.4%
associate-*r/40.4%
metadata-eval40.4%
associate-*l*40.4%
associate-*r*40.4%
unpow240.4%
metadata-eval40.4%
associate-*r/40.4%
metadata-eval40.4%
associate-*r/40.4%
Simplified40.4%
Taylor expanded in n around inf 40.7%
*-commutative40.7%
Simplified40.7%
Final simplification67.5%
(FPCore (i n) :precision binary64 (if (or (<= i 1.9) (not (<= i 9e+250))) (/ n (+ 0.01 (* i -0.005))) (* 16.666666666666668 (* n (* i i)))))
double code(double i, double n) {
double tmp;
if ((i <= 1.9) || !(i <= 9e+250)) {
tmp = n / (0.01 + (i * -0.005));
} else {
tmp = 16.666666666666668 * (n * (i * i));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((i <= 1.9d0) .or. (.not. (i <= 9d+250))) then
tmp = n / (0.01d0 + (i * (-0.005d0)))
else
tmp = 16.666666666666668d0 * (n * (i * i))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((i <= 1.9) || !(i <= 9e+250)) {
tmp = n / (0.01 + (i * -0.005));
} else {
tmp = 16.666666666666668 * (n * (i * i));
}
return tmp;
}
def code(i, n): tmp = 0 if (i <= 1.9) or not (i <= 9e+250): tmp = n / (0.01 + (i * -0.005)) else: tmp = 16.666666666666668 * (n * (i * i)) return tmp
function code(i, n) tmp = 0.0 if ((i <= 1.9) || !(i <= 9e+250)) tmp = Float64(n / Float64(0.01 + Float64(i * -0.005))); else tmp = Float64(16.666666666666668 * Float64(n * Float64(i * i))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((i <= 1.9) || ~((i <= 9e+250))) tmp = n / (0.01 + (i * -0.005)); else tmp = 16.666666666666668 * (n * (i * i)); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[i, 1.9], N[Not[LessEqual[i, 9e+250]], $MachinePrecision]], N[(n / N[(0.01 + N[(i * -0.005), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(16.666666666666668 * N[(n * N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq 1.9 \lor \neg \left(i \leq 9 \cdot 10^{+250}\right):\\
\;\;\;\;\frac{n}{0.01 + i \cdot -0.005}\\
\mathbf{else}:\\
\;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\
\end{array}
\end{array}
if i < 1.8999999999999999 or 8.99999999999999993e250 < i Initial program 23.4%
Taylor expanded in n around inf 23.9%
*-commutative23.9%
associate-/l*23.9%
expm1-def81.5%
Simplified81.5%
associate-*l/81.5%
Applied egg-rr81.5%
Taylor expanded in n around 0 23.9%
*-commutative23.9%
expm1-def75.2%
associate-/l*81.5%
associate-/r/81.4%
associate-/l/81.3%
Simplified81.3%
Taylor expanded in i around 0 73.1%
*-commutative73.1%
Simplified73.1%
if 1.8999999999999999 < i < 8.99999999999999993e250Initial program 44.6%
associate-/r/44.8%
associate-*r*44.8%
*-commutative44.8%
associate-*r/44.8%
sub-neg44.8%
distribute-lft-in44.8%
fma-def44.8%
metadata-eval44.8%
metadata-eval44.8%
Simplified44.8%
Taylor expanded in i around 0 40.3%
distribute-lft-out40.3%
associate-*r/40.3%
metadata-eval40.3%
unpow240.3%
associate--l+40.3%
associate-*r/40.3%
metadata-eval40.3%
unpow240.3%
associate-*r/40.3%
metadata-eval40.3%
Simplified40.3%
Taylor expanded in i around inf 40.4%
associate-*r*40.4%
unpow240.4%
associate--l+40.4%
associate-*r/40.4%
metadata-eval40.4%
unpow240.4%
associate-*r/40.4%
metadata-eval40.4%
associate-*l*40.4%
associate-*r*40.4%
unpow240.4%
metadata-eval40.4%
associate-*r/40.4%
metadata-eval40.4%
associate-*r/40.4%
Simplified40.4%
Taylor expanded in n around inf 40.7%
unpow240.7%
Simplified40.7%
Final simplification67.5%
(FPCore (i n) :precision binary64 (if (<= i -105000000.0) 0.0 (if (<= i 1.9e-9) (* n 100.0) 0.0)))
double code(double i, double n) {
double tmp;
if (i <= -105000000.0) {
tmp = 0.0;
} else if (i <= 1.9e-9) {
tmp = n * 100.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (i <= (-105000000.0d0)) then
tmp = 0.0d0
else if (i <= 1.9d-9) then
tmp = n * 100.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (i <= -105000000.0) {
tmp = 0.0;
} else if (i <= 1.9e-9) {
tmp = n * 100.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(i, n): tmp = 0 if i <= -105000000.0: tmp = 0.0 elif i <= 1.9e-9: tmp = n * 100.0 else: tmp = 0.0 return tmp
function code(i, n) tmp = 0.0 if (i <= -105000000.0) tmp = 0.0; elseif (i <= 1.9e-9) tmp = Float64(n * 100.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (i <= -105000000.0) tmp = 0.0; elseif (i <= 1.9e-9) tmp = n * 100.0; else tmp = 0.0; end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, -105000000.0], 0.0, If[LessEqual[i, 1.9e-9], N[(n * 100.0), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -105000000:\\
\;\;\;\;0\\
\mathbf{elif}\;i \leq 1.9 \cdot 10^{-9}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if i < -1.05e8 or 1.90000000000000006e-9 < i Initial program 57.9%
associate-*r/57.9%
sub-neg57.9%
distribute-lft-in57.9%
fma-def57.9%
metadata-eval57.9%
metadata-eval57.9%
Simplified57.9%
Taylor expanded in n around inf 58.6%
Taylor expanded in i around 0 28.9%
Taylor expanded in i around 0 28.9%
if -1.05e8 < i < 1.90000000000000006e-9Initial program 6.6%
Taylor expanded in i around 0 87.3%
*-commutative87.3%
Simplified87.3%
Final simplification64.1%
(FPCore (i n) :precision binary64 0.0)
double code(double i, double n) {
return 0.0;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = 0.0d0
end function
public static double code(double i, double n) {
return 0.0;
}
def code(i, n): return 0.0
function code(i, n) return 0.0 end
function tmp = code(i, n) tmp = 0.0; end
code[i_, n_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 27.1%
associate-*r/27.1%
sub-neg27.1%
distribute-lft-in27.1%
fma-def27.1%
metadata-eval27.1%
metadata-eval27.1%
Simplified27.1%
Taylor expanded in n around inf 29.2%
Taylor expanded in i around 0 15.5%
Taylor expanded in i around 0 15.8%
Final simplification15.8%
(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 2023279
(FPCore (i n)
:name "Compound Interest"
:precision binary64
:herbie-target
(* 100.0 (/ (- (exp (* n (if (== (+ 1.0 (/ i n)) 1.0) (/ i n) (/ (* (/ i n) (log (+ 1.0 (/ i n)))) (- (+ (/ i n) 1.0) 1.0))))) 1.0) (/ i n)))
(* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))