
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (i n) :precision binary64 (* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))
double code(double i, double n) {
return 100.0 * ((pow((1.0 + (i / n)), n) - 1.0) / (i / n));
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = 100.0d0 * ((((1.0d0 + (i / n)) ** n) - 1.0d0) / (i / n))
end function
public static double code(double i, double n) {
return 100.0 * ((Math.pow((1.0 + (i / n)), n) - 1.0) / (i / n));
}
def code(i, n): return 100.0 * ((math.pow((1.0 + (i / n)), n) - 1.0) / (i / n))
function code(i, n) return Float64(100.0 * Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) - 1.0) / Float64(i / n))) end
function tmp = code(i, n) tmp = 100.0 * ((((1.0 + (i / n)) ^ n) - 1.0) / (i / n)); end
code[i_, n_] := N[(100.0 * N[(N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] - 1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\end{array}
(FPCore (i n)
:precision binary64
(let* ((t_0 (pow (+ 1.0 (/ i n)) n)) (t_1 (/ (+ t_0 -1.0) (/ i n))))
(if (<= t_1 (- INFINITY))
(*
n
(+
100.0
(* i (+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667)))))))
(if (<= t_1 0.0)
(* n (/ (* 100.0 (expm1 (* n (log1p (/ i n))))) i))
(if (<= t_1 INFINITY)
(/ (+ (* t_0 100.0) -100.0) (/ i n))
(* n (/ 100.0 (+ 1.0 (* i (- (* i 0.08333333333333333) 0.5))))))))))
double code(double i, double n) {
double t_0 = pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
} else if (t_1 <= 0.0) {
tmp = n * ((100.0 * expm1((n * log1p((i / n))))) / i);
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((t_0 * 100.0) + -100.0) / (i / n);
} else {
tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5))));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = Math.pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
} else if (t_1 <= 0.0) {
tmp = n * ((100.0 * Math.expm1((n * Math.log1p((i / n))))) / i);
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = ((t_0 * 100.0) + -100.0) / (i / n);
} else {
tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5))));
}
return tmp;
}
def code(i, n): t_0 = math.pow((1.0 + (i / n)), n) t_1 = (t_0 + -1.0) / (i / n) tmp = 0 if t_1 <= -math.inf: tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))) elif t_1 <= 0.0: tmp = n * ((100.0 * math.expm1((n * math.log1p((i / n))))) / i) elif t_1 <= math.inf: tmp = ((t_0 * 100.0) + -100.0) / (i / n) else: tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5)))) return tmp
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) ^ n t_1 = Float64(Float64(t_0 + -1.0) / Float64(i / n)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667))))))); elseif (t_1 <= 0.0) tmp = Float64(n * Float64(Float64(100.0 * expm1(Float64(n * log1p(Float64(i / n))))) / i)); elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(t_0 * 100.0) + -100.0) / Float64(i / n)); else tmp = Float64(n * Float64(100.0 / Float64(1.0 + Float64(i * Float64(Float64(i * 0.08333333333333333) - 0.5))))); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(n * N[(N[(100.0 * N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[(t$95$0 * 100.0), $MachinePrecision] + -100.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 / N[(1.0 + N[(i * N[(N[(i * 0.08333333333333333), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t\_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{i}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{t\_0 \cdot 100 + -100}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \frac{100}{1 + i \cdot \left(i \cdot 0.08333333333333333 - 0.5\right)}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < -inf.0Initial program 100.0%
associate-/r/100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r/100.0%
sub-neg100.0%
distribute-lft-in100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
fma-define100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in n around inf 29.2%
sub-neg29.2%
metadata-eval29.2%
metadata-eval29.2%
distribute-lft-in29.2%
metadata-eval29.2%
sub-neg29.2%
expm1-define29.2%
Simplified29.2%
Taylor expanded in i around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < -0.0Initial program 22.1%
associate-/r/21.7%
associate-*r*21.7%
*-commutative21.7%
associate-*r/21.7%
sub-neg21.7%
distribute-lft-in21.7%
metadata-eval21.7%
metadata-eval21.7%
metadata-eval21.7%
fma-define21.7%
metadata-eval21.7%
Simplified21.7%
fma-undefine21.7%
metadata-eval21.7%
metadata-eval21.7%
distribute-lft-in21.7%
sub-neg21.7%
*-commutative21.7%
add-exp-log21.7%
expm1-define21.7%
log-pow31.2%
log1p-define99.3%
Applied egg-rr99.3%
if -0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < +inf.0Initial program 99.7%
associate-*r/99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) Initial program 0.0%
associate-/r/1.9%
associate-*r*1.9%
*-commutative1.9%
associate-*r/1.9%
sub-neg1.9%
distribute-lft-in1.9%
metadata-eval1.9%
metadata-eval1.9%
metadata-eval1.9%
fma-define1.9%
metadata-eval1.9%
Simplified1.9%
Taylor expanded in n around inf 1.9%
sub-neg1.9%
metadata-eval1.9%
metadata-eval1.9%
distribute-lft-in1.9%
metadata-eval1.9%
sub-neg1.9%
expm1-define76.7%
Simplified76.7%
clear-num76.7%
inv-pow76.7%
*-un-lft-identity76.7%
times-frac76.8%
metadata-eval76.8%
Applied egg-rr76.8%
unpow-176.8%
associate-/r*76.8%
metadata-eval76.8%
Simplified76.8%
Taylor expanded in i around 0 100.0%
Final simplification99.5%
(FPCore (i n)
:precision binary64
(let* ((t_0 (pow (+ 1.0 (/ i n)) n)) (t_1 (/ (+ t_0 -1.0) (/ i n))))
(if (<= t_1 (- INFINITY))
(*
n
(+
100.0
(* i (+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667)))))))
(if (<= t_1 0.0)
(* 100.0 (/ (expm1 i) (/ i n)))
(if (<= t_1 INFINITY)
(/ (+ (* t_0 100.0) -100.0) (/ i n))
(* n (/ 100.0 (+ 1.0 (* i (- (* i 0.08333333333333333) 0.5))))))))))
double code(double i, double n) {
double t_0 = pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
} else if (t_1 <= 0.0) {
tmp = 100.0 * (expm1(i) / (i / n));
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((t_0 * 100.0) + -100.0) / (i / n);
} else {
tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5))));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = Math.pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
} else if (t_1 <= 0.0) {
tmp = 100.0 * (Math.expm1(i) / (i / n));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = ((t_0 * 100.0) + -100.0) / (i / n);
} else {
tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5))));
}
return tmp;
}
def code(i, n): t_0 = math.pow((1.0 + (i / n)), n) t_1 = (t_0 + -1.0) / (i / n) tmp = 0 if t_1 <= -math.inf: tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))) elif t_1 <= 0.0: tmp = 100.0 * (math.expm1(i) / (i / n)) elif t_1 <= math.inf: tmp = ((t_0 * 100.0) + -100.0) / (i / n) else: tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5)))) return tmp
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) ^ n t_1 = Float64(Float64(t_0 + -1.0) / Float64(i / n)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667))))))); elseif (t_1 <= 0.0) tmp = Float64(100.0 * Float64(expm1(i) / Float64(i / n))); elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(t_0 * 100.0) + -100.0) / Float64(i / n)); else tmp = Float64(n * Float64(100.0 / Float64(1.0 + Float64(i * Float64(Float64(i * 0.08333333333333333) - 0.5))))); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[(t$95$0 * 100.0), $MachinePrecision] + -100.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 / N[(1.0 + N[(i * N[(N[(i * 0.08333333333333333), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t\_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{t\_0 \cdot 100 + -100}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \frac{100}{1 + i \cdot \left(i \cdot 0.08333333333333333 - 0.5\right)}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < -inf.0Initial program 100.0%
associate-/r/100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r/100.0%
sub-neg100.0%
distribute-lft-in100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
fma-define100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in n around inf 29.2%
sub-neg29.2%
metadata-eval29.2%
metadata-eval29.2%
distribute-lft-in29.2%
metadata-eval29.2%
sub-neg29.2%
expm1-define29.2%
Simplified29.2%
Taylor expanded in i around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < -0.0Initial program 22.1%
Taylor expanded in n around inf 43.5%
expm1-define82.8%
Simplified82.8%
if -0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < +inf.0Initial program 99.7%
associate-*r/99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) Initial program 0.0%
associate-/r/1.9%
associate-*r*1.9%
*-commutative1.9%
associate-*r/1.9%
sub-neg1.9%
distribute-lft-in1.9%
metadata-eval1.9%
metadata-eval1.9%
metadata-eval1.9%
fma-define1.9%
metadata-eval1.9%
Simplified1.9%
Taylor expanded in n around inf 1.9%
sub-neg1.9%
metadata-eval1.9%
metadata-eval1.9%
distribute-lft-in1.9%
metadata-eval1.9%
sub-neg1.9%
expm1-define76.7%
Simplified76.7%
clear-num76.7%
inv-pow76.7%
*-un-lft-identity76.7%
times-frac76.8%
metadata-eval76.8%
Applied egg-rr76.8%
unpow-176.8%
associate-/r*76.8%
metadata-eval76.8%
Simplified76.8%
Taylor expanded in i around 0 100.0%
Final simplification88.0%
(FPCore (i n)
:precision binary64
(let* ((t_0 (/ (+ (pow (+ 1.0 (/ i n)) n) -1.0) (/ i n))))
(if (<= t_0 (- INFINITY))
(*
n
(+
100.0
(* i (+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667)))))))
(if (<= t_0 0.0)
(* 100.0 (/ (expm1 i) (/ i n)))
(if (<= t_0 INFINITY)
(* t_0 100.0)
(* n (/ 100.0 (+ 1.0 (* i (- (* i 0.08333333333333333) 0.5))))))))))
double code(double i, double n) {
double t_0 = (pow((1.0 + (i / n)), n) + -1.0) / (i / n);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
} else if (t_0 <= 0.0) {
tmp = 100.0 * (expm1(i) / (i / n));
} else if (t_0 <= ((double) INFINITY)) {
tmp = t_0 * 100.0;
} else {
tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 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 tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
} else if (t_0 <= 0.0) {
tmp = 100.0 * (Math.expm1(i) / (i / n));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0 * 100.0;
} else {
tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5))));
}
return tmp;
}
def code(i, n): t_0 = (math.pow((1.0 + (i / n)), n) + -1.0) / (i / n) tmp = 0 if t_0 <= -math.inf: tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))) elif t_0 <= 0.0: tmp = 100.0 * (math.expm1(i) / (i / n)) elif t_0 <= math.inf: tmp = t_0 * 100.0 else: tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5)))) return tmp
function code(i, n) t_0 = Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) + -1.0) / Float64(i / n)) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667))))))); elseif (t_0 <= 0.0) tmp = Float64(100.0 * Float64(expm1(i) / Float64(i / n))); elseif (t_0 <= Inf) tmp = Float64(t_0 * 100.0); else tmp = Float64(n * Float64(100.0 / Float64(1.0 + Float64(i * Float64(Float64(i * 0.08333333333333333) - 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]}, If[LessEqual[t$95$0, (-Infinity)], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(t$95$0 * 100.0), $MachinePrecision], N[(n * N[(100.0 / N[(1.0 + N[(i * N[(N[(i * 0.08333333333333333), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;t\_0 \cdot 100\\
\mathbf{else}:\\
\;\;\;\;n \cdot \frac{100}{1 + i \cdot \left(i \cdot 0.08333333333333333 - 0.5\right)}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < -inf.0Initial program 100.0%
associate-/r/100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*r/100.0%
sub-neg100.0%
distribute-lft-in100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
fma-define100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in n around inf 29.2%
sub-neg29.2%
metadata-eval29.2%
metadata-eval29.2%
distribute-lft-in29.2%
metadata-eval29.2%
sub-neg29.2%
expm1-define29.2%
Simplified29.2%
Taylor expanded in i around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < -0.0Initial program 22.1%
Taylor expanded in n around inf 43.5%
expm1-define82.8%
Simplified82.8%
if -0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < +inf.0Initial program 99.7%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) Initial program 0.0%
associate-/r/1.9%
associate-*r*1.9%
*-commutative1.9%
associate-*r/1.9%
sub-neg1.9%
distribute-lft-in1.9%
metadata-eval1.9%
metadata-eval1.9%
metadata-eval1.9%
fma-define1.9%
metadata-eval1.9%
Simplified1.9%
Taylor expanded in n around inf 1.9%
sub-neg1.9%
metadata-eval1.9%
metadata-eval1.9%
distribute-lft-in1.9%
metadata-eval1.9%
sub-neg1.9%
expm1-define76.7%
Simplified76.7%
clear-num76.7%
inv-pow76.7%
*-un-lft-identity76.7%
times-frac76.8%
metadata-eval76.8%
Applied egg-rr76.8%
unpow-176.8%
associate-/r*76.8%
metadata-eval76.8%
Simplified76.8%
Taylor expanded in i around 0 100.0%
Final simplification87.9%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* 100.0 (/ (expm1 i) (/ i n)))))
(if (<= i -4.2e-52)
t_0
(if (<= i 5.8e-195)
(* n (+ 100.0 (* 100.0 (* i (- 0.5 (/ 0.5 n))))))
(if (<= i 1.5e-63)
(* 100.0 (* (* i n) (/ 1.0 i)))
(if (<= i 7e+243) t_0 (* 100.0 (/ i (/ i n)))))))))
double code(double i, double n) {
double t_0 = 100.0 * (expm1(i) / (i / n));
double tmp;
if (i <= -4.2e-52) {
tmp = t_0;
} else if (i <= 5.8e-195) {
tmp = n * (100.0 + (100.0 * (i * (0.5 - (0.5 / n)))));
} else if (i <= 1.5e-63) {
tmp = 100.0 * ((i * n) * (1.0 / i));
} else if (i <= 7e+243) {
tmp = t_0;
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = 100.0 * (Math.expm1(i) / (i / n));
double tmp;
if (i <= -4.2e-52) {
tmp = t_0;
} else if (i <= 5.8e-195) {
tmp = n * (100.0 + (100.0 * (i * (0.5 - (0.5 / n)))));
} else if (i <= 1.5e-63) {
tmp = 100.0 * ((i * n) * (1.0 / i));
} else if (i <= 7e+243) {
tmp = t_0;
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
def code(i, n): t_0 = 100.0 * (math.expm1(i) / (i / n)) tmp = 0 if i <= -4.2e-52: tmp = t_0 elif i <= 5.8e-195: tmp = n * (100.0 + (100.0 * (i * (0.5 - (0.5 / n))))) elif i <= 1.5e-63: tmp = 100.0 * ((i * n) * (1.0 / i)) elif i <= 7e+243: tmp = t_0 else: tmp = 100.0 * (i / (i / n)) return tmp
function code(i, n) t_0 = Float64(100.0 * Float64(expm1(i) / Float64(i / n))) tmp = 0.0 if (i <= -4.2e-52) tmp = t_0; elseif (i <= 5.8e-195) tmp = Float64(n * Float64(100.0 + Float64(100.0 * Float64(i * Float64(0.5 - Float64(0.5 / n)))))); elseif (i <= 1.5e-63) tmp = Float64(100.0 * Float64(Float64(i * n) * Float64(1.0 / i))); elseif (i <= 7e+243) tmp = t_0; else tmp = Float64(100.0 * Float64(i / Float64(i / n))); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -4.2e-52], t$95$0, If[LessEqual[i, 5.8e-195], N[(n * N[(100.0 + N[(100.0 * N[(i * N[(0.5 - N[(0.5 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.5e-63], N[(100.0 * N[(N[(i * n), $MachinePrecision] * N[(1.0 / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 7e+243], t$95$0, N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\
\mathbf{if}\;i \leq -4.2 \cdot 10^{-52}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;i \leq 5.8 \cdot 10^{-195}:\\
\;\;\;\;n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right)\right)\right)\\
\mathbf{elif}\;i \leq 1.5 \cdot 10^{-63}:\\
\;\;\;\;100 \cdot \left(\left(i \cdot n\right) \cdot \frac{1}{i}\right)\\
\mathbf{elif}\;i \leq 7 \cdot 10^{+243}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\end{array}
\end{array}
if i < -4.1999999999999997e-52 or 1.4999999999999999e-63 < i < 6.99999999999999976e243Initial program 41.9%
Taylor expanded in n around inf 62.1%
expm1-define69.3%
Simplified69.3%
if -4.1999999999999997e-52 < i < 5.8000000000000003e-195Initial program 5.5%
associate-/r/6.3%
associate-*r*6.3%
*-commutative6.3%
associate-*r/6.3%
sub-neg6.3%
distribute-lft-in6.3%
metadata-eval6.3%
metadata-eval6.3%
metadata-eval6.3%
fma-define6.3%
metadata-eval6.3%
Simplified6.3%
Taylor expanded in i around 0 95.1%
*-commutative95.1%
associate-*r/95.1%
metadata-eval95.1%
Simplified95.1%
if 5.8000000000000003e-195 < i < 1.4999999999999999e-63Initial program 18.5%
Taylor expanded in i around 0 70.9%
div-inv70.8%
clear-num70.9%
div-inv70.8%
associate-*r*96.4%
Applied egg-rr96.4%
if 6.99999999999999976e243 < i Initial program 14.3%
Taylor expanded in i around 0 86.2%
Final simplification82.3%
(FPCore (i n)
:precision binary64
(let* ((t_0 (/ i (expm1 i))))
(if (<= n -1.02e-177)
(* n (/ 100.0 t_0))
(if (<= n 1.2e-162)
(/ 0.0 (/ i n))
(if (<= n 5e-12)
(* n (/ 100.0 (+ 1.0 (* i (- (* i 0.08333333333333333) 0.5)))))
(/ (* n 100.0) t_0))))))
double code(double i, double n) {
double t_0 = i / expm1(i);
double tmp;
if (n <= -1.02e-177) {
tmp = n * (100.0 / t_0);
} else if (n <= 1.2e-162) {
tmp = 0.0 / (i / n);
} else if (n <= 5e-12) {
tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5))));
} else {
tmp = (n * 100.0) / t_0;
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = i / Math.expm1(i);
double tmp;
if (n <= -1.02e-177) {
tmp = n * (100.0 / t_0);
} else if (n <= 1.2e-162) {
tmp = 0.0 / (i / n);
} else if (n <= 5e-12) {
tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5))));
} else {
tmp = (n * 100.0) / t_0;
}
return tmp;
}
def code(i, n): t_0 = i / math.expm1(i) tmp = 0 if n <= -1.02e-177: tmp = n * (100.0 / t_0) elif n <= 1.2e-162: tmp = 0.0 / (i / n) elif n <= 5e-12: tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5)))) else: tmp = (n * 100.0) / t_0 return tmp
function code(i, n) t_0 = Float64(i / expm1(i)) tmp = 0.0 if (n <= -1.02e-177) tmp = Float64(n * Float64(100.0 / t_0)); elseif (n <= 1.2e-162) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 5e-12) tmp = Float64(n * Float64(100.0 / Float64(1.0 + Float64(i * Float64(Float64(i * 0.08333333333333333) - 0.5))))); else tmp = Float64(Float64(n * 100.0) / t_0); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.02e-177], N[(n * N[(100.0 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.2e-162], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5e-12], N[(n * N[(100.0 / N[(1.0 + N[(i * N[(N[(i * 0.08333333333333333), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{i}{\mathsf{expm1}\left(i\right)}\\
\mathbf{if}\;n \leq -1.02 \cdot 10^{-177}:\\
\;\;\;\;n \cdot \frac{100}{t\_0}\\
\mathbf{elif}\;n \leq 1.2 \cdot 10^{-162}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 5 \cdot 10^{-12}:\\
\;\;\;\;n \cdot \frac{100}{1 + i \cdot \left(i \cdot 0.08333333333333333 - 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{t\_0}\\
\end{array}
\end{array}
if n < -1.01999999999999997e-177Initial program 21.5%
associate-/r/21.2%
associate-*r*21.2%
*-commutative21.2%
associate-*r/21.2%
sub-neg21.2%
distribute-lft-in21.2%
metadata-eval21.2%
metadata-eval21.2%
metadata-eval21.2%
fma-define21.2%
metadata-eval21.2%
Simplified21.2%
Taylor expanded in n around inf 37.0%
sub-neg37.0%
metadata-eval37.0%
metadata-eval37.0%
distribute-lft-in37.2%
metadata-eval37.2%
sub-neg37.2%
expm1-define86.9%
Simplified86.9%
clear-num87.0%
inv-pow87.0%
*-un-lft-identity87.0%
times-frac87.0%
metadata-eval87.0%
Applied egg-rr87.0%
unpow-187.0%
associate-/r*87.0%
metadata-eval87.0%
Simplified87.0%
if -1.01999999999999997e-177 < n < 1.2000000000000001e-162Initial program 63.0%
associate-*r/63.0%
sub-neg63.0%
distribute-rgt-in63.0%
metadata-eval63.0%
metadata-eval63.0%
Simplified63.0%
Taylor expanded in i around 0 84.9%
if 1.2000000000000001e-162 < n < 4.9999999999999997e-12Initial program 9.7%
associate-/r/9.9%
associate-*r*9.9%
*-commutative9.9%
associate-*r/9.9%
sub-neg9.9%
distribute-lft-in9.9%
metadata-eval9.9%
metadata-eval9.9%
metadata-eval9.9%
fma-define9.9%
metadata-eval9.9%
Simplified9.9%
Taylor expanded in n around inf 3.2%
sub-neg3.2%
metadata-eval3.2%
metadata-eval3.2%
distribute-lft-in3.2%
metadata-eval3.2%
sub-neg3.2%
expm1-define54.2%
Simplified54.2%
clear-num54.3%
inv-pow54.3%
*-un-lft-identity54.3%
times-frac54.4%
metadata-eval54.4%
Applied egg-rr54.4%
unpow-154.4%
associate-/r*54.4%
metadata-eval54.4%
Simplified54.4%
Taylor expanded in i around 0 74.0%
if 4.9999999999999997e-12 < n Initial program 22.7%
associate-/r/23.3%
associate-*r*23.3%
*-commutative23.3%
associate-*r/23.3%
sub-neg23.3%
distribute-lft-in23.3%
metadata-eval23.3%
metadata-eval23.3%
metadata-eval23.3%
fma-define23.3%
metadata-eval23.3%
Simplified23.3%
Taylor expanded in n around inf 37.8%
sub-neg37.8%
metadata-eval37.8%
metadata-eval37.8%
distribute-lft-in37.8%
metadata-eval37.8%
sub-neg37.8%
expm1-define93.2%
Simplified93.2%
clear-num93.2%
inv-pow93.2%
*-un-lft-identity93.2%
times-frac93.3%
metadata-eval93.3%
Applied egg-rr93.3%
unpow-193.3%
associate-/r*93.3%
metadata-eval93.3%
Simplified93.3%
associate-*r/93.3%
Applied egg-rr93.3%
Final simplification86.9%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* n (/ 100.0 (/ i (expm1 i))))))
(if (<= n -1.2e-187)
t_0
(if (<= n 1.2e-162)
(/ 0.0 (/ i n))
(if (<= n 5e-12)
(* n (/ 100.0 (+ 1.0 (* i (- (* i 0.08333333333333333) 0.5)))))
t_0)))))
double code(double i, double n) {
double t_0 = n * (100.0 / (i / expm1(i)));
double tmp;
if (n <= -1.2e-187) {
tmp = t_0;
} else if (n <= 1.2e-162) {
tmp = 0.0 / (i / n);
} else if (n <= 5e-12) {
tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5))));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = n * (100.0 / (i / Math.expm1(i)));
double tmp;
if (n <= -1.2e-187) {
tmp = t_0;
} else if (n <= 1.2e-162) {
tmp = 0.0 / (i / n);
} else if (n <= 5e-12) {
tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5))));
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = n * (100.0 / (i / math.expm1(i))) tmp = 0 if n <= -1.2e-187: tmp = t_0 elif n <= 1.2e-162: tmp = 0.0 / (i / n) elif n <= 5e-12: tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5)))) else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(n * Float64(100.0 / Float64(i / expm1(i)))) tmp = 0.0 if (n <= -1.2e-187) tmp = t_0; elseif (n <= 1.2e-162) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 5e-12) tmp = Float64(n * Float64(100.0 / Float64(1.0 + Float64(i * Float64(Float64(i * 0.08333333333333333) - 0.5))))); else tmp = t_0; end return tmp end
code[i_, n_] := Block[{t$95$0 = N[(n * N[(100.0 / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.2e-187], t$95$0, If[LessEqual[n, 1.2e-162], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5e-12], N[(n * N[(100.0 / N[(1.0 + N[(i * N[(N[(i * 0.08333333333333333), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \frac{100}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{if}\;n \leq -1.2 \cdot 10^{-187}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 1.2 \cdot 10^{-162}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 5 \cdot 10^{-12}:\\
\;\;\;\;n \cdot \frac{100}{1 + i \cdot \left(i \cdot 0.08333333333333333 - 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -1.20000000000000007e-187 or 4.9999999999999997e-12 < n Initial program 22.0%
associate-/r/22.0%
associate-*r*22.0%
*-commutative22.0%
associate-*r/22.0%
sub-neg22.0%
distribute-lft-in22.0%
metadata-eval22.0%
metadata-eval22.0%
metadata-eval22.0%
fma-define22.0%
metadata-eval22.0%
Simplified22.0%
Taylor expanded in n around inf 37.3%
sub-neg37.3%
metadata-eval37.3%
metadata-eval37.3%
distribute-lft-in37.4%
metadata-eval37.4%
sub-neg37.4%
expm1-define89.4%
Simplified89.4%
clear-num89.4%
inv-pow89.4%
*-un-lft-identity89.4%
times-frac89.4%
metadata-eval89.4%
Applied egg-rr89.4%
unpow-189.4%
associate-/r*89.4%
metadata-eval89.4%
Simplified89.4%
if -1.20000000000000007e-187 < n < 1.2000000000000001e-162Initial program 63.0%
associate-*r/63.0%
sub-neg63.0%
distribute-rgt-in63.0%
metadata-eval63.0%
metadata-eval63.0%
Simplified63.0%
Taylor expanded in i around 0 84.9%
if 1.2000000000000001e-162 < n < 4.9999999999999997e-12Initial program 9.7%
associate-/r/9.9%
associate-*r*9.9%
*-commutative9.9%
associate-*r/9.9%
sub-neg9.9%
distribute-lft-in9.9%
metadata-eval9.9%
metadata-eval9.9%
metadata-eval9.9%
fma-define9.9%
metadata-eval9.9%
Simplified9.9%
Taylor expanded in n around inf 3.2%
sub-neg3.2%
metadata-eval3.2%
metadata-eval3.2%
distribute-lft-in3.2%
metadata-eval3.2%
sub-neg3.2%
expm1-define54.2%
Simplified54.2%
clear-num54.3%
inv-pow54.3%
*-un-lft-identity54.3%
times-frac54.4%
metadata-eval54.4%
Applied egg-rr54.4%
unpow-154.4%
associate-/r*54.4%
metadata-eval54.4%
Simplified54.4%
Taylor expanded in i around 0 74.0%
Final simplification86.9%
(FPCore (i n)
:precision binary64
(let* ((t_0
(+
100.0
(*
i
(+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667))))))))
(if (<= n -2.2e+203)
(* n t_0)
(if (<= n -2.1e-184)
(* n (/ 100.0 (+ 1.0 (* i -0.5))))
(if (<= n 1.2e-162)
(/ 0.0 (/ i n))
(if (<= n 5e-12)
(* n (/ 100.0 (+ 1.0 (* i (- (* i 0.08333333333333333) 0.5)))))
(* n (/ (* i t_0) i))))))))
double code(double i, double n) {
double t_0 = 100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))));
double tmp;
if (n <= -2.2e+203) {
tmp = n * t_0;
} else if (n <= -2.1e-184) {
tmp = n * (100.0 / (1.0 + (i * -0.5)));
} else if (n <= 1.2e-162) {
tmp = 0.0 / (i / n);
} else if (n <= 5e-12) {
tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5))));
} else {
tmp = n * ((i * t_0) / i);
}
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 + (i * (50.0d0 + (i * (16.666666666666668d0 + (i * 4.166666666666667d0)))))
if (n <= (-2.2d+203)) then
tmp = n * t_0
else if (n <= (-2.1d-184)) then
tmp = n * (100.0d0 / (1.0d0 + (i * (-0.5d0))))
else if (n <= 1.2d-162) then
tmp = 0.0d0 / (i / n)
else if (n <= 5d-12) then
tmp = n * (100.0d0 / (1.0d0 + (i * ((i * 0.08333333333333333d0) - 0.5d0))))
else
tmp = n * ((i * t_0) / i)
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = 100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))));
double tmp;
if (n <= -2.2e+203) {
tmp = n * t_0;
} else if (n <= -2.1e-184) {
tmp = n * (100.0 / (1.0 + (i * -0.5)));
} else if (n <= 1.2e-162) {
tmp = 0.0 / (i / n);
} else if (n <= 5e-12) {
tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5))));
} else {
tmp = n * ((i * t_0) / i);
}
return tmp;
}
def code(i, n): t_0 = 100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))) tmp = 0 if n <= -2.2e+203: tmp = n * t_0 elif n <= -2.1e-184: tmp = n * (100.0 / (1.0 + (i * -0.5))) elif n <= 1.2e-162: tmp = 0.0 / (i / n) elif n <= 5e-12: tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5)))) else: tmp = n * ((i * t_0) / i) return tmp
function code(i, n) t_0 = Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667)))))) tmp = 0.0 if (n <= -2.2e+203) tmp = Float64(n * t_0); elseif (n <= -2.1e-184) tmp = Float64(n * Float64(100.0 / Float64(1.0 + Float64(i * -0.5)))); elseif (n <= 1.2e-162) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 5e-12) tmp = Float64(n * Float64(100.0 / Float64(1.0 + Float64(i * Float64(Float64(i * 0.08333333333333333) - 0.5))))); else tmp = Float64(n * Float64(Float64(i * t_0) / i)); end return tmp end
function tmp_2 = code(i, n) t_0 = 100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))); tmp = 0.0; if (n <= -2.2e+203) tmp = n * t_0; elseif (n <= -2.1e-184) tmp = n * (100.0 / (1.0 + (i * -0.5))); elseif (n <= 1.2e-162) tmp = 0.0 / (i / n); elseif (n <= 5e-12) tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5)))); else tmp = n * ((i * t_0) / i); end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -2.2e+203], N[(n * t$95$0), $MachinePrecision], If[LessEqual[n, -2.1e-184], N[(n * N[(100.0 / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.2e-162], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5e-12], N[(n * N[(100.0 / N[(1.0 + N[(i * N[(N[(i * 0.08333333333333333), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(N[(i * t$95$0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\\
\mathbf{if}\;n \leq -2.2 \cdot 10^{+203}:\\
\;\;\;\;n \cdot t\_0\\
\mathbf{elif}\;n \leq -2.1 \cdot 10^{-184}:\\
\;\;\;\;n \cdot \frac{100}{1 + i \cdot -0.5}\\
\mathbf{elif}\;n \leq 1.2 \cdot 10^{-162}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 5 \cdot 10^{-12}:\\
\;\;\;\;n \cdot \frac{100}{1 + i \cdot \left(i \cdot 0.08333333333333333 - 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \frac{i \cdot t\_0}{i}\\
\end{array}
\end{array}
if n < -2.20000000000000004e203Initial program 13.0%
associate-/r/13.5%
associate-*r*13.5%
*-commutative13.5%
associate-*r/13.5%
sub-neg13.5%
distribute-lft-in13.5%
metadata-eval13.5%
metadata-eval13.5%
metadata-eval13.5%
fma-define13.5%
metadata-eval13.5%
Simplified13.5%
Taylor expanded in n around inf 69.8%
sub-neg69.8%
metadata-eval69.8%
metadata-eval69.8%
distribute-lft-in70.1%
metadata-eval70.1%
sub-neg70.1%
expm1-define99.8%
Simplified99.8%
Taylor expanded in i around 0 64.6%
*-commutative64.6%
Simplified64.6%
if -2.20000000000000004e203 < n < -2.0999999999999999e-184Initial program 24.9%
associate-/r/24.3%
associate-*r*24.3%
*-commutative24.3%
associate-*r/24.3%
sub-neg24.3%
distribute-lft-in24.3%
metadata-eval24.3%
metadata-eval24.3%
metadata-eval24.3%
fma-define24.3%
metadata-eval24.3%
Simplified24.3%
Taylor expanded in n around inf 23.8%
sub-neg23.8%
metadata-eval23.8%
metadata-eval23.8%
distribute-lft-in23.8%
metadata-eval23.8%
sub-neg23.8%
expm1-define81.7%
Simplified81.7%
clear-num81.8%
inv-pow81.8%
*-un-lft-identity81.8%
times-frac81.9%
metadata-eval81.9%
Applied egg-rr81.9%
unpow-181.9%
associate-/r*81.8%
metadata-eval81.8%
Simplified81.8%
Taylor expanded in i around 0 70.5%
*-commutative70.5%
Simplified70.5%
if -2.0999999999999999e-184 < n < 1.2000000000000001e-162Initial program 63.0%
associate-*r/63.0%
sub-neg63.0%
distribute-rgt-in63.0%
metadata-eval63.0%
metadata-eval63.0%
Simplified63.0%
Taylor expanded in i around 0 84.9%
if 1.2000000000000001e-162 < n < 4.9999999999999997e-12Initial program 9.7%
associate-/r/9.9%
associate-*r*9.9%
*-commutative9.9%
associate-*r/9.9%
sub-neg9.9%
distribute-lft-in9.9%
metadata-eval9.9%
metadata-eval9.9%
metadata-eval9.9%
fma-define9.9%
metadata-eval9.9%
Simplified9.9%
Taylor expanded in n around inf 3.2%
sub-neg3.2%
metadata-eval3.2%
metadata-eval3.2%
distribute-lft-in3.2%
metadata-eval3.2%
sub-neg3.2%
expm1-define54.2%
Simplified54.2%
clear-num54.3%
inv-pow54.3%
*-un-lft-identity54.3%
times-frac54.4%
metadata-eval54.4%
Applied egg-rr54.4%
unpow-154.4%
associate-/r*54.4%
metadata-eval54.4%
Simplified54.4%
Taylor expanded in i around 0 74.0%
if 4.9999999999999997e-12 < n Initial program 22.7%
associate-/r/23.3%
associate-*r*23.3%
*-commutative23.3%
associate-*r/23.3%
sub-neg23.3%
distribute-lft-in23.3%
metadata-eval23.3%
metadata-eval23.3%
metadata-eval23.3%
fma-define23.3%
metadata-eval23.3%
Simplified23.3%
Taylor expanded in n around inf 37.8%
sub-neg37.8%
metadata-eval37.8%
metadata-eval37.8%
distribute-lft-in37.8%
metadata-eval37.8%
sub-neg37.8%
expm1-define93.2%
Simplified93.2%
Taylor expanded in i around 0 88.2%
*-commutative88.2%
Simplified88.2%
Final simplification77.1%
(FPCore (i n)
:precision binary64
(let* ((t_0
(*
n
(+
100.0
(*
i
(+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667)))))))))
(if (<= n -1.22e+203)
t_0
(if (<= n -6.4e-189)
(* n (/ 100.0 (+ 1.0 (* i -0.5))))
(if (<= n 3.5e-162)
(/ 0.0 (/ i n))
(if (<= n 5e-12)
(* n (/ 100.0 (+ 1.0 (* i (- (* i 0.08333333333333333) 0.5)))))
t_0))))))
double code(double i, double n) {
double t_0 = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
double tmp;
if (n <= -1.22e+203) {
tmp = t_0;
} else if (n <= -6.4e-189) {
tmp = n * (100.0 / (1.0 + (i * -0.5)));
} else if (n <= 3.5e-162) {
tmp = 0.0 / (i / n);
} else if (n <= 5e-12) {
tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = n * (100.0d0 + (i * (50.0d0 + (i * (16.666666666666668d0 + (i * 4.166666666666667d0))))))
if (n <= (-1.22d+203)) then
tmp = t_0
else if (n <= (-6.4d-189)) then
tmp = n * (100.0d0 / (1.0d0 + (i * (-0.5d0))))
else if (n <= 3.5d-162) then
tmp = 0.0d0 / (i / n)
else if (n <= 5d-12) then
tmp = n * (100.0d0 / (1.0d0 + (i * ((i * 0.08333333333333333d0) - 0.5d0))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
double tmp;
if (n <= -1.22e+203) {
tmp = t_0;
} else if (n <= -6.4e-189) {
tmp = n * (100.0 / (1.0 + (i * -0.5)));
} else if (n <= 3.5e-162) {
tmp = 0.0 / (i / n);
} else if (n <= 5e-12) {
tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5))));
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))) tmp = 0 if n <= -1.22e+203: tmp = t_0 elif n <= -6.4e-189: tmp = n * (100.0 / (1.0 + (i * -0.5))) elif n <= 3.5e-162: tmp = 0.0 / (i / n) elif n <= 5e-12: tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5)))) else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667))))))) tmp = 0.0 if (n <= -1.22e+203) tmp = t_0; elseif (n <= -6.4e-189) tmp = Float64(n * Float64(100.0 / Float64(1.0 + Float64(i * -0.5)))); elseif (n <= 3.5e-162) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 5e-12) tmp = Float64(n * Float64(100.0 / Float64(1.0 + Float64(i * Float64(Float64(i * 0.08333333333333333) - 0.5))))); else tmp = t_0; end return tmp end
function tmp_2 = code(i, n) t_0 = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))); tmp = 0.0; if (n <= -1.22e+203) tmp = t_0; elseif (n <= -6.4e-189) tmp = n * (100.0 / (1.0 + (i * -0.5))); elseif (n <= 3.5e-162) tmp = 0.0 / (i / n); elseif (n <= 5e-12) tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5)))); else tmp = t_0; end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.22e+203], t$95$0, If[LessEqual[n, -6.4e-189], N[(n * N[(100.0 / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 3.5e-162], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5e-12], N[(n * N[(100.0 / N[(1.0 + N[(i * N[(N[(i * 0.08333333333333333), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\\
\mathbf{if}\;n \leq -1.22 \cdot 10^{+203}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq -6.4 \cdot 10^{-189}:\\
\;\;\;\;n \cdot \frac{100}{1 + i \cdot -0.5}\\
\mathbf{elif}\;n \leq 3.5 \cdot 10^{-162}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 5 \cdot 10^{-12}:\\
\;\;\;\;n \cdot \frac{100}{1 + i \cdot \left(i \cdot 0.08333333333333333 - 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -1.21999999999999992e203 or 4.9999999999999997e-12 < n Initial program 19.7%
associate-/r/20.2%
associate-*r*20.2%
*-commutative20.2%
associate-*r/20.2%
sub-neg20.2%
distribute-lft-in20.2%
metadata-eval20.2%
metadata-eval20.2%
metadata-eval20.2%
fma-define20.2%
metadata-eval20.2%
Simplified20.2%
Taylor expanded in n around inf 47.9%
sub-neg47.9%
metadata-eval47.9%
metadata-eval47.9%
distribute-lft-in48.0%
metadata-eval48.0%
sub-neg48.0%
expm1-define95.3%
Simplified95.3%
Taylor expanded in i around 0 80.0%
*-commutative80.0%
Simplified80.0%
if -1.21999999999999992e203 < n < -6.4000000000000001e-189Initial program 24.9%
associate-/r/24.3%
associate-*r*24.3%
*-commutative24.3%
associate-*r/24.3%
sub-neg24.3%
distribute-lft-in24.3%
metadata-eval24.3%
metadata-eval24.3%
metadata-eval24.3%
fma-define24.3%
metadata-eval24.3%
Simplified24.3%
Taylor expanded in n around inf 23.8%
sub-neg23.8%
metadata-eval23.8%
metadata-eval23.8%
distribute-lft-in23.8%
metadata-eval23.8%
sub-neg23.8%
expm1-define81.7%
Simplified81.7%
clear-num81.8%
inv-pow81.8%
*-un-lft-identity81.8%
times-frac81.9%
metadata-eval81.9%
Applied egg-rr81.9%
unpow-181.9%
associate-/r*81.8%
metadata-eval81.8%
Simplified81.8%
Taylor expanded in i around 0 70.5%
*-commutative70.5%
Simplified70.5%
if -6.4000000000000001e-189 < n < 3.4999999999999999e-162Initial program 63.0%
associate-*r/63.0%
sub-neg63.0%
distribute-rgt-in63.0%
metadata-eval63.0%
metadata-eval63.0%
Simplified63.0%
Taylor expanded in i around 0 84.9%
if 3.4999999999999999e-162 < n < 4.9999999999999997e-12Initial program 9.7%
associate-/r/9.9%
associate-*r*9.9%
*-commutative9.9%
associate-*r/9.9%
sub-neg9.9%
distribute-lft-in9.9%
metadata-eval9.9%
metadata-eval9.9%
metadata-eval9.9%
fma-define9.9%
metadata-eval9.9%
Simplified9.9%
Taylor expanded in n around inf 3.2%
sub-neg3.2%
metadata-eval3.2%
metadata-eval3.2%
distribute-lft-in3.2%
metadata-eval3.2%
sub-neg3.2%
expm1-define54.2%
Simplified54.2%
clear-num54.3%
inv-pow54.3%
*-un-lft-identity54.3%
times-frac54.4%
metadata-eval54.4%
Applied egg-rr54.4%
unpow-154.4%
associate-/r*54.4%
metadata-eval54.4%
Simplified54.4%
Taylor expanded in i around 0 74.0%
Final simplification76.7%
(FPCore (i n)
:precision binary64
(if (<= n -2.2e+203)
(* n (+ 100.0 (* i (+ 50.0 (* i 16.666666666666668)))))
(if (<= n -6.6e-191)
(* n (/ 100.0 (+ 1.0 (* i -0.5))))
(if (<= n 1.2e-162)
(/ 0.0 (/ i n))
(if (<= n 5e-12)
(* n (/ 100.0 (+ 1.0 (* i (- (* i 0.08333333333333333) 0.5)))))
(* n (/ (* i (+ 100.0 (* i 50.0))) i)))))))
double code(double i, double n) {
double tmp;
if (n <= -2.2e+203) {
tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
} else if (n <= -6.6e-191) {
tmp = n * (100.0 / (1.0 + (i * -0.5)));
} else if (n <= 1.2e-162) {
tmp = 0.0 / (i / n);
} else if (n <= 5e-12) {
tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5))));
} else {
tmp = n * ((i * (100.0 + (i * 50.0))) / i);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-2.2d+203)) then
tmp = n * (100.0d0 + (i * (50.0d0 + (i * 16.666666666666668d0))))
else if (n <= (-6.6d-191)) then
tmp = n * (100.0d0 / (1.0d0 + (i * (-0.5d0))))
else if (n <= 1.2d-162) then
tmp = 0.0d0 / (i / n)
else if (n <= 5d-12) then
tmp = n * (100.0d0 / (1.0d0 + (i * ((i * 0.08333333333333333d0) - 0.5d0))))
else
tmp = n * ((i * (100.0d0 + (i * 50.0d0))) / i)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -2.2e+203) {
tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
} else if (n <= -6.6e-191) {
tmp = n * (100.0 / (1.0 + (i * -0.5)));
} else if (n <= 1.2e-162) {
tmp = 0.0 / (i / n);
} else if (n <= 5e-12) {
tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5))));
} else {
tmp = n * ((i * (100.0 + (i * 50.0))) / i);
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -2.2e+203: tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))) elif n <= -6.6e-191: tmp = n * (100.0 / (1.0 + (i * -0.5))) elif n <= 1.2e-162: tmp = 0.0 / (i / n) elif n <= 5e-12: tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5)))) else: tmp = n * ((i * (100.0 + (i * 50.0))) / i) return tmp
function code(i, n) tmp = 0.0 if (n <= -2.2e+203) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * 16.666666666666668))))); elseif (n <= -6.6e-191) tmp = Float64(n * Float64(100.0 / Float64(1.0 + Float64(i * -0.5)))); elseif (n <= 1.2e-162) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 5e-12) tmp = Float64(n * Float64(100.0 / Float64(1.0 + Float64(i * Float64(Float64(i * 0.08333333333333333) - 0.5))))); else tmp = Float64(n * Float64(Float64(i * Float64(100.0 + Float64(i * 50.0))) / i)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -2.2e+203) tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))); elseif (n <= -6.6e-191) tmp = n * (100.0 / (1.0 + (i * -0.5))); elseif (n <= 1.2e-162) tmp = 0.0 / (i / n); elseif (n <= 5e-12) tmp = n * (100.0 / (1.0 + (i * ((i * 0.08333333333333333) - 0.5)))); else tmp = n * ((i * (100.0 + (i * 50.0))) / i); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -2.2e+203], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -6.6e-191], N[(n * N[(100.0 / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.2e-162], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5e-12], N[(n * N[(100.0 / N[(1.0 + N[(i * N[(N[(i * 0.08333333333333333), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(N[(i * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.2 \cdot 10^{+203}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\
\mathbf{elif}\;n \leq -6.6 \cdot 10^{-191}:\\
\;\;\;\;n \cdot \frac{100}{1 + i \cdot -0.5}\\
\mathbf{elif}\;n \leq 1.2 \cdot 10^{-162}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 5 \cdot 10^{-12}:\\
\;\;\;\;n \cdot \frac{100}{1 + i \cdot \left(i \cdot 0.08333333333333333 - 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \frac{i \cdot \left(100 + i \cdot 50\right)}{i}\\
\end{array}
\end{array}
if n < -2.20000000000000004e203Initial program 13.0%
associate-/r/13.5%
associate-*r*13.5%
*-commutative13.5%
associate-*r/13.5%
sub-neg13.5%
distribute-lft-in13.5%
metadata-eval13.5%
metadata-eval13.5%
metadata-eval13.5%
fma-define13.5%
metadata-eval13.5%
Simplified13.5%
Taylor expanded in n around inf 69.8%
sub-neg69.8%
metadata-eval69.8%
metadata-eval69.8%
distribute-lft-in70.1%
metadata-eval70.1%
sub-neg70.1%
expm1-define99.8%
Simplified99.8%
Taylor expanded in i around 0 64.4%
*-commutative64.4%
Simplified64.4%
if -2.20000000000000004e203 < n < -6.59999999999999963e-191Initial program 24.9%
associate-/r/24.3%
associate-*r*24.3%
*-commutative24.3%
associate-*r/24.3%
sub-neg24.3%
distribute-lft-in24.3%
metadata-eval24.3%
metadata-eval24.3%
metadata-eval24.3%
fma-define24.3%
metadata-eval24.3%
Simplified24.3%
Taylor expanded in n around inf 23.8%
sub-neg23.8%
metadata-eval23.8%
metadata-eval23.8%
distribute-lft-in23.8%
metadata-eval23.8%
sub-neg23.8%
expm1-define81.7%
Simplified81.7%
clear-num81.8%
inv-pow81.8%
*-un-lft-identity81.8%
times-frac81.9%
metadata-eval81.9%
Applied egg-rr81.9%
unpow-181.9%
associate-/r*81.8%
metadata-eval81.8%
Simplified81.8%
Taylor expanded in i around 0 70.5%
*-commutative70.5%
Simplified70.5%
if -6.59999999999999963e-191 < n < 1.2000000000000001e-162Initial program 63.0%
associate-*r/63.0%
sub-neg63.0%
distribute-rgt-in63.0%
metadata-eval63.0%
metadata-eval63.0%
Simplified63.0%
Taylor expanded in i around 0 84.9%
if 1.2000000000000001e-162 < n < 4.9999999999999997e-12Initial program 9.7%
associate-/r/9.9%
associate-*r*9.9%
*-commutative9.9%
associate-*r/9.9%
sub-neg9.9%
distribute-lft-in9.9%
metadata-eval9.9%
metadata-eval9.9%
metadata-eval9.9%
fma-define9.9%
metadata-eval9.9%
Simplified9.9%
Taylor expanded in n around inf 3.2%
sub-neg3.2%
metadata-eval3.2%
metadata-eval3.2%
distribute-lft-in3.2%
metadata-eval3.2%
sub-neg3.2%
expm1-define54.2%
Simplified54.2%
clear-num54.3%
inv-pow54.3%
*-un-lft-identity54.3%
times-frac54.4%
metadata-eval54.4%
Applied egg-rr54.4%
unpow-154.4%
associate-/r*54.4%
metadata-eval54.4%
Simplified54.4%
Taylor expanded in i around 0 74.0%
if 4.9999999999999997e-12 < n Initial program 22.7%
associate-/r/23.3%
associate-*r*23.3%
*-commutative23.3%
associate-*r/23.3%
sub-neg23.3%
distribute-lft-in23.3%
metadata-eval23.3%
metadata-eval23.3%
metadata-eval23.3%
fma-define23.3%
metadata-eval23.3%
Simplified23.3%
Taylor expanded in n around inf 37.8%
sub-neg37.8%
metadata-eval37.8%
metadata-eval37.8%
distribute-lft-in37.8%
metadata-eval37.8%
sub-neg37.8%
expm1-define93.2%
Simplified93.2%
Taylor expanded in i around 0 81.7%
Final simplification75.2%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* n (/ 100.0 (+ 1.0 (* i -0.5))))))
(if (<= n -4.2e+203)
(* n (+ 100.0 (* i (+ 50.0 (* i 16.666666666666668)))))
(if (<= n -1.45e-190)
t_0
(if (<= n 1.2e-162)
(/ 0.0 (/ i n))
(if (<= n 2.35e-15) t_0 (* n (/ (* i (+ 100.0 (* i 50.0))) i))))))))
double code(double i, double n) {
double t_0 = n * (100.0 / (1.0 + (i * -0.5)));
double tmp;
if (n <= -4.2e+203) {
tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
} else if (n <= -1.45e-190) {
tmp = t_0;
} else if (n <= 1.2e-162) {
tmp = 0.0 / (i / n);
} else if (n <= 2.35e-15) {
tmp = t_0;
} else {
tmp = n * ((i * (100.0 + (i * 50.0))) / i);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = n * (100.0d0 / (1.0d0 + (i * (-0.5d0))))
if (n <= (-4.2d+203)) then
tmp = n * (100.0d0 + (i * (50.0d0 + (i * 16.666666666666668d0))))
else if (n <= (-1.45d-190)) then
tmp = t_0
else if (n <= 1.2d-162) then
tmp = 0.0d0 / (i / n)
else if (n <= 2.35d-15) then
tmp = t_0
else
tmp = n * ((i * (100.0d0 + (i * 50.0d0))) / i)
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = n * (100.0 / (1.0 + (i * -0.5)));
double tmp;
if (n <= -4.2e+203) {
tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
} else if (n <= -1.45e-190) {
tmp = t_0;
} else if (n <= 1.2e-162) {
tmp = 0.0 / (i / n);
} else if (n <= 2.35e-15) {
tmp = t_0;
} else {
tmp = n * ((i * (100.0 + (i * 50.0))) / i);
}
return tmp;
}
def code(i, n): t_0 = n * (100.0 / (1.0 + (i * -0.5))) tmp = 0 if n <= -4.2e+203: tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))) elif n <= -1.45e-190: tmp = t_0 elif n <= 1.2e-162: tmp = 0.0 / (i / n) elif n <= 2.35e-15: tmp = t_0 else: tmp = n * ((i * (100.0 + (i * 50.0))) / i) return tmp
function code(i, n) t_0 = Float64(n * Float64(100.0 / Float64(1.0 + Float64(i * -0.5)))) tmp = 0.0 if (n <= -4.2e+203) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * 16.666666666666668))))); elseif (n <= -1.45e-190) tmp = t_0; elseif (n <= 1.2e-162) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 2.35e-15) tmp = t_0; else tmp = Float64(n * Float64(Float64(i * Float64(100.0 + Float64(i * 50.0))) / i)); end return tmp end
function tmp_2 = code(i, n) t_0 = n * (100.0 / (1.0 + (i * -0.5))); tmp = 0.0; if (n <= -4.2e+203) tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))); elseif (n <= -1.45e-190) tmp = t_0; elseif (n <= 1.2e-162) tmp = 0.0 / (i / n); elseif (n <= 2.35e-15) tmp = t_0; else tmp = n * ((i * (100.0 + (i * 50.0))) / i); end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(n * N[(100.0 / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -4.2e+203], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -1.45e-190], t$95$0, If[LessEqual[n, 1.2e-162], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.35e-15], t$95$0, N[(n * N[(N[(i * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \frac{100}{1 + i \cdot -0.5}\\
\mathbf{if}\;n \leq -4.2 \cdot 10^{+203}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\
\mathbf{elif}\;n \leq -1.45 \cdot 10^{-190}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 1.2 \cdot 10^{-162}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 2.35 \cdot 10^{-15}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;n \cdot \frac{i \cdot \left(100 + i \cdot 50\right)}{i}\\
\end{array}
\end{array}
if n < -4.19999999999999967e203Initial program 13.0%
associate-/r/13.5%
associate-*r*13.5%
*-commutative13.5%
associate-*r/13.5%
sub-neg13.5%
distribute-lft-in13.5%
metadata-eval13.5%
metadata-eval13.5%
metadata-eval13.5%
fma-define13.5%
metadata-eval13.5%
Simplified13.5%
Taylor expanded in n around inf 69.8%
sub-neg69.8%
metadata-eval69.8%
metadata-eval69.8%
distribute-lft-in70.1%
metadata-eval70.1%
sub-neg70.1%
expm1-define99.8%
Simplified99.8%
Taylor expanded in i around 0 64.4%
*-commutative64.4%
Simplified64.4%
if -4.19999999999999967e203 < n < -1.4500000000000001e-190 or 1.2000000000000001e-162 < n < 2.3499999999999999e-15Initial program 20.7%
associate-/r/20.3%
associate-*r*20.3%
*-commutative20.3%
associate-*r/20.3%
sub-neg20.3%
distribute-lft-in20.3%
metadata-eval20.3%
metadata-eval20.3%
metadata-eval20.3%
fma-define20.3%
metadata-eval20.3%
Simplified20.3%
Taylor expanded in n around inf 18.1%
sub-neg18.1%
metadata-eval18.1%
metadata-eval18.1%
distribute-lft-in18.1%
metadata-eval18.1%
sub-neg18.1%
expm1-define74.2%
Simplified74.2%
clear-num74.2%
inv-pow74.2%
*-un-lft-identity74.2%
times-frac74.3%
metadata-eval74.3%
Applied egg-rr74.3%
unpow-174.3%
associate-/r*74.3%
metadata-eval74.3%
Simplified74.3%
Taylor expanded in i around 0 70.4%
*-commutative70.4%
Simplified70.4%
if -1.4500000000000001e-190 < n < 1.2000000000000001e-162Initial program 63.0%
associate-*r/63.0%
sub-neg63.0%
distribute-rgt-in63.0%
metadata-eval63.0%
metadata-eval63.0%
Simplified63.0%
Taylor expanded in i around 0 84.9%
if 2.3499999999999999e-15 < n Initial program 22.7%
associate-/r/23.3%
associate-*r*23.3%
*-commutative23.3%
associate-*r/23.3%
sub-neg23.3%
distribute-lft-in23.3%
metadata-eval23.3%
metadata-eval23.3%
metadata-eval23.3%
fma-define23.3%
metadata-eval23.3%
Simplified23.3%
Taylor expanded in n around inf 37.8%
sub-neg37.8%
metadata-eval37.8%
metadata-eval37.8%
distribute-lft-in37.8%
metadata-eval37.8%
sub-neg37.8%
expm1-define93.2%
Simplified93.2%
Taylor expanded in i around 0 81.7%
Final simplification74.7%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* n (/ 100.0 (+ 1.0 (* i -0.5)))))
(t_1 (* n (+ 100.0 (* i (+ 50.0 (* i 16.666666666666668)))))))
(if (<= n -1.25e+203)
t_1
(if (<= n -1.45e-190)
t_0
(if (<= n 1.4e-162) (/ 0.0 (/ i n)) (if (<= n 8.6e-16) t_0 t_1))))))
double code(double i, double n) {
double t_0 = n * (100.0 / (1.0 + (i * -0.5)));
double t_1 = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
double tmp;
if (n <= -1.25e+203) {
tmp = t_1;
} else if (n <= -1.45e-190) {
tmp = t_0;
} else if (n <= 1.4e-162) {
tmp = 0.0 / (i / n);
} else if (n <= 8.6e-16) {
tmp = t_0;
} else {
tmp = 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) :: tmp
t_0 = n * (100.0d0 / (1.0d0 + (i * (-0.5d0))))
t_1 = n * (100.0d0 + (i * (50.0d0 + (i * 16.666666666666668d0))))
if (n <= (-1.25d+203)) then
tmp = t_1
else if (n <= (-1.45d-190)) then
tmp = t_0
else if (n <= 1.4d-162) then
tmp = 0.0d0 / (i / n)
else if (n <= 8.6d-16) then
tmp = t_0
else
tmp = 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 = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
double tmp;
if (n <= -1.25e+203) {
tmp = t_1;
} else if (n <= -1.45e-190) {
tmp = t_0;
} else if (n <= 1.4e-162) {
tmp = 0.0 / (i / n);
} else if (n <= 8.6e-16) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(i, n): t_0 = n * (100.0 / (1.0 + (i * -0.5))) t_1 = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))) tmp = 0 if n <= -1.25e+203: tmp = t_1 elif n <= -1.45e-190: tmp = t_0 elif n <= 1.4e-162: tmp = 0.0 / (i / n) elif n <= 8.6e-16: tmp = t_0 else: tmp = t_1 return tmp
function code(i, n) t_0 = Float64(n * Float64(100.0 / Float64(1.0 + Float64(i * -0.5)))) t_1 = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * 16.666666666666668))))) tmp = 0.0 if (n <= -1.25e+203) tmp = t_1; elseif (n <= -1.45e-190) tmp = t_0; elseif (n <= 1.4e-162) tmp = Float64(0.0 / Float64(i / n)); elseif (n <= 8.6e-16) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(i, n) t_0 = n * (100.0 / (1.0 + (i * -0.5))); t_1 = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))); tmp = 0.0; if (n <= -1.25e+203) tmp = t_1; elseif (n <= -1.45e-190) tmp = t_0; elseif (n <= 1.4e-162) tmp = 0.0 / (i / n); elseif (n <= 8.6e-16) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(n * N[(100.0 / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.25e+203], t$95$1, If[LessEqual[n, -1.45e-190], t$95$0, If[LessEqual[n, 1.4e-162], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 8.6e-16], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \frac{100}{1 + i \cdot -0.5}\\
t_1 := n \cdot \left(100 + i \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\
\mathbf{if}\;n \leq -1.25 \cdot 10^{+203}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;n \leq -1.45 \cdot 10^{-190}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq 1.4 \cdot 10^{-162}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{elif}\;n \leq 8.6 \cdot 10^{-16}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if n < -1.24999999999999999e203 or 8.5999999999999997e-16 < n Initial program 19.7%
associate-/r/20.2%
associate-*r*20.2%
*-commutative20.2%
associate-*r/20.2%
sub-neg20.2%
distribute-lft-in20.2%
metadata-eval20.2%
metadata-eval20.2%
metadata-eval20.2%
fma-define20.2%
metadata-eval20.2%
Simplified20.2%
Taylor expanded in n around inf 47.9%
sub-neg47.9%
metadata-eval47.9%
metadata-eval47.9%
distribute-lft-in48.0%
metadata-eval48.0%
sub-neg48.0%
expm1-define95.3%
Simplified95.3%
Taylor expanded in i around 0 74.5%
*-commutative74.5%
Simplified74.5%
if -1.24999999999999999e203 < n < -1.4500000000000001e-190 or 1.40000000000000011e-162 < n < 8.5999999999999997e-16Initial program 20.7%
associate-/r/20.3%
associate-*r*20.3%
*-commutative20.3%
associate-*r/20.3%
sub-neg20.3%
distribute-lft-in20.3%
metadata-eval20.3%
metadata-eval20.3%
metadata-eval20.3%
fma-define20.3%
metadata-eval20.3%
Simplified20.3%
Taylor expanded in n around inf 18.1%
sub-neg18.1%
metadata-eval18.1%
metadata-eval18.1%
distribute-lft-in18.1%
metadata-eval18.1%
sub-neg18.1%
expm1-define74.2%
Simplified74.2%
clear-num74.2%
inv-pow74.2%
*-un-lft-identity74.2%
times-frac74.3%
metadata-eval74.3%
Applied egg-rr74.3%
unpow-174.3%
associate-/r*74.3%
metadata-eval74.3%
Simplified74.3%
Taylor expanded in i around 0 70.4%
*-commutative70.4%
Simplified70.4%
if -1.4500000000000001e-190 < n < 1.40000000000000011e-162Initial program 63.0%
associate-*r/63.0%
sub-neg63.0%
distribute-rgt-in63.0%
metadata-eval63.0%
metadata-eval63.0%
Simplified63.0%
Taylor expanded in i around 0 84.9%
Final simplification74.0%
(FPCore (i n)
:precision binary64
(if (<= n -4e+211)
(+ (* n 100.0) (* 50.0 (* i n)))
(if (<= n -8.5e-191)
(* n (/ 100.0 (+ 1.0 (* i -0.5))))
(if (<= n 2.7e-137) 0.0 (* n (+ 100.0 (* i 50.0)))))))
double code(double i, double n) {
double tmp;
if (n <= -4e+211) {
tmp = (n * 100.0) + (50.0 * (i * n));
} else if (n <= -8.5e-191) {
tmp = n * (100.0 / (1.0 + (i * -0.5)));
} else if (n <= 2.7e-137) {
tmp = 0.0;
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-4d+211)) then
tmp = (n * 100.0d0) + (50.0d0 * (i * n))
else if (n <= (-8.5d-191)) then
tmp = n * (100.0d0 / (1.0d0 + (i * (-0.5d0))))
else if (n <= 2.7d-137) then
tmp = 0.0d0
else
tmp = n * (100.0d0 + (i * 50.0d0))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -4e+211) {
tmp = (n * 100.0) + (50.0 * (i * n));
} else if (n <= -8.5e-191) {
tmp = n * (100.0 / (1.0 + (i * -0.5)));
} else if (n <= 2.7e-137) {
tmp = 0.0;
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -4e+211: tmp = (n * 100.0) + (50.0 * (i * n)) elif n <= -8.5e-191: tmp = n * (100.0 / (1.0 + (i * -0.5))) elif n <= 2.7e-137: tmp = 0.0 else: tmp = n * (100.0 + (i * 50.0)) return tmp
function code(i, n) tmp = 0.0 if (n <= -4e+211) tmp = Float64(Float64(n * 100.0) + Float64(50.0 * Float64(i * n))); elseif (n <= -8.5e-191) tmp = Float64(n * Float64(100.0 / Float64(1.0 + Float64(i * -0.5)))); elseif (n <= 2.7e-137) tmp = 0.0; else tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -4e+211) tmp = (n * 100.0) + (50.0 * (i * n)); elseif (n <= -8.5e-191) tmp = n * (100.0 / (1.0 + (i * -0.5))); elseif (n <= 2.7e-137) tmp = 0.0; else tmp = n * (100.0 + (i * 50.0)); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -4e+211], N[(N[(n * 100.0), $MachinePrecision] + N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -8.5e-191], N[(n * N[(100.0 / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.7e-137], 0.0, N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -4 \cdot 10^{+211}:\\
\;\;\;\;n \cdot 100 + 50 \cdot \left(i \cdot n\right)\\
\mathbf{elif}\;n \leq -8.5 \cdot 10^{-191}:\\
\;\;\;\;n \cdot \frac{100}{1 + i \cdot -0.5}\\
\mathbf{elif}\;n \leq 2.7 \cdot 10^{-137}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if n < -3.9999999999999998e211Initial program 14.6%
associate-/r/15.0%
associate-*r*15.0%
*-commutative15.0%
associate-*r/15.0%
sub-neg15.0%
distribute-lft-in15.0%
metadata-eval15.0%
metadata-eval15.0%
metadata-eval15.0%
fma-define15.0%
metadata-eval15.0%
Simplified15.0%
Taylor expanded in n around inf 72.3%
sub-neg72.3%
metadata-eval72.3%
metadata-eval72.3%
distribute-lft-in72.7%
metadata-eval72.7%
sub-neg72.7%
expm1-define99.8%
Simplified99.8%
clear-num99.8%
inv-pow99.8%
*-un-lft-identity99.8%
times-frac99.8%
metadata-eval99.8%
Applied egg-rr99.8%
unpow-199.8%
associate-/r*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in i around 0 59.4%
if -3.9999999999999998e211 < n < -8.49999999999999954e-191Initial program 23.9%
associate-/r/23.2%
associate-*r*23.3%
*-commutative23.3%
associate-*r/23.3%
sub-neg23.3%
distribute-lft-in23.3%
metadata-eval23.3%
metadata-eval23.3%
metadata-eval23.3%
fma-define23.3%
metadata-eval23.3%
Simplified23.3%
Taylor expanded in n around inf 25.0%
sub-neg25.0%
metadata-eval25.0%
metadata-eval25.0%
distribute-lft-in25.1%
metadata-eval25.1%
sub-neg25.1%
expm1-define82.6%
Simplified82.6%
clear-num82.6%
inv-pow82.6%
*-un-lft-identity82.6%
times-frac82.7%
metadata-eval82.7%
Applied egg-rr82.7%
unpow-182.7%
associate-/r*82.6%
metadata-eval82.6%
Simplified82.6%
Taylor expanded in i around 0 69.8%
*-commutative69.8%
Simplified69.8%
if -8.49999999999999954e-191 < n < 2.69999999999999993e-137Initial program 54.8%
associate-*r/54.8%
sub-neg54.8%
distribute-rgt-in54.8%
metadata-eval54.8%
metadata-eval54.8%
Simplified54.8%
Taylor expanded in i around 0 77.8%
Taylor expanded in i around 0 77.8%
if 2.69999999999999993e-137 < n Initial program 18.9%
associate-*r/18.9%
sub-neg18.9%
distribute-rgt-in18.9%
metadata-eval18.9%
metadata-eval18.9%
Simplified18.9%
Taylor expanded in i around 0 20.0%
*-commutative20.0%
associate-*r/20.0%
metadata-eval20.0%
Simplified20.0%
Taylor expanded in n around inf 71.1%
*-commutative71.1%
Simplified71.1%
Final simplification70.3%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* n (+ 100.0 (* i 50.0)))))
(if (<= n -4e+211)
t_0
(if (<= n -8.5e-191)
(* n (/ 100.0 (+ 1.0 (* i -0.5))))
(if (<= n 3.8e-137) 0.0 t_0)))))
double code(double i, double n) {
double t_0 = n * (100.0 + (i * 50.0));
double tmp;
if (n <= -4e+211) {
tmp = t_0;
} else if (n <= -8.5e-191) {
tmp = n * (100.0 / (1.0 + (i * -0.5)));
} else if (n <= 3.8e-137) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = n * (100.0d0 + (i * 50.0d0))
if (n <= (-4d+211)) then
tmp = t_0
else if (n <= (-8.5d-191)) then
tmp = n * (100.0d0 / (1.0d0 + (i * (-0.5d0))))
else if (n <= 3.8d-137) then
tmp = 0.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = n * (100.0 + (i * 50.0));
double tmp;
if (n <= -4e+211) {
tmp = t_0;
} else if (n <= -8.5e-191) {
tmp = n * (100.0 / (1.0 + (i * -0.5)));
} else if (n <= 3.8e-137) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(i, n): t_0 = n * (100.0 + (i * 50.0)) tmp = 0 if n <= -4e+211: tmp = t_0 elif n <= -8.5e-191: tmp = n * (100.0 / (1.0 + (i * -0.5))) elif n <= 3.8e-137: tmp = 0.0 else: tmp = t_0 return tmp
function code(i, n) t_0 = Float64(n * Float64(100.0 + Float64(i * 50.0))) tmp = 0.0 if (n <= -4e+211) tmp = t_0; elseif (n <= -8.5e-191) tmp = Float64(n * Float64(100.0 / Float64(1.0 + Float64(i * -0.5)))); elseif (n <= 3.8e-137) tmp = 0.0; else tmp = t_0; end return tmp end
function tmp_2 = code(i, n) t_0 = n * (100.0 + (i * 50.0)); tmp = 0.0; if (n <= -4e+211) tmp = t_0; elseif (n <= -8.5e-191) tmp = n * (100.0 / (1.0 + (i * -0.5))); elseif (n <= 3.8e-137) tmp = 0.0; else tmp = t_0; end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -4e+211], t$95$0, If[LessEqual[n, -8.5e-191], N[(n * N[(100.0 / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 3.8e-137], 0.0, t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{if}\;n \leq -4 \cdot 10^{+211}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;n \leq -8.5 \cdot 10^{-191}:\\
\;\;\;\;n \cdot \frac{100}{1 + i \cdot -0.5}\\
\mathbf{elif}\;n \leq 3.8 \cdot 10^{-137}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if n < -3.9999999999999998e211 or 3.79999999999999999e-137 < n Initial program 17.9%
associate-*r/17.9%
sub-neg17.9%
distribute-rgt-in17.9%
metadata-eval17.9%
metadata-eval17.9%
Simplified17.9%
Taylor expanded in i around 0 23.0%
*-commutative23.0%
associate-*r/23.0%
metadata-eval23.0%
Simplified23.0%
Taylor expanded in n around inf 68.4%
*-commutative68.4%
Simplified68.4%
if -3.9999999999999998e211 < n < -8.49999999999999954e-191Initial program 23.9%
associate-/r/23.2%
associate-*r*23.3%
*-commutative23.3%
associate-*r/23.3%
sub-neg23.3%
distribute-lft-in23.3%
metadata-eval23.3%
metadata-eval23.3%
metadata-eval23.3%
fma-define23.3%
metadata-eval23.3%
Simplified23.3%
Taylor expanded in n around inf 25.0%
sub-neg25.0%
metadata-eval25.0%
metadata-eval25.0%
distribute-lft-in25.1%
metadata-eval25.1%
sub-neg25.1%
expm1-define82.6%
Simplified82.6%
clear-num82.6%
inv-pow82.6%
*-un-lft-identity82.6%
times-frac82.7%
metadata-eval82.7%
Applied egg-rr82.7%
unpow-182.7%
associate-/r*82.6%
metadata-eval82.6%
Simplified82.6%
Taylor expanded in i around 0 69.8%
*-commutative69.8%
Simplified69.8%
if -8.49999999999999954e-191 < n < 3.79999999999999999e-137Initial program 54.8%
associate-*r/54.8%
sub-neg54.8%
distribute-rgt-in54.8%
metadata-eval54.8%
metadata-eval54.8%
Simplified54.8%
Taylor expanded in i around 0 77.8%
Taylor expanded in i around 0 77.8%
Final simplification70.3%
(FPCore (i n) :precision binary64 (if (or (<= n -8.5e-153) (not (<= n 2.3e-137))) (* n (+ 100.0 (* i 50.0))) 0.0))
double code(double i, double n) {
double tmp;
if ((n <= -8.5e-153) || !(n <= 2.3e-137)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-8.5d-153)) .or. (.not. (n <= 2.3d-137))) then
tmp = n * (100.0d0 + (i * 50.0d0))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -8.5e-153) || !(n <= 2.3e-137)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 0.0;
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -8.5e-153) or not (n <= 2.3e-137): tmp = n * (100.0 + (i * 50.0)) else: tmp = 0.0 return tmp
function code(i, n) tmp = 0.0 if ((n <= -8.5e-153) || !(n <= 2.3e-137)) tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); else tmp = 0.0; end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -8.5e-153) || ~((n <= 2.3e-137))) tmp = n * (100.0 + (i * 50.0)); else tmp = 0.0; end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -8.5e-153], N[Not[LessEqual[n, 2.3e-137]], $MachinePrecision]], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -8.5 \cdot 10^{-153} \lor \neg \left(n \leq 2.3 \cdot 10^{-137}\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if n < -8.4999999999999996e-153 or 2.30000000000000008e-137 < n Initial program 19.7%
associate-*r/19.7%
sub-neg19.7%
distribute-rgt-in19.7%
metadata-eval19.7%
metadata-eval19.7%
Simplified19.7%
Taylor expanded in i around 0 15.6%
*-commutative15.6%
associate-*r/15.6%
metadata-eval15.6%
Simplified15.6%
Taylor expanded in n around inf 66.3%
*-commutative66.3%
Simplified66.3%
if -8.4999999999999996e-153 < n < 2.30000000000000008e-137Initial program 55.7%
associate-*r/55.7%
sub-neg55.7%
distribute-rgt-in55.7%
metadata-eval55.7%
metadata-eval55.7%
Simplified55.7%
Taylor expanded in i around 0 77.2%
Taylor expanded in i around 0 77.2%
Final simplification68.1%
(FPCore (i n) :precision binary64 (if (or (<= n -1.15e-154) (not (<= n 2.4e-137))) (* n 100.0) 0.0))
double code(double i, double n) {
double tmp;
if ((n <= -1.15e-154) || !(n <= 2.4e-137)) {
tmp = n * 100.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-1.15d-154)) .or. (.not. (n <= 2.4d-137))) then
tmp = n * 100.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -1.15e-154) || !(n <= 2.4e-137)) {
tmp = n * 100.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -1.15e-154) or not (n <= 2.4e-137): tmp = n * 100.0 else: tmp = 0.0 return tmp
function code(i, n) tmp = 0.0 if ((n <= -1.15e-154) || !(n <= 2.4e-137)) tmp = Float64(n * 100.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -1.15e-154) || ~((n <= 2.4e-137))) tmp = n * 100.0; else tmp = 0.0; end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -1.15e-154], N[Not[LessEqual[n, 2.4e-137]], $MachinePrecision]], N[(n * 100.0), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.15 \cdot 10^{-154} \lor \neg \left(n \leq 2.4 \cdot 10^{-137}\right):\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if n < -1.15e-154 or 2.4e-137 < n Initial program 19.7%
Taylor expanded in i around 0 57.3%
*-commutative57.3%
Simplified57.3%
if -1.15e-154 < n < 2.4e-137Initial program 55.7%
associate-*r/55.7%
sub-neg55.7%
distribute-rgt-in55.7%
metadata-eval55.7%
metadata-eval55.7%
Simplified55.7%
Taylor expanded in i around 0 77.2%
Taylor expanded in i around 0 77.2%
Final simplification60.6%
(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 25.6%
associate-*r/25.6%
sub-neg25.6%
distribute-rgt-in25.6%
metadata-eval25.6%
metadata-eval25.6%
Simplified25.6%
Taylor expanded in i around 0 17.3%
Taylor expanded in i around 0 17.6%
(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 2024085
(FPCore (i n)
:name "Compound Interest"
:precision binary64
:alt
(* 100.0 (/ (- (exp (* n (if (== (+ 1.0 (/ i n)) 1.0) (/ i n) (/ (* (/ i n) (log (+ 1.0 (/ i n)))) (- (+ (/ i n) 1.0) 1.0))))) 1.0) (/ i n)))
(* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))