
(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 24 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 (- INFINITY))
(* 100.0 (* (/ n i) t_1))
(if (<= t_2 0.0)
(/ (* n 100.0) (/ i (expm1 (* n (log1p (/ i n))))))
(if (<= t_2 INFINITY)
(* 100.0 (- (* t_0 (/ n i)) (/ n i)))
(/ (* n 100.0) (+ 1.0 (* (/ i n) 0.5))))))))
double code(double i, double n) {
double t_0 = pow((1.0 + (i / n)), n);
double t_1 = t_0 + -1.0;
double t_2 = t_1 / (i / n);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = 100.0 * ((n / i) * t_1);
} else if (t_2 <= 0.0) {
tmp = (n * 100.0) / (i / expm1((n * log1p((i / n)))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = 100.0 * ((t_0 * (n / i)) - (n / i));
} else {
tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = Math.pow((1.0 + (i / n)), n);
double t_1 = t_0 + -1.0;
double t_2 = t_1 / (i / n);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = 100.0 * ((n / i) * t_1);
} else if (t_2 <= 0.0) {
tmp = (n * 100.0) / (i / Math.expm1((n * Math.log1p((i / n)))));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = 100.0 * ((t_0 * (n / i)) - (n / i));
} else {
tmp = (n * 100.0) / (1.0 + ((i / n) * 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 <= -math.inf: tmp = 100.0 * ((n / i) * t_1) elif t_2 <= 0.0: tmp = (n * 100.0) / (i / math.expm1((n * math.log1p((i / n))))) elif t_2 <= math.inf: tmp = 100.0 * ((t_0 * (n / i)) - (n / i)) else: tmp = (n * 100.0) / (1.0 + ((i / n) * 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 <= Float64(-Inf)) tmp = Float64(100.0 * Float64(Float64(n / i) * t_1)); elseif (t_2 <= 0.0) tmp = Float64(Float64(n * 100.0) / Float64(i / expm1(Float64(n * log1p(Float64(i / n)))))); elseif (t_2 <= Inf) tmp = Float64(100.0 * Float64(Float64(t_0 * Float64(n / i)) - Float64(n / i))); else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(Float64(i / n) * 0.5))); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + -1.0), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(100.0 * N[(N[(n / i), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[(n * 100.0), $MachinePrecision] / N[(i / N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(100.0 * N[(N[(t$95$0 * N[(n / i), $MachinePrecision]), $MachinePrecision] - N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(N[(i / n), $MachinePrecision] * 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 -\infty:\\
\;\;\;\;100 \cdot \left(\frac{n}{i} \cdot t_1\right)\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;\frac{n \cdot 100}{\frac{i}{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;100 \cdot \left(t_0 \cdot \frac{n}{i} - \frac{n}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + \frac{i}{n} \cdot 0.5}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -inf.0Initial program 100.0%
div-sub100.0%
clear-num100.0%
sub-neg100.0%
div-inv100.0%
clear-num100.0%
Applied egg-rr100.0%
neg-mul-1100.0%
distribute-rgt-out100.0%
+-commutative100.0%
Simplified100.0%
if -inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0Initial program 27.0%
*-commutative27.0%
associate-/r/27.0%
sub-neg27.0%
metadata-eval27.0%
associate-*r*27.0%
*-commutative27.0%
clear-num27.0%
un-div-inv27.0%
metadata-eval27.0%
sub-neg27.0%
pow-to-exp27.0%
expm1-def39.9%
add-log-exp27.0%
pow-to-exp27.0%
log-pow39.9%
log1p-udef99.1%
Applied egg-rr99.1%
if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 98.6%
div-sub98.8%
clear-num98.8%
sub-neg98.8%
div-inv98.8%
clear-num98.8%
Applied egg-rr98.8%
sub-neg98.8%
Simplified98.8%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
*-commutative0.0%
associate-/r/2.0%
sub-neg2.0%
metadata-eval2.0%
associate-*r*2.0%
*-commutative2.0%
clear-num2.0%
un-div-inv2.0%
metadata-eval2.0%
sub-neg2.0%
pow-to-exp2.0%
expm1-def2.0%
add-log-exp2.0%
pow-to-exp2.0%
log-pow2.0%
log1p-udef2.0%
Applied egg-rr2.0%
Taylor expanded in i around 0 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in n around 0 100.0%
Final simplification99.3%
(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 -1e-42)
(* t_1 100.0)
(if (<= t_1 0.0)
(* 100.0 (* (/ n i) (expm1 (* n (log1p (/ i n))))))
(if (<= t_1 INFINITY)
(* 100.0 (- (* t_0 (/ n i)) (/ n i)))
(/ (* n 100.0) (+ 1.0 (* (/ i n) 0.5))))))))
double code(double i, double n) {
double t_0 = pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= -1e-42) {
tmp = t_1 * 100.0;
} else if (t_1 <= 0.0) {
tmp = 100.0 * ((n / i) * expm1((n * log1p((i / n)))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = 100.0 * ((t_0 * (n / i)) - (n / i));
} else {
tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = Math.pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= -1e-42) {
tmp = t_1 * 100.0;
} else if (t_1 <= 0.0) {
tmp = 100.0 * ((n / i) * Math.expm1((n * Math.log1p((i / n)))));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = 100.0 * ((t_0 * (n / i)) - (n / i));
} else {
tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5));
}
return tmp;
}
def code(i, n): t_0 = math.pow((1.0 + (i / n)), n) t_1 = (t_0 + -1.0) / (i / n) tmp = 0 if t_1 <= -1e-42: tmp = t_1 * 100.0 elif t_1 <= 0.0: tmp = 100.0 * ((n / i) * math.expm1((n * math.log1p((i / n))))) elif t_1 <= math.inf: tmp = 100.0 * ((t_0 * (n / i)) - (n / i)) else: tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5)) return tmp
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) ^ n t_1 = Float64(Float64(t_0 + -1.0) / Float64(i / n)) tmp = 0.0 if (t_1 <= -1e-42) tmp = Float64(t_1 * 100.0); elseif (t_1 <= 0.0) tmp = Float64(100.0 * Float64(Float64(n / i) * expm1(Float64(n * log1p(Float64(i / n)))))); elseif (t_1 <= Inf) tmp = Float64(100.0 * Float64(Float64(t_0 * Float64(n / i)) - Float64(n / i))); else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(Float64(i / n) * 0.5))); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-42], N[(t$95$1 * 100.0), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(100.0 * N[(N[(n / i), $MachinePrecision] * N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(100.0 * N[(N[(t$95$0 * N[(n / i), $MachinePrecision]), $MachinePrecision] - N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(N[(i / n), $MachinePrecision] * 0.5), $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 -1 \cdot 10^{-42}:\\
\;\;\;\;t_1 \cdot 100\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;100 \cdot \left(\frac{n}{i} \cdot \mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)\right)\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;100 \cdot \left(t_0 \cdot \frac{n}{i} - \frac{n}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + \frac{i}{n} \cdot 0.5}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -1.00000000000000004e-42Initial program 99.9%
if -1.00000000000000004e-42 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0Initial program 25.6%
clear-num25.6%
associate-/r/25.6%
clear-num25.6%
pow-to-exp25.6%
expm1-def38.7%
add-log-exp25.6%
pow-to-exp25.6%
log-pow38.7%
log1p-udef97.8%
Applied egg-rr97.8%
if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 98.6%
div-sub98.8%
clear-num98.8%
sub-neg98.8%
div-inv98.8%
clear-num98.8%
Applied egg-rr98.8%
sub-neg98.8%
Simplified98.8%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
*-commutative0.0%
associate-/r/2.0%
sub-neg2.0%
metadata-eval2.0%
associate-*r*2.0%
*-commutative2.0%
clear-num2.0%
un-div-inv2.0%
metadata-eval2.0%
sub-neg2.0%
pow-to-exp2.0%
expm1-def2.0%
add-log-exp2.0%
pow-to-exp2.0%
log-pow2.0%
log1p-udef2.0%
Applied egg-rr2.0%
Taylor expanded in i around 0 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in n around 0 100.0%
Final simplification98.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 -1e-42)
(* t_1 100.0)
(if (<= t_1 0.0)
(* 100.0 (* n (/ (expm1 (* n (log1p (/ i n)))) i)))
(if (<= t_1 INFINITY)
(* 100.0 (- (* t_0 (/ n i)) (/ n i)))
(/ (* n 100.0) (+ 1.0 (* (/ i n) 0.5))))))))
double code(double i, double n) {
double t_0 = pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= -1e-42) {
tmp = t_1 * 100.0;
} else if (t_1 <= 0.0) {
tmp = 100.0 * (n * (expm1((n * log1p((i / n)))) / i));
} else if (t_1 <= ((double) INFINITY)) {
tmp = 100.0 * ((t_0 * (n / i)) - (n / i));
} else {
tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = Math.pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= -1e-42) {
tmp = t_1 * 100.0;
} else if (t_1 <= 0.0) {
tmp = 100.0 * (n * (Math.expm1((n * Math.log1p((i / n)))) / i));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = 100.0 * ((t_0 * (n / i)) - (n / i));
} else {
tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5));
}
return tmp;
}
def code(i, n): t_0 = math.pow((1.0 + (i / n)), n) t_1 = (t_0 + -1.0) / (i / n) tmp = 0 if t_1 <= -1e-42: tmp = t_1 * 100.0 elif t_1 <= 0.0: tmp = 100.0 * (n * (math.expm1((n * math.log1p((i / n)))) / i)) elif t_1 <= math.inf: tmp = 100.0 * ((t_0 * (n / i)) - (n / i)) else: tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5)) return tmp
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) ^ n t_1 = Float64(Float64(t_0 + -1.0) / Float64(i / n)) tmp = 0.0 if (t_1 <= -1e-42) tmp = Float64(t_1 * 100.0); elseif (t_1 <= 0.0) tmp = Float64(100.0 * Float64(n * Float64(expm1(Float64(n * log1p(Float64(i / n)))) / i))); elseif (t_1 <= Inf) tmp = Float64(100.0 * Float64(Float64(t_0 * Float64(n / i)) - Float64(n / i))); else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(Float64(i / n) * 0.5))); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-42], N[(t$95$1 * 100.0), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(100.0 * N[(n * N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(100.0 * N[(N[(t$95$0 * N[(n / i), $MachinePrecision]), $MachinePrecision] - N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(N[(i / n), $MachinePrecision] * 0.5), $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 -1 \cdot 10^{-42}:\\
\;\;\;\;t_1 \cdot 100\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;100 \cdot \left(n \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{i}\right)\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;100 \cdot \left(t_0 \cdot \frac{n}{i} - \frac{n}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + \frac{i}{n} \cdot 0.5}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -1.00000000000000004e-42Initial program 99.9%
if -1.00000000000000004e-42 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0Initial program 25.6%
div-inv25.6%
associate-/r/25.6%
associate-*l*25.6%
div-inv25.6%
pow-to-exp25.6%
expm1-def38.7%
add-log-exp25.6%
pow-to-exp25.6%
log-pow38.7%
log1p-udef99.0%
Applied egg-rr99.0%
if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 98.6%
div-sub98.8%
clear-num98.8%
sub-neg98.8%
div-inv98.8%
clear-num98.8%
Applied egg-rr98.8%
sub-neg98.8%
Simplified98.8%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
*-commutative0.0%
associate-/r/2.0%
sub-neg2.0%
metadata-eval2.0%
associate-*r*2.0%
*-commutative2.0%
clear-num2.0%
un-div-inv2.0%
metadata-eval2.0%
sub-neg2.0%
pow-to-exp2.0%
expm1-def2.0%
add-log-exp2.0%
pow-to-exp2.0%
log-pow2.0%
log1p-udef2.0%
Applied egg-rr2.0%
Taylor expanded in i around 0 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in n around 0 100.0%
Final simplification99.3%
(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 -5e-94)
(* t_1 100.0)
(if (<= t_1 0.0)
(* n (* 100.0 (/ (expm1 (* n (log1p (/ i n)))) i)))
(if (<= t_1 INFINITY)
(* 100.0 (- (* t_0 (/ n i)) (/ n i)))
(/ (* n 100.0) (+ 1.0 (* (/ i n) 0.5))))))))
double code(double i, double n) {
double t_0 = pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= -5e-94) {
tmp = t_1 * 100.0;
} else if (t_1 <= 0.0) {
tmp = n * (100.0 * (expm1((n * log1p((i / n)))) / i));
} else if (t_1 <= ((double) INFINITY)) {
tmp = 100.0 * ((t_0 * (n / i)) - (n / i));
} else {
tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = Math.pow((1.0 + (i / n)), n);
double t_1 = (t_0 + -1.0) / (i / n);
double tmp;
if (t_1 <= -5e-94) {
tmp = t_1 * 100.0;
} else if (t_1 <= 0.0) {
tmp = n * (100.0 * (Math.expm1((n * Math.log1p((i / n)))) / i));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = 100.0 * ((t_0 * (n / i)) - (n / i));
} else {
tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5));
}
return tmp;
}
def code(i, n): t_0 = math.pow((1.0 + (i / n)), n) t_1 = (t_0 + -1.0) / (i / n) tmp = 0 if t_1 <= -5e-94: tmp = t_1 * 100.0 elif t_1 <= 0.0: tmp = n * (100.0 * (math.expm1((n * math.log1p((i / n)))) / i)) elif t_1 <= math.inf: tmp = 100.0 * ((t_0 * (n / i)) - (n / i)) else: tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5)) return tmp
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) ^ n t_1 = Float64(Float64(t_0 + -1.0) / Float64(i / n)) tmp = 0.0 if (t_1 <= -5e-94) tmp = Float64(t_1 * 100.0); elseif (t_1 <= 0.0) tmp = Float64(n * Float64(100.0 * Float64(expm1(Float64(n * log1p(Float64(i / n)))) / i))); elseif (t_1 <= Inf) tmp = Float64(100.0 * Float64(Float64(t_0 * Float64(n / i)) - Float64(n / i))); else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(Float64(i / n) * 0.5))); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-94], N[(t$95$1 * 100.0), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(n * N[(100.0 * N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(100.0 * N[(N[(t$95$0 * N[(n / i), $MachinePrecision]), $MachinePrecision] - N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(N[(i / n), $MachinePrecision] * 0.5), $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 -5 \cdot 10^{-94}:\\
\;\;\;\;t_1 \cdot 100\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{i}\right)\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;100 \cdot \left(t_0 \cdot \frac{n}{i} - \frac{n}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + \frac{i}{n} \cdot 0.5}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -4.9999999999999995e-94Initial program 99.7%
if -4.9999999999999995e-94 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0Initial program 23.7%
*-commutative23.7%
associate-/r/23.8%
sub-neg23.8%
metadata-eval23.8%
associate-*r*23.7%
*-commutative23.7%
clear-num23.7%
un-div-inv23.8%
metadata-eval23.8%
sub-neg23.8%
pow-to-exp23.8%
expm1-def37.2%
add-log-exp23.8%
pow-to-exp23.8%
log-pow37.2%
log1p-udef99.1%
Applied egg-rr99.1%
div-inv99.0%
clear-num99.0%
Applied egg-rr99.0%
associate-*l*99.1%
Simplified99.1%
if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 98.6%
div-sub98.8%
clear-num98.8%
sub-neg98.8%
div-inv98.8%
clear-num98.8%
Applied egg-rr98.8%
sub-neg98.8%
Simplified98.8%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
*-commutative0.0%
associate-/r/2.0%
sub-neg2.0%
metadata-eval2.0%
associate-*r*2.0%
*-commutative2.0%
clear-num2.0%
un-div-inv2.0%
metadata-eval2.0%
sub-neg2.0%
pow-to-exp2.0%
expm1-def2.0%
add-log-exp2.0%
pow-to-exp2.0%
log-pow2.0%
log1p-udef2.0%
Applied egg-rr2.0%
Taylor expanded in i around 0 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in n around 0 100.0%
Final simplification99.3%
(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-24)
(* 100.0 (* (/ n i) t_1))
(if (<= t_2 0.0)
(* n (* (expm1 (* n (log1p (/ i n)))) (/ 100.0 i)))
(if (<= t_2 INFINITY)
(* 100.0 (- (* t_0 (/ n i)) (/ n i)))
(/ (* n 100.0) (+ 1.0 (* (/ i n) 0.5))))))))
double code(double i, double n) {
double t_0 = pow((1.0 + (i / n)), n);
double t_1 = t_0 + -1.0;
double t_2 = t_1 / (i / n);
double tmp;
if (t_2 <= -5e-24) {
tmp = 100.0 * ((n / i) * t_1);
} else if (t_2 <= 0.0) {
tmp = n * (expm1((n * log1p((i / n)))) * (100.0 / i));
} else if (t_2 <= ((double) INFINITY)) {
tmp = 100.0 * ((t_0 * (n / i)) - (n / i));
} else {
tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5));
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = Math.pow((1.0 + (i / n)), n);
double t_1 = t_0 + -1.0;
double t_2 = t_1 / (i / n);
double tmp;
if (t_2 <= -5e-24) {
tmp = 100.0 * ((n / i) * t_1);
} else if (t_2 <= 0.0) {
tmp = n * (Math.expm1((n * Math.log1p((i / n)))) * (100.0 / i));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = 100.0 * ((t_0 * (n / i)) - (n / i));
} else {
tmp = (n * 100.0) / (1.0 + ((i / n) * 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-24: tmp = 100.0 * ((n / i) * t_1) elif t_2 <= 0.0: tmp = n * (math.expm1((n * math.log1p((i / n)))) * (100.0 / i)) elif t_2 <= math.inf: tmp = 100.0 * ((t_0 * (n / i)) - (n / i)) else: tmp = (n * 100.0) / (1.0 + ((i / n) * 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-24) tmp = Float64(100.0 * Float64(Float64(n / i) * t_1)); elseif (t_2 <= 0.0) tmp = Float64(n * Float64(expm1(Float64(n * log1p(Float64(i / n)))) * Float64(100.0 / i))); elseif (t_2 <= Inf) tmp = Float64(100.0 * Float64(Float64(t_0 * Float64(n / i)) - Float64(n / i))); else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(Float64(i / n) * 0.5))); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(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-24], N[(100.0 * N[(N[(n / i), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(n * N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] * N[(100.0 / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(100.0 * N[(N[(t$95$0 * N[(n / i), $MachinePrecision]), $MachinePrecision] - N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(N[(i / n), $MachinePrecision] * 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^{-24}:\\
\;\;\;\;100 \cdot \left(\frac{n}{i} \cdot t_1\right)\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;n \cdot \left(\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot \frac{100}{i}\right)\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;100 \cdot \left(t_0 \cdot \frac{n}{i} - \frac{n}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + \frac{i}{n} \cdot 0.5}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -4.9999999999999998e-24Initial program 100.0%
div-sub100.0%
clear-num100.0%
sub-neg100.0%
div-inv100.0%
clear-num100.0%
Applied egg-rr100.0%
neg-mul-1100.0%
distribute-rgt-out100.0%
+-commutative100.0%
Simplified100.0%
if -4.9999999999999998e-24 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0Initial program 26.5%
clear-num26.5%
associate-/r/26.5%
clear-num26.5%
pow-to-exp26.5%
expm1-def39.4%
add-log-exp26.5%
pow-to-exp26.5%
log-pow39.4%
log1p-udef97.8%
Applied egg-rr97.8%
expm1-log1p-u80.5%
expm1-udef43.9%
Applied egg-rr43.9%
expm1-def80.5%
expm1-log1p97.8%
associate-/r/99.0%
associate-*r/99.1%
*-commutative99.1%
associate-*r/99.1%
associate-/r/99.1%
Simplified99.1%
if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0Initial program 98.6%
div-sub98.8%
clear-num98.8%
sub-neg98.8%
div-inv98.8%
clear-num98.8%
Applied egg-rr98.8%
sub-neg98.8%
Simplified98.8%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) Initial program 0.0%
*-commutative0.0%
associate-/r/2.0%
sub-neg2.0%
metadata-eval2.0%
associate-*r*2.0%
*-commutative2.0%
clear-num2.0%
un-div-inv2.0%
metadata-eval2.0%
sub-neg2.0%
pow-to-exp2.0%
expm1-def2.0%
add-log-exp2.0%
pow-to-exp2.0%
log-pow2.0%
log1p-udef2.0%
Applied egg-rr2.0%
Taylor expanded in i around 0 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in n around 0 100.0%
Final simplification99.3%
(FPCore (i n)
:precision binary64
(if (<= n -2050.0)
(/ (* n 100.0) (/ i (expm1 i)))
(if (<= n 0.58)
(* n (/ 1.0 (* (fma i (+ (/ 0.5 n) -0.5) 1.0) 0.01)))
(* n (* 100.0 (/ (expm1 i) i))))))
double code(double i, double n) {
double tmp;
if (n <= -2050.0) {
tmp = (n * 100.0) / (i / expm1(i));
} else if (n <= 0.58) {
tmp = n * (1.0 / (fma(i, ((0.5 / n) + -0.5), 1.0) * 0.01));
} else {
tmp = n * (100.0 * (expm1(i) / i));
}
return tmp;
}
function code(i, n) tmp = 0.0 if (n <= -2050.0) tmp = Float64(Float64(n * 100.0) / Float64(i / expm1(i))); elseif (n <= 0.58) tmp = Float64(n * Float64(1.0 / Float64(fma(i, Float64(Float64(0.5 / n) + -0.5), 1.0) * 0.01))); else tmp = Float64(n * Float64(100.0 * Float64(expm1(i) / i))); end return tmp end
code[i_, n_] := If[LessEqual[n, -2050.0], N[(N[(n * 100.0), $MachinePrecision] / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 0.58], N[(n * N[(1.0 / N[(N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * 0.01), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2050:\\
\;\;\;\;\frac{n \cdot 100}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{elif}\;n \leq 0.58:\\
\;\;\;\;n \cdot \frac{1}{\mathsf{fma}\left(i, \frac{0.5}{n} + -0.5, 1\right) \cdot 0.01}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\
\end{array}
\end{array}
if n < -2050Initial program 29.0%
Taylor expanded in n around inf 38.8%
*-commutative38.8%
associate-/l*38.8%
expm1-def87.8%
Simplified87.8%
associate-*l/87.8%
Applied egg-rr87.8%
if -2050 < n < 0.57999999999999996Initial program 35.5%
*-commutative35.5%
associate-/r/35.6%
sub-neg35.6%
metadata-eval35.6%
associate-*r*35.6%
*-commutative35.6%
clear-num35.6%
un-div-inv35.6%
metadata-eval35.6%
sub-neg35.6%
pow-to-exp35.6%
expm1-def57.1%
add-log-exp35.6%
pow-to-exp35.6%
log-pow57.1%
log1p-udef90.9%
Applied egg-rr90.9%
Taylor expanded in i around 0 80.4%
sub-neg80.4%
associate-*r/80.4%
metadata-eval80.4%
metadata-eval80.4%
Simplified80.4%
associate-/l*80.4%
div-inv80.4%
div-inv80.4%
+-commutative80.4%
fma-def80.4%
metadata-eval80.4%
Applied egg-rr80.4%
if 0.57999999999999996 < n Initial program 29.1%
Taylor expanded in n around inf 45.0%
*-commutative45.0%
associate-/l*44.9%
expm1-def92.6%
Simplified92.6%
associate-*l/92.7%
Applied egg-rr92.7%
Taylor expanded in n around 0 45.0%
expm1-def92.6%
associate-/l*92.6%
associate-*r/92.7%
associate-*l/92.6%
*-commutative92.6%
associate-/r/92.6%
Simplified92.6%
Taylor expanded in i around inf 45.0%
expm1-def92.7%
Simplified92.7%
Final simplification86.5%
(FPCore (i n)
:precision binary64
(if (<= n -2050.0)
(/ (* n 100.0) (/ i (expm1 i)))
(if (<= n 0.58)
(* (* n 100.0) (/ 1.0 (fma i (+ (/ 0.5 n) -0.5) 1.0)))
(* n (* 100.0 (/ (expm1 i) i))))))
double code(double i, double n) {
double tmp;
if (n <= -2050.0) {
tmp = (n * 100.0) / (i / expm1(i));
} else if (n <= 0.58) {
tmp = (n * 100.0) * (1.0 / fma(i, ((0.5 / n) + -0.5), 1.0));
} else {
tmp = n * (100.0 * (expm1(i) / i));
}
return tmp;
}
function code(i, n) tmp = 0.0 if (n <= -2050.0) tmp = Float64(Float64(n * 100.0) / Float64(i / expm1(i))); elseif (n <= 0.58) tmp = Float64(Float64(n * 100.0) * Float64(1.0 / fma(i, Float64(Float64(0.5 / n) + -0.5), 1.0))); else tmp = Float64(n * Float64(100.0 * Float64(expm1(i) / i))); end return tmp end
code[i_, n_] := If[LessEqual[n, -2050.0], N[(N[(n * 100.0), $MachinePrecision] / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 0.58], N[(N[(n * 100.0), $MachinePrecision] * N[(1.0 / N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2050:\\
\;\;\;\;\frac{n \cdot 100}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{elif}\;n \leq 0.58:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \frac{1}{\mathsf{fma}\left(i, \frac{0.5}{n} + -0.5, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\
\end{array}
\end{array}
if n < -2050Initial program 29.0%
Taylor expanded in n around inf 38.8%
*-commutative38.8%
associate-/l*38.8%
expm1-def87.8%
Simplified87.8%
associate-*l/87.8%
Applied egg-rr87.8%
if -2050 < n < 0.57999999999999996Initial program 35.5%
*-commutative35.5%
associate-/r/35.6%
sub-neg35.6%
metadata-eval35.6%
associate-*r*35.6%
*-commutative35.6%
clear-num35.6%
un-div-inv35.6%
metadata-eval35.6%
sub-neg35.6%
pow-to-exp35.6%
expm1-def57.1%
add-log-exp35.6%
pow-to-exp35.6%
log-pow57.1%
log1p-udef90.9%
Applied egg-rr90.9%
Taylor expanded in i around 0 80.4%
sub-neg80.4%
associate-*r/80.4%
metadata-eval80.4%
metadata-eval80.4%
Simplified80.4%
div-inv80.4%
*-commutative80.4%
+-commutative80.4%
fma-def80.4%
Applied egg-rr80.4%
if 0.57999999999999996 < n Initial program 29.1%
Taylor expanded in n around inf 45.0%
*-commutative45.0%
associate-/l*44.9%
expm1-def92.6%
Simplified92.6%
associate-*l/92.7%
Applied egg-rr92.7%
Taylor expanded in n around 0 45.0%
expm1-def92.6%
associate-/l*92.6%
associate-*r/92.7%
associate-*l/92.6%
*-commutative92.6%
associate-/r/92.6%
Simplified92.6%
Taylor expanded in i around inf 45.0%
expm1-def92.7%
Simplified92.7%
Final simplification86.5%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* 100.0 (/ (expm1 i) (/ i n)))))
(if (<= i -2.1e-15)
t_0
(if (<= i 1.6e-20)
(/ (* n 100.0) (+ 1.0 (* (/ i n) 0.5)))
(if (<= i 6.8e+229)
t_0
(if (<= i 6.3e+255)
(/ 100.0 (/ (+ 1.0 (* i -0.5)) n))
(* 100.0 (/ (* i n) i))))))))
double code(double i, double n) {
double t_0 = 100.0 * (expm1(i) / (i / n));
double tmp;
if (i <= -2.1e-15) {
tmp = t_0;
} else if (i <= 1.6e-20) {
tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5));
} else if (i <= 6.8e+229) {
tmp = t_0;
} else if (i <= 6.3e+255) {
tmp = 100.0 / ((1.0 + (i * -0.5)) / n);
} else {
tmp = 100.0 * ((i * n) / i);
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = 100.0 * (Math.expm1(i) / (i / n));
double tmp;
if (i <= -2.1e-15) {
tmp = t_0;
} else if (i <= 1.6e-20) {
tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5));
} else if (i <= 6.8e+229) {
tmp = t_0;
} else if (i <= 6.3e+255) {
tmp = 100.0 / ((1.0 + (i * -0.5)) / n);
} else {
tmp = 100.0 * ((i * n) / i);
}
return tmp;
}
def code(i, n): t_0 = 100.0 * (math.expm1(i) / (i / n)) tmp = 0 if i <= -2.1e-15: tmp = t_0 elif i <= 1.6e-20: tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5)) elif i <= 6.8e+229: tmp = t_0 elif i <= 6.3e+255: tmp = 100.0 / ((1.0 + (i * -0.5)) / n) else: tmp = 100.0 * ((i * n) / i) return tmp
function code(i, n) t_0 = Float64(100.0 * Float64(expm1(i) / Float64(i / n))) tmp = 0.0 if (i <= -2.1e-15) tmp = t_0; elseif (i <= 1.6e-20) tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(Float64(i / n) * 0.5))); elseif (i <= 6.8e+229) tmp = t_0; elseif (i <= 6.3e+255) tmp = Float64(100.0 / Float64(Float64(1.0 + Float64(i * -0.5)) / n)); else tmp = Float64(100.0 * Float64(Float64(i * n) / i)); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -2.1e-15], t$95$0, If[LessEqual[i, 1.6e-20], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(N[(i / n), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 6.8e+229], t$95$0, If[LessEqual[i, 6.3e+255], N[(100.0 / N[(N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(N[(i * n), $MachinePrecision] / i), $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 -2.1 \cdot 10^{-15}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;i \leq 1.6 \cdot 10^{-20}:\\
\;\;\;\;\frac{n \cdot 100}{1 + \frac{i}{n} \cdot 0.5}\\
\mathbf{elif}\;i \leq 6.8 \cdot 10^{+229}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;i \leq 6.3 \cdot 10^{+255}:\\
\;\;\;\;\frac{100}{\frac{1 + i \cdot -0.5}{n}}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{i \cdot n}{i}\\
\end{array}
\end{array}
if i < -2.09999999999999981e-15 or 1.59999999999999985e-20 < i < 6.8000000000000002e229Initial program 55.0%
Taylor expanded in n around inf 68.2%
expm1-def69.2%
Simplified69.2%
if -2.09999999999999981e-15 < i < 1.59999999999999985e-20Initial program 8.3%
*-commutative8.3%
associate-/r/9.0%
sub-neg9.0%
metadata-eval9.0%
associate-*r*9.0%
*-commutative9.0%
clear-num9.0%
un-div-inv9.0%
metadata-eval9.0%
sub-neg9.0%
pow-to-exp9.0%
expm1-def18.5%
add-log-exp9.0%
pow-to-exp9.0%
log-pow18.5%
log1p-udef65.1%
Applied egg-rr65.1%
Taylor expanded in i around 0 92.3%
sub-neg92.3%
associate-*r/92.3%
metadata-eval92.3%
metadata-eval92.3%
Simplified92.3%
Taylor expanded in n around 0 92.3%
if 6.8000000000000002e229 < i < 6.3e255Initial program 33.1%
Taylor expanded in n around inf 1.4%
*-commutative1.4%
associate-/l*1.4%
expm1-def1.4%
Simplified1.4%
*-commutative1.4%
clear-num1.4%
un-div-inv1.4%
Applied egg-rr1.4%
Taylor expanded in i around 0 72.9%
*-commutative54.5%
Simplified72.9%
if 6.3e255 < i Initial program 83.3%
div-sub83.3%
clear-num83.3%
sub-neg83.3%
div-inv83.3%
clear-num83.3%
Applied egg-rr83.3%
sub-neg83.3%
Simplified83.3%
associate-*r/83.6%
sub-div83.6%
Applied egg-rr83.6%
Taylor expanded in i around 0 76.3%
Final simplification81.6%
(FPCore (i n) :precision binary64 (if (or (<= n -2050.0) (not (<= n 0.58))) (* n (* 100.0 (/ (expm1 i) i))) (/ (* n 100.0) (+ 1.0 (* i (+ (/ 0.5 n) -0.5))))))
double code(double i, double n) {
double tmp;
if ((n <= -2050.0) || !(n <= 0.58)) {
tmp = n * (100.0 * (expm1(i) / i));
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((n <= -2050.0) || !(n <= 0.58)) {
tmp = n * (100.0 * (Math.expm1(i) / i));
} else {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -2050.0) or not (n <= 0.58): tmp = n * (100.0 * (math.expm1(i) / i)) else: tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))) return tmp
function code(i, n) tmp = 0.0 if ((n <= -2050.0) || !(n <= 0.58)) tmp = Float64(n * Float64(100.0 * Float64(expm1(i) / i))); else tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * Float64(Float64(0.5 / n) + -0.5)))); end return tmp end
code[i_, n_] := If[Or[LessEqual[n, -2050.0], N[Not[LessEqual[n, 0.58]], $MachinePrecision]], N[(n * N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2050 \lor \neg \left(n \leq 0.58\right):\\
\;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot \left(\frac{0.5}{n} + -0.5\right)}\\
\end{array}
\end{array}
if n < -2050 or 0.57999999999999996 < n Initial program 29.1%
Taylor expanded in n around inf 42.1%
*-commutative42.1%
associate-/l*42.0%
expm1-def90.3%
Simplified90.3%
associate-*l/90.4%
Applied egg-rr90.4%
Taylor expanded in n around 0 42.1%
expm1-def90.3%
associate-/l*90.3%
associate-*r/90.4%
associate-*l/90.3%
*-commutative90.3%
associate-/r/89.7%
Simplified89.7%
Taylor expanded in i around inf 42.0%
expm1-def90.3%
Simplified90.3%
if -2050 < n < 0.57999999999999996Initial program 35.5%
*-commutative35.5%
associate-/r/35.6%
sub-neg35.6%
metadata-eval35.6%
associate-*r*35.6%
*-commutative35.6%
clear-num35.6%
un-div-inv35.6%
metadata-eval35.6%
sub-neg35.6%
pow-to-exp35.6%
expm1-def57.1%
add-log-exp35.6%
pow-to-exp35.6%
log-pow57.1%
log1p-udef90.9%
Applied egg-rr90.9%
Taylor expanded in i around 0 80.4%
sub-neg80.4%
associate-*r/80.4%
metadata-eval80.4%
metadata-eval80.4%
Simplified80.4%
Final simplification86.4%
(FPCore (i n)
:precision binary64
(let* ((t_0 (/ (expm1 i) i)))
(if (<= n -2050.0)
(* 100.0 (* n t_0))
(if (<= n 0.58)
(/ (* n 100.0) (+ 1.0 (* i (+ (/ 0.5 n) -0.5))))
(* n (* 100.0 t_0))))))
double code(double i, double n) {
double t_0 = expm1(i) / i;
double tmp;
if (n <= -2050.0) {
tmp = 100.0 * (n * t_0);
} else if (n <= 0.58) {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
} else {
tmp = n * (100.0 * t_0);
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = Math.expm1(i) / i;
double tmp;
if (n <= -2050.0) {
tmp = 100.0 * (n * t_0);
} else if (n <= 0.58) {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
} else {
tmp = n * (100.0 * t_0);
}
return tmp;
}
def code(i, n): t_0 = math.expm1(i) / i tmp = 0 if n <= -2050.0: tmp = 100.0 * (n * t_0) elif n <= 0.58: tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))) else: tmp = n * (100.0 * t_0) return tmp
function code(i, n) t_0 = Float64(expm1(i) / i) tmp = 0.0 if (n <= -2050.0) tmp = Float64(100.0 * Float64(n * t_0)); elseif (n <= 0.58) tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * Float64(Float64(0.5 / n) + -0.5)))); else tmp = Float64(n * Float64(100.0 * t_0)); end return tmp end
code[i_, n_] := Block[{t$95$0 = N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]}, If[LessEqual[n, -2050.0], N[(100.0 * N[(n * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 0.58], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{expm1}\left(i\right)}{i}\\
\mathbf{if}\;n \leq -2050:\\
\;\;\;\;100 \cdot \left(n \cdot t_0\right)\\
\mathbf{elif}\;n \leq 0.58:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot \left(\frac{0.5}{n} + -0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 \cdot t_0\right)\\
\end{array}
\end{array}
if n < -2050Initial program 29.0%
Taylor expanded in n around inf 38.8%
*-commutative38.8%
associate-/l*38.8%
expm1-def87.8%
Simplified87.8%
Taylor expanded in n around 0 38.8%
expm1-def87.7%
associate-*r/87.8%
Simplified87.8%
if -2050 < n < 0.57999999999999996Initial program 35.5%
*-commutative35.5%
associate-/r/35.6%
sub-neg35.6%
metadata-eval35.6%
associate-*r*35.6%
*-commutative35.6%
clear-num35.6%
un-div-inv35.6%
metadata-eval35.6%
sub-neg35.6%
pow-to-exp35.6%
expm1-def57.1%
add-log-exp35.6%
pow-to-exp35.6%
log-pow57.1%
log1p-udef90.9%
Applied egg-rr90.9%
Taylor expanded in i around 0 80.4%
sub-neg80.4%
associate-*r/80.4%
metadata-eval80.4%
metadata-eval80.4%
Simplified80.4%
if 0.57999999999999996 < n Initial program 29.1%
Taylor expanded in n around inf 45.0%
*-commutative45.0%
associate-/l*44.9%
expm1-def92.6%
Simplified92.6%
associate-*l/92.7%
Applied egg-rr92.7%
Taylor expanded in n around 0 45.0%
expm1-def92.6%
associate-/l*92.6%
associate-*r/92.7%
associate-*l/92.6%
*-commutative92.6%
associate-/r/92.6%
Simplified92.6%
Taylor expanded in i around inf 45.0%
expm1-def92.7%
Simplified92.7%
Final simplification86.5%
(FPCore (i n)
:precision binary64
(if (<= n -2050.0)
(/ (* n 100.0) (/ i (expm1 i)))
(if (<= n 0.58)
(/ (* n 100.0) (+ 1.0 (* i (+ (/ 0.5 n) -0.5))))
(* n (* 100.0 (/ (expm1 i) i))))))
double code(double i, double n) {
double tmp;
if (n <= -2050.0) {
tmp = (n * 100.0) / (i / expm1(i));
} else if (n <= 0.58) {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
} else {
tmp = n * (100.0 * (expm1(i) / i));
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (n <= -2050.0) {
tmp = (n * 100.0) / (i / Math.expm1(i));
} else if (n <= 0.58) {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
} else {
tmp = n * (100.0 * (Math.expm1(i) / i));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -2050.0: tmp = (n * 100.0) / (i / math.expm1(i)) elif n <= 0.58: tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))) else: tmp = n * (100.0 * (math.expm1(i) / i)) return tmp
function code(i, n) tmp = 0.0 if (n <= -2050.0) tmp = Float64(Float64(n * 100.0) / Float64(i / expm1(i))); elseif (n <= 0.58) tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * Float64(Float64(0.5 / n) + -0.5)))); else tmp = Float64(n * Float64(100.0 * Float64(expm1(i) / i))); end return tmp end
code[i_, n_] := If[LessEqual[n, -2050.0], N[(N[(n * 100.0), $MachinePrecision] / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 0.58], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2050:\\
\;\;\;\;\frac{n \cdot 100}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{elif}\;n \leq 0.58:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot \left(\frac{0.5}{n} + -0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\
\end{array}
\end{array}
if n < -2050Initial program 29.0%
Taylor expanded in n around inf 38.8%
*-commutative38.8%
associate-/l*38.8%
expm1-def87.8%
Simplified87.8%
associate-*l/87.8%
Applied egg-rr87.8%
if -2050 < n < 0.57999999999999996Initial program 35.5%
*-commutative35.5%
associate-/r/35.6%
sub-neg35.6%
metadata-eval35.6%
associate-*r*35.6%
*-commutative35.6%
clear-num35.6%
un-div-inv35.6%
metadata-eval35.6%
sub-neg35.6%
pow-to-exp35.6%
expm1-def57.1%
add-log-exp35.6%
pow-to-exp35.6%
log-pow57.1%
log1p-udef90.9%
Applied egg-rr90.9%
Taylor expanded in i around 0 80.4%
sub-neg80.4%
associate-*r/80.4%
metadata-eval80.4%
metadata-eval80.4%
Simplified80.4%
if 0.57999999999999996 < n Initial program 29.1%
Taylor expanded in n around inf 45.0%
*-commutative45.0%
associate-/l*44.9%
expm1-def92.6%
Simplified92.6%
associate-*l/92.7%
Applied egg-rr92.7%
Taylor expanded in n around 0 45.0%
expm1-def92.6%
associate-/l*92.6%
associate-*r/92.7%
associate-*l/92.6%
*-commutative92.6%
associate-/r/92.6%
Simplified92.6%
Taylor expanded in i around inf 45.0%
expm1-def92.7%
Simplified92.7%
Final simplification86.5%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* 200.0 (/ (* n n) i))))
(if (<= i -1600000000000.0)
t_0
(if (<= i 5.7e-188)
(* n 100.0)
(if (<= i 29.0)
(* 100.0 (/ (* i n) i))
(if (or (<= i 1.35e+260) (not (<= i 8.5e+283)))
t_0
(* (* i n) 50.0)))))))
double code(double i, double n) {
double t_0 = 200.0 * ((n * n) / i);
double tmp;
if (i <= -1600000000000.0) {
tmp = t_0;
} else if (i <= 5.7e-188) {
tmp = n * 100.0;
} else if (i <= 29.0) {
tmp = 100.0 * ((i * n) / i);
} else if ((i <= 1.35e+260) || !(i <= 8.5e+283)) {
tmp = t_0;
} else {
tmp = (i * n) * 50.0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = 200.0d0 * ((n * n) / i)
if (i <= (-1600000000000.0d0)) then
tmp = t_0
else if (i <= 5.7d-188) then
tmp = n * 100.0d0
else if (i <= 29.0d0) then
tmp = 100.0d0 * ((i * n) / i)
else if ((i <= 1.35d+260) .or. (.not. (i <= 8.5d+283))) then
tmp = t_0
else
tmp = (i * n) * 50.0d0
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = 200.0 * ((n * n) / i);
double tmp;
if (i <= -1600000000000.0) {
tmp = t_0;
} else if (i <= 5.7e-188) {
tmp = n * 100.0;
} else if (i <= 29.0) {
tmp = 100.0 * ((i * n) / i);
} else if ((i <= 1.35e+260) || !(i <= 8.5e+283)) {
tmp = t_0;
} else {
tmp = (i * n) * 50.0;
}
return tmp;
}
def code(i, n): t_0 = 200.0 * ((n * n) / i) tmp = 0 if i <= -1600000000000.0: tmp = t_0 elif i <= 5.7e-188: tmp = n * 100.0 elif i <= 29.0: tmp = 100.0 * ((i * n) / i) elif (i <= 1.35e+260) or not (i <= 8.5e+283): tmp = t_0 else: tmp = (i * n) * 50.0 return tmp
function code(i, n) t_0 = Float64(200.0 * Float64(Float64(n * n) / i)) tmp = 0.0 if (i <= -1600000000000.0) tmp = t_0; elseif (i <= 5.7e-188) tmp = Float64(n * 100.0); elseif (i <= 29.0) tmp = Float64(100.0 * Float64(Float64(i * n) / i)); elseif ((i <= 1.35e+260) || !(i <= 8.5e+283)) tmp = t_0; else tmp = Float64(Float64(i * n) * 50.0); end return tmp end
function tmp_2 = code(i, n) t_0 = 200.0 * ((n * n) / i); tmp = 0.0; if (i <= -1600000000000.0) tmp = t_0; elseif (i <= 5.7e-188) tmp = n * 100.0; elseif (i <= 29.0) tmp = 100.0 * ((i * n) / i); elseif ((i <= 1.35e+260) || ~((i <= 8.5e+283))) tmp = t_0; else tmp = (i * n) * 50.0; end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(200.0 * N[(N[(n * n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1600000000000.0], t$95$0, If[LessEqual[i, 5.7e-188], N[(n * 100.0), $MachinePrecision], If[LessEqual[i, 29.0], N[(100.0 * N[(N[(i * n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[i, 1.35e+260], N[Not[LessEqual[i, 8.5e+283]], $MachinePrecision]], t$95$0, N[(N[(i * n), $MachinePrecision] * 50.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 200 \cdot \frac{n \cdot n}{i}\\
\mathbf{if}\;i \leq -1600000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;i \leq 5.7 \cdot 10^{-188}:\\
\;\;\;\;n \cdot 100\\
\mathbf{elif}\;i \leq 29:\\
\;\;\;\;100 \cdot \frac{i \cdot n}{i}\\
\mathbf{elif}\;i \leq 1.35 \cdot 10^{+260} \lor \neg \left(i \leq 8.5 \cdot 10^{+283}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot n\right) \cdot 50\\
\end{array}
\end{array}
if i < -1.6e12 or 29 < i < 1.3499999999999999e260 or 8.5000000000000008e283 < i Initial program 56.1%
*-commutative56.1%
associate-/r/56.2%
sub-neg56.2%
metadata-eval56.2%
associate-*r*56.2%
*-commutative56.2%
clear-num56.2%
un-div-inv56.2%
metadata-eval56.2%
sub-neg56.2%
pow-to-exp42.6%
expm1-def50.6%
add-log-exp42.6%
pow-to-exp56.2%
log-pow50.6%
log1p-udef78.2%
Applied egg-rr78.2%
Taylor expanded in i around 0 36.5%
sub-neg36.5%
associate-*r/36.5%
metadata-eval36.5%
metadata-eval36.5%
Simplified36.5%
Taylor expanded in n around 0 43.2%
unpow243.2%
Simplified43.2%
if -1.6e12 < i < 5.70000000000000025e-188Initial program 4.4%
Taylor expanded in i around 0 88.4%
*-commutative88.4%
Simplified88.4%
if 5.70000000000000025e-188 < i < 29Initial program 18.3%
div-sub18.3%
clear-num16.3%
sub-neg16.3%
div-inv16.3%
clear-num18.3%
Applied egg-rr18.3%
sub-neg18.3%
Simplified18.3%
associate-*r/18.3%
sub-div18.7%
Applied egg-rr18.7%
Taylor expanded in i around 0 82.1%
if 1.3499999999999999e260 < i < 8.5000000000000008e283Initial program 100.0%
Taylor expanded in i around 0 100.0%
unpow2100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in i around inf 100.0%
associate-*r*100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in n around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification68.4%
(FPCore (i n)
:precision binary64
(if (<= n -3e+179)
(* 100.0 (/ (* i n) i))
(if (<= n 0.58)
(/ (* n 100.0) (+ 1.0 (* (/ i n) 0.5)))
(* 100.0 (/ n (/ i (+ i (* i (* i 0.5)))))))))
double code(double i, double n) {
double tmp;
if (n <= -3e+179) {
tmp = 100.0 * ((i * n) / i);
} else if (n <= 0.58) {
tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5));
} else {
tmp = 100.0 * (n / (i / (i + (i * (i * 0.5)))));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-3d+179)) then
tmp = 100.0d0 * ((i * n) / i)
else if (n <= 0.58d0) then
tmp = (n * 100.0d0) / (1.0d0 + ((i / n) * 0.5d0))
else
tmp = 100.0d0 * (n / (i / (i + (i * (i * 0.5d0)))))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -3e+179) {
tmp = 100.0 * ((i * n) / i);
} else if (n <= 0.58) {
tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5));
} else {
tmp = 100.0 * (n / (i / (i + (i * (i * 0.5)))));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -3e+179: tmp = 100.0 * ((i * n) / i) elif n <= 0.58: tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5)) else: tmp = 100.0 * (n / (i / (i + (i * (i * 0.5))))) return tmp
function code(i, n) tmp = 0.0 if (n <= -3e+179) tmp = Float64(100.0 * Float64(Float64(i * n) / i)); elseif (n <= 0.58) tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(Float64(i / n) * 0.5))); else tmp = Float64(100.0 * Float64(n / Float64(i / Float64(i + Float64(i * Float64(i * 0.5)))))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -3e+179) tmp = 100.0 * ((i * n) / i); elseif (n <= 0.58) tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5)); else tmp = 100.0 * (n / (i / (i + (i * (i * 0.5))))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -3e+179], N[(100.0 * N[(N[(i * n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 0.58], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(N[(i / n), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n / N[(i / N[(i + N[(i * N[(i * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -3 \cdot 10^{+179}:\\
\;\;\;\;100 \cdot \frac{i \cdot n}{i}\\
\mathbf{elif}\;n \leq 0.58:\\
\;\;\;\;\frac{n \cdot 100}{1 + \frac{i}{n} \cdot 0.5}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{i + i \cdot \left(i \cdot 0.5\right)}}\\
\end{array}
\end{array}
if n < -2.9999999999999998e179Initial program 15.4%
div-sub15.4%
clear-num15.6%
sub-neg15.6%
div-inv15.6%
clear-num15.4%
Applied egg-rr15.4%
sub-neg15.4%
Simplified15.4%
associate-*r/15.4%
sub-div16.2%
Applied egg-rr16.2%
Taylor expanded in i around 0 72.0%
if -2.9999999999999998e179 < n < 0.57999999999999996Initial program 36.9%
*-commutative36.9%
associate-/r/37.2%
sub-neg37.2%
metadata-eval37.2%
associate-*r*37.2%
*-commutative37.2%
clear-num37.2%
un-div-inv37.3%
metadata-eval37.3%
sub-neg37.3%
pow-to-exp30.8%
expm1-def46.2%
add-log-exp30.8%
pow-to-exp37.3%
log-pow46.2%
log1p-udef78.3%
Applied egg-rr78.3%
Taylor expanded in i around 0 72.8%
sub-neg72.8%
associate-*r/72.8%
metadata-eval72.8%
metadata-eval72.8%
Simplified72.8%
Taylor expanded in n around 0 71.3%
if 0.57999999999999996 < n Initial program 29.1%
Taylor expanded in i around 0 56.4%
unpow256.4%
associate-*r/56.4%
metadata-eval56.4%
Simplified56.4%
Taylor expanded in n around inf 85.6%
associate-/l*77.6%
*-commutative77.6%
unpow277.6%
associate-*l*77.6%
Simplified77.6%
Final simplification73.4%
(FPCore (i n)
:precision binary64
(let* ((t_0 (* 100.0 (/ i (/ i n)))))
(if (<= n -1.1e+46)
(* 100.0 (/ (* i n) i))
(if (<= n -3.8e-175)
t_0
(if (<= n 3.4e-241)
(* 200.0 (/ (* n n) i))
(if (<= n 0.58) t_0 (* n (+ 100.0 (* i 50.0)))))))))
double code(double i, double n) {
double t_0 = 100.0 * (i / (i / n));
double tmp;
if (n <= -1.1e+46) {
tmp = 100.0 * ((i * n) / i);
} else if (n <= -3.8e-175) {
tmp = t_0;
} else if (n <= 3.4e-241) {
tmp = 200.0 * ((n * n) / i);
} else if (n <= 0.58) {
tmp = t_0;
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = 100.0d0 * (i / (i / n))
if (n <= (-1.1d+46)) then
tmp = 100.0d0 * ((i * n) / i)
else if (n <= (-3.8d-175)) then
tmp = t_0
else if (n <= 3.4d-241) then
tmp = 200.0d0 * ((n * n) / i)
else if (n <= 0.58d0) then
tmp = t_0
else
tmp = n * (100.0d0 + (i * 50.0d0))
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = 100.0 * (i / (i / n));
double tmp;
if (n <= -1.1e+46) {
tmp = 100.0 * ((i * n) / i);
} else if (n <= -3.8e-175) {
tmp = t_0;
} else if (n <= 3.4e-241) {
tmp = 200.0 * ((n * n) / i);
} else if (n <= 0.58) {
tmp = t_0;
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): t_0 = 100.0 * (i / (i / n)) tmp = 0 if n <= -1.1e+46: tmp = 100.0 * ((i * n) / i) elif n <= -3.8e-175: tmp = t_0 elif n <= 3.4e-241: tmp = 200.0 * ((n * n) / i) elif n <= 0.58: tmp = t_0 else: tmp = n * (100.0 + (i * 50.0)) return tmp
function code(i, n) t_0 = Float64(100.0 * Float64(i / Float64(i / n))) tmp = 0.0 if (n <= -1.1e+46) tmp = Float64(100.0 * Float64(Float64(i * n) / i)); elseif (n <= -3.8e-175) tmp = t_0; elseif (n <= 3.4e-241) tmp = Float64(200.0 * Float64(Float64(n * n) / i)); elseif (n <= 0.58) tmp = t_0; else tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); end return tmp end
function tmp_2 = code(i, n) t_0 = 100.0 * (i / (i / n)); tmp = 0.0; if (n <= -1.1e+46) tmp = 100.0 * ((i * n) / i); elseif (n <= -3.8e-175) tmp = t_0; elseif (n <= 3.4e-241) tmp = 200.0 * ((n * n) / i); elseif (n <= 0.58) tmp = t_0; else tmp = n * (100.0 + (i * 50.0)); end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.1e+46], N[(100.0 * N[(N[(i * n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -3.8e-175], t$95$0, If[LessEqual[n, 3.4e-241], N[(200.0 * N[(N[(n * n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 0.58], t$95$0, N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{if}\;n \leq -1.1 \cdot 10^{+46}:\\
\;\;\;\;100 \cdot \frac{i \cdot n}{i}\\
\mathbf{elif}\;n \leq -3.8 \cdot 10^{-175}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq 3.4 \cdot 10^{-241}:\\
\;\;\;\;200 \cdot \frac{n \cdot n}{i}\\
\mathbf{elif}\;n \leq 0.58:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if n < -1.1e46Initial program 20.7%
div-sub20.6%
clear-num20.9%
sub-neg20.9%
div-inv20.9%
clear-num20.6%
Applied egg-rr20.6%
sub-neg20.6%
Simplified20.6%
associate-*r/20.6%
sub-div21.6%
Applied egg-rr21.6%
Taylor expanded in i around 0 64.6%
if -1.1e46 < n < -3.8e-175 or 3.3999999999999999e-241 < n < 0.57999999999999996Initial program 29.7%
Taylor expanded in i around 0 59.5%
if -3.8e-175 < n < 3.3999999999999999e-241Initial program 65.5%
*-commutative65.5%
associate-/r/65.8%
sub-neg65.8%
metadata-eval65.8%
associate-*r*65.8%
*-commutative65.8%
clear-num65.8%
un-div-inv65.8%
metadata-eval65.8%
sub-neg65.8%
pow-to-exp65.8%
expm1-def78.4%
add-log-exp65.8%
pow-to-exp65.8%
log-pow78.4%
log1p-udef84.0%
Applied egg-rr84.0%
Taylor expanded in i around 0 92.0%
sub-neg92.0%
associate-*r/92.0%
metadata-eval92.0%
metadata-eval92.0%
Simplified92.0%
Taylor expanded in n around 0 81.7%
unpow281.7%
Simplified81.7%
if 0.57999999999999996 < n Initial program 29.1%
Taylor expanded in n around inf 45.0%
*-commutative45.0%
associate-/l*44.9%
expm1-def92.6%
Simplified92.6%
associate-*l/92.7%
Applied egg-rr92.7%
Taylor expanded in i around 0 72.1%
associate-*r*72.1%
distribute-rgt-out72.1%
Simplified72.1%
Final simplification67.5%
(FPCore (i n)
:precision binary64
(let* ((t_0 (+ 1.0 (* i -0.5))))
(if (<= n -1.22e-175)
(* 100.0 (/ n t_0))
(if (<= n 2.8e-245)
(* 200.0 (/ (* n n) i))
(if (<= n 7.5e-61) (/ 100.0 (/ t_0 n)) (* n (+ 100.0 (* i 50.0))))))))
double code(double i, double n) {
double t_0 = 1.0 + (i * -0.5);
double tmp;
if (n <= -1.22e-175) {
tmp = 100.0 * (n / t_0);
} else if (n <= 2.8e-245) {
tmp = 200.0 * ((n * n) / i);
} else if (n <= 7.5e-61) {
tmp = 100.0 / (t_0 / n);
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (i * (-0.5d0))
if (n <= (-1.22d-175)) then
tmp = 100.0d0 * (n / t_0)
else if (n <= 2.8d-245) then
tmp = 200.0d0 * ((n * n) / i)
else if (n <= 7.5d-61) then
tmp = 100.0d0 / (t_0 / n)
else
tmp = n * (100.0d0 + (i * 50.0d0))
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = 1.0 + (i * -0.5);
double tmp;
if (n <= -1.22e-175) {
tmp = 100.0 * (n / t_0);
} else if (n <= 2.8e-245) {
tmp = 200.0 * ((n * n) / i);
} else if (n <= 7.5e-61) {
tmp = 100.0 / (t_0 / n);
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): t_0 = 1.0 + (i * -0.5) tmp = 0 if n <= -1.22e-175: tmp = 100.0 * (n / t_0) elif n <= 2.8e-245: tmp = 200.0 * ((n * n) / i) elif n <= 7.5e-61: tmp = 100.0 / (t_0 / n) else: tmp = n * (100.0 + (i * 50.0)) return tmp
function code(i, n) t_0 = Float64(1.0 + Float64(i * -0.5)) tmp = 0.0 if (n <= -1.22e-175) tmp = Float64(100.0 * Float64(n / t_0)); elseif (n <= 2.8e-245) tmp = Float64(200.0 * Float64(Float64(n * n) / i)); elseif (n <= 7.5e-61) tmp = Float64(100.0 / Float64(t_0 / n)); else tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); end return tmp end
function tmp_2 = code(i, n) t_0 = 1.0 + (i * -0.5); tmp = 0.0; if (n <= -1.22e-175) tmp = 100.0 * (n / t_0); elseif (n <= 2.8e-245) tmp = 200.0 * ((n * n) / i); elseif (n <= 7.5e-61) tmp = 100.0 / (t_0 / n); else tmp = n * (100.0 + (i * 50.0)); end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.22e-175], N[(100.0 * N[(n / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.8e-245], N[(200.0 * N[(N[(n * n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 7.5e-61], N[(100.0 / N[(t$95$0 / n), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + i \cdot -0.5\\
\mathbf{if}\;n \leq -1.22 \cdot 10^{-175}:\\
\;\;\;\;100 \cdot \frac{n}{t_0}\\
\mathbf{elif}\;n \leq 2.8 \cdot 10^{-245}:\\
\;\;\;\;200 \cdot \frac{n \cdot n}{i}\\
\mathbf{elif}\;n \leq 7.5 \cdot 10^{-61}:\\
\;\;\;\;\frac{100}{\frac{t_0}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if n < -1.2200000000000001e-175Initial program 28.6%
Taylor expanded in n around inf 34.8%
*-commutative34.8%
associate-/l*34.8%
expm1-def83.1%
Simplified83.1%
Taylor expanded in i around 0 61.1%
*-commutative61.1%
Simplified61.1%
if -1.2200000000000001e-175 < n < 2.8000000000000001e-245Initial program 65.5%
*-commutative65.5%
associate-/r/65.8%
sub-neg65.8%
metadata-eval65.8%
associate-*r*65.8%
*-commutative65.8%
clear-num65.8%
un-div-inv65.8%
metadata-eval65.8%
sub-neg65.8%
pow-to-exp65.8%
expm1-def78.4%
add-log-exp65.8%
pow-to-exp65.8%
log-pow78.4%
log1p-udef84.0%
Applied egg-rr84.0%
Taylor expanded in i around 0 92.0%
sub-neg92.0%
associate-*r/92.0%
metadata-eval92.0%
metadata-eval92.0%
Simplified92.0%
Taylor expanded in n around 0 81.7%
unpow281.7%
Simplified81.7%
if 2.8000000000000001e-245 < n < 7.50000000000000047e-61Initial program 19.4%
Taylor expanded in n around inf 4.4%
*-commutative4.4%
associate-/l*4.4%
expm1-def47.2%
Simplified47.2%
*-commutative47.2%
clear-num47.2%
un-div-inv47.2%
Applied egg-rr47.2%
Taylor expanded in i around 0 63.3%
*-commutative59.1%
Simplified63.3%
if 7.50000000000000047e-61 < n Initial program 27.1%
Taylor expanded in n around inf 38.8%
*-commutative38.8%
associate-/l*38.8%
expm1-def87.6%
Simplified87.6%
associate-*l/87.6%
Applied egg-rr87.6%
Taylor expanded in i around 0 70.2%
associate-*r*70.2%
distribute-rgt-out70.2%
Simplified70.2%
Final simplification67.2%
(FPCore (i n)
:precision binary64
(let* ((t_0 (+ 1.0 (* i -0.5))))
(if (<= n -6e-170)
(* 100.0 (/ n t_0))
(if (<= n 6.5e-245)
(* 100.0 (/ (/ n i) (+ (/ 0.5 n) -0.5)))
(if (<= n 7.5e-61) (/ 100.0 (/ t_0 n)) (* n (+ 100.0 (* i 50.0))))))))
double code(double i, double n) {
double t_0 = 1.0 + (i * -0.5);
double tmp;
if (n <= -6e-170) {
tmp = 100.0 * (n / t_0);
} else if (n <= 6.5e-245) {
tmp = 100.0 * ((n / i) / ((0.5 / n) + -0.5));
} else if (n <= 7.5e-61) {
tmp = 100.0 / (t_0 / n);
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (i * (-0.5d0))
if (n <= (-6d-170)) then
tmp = 100.0d0 * (n / t_0)
else if (n <= 6.5d-245) then
tmp = 100.0d0 * ((n / i) / ((0.5d0 / n) + (-0.5d0)))
else if (n <= 7.5d-61) then
tmp = 100.0d0 / (t_0 / n)
else
tmp = n * (100.0d0 + (i * 50.0d0))
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = 1.0 + (i * -0.5);
double tmp;
if (n <= -6e-170) {
tmp = 100.0 * (n / t_0);
} else if (n <= 6.5e-245) {
tmp = 100.0 * ((n / i) / ((0.5 / n) + -0.5));
} else if (n <= 7.5e-61) {
tmp = 100.0 / (t_0 / n);
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): t_0 = 1.0 + (i * -0.5) tmp = 0 if n <= -6e-170: tmp = 100.0 * (n / t_0) elif n <= 6.5e-245: tmp = 100.0 * ((n / i) / ((0.5 / n) + -0.5)) elif n <= 7.5e-61: tmp = 100.0 / (t_0 / n) else: tmp = n * (100.0 + (i * 50.0)) return tmp
function code(i, n) t_0 = Float64(1.0 + Float64(i * -0.5)) tmp = 0.0 if (n <= -6e-170) tmp = Float64(100.0 * Float64(n / t_0)); elseif (n <= 6.5e-245) tmp = Float64(100.0 * Float64(Float64(n / i) / Float64(Float64(0.5 / n) + -0.5))); elseif (n <= 7.5e-61) tmp = Float64(100.0 / Float64(t_0 / n)); else tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); end return tmp end
function tmp_2 = code(i, n) t_0 = 1.0 + (i * -0.5); tmp = 0.0; if (n <= -6e-170) tmp = 100.0 * (n / t_0); elseif (n <= 6.5e-245) tmp = 100.0 * ((n / i) / ((0.5 / n) + -0.5)); elseif (n <= 7.5e-61) tmp = 100.0 / (t_0 / n); else tmp = n * (100.0 + (i * 50.0)); end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -6e-170], N[(100.0 * N[(n / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 6.5e-245], N[(100.0 * N[(N[(n / i), $MachinePrecision] / N[(N[(0.5 / n), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 7.5e-61], N[(100.0 / N[(t$95$0 / n), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + i \cdot -0.5\\
\mathbf{if}\;n \leq -6 \cdot 10^{-170}:\\
\;\;\;\;100 \cdot \frac{n}{t_0}\\
\mathbf{elif}\;n \leq 6.5 \cdot 10^{-245}:\\
\;\;\;\;100 \cdot \frac{\frac{n}{i}}{\frac{0.5}{n} + -0.5}\\
\mathbf{elif}\;n \leq 7.5 \cdot 10^{-61}:\\
\;\;\;\;\frac{100}{\frac{t_0}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if n < -6.00000000000000027e-170Initial program 28.6%
Taylor expanded in n around inf 34.8%
*-commutative34.8%
associate-/l*34.8%
expm1-def83.1%
Simplified83.1%
Taylor expanded in i around 0 61.1%
*-commutative61.1%
Simplified61.1%
if -6.00000000000000027e-170 < n < 6.5000000000000004e-245Initial program 65.5%
*-commutative65.5%
associate-/r/65.8%
sub-neg65.8%
metadata-eval65.8%
associate-*r*65.8%
*-commutative65.8%
clear-num65.8%
un-div-inv65.8%
metadata-eval65.8%
sub-neg65.8%
pow-to-exp65.8%
expm1-def78.4%
add-log-exp65.8%
pow-to-exp65.8%
log-pow78.4%
log1p-udef84.0%
Applied egg-rr84.0%
Taylor expanded in i around 0 92.0%
sub-neg92.0%
associate-*r/92.0%
metadata-eval92.0%
metadata-eval92.0%
Simplified92.0%
Taylor expanded in i around inf 82.4%
associate-/r*82.4%
sub-neg82.4%
metadata-eval82.4%
associate-*r/82.4%
metadata-eval82.4%
+-commutative82.4%
Simplified82.4%
if 6.5000000000000004e-245 < n < 7.50000000000000047e-61Initial program 19.4%
Taylor expanded in n around inf 4.4%
*-commutative4.4%
associate-/l*4.4%
expm1-def47.2%
Simplified47.2%
*-commutative47.2%
clear-num47.2%
un-div-inv47.2%
Applied egg-rr47.2%
Taylor expanded in i around 0 63.3%
*-commutative59.1%
Simplified63.3%
if 7.50000000000000047e-61 < n Initial program 27.1%
Taylor expanded in n around inf 38.8%
*-commutative38.8%
associate-/l*38.8%
expm1-def87.6%
Simplified87.6%
associate-*l/87.6%
Applied egg-rr87.6%
Taylor expanded in i around 0 70.2%
associate-*r*70.2%
distribute-rgt-out70.2%
Simplified70.2%
Final simplification67.3%
(FPCore (i n)
:precision binary64
(if (<= n -1.55e+182)
(* 100.0 (/ (* i n) i))
(if (<= n 0.58)
(/ (* n 100.0) (+ 1.0 (* (/ i n) 0.5)))
(* n (+ 100.0 (* i 50.0))))))
double code(double i, double n) {
double tmp;
if (n <= -1.55e+182) {
tmp = 100.0 * ((i * n) / i);
} else if (n <= 0.58) {
tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5));
} 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 <= (-1.55d+182)) then
tmp = 100.0d0 * ((i * n) / i)
else if (n <= 0.58d0) then
tmp = (n * 100.0d0) / (1.0d0 + ((i / n) * 0.5d0))
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 <= -1.55e+182) {
tmp = 100.0 * ((i * n) / i);
} else if (n <= 0.58) {
tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5));
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.55e+182: tmp = 100.0 * ((i * n) / i) elif n <= 0.58: tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5)) else: tmp = n * (100.0 + (i * 50.0)) return tmp
function code(i, n) tmp = 0.0 if (n <= -1.55e+182) tmp = Float64(100.0 * Float64(Float64(i * n) / i)); elseif (n <= 0.58) tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(Float64(i / n) * 0.5))); 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 <= -1.55e+182) tmp = 100.0 * ((i * n) / i); elseif (n <= 0.58) tmp = (n * 100.0) / (1.0 + ((i / n) * 0.5)); else tmp = n * (100.0 + (i * 50.0)); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.55e+182], N[(100.0 * N[(N[(i * n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 0.58], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(N[(i / n), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.55 \cdot 10^{+182}:\\
\;\;\;\;100 \cdot \frac{i \cdot n}{i}\\
\mathbf{elif}\;n \leq 0.58:\\
\;\;\;\;\frac{n \cdot 100}{1 + \frac{i}{n} \cdot 0.5}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if n < -1.54999999999999998e182Initial program 15.4%
div-sub15.4%
clear-num15.6%
sub-neg15.6%
div-inv15.6%
clear-num15.4%
Applied egg-rr15.4%
sub-neg15.4%
Simplified15.4%
associate-*r/15.4%
sub-div16.2%
Applied egg-rr16.2%
Taylor expanded in i around 0 72.0%
if -1.54999999999999998e182 < n < 0.57999999999999996Initial program 36.9%
*-commutative36.9%
associate-/r/37.2%
sub-neg37.2%
metadata-eval37.2%
associate-*r*37.2%
*-commutative37.2%
clear-num37.2%
un-div-inv37.3%
metadata-eval37.3%
sub-neg37.3%
pow-to-exp30.8%
expm1-def46.2%
add-log-exp30.8%
pow-to-exp37.3%
log-pow46.2%
log1p-udef78.3%
Applied egg-rr78.3%
Taylor expanded in i around 0 72.8%
sub-neg72.8%
associate-*r/72.8%
metadata-eval72.8%
metadata-eval72.8%
Simplified72.8%
Taylor expanded in n around 0 71.3%
if 0.57999999999999996 < n Initial program 29.1%
Taylor expanded in n around inf 45.0%
*-commutative45.0%
associate-/l*44.9%
expm1-def92.6%
Simplified92.6%
associate-*l/92.7%
Applied egg-rr92.7%
Taylor expanded in i around 0 72.1%
associate-*r*72.1%
distribute-rgt-out72.1%
Simplified72.1%
Final simplification71.7%
(FPCore (i n) :precision binary64 (if (<= n 0.58) (/ (* n 100.0) (+ 1.0 (* i (+ (/ 0.5 n) -0.5)))) (* 100.0 (/ n (/ i (+ i (* i (* i 0.5))))))))
double code(double i, double n) {
double tmp;
if (n <= 0.58) {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
} else {
tmp = 100.0 * (n / (i / (i + (i * (i * 0.5)))));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= 0.58d0) then
tmp = (n * 100.0d0) / (1.0d0 + (i * ((0.5d0 / n) + (-0.5d0))))
else
tmp = 100.0d0 * (n / (i / (i + (i * (i * 0.5d0)))))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= 0.58) {
tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5)));
} else {
tmp = 100.0 * (n / (i / (i + (i * (i * 0.5)))));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= 0.58: tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))) else: tmp = 100.0 * (n / (i / (i + (i * (i * 0.5))))) return tmp
function code(i, n) tmp = 0.0 if (n <= 0.58) tmp = Float64(Float64(n * 100.0) / Float64(1.0 + Float64(i * Float64(Float64(0.5 / n) + -0.5)))); else tmp = Float64(100.0 * Float64(n / Float64(i / Float64(i + Float64(i * Float64(i * 0.5)))))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= 0.58) tmp = (n * 100.0) / (1.0 + (i * ((0.5 / n) + -0.5))); else tmp = 100.0 * (n / (i / (i + (i * (i * 0.5))))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, 0.58], N[(N[(n * 100.0), $MachinePrecision] / N[(1.0 + N[(i * N[(N[(0.5 / n), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n / N[(i / N[(i + N[(i * N[(i * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 0.58:\\
\;\;\;\;\frac{n \cdot 100}{1 + i \cdot \left(\frac{0.5}{n} + -0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{i + i \cdot \left(i \cdot 0.5\right)}}\\
\end{array}
\end{array}
if n < 0.57999999999999996Initial program 32.7%
*-commutative32.7%
associate-/r/33.1%
sub-neg33.1%
metadata-eval33.1%
associate-*r*33.1%
*-commutative33.1%
clear-num33.1%
un-div-inv33.2%
metadata-eval33.2%
sub-neg33.2%
pow-to-exp28.0%
expm1-def40.3%
add-log-exp28.0%
pow-to-exp33.2%
log-pow40.3%
log1p-udef73.5%
Applied egg-rr73.5%
Taylor expanded in i around 0 70.5%
sub-neg70.5%
associate-*r/70.5%
metadata-eval70.5%
metadata-eval70.5%
Simplified70.5%
if 0.57999999999999996 < n Initial program 29.1%
Taylor expanded in i around 0 56.4%
unpow256.4%
associate-*r/56.4%
metadata-eval56.4%
Simplified56.4%
Taylor expanded in n around inf 85.6%
associate-/l*77.6%
*-commutative77.6%
unpow277.6%
associate-*l*77.6%
Simplified77.6%
Final simplification72.8%
(FPCore (i n)
:precision binary64
(if (<= n -1.45e-175)
(* 100.0 (/ n (+ 1.0 (* i -0.5))))
(if (<= n 4.8e-248)
(* 200.0 (/ (* n n) i))
(if (<= n 0.48) (* 100.0 (/ i (/ i n))) (* n (+ 100.0 (* i 50.0)))))))
double code(double i, double n) {
double tmp;
if (n <= -1.45e-175) {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
} else if (n <= 4.8e-248) {
tmp = 200.0 * ((n * n) / i);
} else if (n <= 0.48) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-1.45d-175)) then
tmp = 100.0d0 * (n / (1.0d0 + (i * (-0.5d0))))
else if (n <= 4.8d-248) then
tmp = 200.0d0 * ((n * n) / i)
else if (n <= 0.48d0) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = n * (100.0d0 + (i * 50.0d0))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -1.45e-175) {
tmp = 100.0 * (n / (1.0 + (i * -0.5)));
} else if (n <= 4.8e-248) {
tmp = 200.0 * ((n * n) / i);
} else if (n <= 0.48) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.45e-175: tmp = 100.0 * (n / (1.0 + (i * -0.5))) elif n <= 4.8e-248: tmp = 200.0 * ((n * n) / i) elif n <= 0.48: tmp = 100.0 * (i / (i / n)) else: tmp = n * (100.0 + (i * 50.0)) return tmp
function code(i, n) tmp = 0.0 if (n <= -1.45e-175) tmp = Float64(100.0 * Float64(n / Float64(1.0 + Float64(i * -0.5)))); elseif (n <= 4.8e-248) tmp = Float64(200.0 * Float64(Float64(n * n) / i)); elseif (n <= 0.48) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -1.45e-175) tmp = 100.0 * (n / (1.0 + (i * -0.5))); elseif (n <= 4.8e-248) tmp = 200.0 * ((n * n) / i); elseif (n <= 0.48) tmp = 100.0 * (i / (i / n)); else tmp = n * (100.0 + (i * 50.0)); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.45e-175], N[(100.0 * N[(n / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 4.8e-248], N[(200.0 * N[(N[(n * n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 0.48], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.45 \cdot 10^{-175}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\
\mathbf{elif}\;n \leq 4.8 \cdot 10^{-248}:\\
\;\;\;\;200 \cdot \frac{n \cdot n}{i}\\
\mathbf{elif}\;n \leq 0.48:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if n < -1.44999999999999999e-175Initial program 28.6%
Taylor expanded in n around inf 34.8%
*-commutative34.8%
associate-/l*34.8%
expm1-def83.1%
Simplified83.1%
Taylor expanded in i around 0 61.1%
*-commutative61.1%
Simplified61.1%
if -1.44999999999999999e-175 < n < 4.80000000000000006e-248Initial program 65.5%
*-commutative65.5%
associate-/r/65.8%
sub-neg65.8%
metadata-eval65.8%
associate-*r*65.8%
*-commutative65.8%
clear-num65.8%
un-div-inv65.8%
metadata-eval65.8%
sub-neg65.8%
pow-to-exp65.8%
expm1-def78.4%
add-log-exp65.8%
pow-to-exp65.8%
log-pow78.4%
log1p-udef84.0%
Applied egg-rr84.0%
Taylor expanded in i around 0 92.0%
sub-neg92.0%
associate-*r/92.0%
metadata-eval92.0%
metadata-eval92.0%
Simplified92.0%
Taylor expanded in n around 0 81.7%
unpow281.7%
Simplified81.7%
if 4.80000000000000006e-248 < n < 0.47999999999999998Initial program 17.8%
Taylor expanded in i around 0 61.6%
if 0.47999999999999998 < n Initial program 29.1%
Taylor expanded in n around inf 45.0%
*-commutative45.0%
associate-/l*44.9%
expm1-def92.6%
Simplified92.6%
associate-*l/92.7%
Applied egg-rr92.7%
Taylor expanded in i around 0 72.1%
associate-*r*72.1%
distribute-rgt-out72.1%
Simplified72.1%
Final simplification67.2%
(FPCore (i n) :precision binary64 (if (or (<= n -1.36e+45) (not (<= n 3e+16))) (* 100.0 (/ (* i n) i)) (* 100.0 (/ i (/ i n)))))
double code(double i, double n) {
double tmp;
if ((n <= -1.36e+45) || !(n <= 3e+16)) {
tmp = 100.0 * ((i * n) / i);
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-1.36d+45)) .or. (.not. (n <= 3d+16))) then
tmp = 100.0d0 * ((i * n) / i)
else
tmp = 100.0d0 * (i / (i / n))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -1.36e+45) || !(n <= 3e+16)) {
tmp = 100.0 * ((i * n) / i);
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -1.36e+45) or not (n <= 3e+16): tmp = 100.0 * ((i * n) / i) else: tmp = 100.0 * (i / (i / n)) return tmp
function code(i, n) tmp = 0.0 if ((n <= -1.36e+45) || !(n <= 3e+16)) tmp = Float64(100.0 * Float64(Float64(i * n) / i)); else tmp = Float64(100.0 * Float64(i / Float64(i / n))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -1.36e+45) || ~((n <= 3e+16))) tmp = 100.0 * ((i * n) / i); else tmp = 100.0 * (i / (i / n)); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -1.36e+45], N[Not[LessEqual[n, 3e+16]], $MachinePrecision]], N[(100.0 * N[(N[(i * n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.36 \cdot 10^{+45} \lor \neg \left(n \leq 3 \cdot 10^{+16}\right):\\
\;\;\;\;100 \cdot \frac{i \cdot n}{i}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -1.36e45 or 3e16 < n Initial program 24.7%
div-sub24.6%
clear-num24.9%
sub-neg24.9%
div-inv24.9%
clear-num24.6%
Applied egg-rr24.6%
sub-neg24.6%
Simplified24.6%
associate-*r/24.6%
sub-div25.3%
Applied egg-rr25.3%
Taylor expanded in i around 0 67.9%
if -1.36e45 < n < 3e16Initial program 40.3%
Taylor expanded in i around 0 59.2%
Final simplification64.1%
(FPCore (i n) :precision binary64 (if (<= i -2.8e+76) (* 100.0 (/ i (/ i n))) (if (<= i 8.2e+92) (* n 100.0) (* (* i n) 50.0))))
double code(double i, double n) {
double tmp;
if (i <= -2.8e+76) {
tmp = 100.0 * (i / (i / n));
} else if (i <= 8.2e+92) {
tmp = n * 100.0;
} else {
tmp = (i * n) * 50.0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (i <= (-2.8d+76)) then
tmp = 100.0d0 * (i / (i / n))
else if (i <= 8.2d+92) then
tmp = n * 100.0d0
else
tmp = (i * n) * 50.0d0
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (i <= -2.8e+76) {
tmp = 100.0 * (i / (i / n));
} else if (i <= 8.2e+92) {
tmp = n * 100.0;
} else {
tmp = (i * n) * 50.0;
}
return tmp;
}
def code(i, n): tmp = 0 if i <= -2.8e+76: tmp = 100.0 * (i / (i / n)) elif i <= 8.2e+92: tmp = n * 100.0 else: tmp = (i * n) * 50.0 return tmp
function code(i, n) tmp = 0.0 if (i <= -2.8e+76) tmp = Float64(100.0 * Float64(i / Float64(i / n))); elseif (i <= 8.2e+92) tmp = Float64(n * 100.0); else tmp = Float64(Float64(i * n) * 50.0); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (i <= -2.8e+76) tmp = 100.0 * (i / (i / n)); elseif (i <= 8.2e+92) tmp = n * 100.0; else tmp = (i * n) * 50.0; end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, -2.8e+76], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 8.2e+92], N[(n * 100.0), $MachinePrecision], N[(N[(i * n), $MachinePrecision] * 50.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.8 \cdot 10^{+76}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{elif}\;i \leq 8.2 \cdot 10^{+92}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot n\right) \cdot 50\\
\end{array}
\end{array}
if i < -2.7999999999999999e76Initial program 74.0%
Taylor expanded in i around 0 41.3%
if -2.7999999999999999e76 < i < 8.20000000000000047e92Initial program 11.9%
Taylor expanded in i around 0 70.7%
*-commutative70.7%
Simplified70.7%
if 8.20000000000000047e92 < i Initial program 61.7%
Taylor expanded in i around 0 50.9%
unpow250.9%
associate-*r/50.9%
metadata-eval50.9%
Simplified50.9%
Taylor expanded in i around inf 43.8%
associate-*r*43.8%
associate-*r/43.8%
metadata-eval43.8%
Simplified43.8%
Taylor expanded in n around inf 44.1%
*-commutative44.1%
Simplified44.1%
Final simplification60.8%
(FPCore (i n) :precision binary64 (if (<= i 8.2e+92) (* n 100.0) (* (* i n) 50.0)))
double code(double i, double n) {
double tmp;
if (i <= 8.2e+92) {
tmp = n * 100.0;
} else {
tmp = (i * n) * 50.0;
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (i <= 8.2d+92) then
tmp = n * 100.0d0
else
tmp = (i * n) * 50.0d0
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (i <= 8.2e+92) {
tmp = n * 100.0;
} else {
tmp = (i * n) * 50.0;
}
return tmp;
}
def code(i, n): tmp = 0 if i <= 8.2e+92: tmp = n * 100.0 else: tmp = (i * n) * 50.0 return tmp
function code(i, n) tmp = 0.0 if (i <= 8.2e+92) tmp = Float64(n * 100.0); else tmp = Float64(Float64(i * n) * 50.0); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (i <= 8.2e+92) tmp = n * 100.0; else tmp = (i * n) * 50.0; end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, 8.2e+92], N[(n * 100.0), $MachinePrecision], N[(N[(i * n), $MachinePrecision] * 50.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq 8.2 \cdot 10^{+92}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot n\right) \cdot 50\\
\end{array}
\end{array}
if i < 8.20000000000000047e92Initial program 24.3%
Taylor expanded in i around 0 57.5%
*-commutative57.5%
Simplified57.5%
if 8.20000000000000047e92 < i Initial program 61.7%
Taylor expanded in i around 0 50.9%
unpow250.9%
associate-*r/50.9%
metadata-eval50.9%
Simplified50.9%
Taylor expanded in i around inf 43.8%
associate-*r*43.8%
associate-*r/43.8%
metadata-eval43.8%
Simplified43.8%
Taylor expanded in n around inf 44.1%
*-commutative44.1%
Simplified44.1%
Final simplification54.9%
(FPCore (i n) :precision binary64 (* i -50.0))
double code(double i, double n) {
return i * -50.0;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = i * (-50.0d0)
end function
public static double code(double i, double n) {
return i * -50.0;
}
def code(i, n): return i * -50.0
function code(i, n) return Float64(i * -50.0) end
function tmp = code(i, n) tmp = i * -50.0; end
code[i_, n_] := N[(i * -50.0), $MachinePrecision]
\begin{array}{l}
\\
i \cdot -50
\end{array}
Initial program 31.6%
Taylor expanded in i around 0 38.8%
unpow238.8%
associate-*r/38.8%
metadata-eval38.8%
Simplified38.8%
Taylor expanded in n around 0 2.6%
*-commutative2.6%
Simplified2.6%
Final simplification2.6%
(FPCore (i n) :precision binary64 (* n 100.0))
double code(double i, double n) {
return n * 100.0;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = n * 100.0d0
end function
public static double code(double i, double n) {
return n * 100.0;
}
def code(i, n): return n * 100.0
function code(i, n) return Float64(n * 100.0) end
function tmp = code(i, n) tmp = n * 100.0; end
code[i_, n_] := N[(n * 100.0), $MachinePrecision]
\begin{array}{l}
\\
n \cdot 100
\end{array}
Initial program 31.6%
Taylor expanded in i around 0 47.3%
*-commutative47.3%
Simplified47.3%
Final simplification47.3%
(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 2023271
(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))))