
(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 20 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) -1.0) (/ i n))))
(if (<= t_0 (- INFINITY))
(* 50.0 (* i n))
(if (<= t_0 0.0)
(* 100.0 (/ (expm1 (* n (log1p (/ i n)))) (/ i n)))
(if (<= t_0 INFINITY)
(/ (+ (* 100.0 (pow (/ i n) n)) -100.0) (/ i n))
(* n 100.0))))))
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 = 50.0 * (i * n);
} else if (t_0 <= 0.0) {
tmp = 100.0 * (expm1((n * log1p((i / n)))) / (i / n));
} else if (t_0 <= ((double) INFINITY)) {
tmp = ((100.0 * pow((i / n), n)) + -100.0) / (i / n);
} else {
tmp = n * 100.0;
}
return tmp;
}
public static double code(double i, double n) {
double t_0 = (Math.pow((1.0 + (i / n)), n) + -1.0) / (i / n);
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = 50.0 * (i * n);
} else if (t_0 <= 0.0) {
tmp = 100.0 * (Math.expm1((n * Math.log1p((i / n)))) / (i / n));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = ((100.0 * Math.pow((i / n), n)) + -100.0) / (i / n);
} else {
tmp = n * 100.0;
}
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 = 50.0 * (i * n) elif t_0 <= 0.0: tmp = 100.0 * (math.expm1((n * math.log1p((i / n)))) / (i / n)) elif t_0 <= math.inf: tmp = ((100.0 * math.pow((i / n), n)) + -100.0) / (i / n) else: tmp = n * 100.0 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(50.0 * Float64(i * n)); elseif (t_0 <= 0.0) tmp = Float64(100.0 * Float64(expm1(Float64(n * log1p(Float64(i / n)))) / Float64(i / n))); elseif (t_0 <= Inf) tmp = Float64(Float64(Float64(100.0 * (Float64(i / n) ^ n)) + -100.0) / Float64(i / n)); else tmp = Float64(n * 100.0); 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[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(100.0 * N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(N[(100.0 * N[Power[N[(i / n), $MachinePrecision], n], $MachinePrecision]), $MachinePrecision] + -100.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(n * 100.0), $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:\\
\;\;\;\;50 \cdot \left(i \cdot n\right)\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{i}{n}}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{100 \cdot {\left(\frac{i}{n}\right)}^{n} + -100}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100\\
\end{array}
\end{array}
if (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < -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 0.7%
Taylor expanded in i around 0 100.0%
+-commutative100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in i around inf 100.0%
if -inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < -0.0Initial program 19.5%
sub-neg19.5%
metadata-eval19.5%
Applied egg-rr19.5%
metadata-eval19.5%
sub-neg19.5%
exp-to-pow19.5%
log1p-undefine42.2%
*-commutative42.2%
expm1-undefine99.7%
Simplified99.7%
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.2%
associate-*r/99.4%
sub-neg99.4%
distribute-rgt-in99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in i around inf 99.4%
if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) Initial program 0.0%
associate-/r/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 i around 0 88.3%
*-commutative88.3%
Simplified88.3%
Final simplification97.6%
(FPCore (i n) :precision binary64 (if (or (<= n -1.1e-212) (not (<= n 1.35e-189))) (* 100.0 (* n (/ (expm1 i) i))) (/ 0.0 (/ i n))))
double code(double i, double n) {
double tmp;
if ((n <= -1.1e-212) || !(n <= 1.35e-189)) {
tmp = 100.0 * (n * (expm1(i) / i));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((n <= -1.1e-212) || !(n <= 1.35e-189)) {
tmp = 100.0 * (n * (Math.expm1(i) / i));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -1.1e-212) or not (n <= 1.35e-189): tmp = 100.0 * (n * (math.expm1(i) / i)) else: tmp = 0.0 / (i / n) return tmp
function code(i, n) tmp = 0.0 if ((n <= -1.1e-212) || !(n <= 1.35e-189)) tmp = Float64(100.0 * Float64(n * Float64(expm1(i) / i))); else tmp = Float64(0.0 / Float64(i / n)); end return tmp end
code[i_, n_] := If[Or[LessEqual[n, -1.1e-212], N[Not[LessEqual[n, 1.35e-189]], $MachinePrecision]], N[(100.0 * N[(n * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.1 \cdot 10^{-212} \lor \neg \left(n \leq 1.35 \cdot 10^{-189}\right):\\
\;\;\;\;100 \cdot \left(n \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -1.10000000000000002e-212 or 1.35e-189 < n Initial program 21.4%
Taylor expanded in n around inf 31.1%
*-commutative31.1%
associate-/l*31.0%
expm1-define83.4%
Simplified83.4%
if -1.10000000000000002e-212 < n < 1.35e-189Initial program 52.6%
associate-*r/52.6%
sub-neg52.6%
distribute-rgt-in52.6%
metadata-eval52.6%
metadata-eval52.6%
Simplified52.6%
Taylor expanded in i around 0 68.0%
Final simplification81.8%
(FPCore (i n) :precision binary64 (if (or (<= n -5.2e-210) (not (<= n 7.3e-190))) (* n (/ (* 100.0 (expm1 i)) i)) (/ 0.0 (/ i n))))
double code(double i, double n) {
double tmp;
if ((n <= -5.2e-210) || !(n <= 7.3e-190)) {
tmp = n * ((100.0 * expm1(i)) / i);
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((n <= -5.2e-210) || !(n <= 7.3e-190)) {
tmp = n * ((100.0 * Math.expm1(i)) / i);
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -5.2e-210) or not (n <= 7.3e-190): tmp = n * ((100.0 * math.expm1(i)) / i) else: tmp = 0.0 / (i / n) return tmp
function code(i, n) tmp = 0.0 if ((n <= -5.2e-210) || !(n <= 7.3e-190)) tmp = Float64(n * Float64(Float64(100.0 * expm1(i)) / i)); else tmp = Float64(0.0 / Float64(i / n)); end return tmp end
code[i_, n_] := If[Or[LessEqual[n, -5.2e-210], N[Not[LessEqual[n, 7.3e-190]], $MachinePrecision]], N[(n * N[(N[(100.0 * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -5.2 \cdot 10^{-210} \lor \neg \left(n \leq 7.3 \cdot 10^{-190}\right):\\
\;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{i}\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -5.1999999999999997e-210 or 7.29999999999999976e-190 < n Initial program 21.4%
associate-/r/21.8%
associate-*r*21.8%
*-commutative21.8%
associate-*r/21.8%
sub-neg21.8%
distribute-lft-in21.8%
metadata-eval21.8%
metadata-eval21.8%
metadata-eval21.8%
fma-define21.8%
metadata-eval21.8%
Simplified21.8%
Taylor expanded in n around inf 31.1%
sub-neg31.1%
metadata-eval31.1%
metadata-eval31.1%
distribute-lft-in31.1%
metadata-eval31.1%
sub-neg31.1%
expm1-define83.3%
Simplified83.3%
if -5.1999999999999997e-210 < n < 7.29999999999999976e-190Initial program 52.6%
associate-*r/52.6%
sub-neg52.6%
distribute-rgt-in52.6%
metadata-eval52.6%
metadata-eval52.6%
Simplified52.6%
Taylor expanded in i around 0 68.0%
Final simplification81.8%
(FPCore (i n) :precision binary64 (if (or (<= i -5e-15) (not (<= i 3.8e-6))) (* 100.0 (/ (expm1 i) (/ i n))) (* n 100.0)))
double code(double i, double n) {
double tmp;
if ((i <= -5e-15) || !(i <= 3.8e-6)) {
tmp = 100.0 * (expm1(i) / (i / n));
} else {
tmp = n * 100.0;
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if ((i <= -5e-15) || !(i <= 3.8e-6)) {
tmp = 100.0 * (Math.expm1(i) / (i / n));
} else {
tmp = n * 100.0;
}
return tmp;
}
def code(i, n): tmp = 0 if (i <= -5e-15) or not (i <= 3.8e-6): tmp = 100.0 * (math.expm1(i) / (i / n)) else: tmp = n * 100.0 return tmp
function code(i, n) tmp = 0.0 if ((i <= -5e-15) || !(i <= 3.8e-6)) tmp = Float64(100.0 * Float64(expm1(i) / Float64(i / n))); else tmp = Float64(n * 100.0); end return tmp end
code[i_, n_] := If[Or[LessEqual[i, -5e-15], N[Not[LessEqual[i, 3.8e-6]], $MachinePrecision]], N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * 100.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -5 \cdot 10^{-15} \lor \neg \left(i \leq 3.8 \cdot 10^{-6}\right):\\
\;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100\\
\end{array}
\end{array}
if i < -4.99999999999999999e-15 or 3.8e-6 < i Initial program 49.1%
Taylor expanded in n around inf 65.4%
expm1-define66.6%
Simplified66.6%
if -4.99999999999999999e-15 < i < 3.8e-6Initial program 6.7%
associate-/r/7.2%
associate-*r*7.2%
*-commutative7.2%
associate-*r/7.2%
sub-neg7.2%
distribute-lft-in7.2%
metadata-eval7.2%
metadata-eval7.2%
metadata-eval7.2%
fma-define7.2%
metadata-eval7.2%
Simplified7.2%
Taylor expanded in i around 0 87.1%
*-commutative87.1%
Simplified87.1%
Final simplification78.4%
(FPCore (i n) :precision binary64 (if (<= i 1.3e+116) (* 100.0 (* n (/ (expm1 i) i))) (* 100.0 (/ (* n (+ (pow (/ i n) n) -1.0)) i))))
double code(double i, double n) {
double tmp;
if (i <= 1.3e+116) {
tmp = 100.0 * (n * (expm1(i) / i));
} else {
tmp = 100.0 * ((n * (pow((i / n), n) + -1.0)) / i);
}
return tmp;
}
public static double code(double i, double n) {
double tmp;
if (i <= 1.3e+116) {
tmp = 100.0 * (n * (Math.expm1(i) / i));
} else {
tmp = 100.0 * ((n * (Math.pow((i / n), n) + -1.0)) / i);
}
return tmp;
}
def code(i, n): tmp = 0 if i <= 1.3e+116: tmp = 100.0 * (n * (math.expm1(i) / i)) else: tmp = 100.0 * ((n * (math.pow((i / n), n) + -1.0)) / i) return tmp
function code(i, n) tmp = 0.0 if (i <= 1.3e+116) tmp = Float64(100.0 * Float64(n * Float64(expm1(i) / i))); else tmp = Float64(100.0 * Float64(Float64(n * Float64((Float64(i / n) ^ n) + -1.0)) / i)); end return tmp end
code[i_, n_] := If[LessEqual[i, 1.3e+116], N[(100.0 * N[(n * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(N[(n * N[(N[Power[N[(i / n), $MachinePrecision], n], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq 1.3 \cdot 10^{+116}:\\
\;\;\;\;100 \cdot \left(n \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n \cdot \left({\left(\frac{i}{n}\right)}^{n} + -1\right)}{i}\\
\end{array}
\end{array}
if i < 1.29999999999999993e116Initial program 18.2%
Taylor expanded in n around inf 27.6%
*-commutative27.6%
associate-/l*27.5%
expm1-define82.9%
Simplified82.9%
if 1.29999999999999993e116 < i Initial program 62.3%
Taylor expanded in i around inf 78.2%
Taylor expanded in n around inf 78.4%
Final simplification82.3%
(FPCore (i n)
:precision binary64
(if (or (<= n -3.8e+27) (not (<= n 1.7)))
(/
(*
i
(*
n
(+
100.0
(* i (+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667))))))))
i)
(* 100.0 (/ i (/ i n)))))
double code(double i, double n) {
double tmp;
if ((n <= -3.8e+27) || !(n <= 1.7)) {
tmp = (i * (n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / 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 <= (-3.8d+27)) .or. (.not. (n <= 1.7d0))) then
tmp = (i * (n * (100.0d0 + (i * (50.0d0 + (i * (16.666666666666668d0 + (i * 4.166666666666667d0)))))))) / 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 <= -3.8e+27) || !(n <= 1.7)) {
tmp = (i * (n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i;
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -3.8e+27) or not (n <= 1.7): tmp = (i * (n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i else: tmp = 100.0 * (i / (i / n)) return tmp
function code(i, n) tmp = 0.0 if ((n <= -3.8e+27) || !(n <= 1.7)) tmp = Float64(Float64(i * Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667)))))))) / 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 <= -3.8e+27) || ~((n <= 1.7))) tmp = (i * (n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))))) / i; else tmp = 100.0 * (i / (i / n)); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -3.8e+27], N[Not[LessEqual[n, 1.7]], $MachinePrecision]], N[(N[(i * 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]), $MachinePrecision] / i), $MachinePrecision], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -3.8 \cdot 10^{+27} \lor \neg \left(n \leq 1.7\right):\\
\;\;\;\;\frac{i \cdot \left(n \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\right)}{i}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -3.80000000000000022e27 or 1.69999999999999996 < n Initial program 23.9%
associate-/r/24.4%
associate-*r*24.5%
*-commutative24.5%
associate-*r/24.5%
sub-neg24.5%
distribute-lft-in24.5%
metadata-eval24.5%
metadata-eval24.5%
metadata-eval24.5%
fma-define24.5%
metadata-eval24.5%
Simplified24.5%
Taylor expanded in n around inf 41.7%
Taylor expanded in i around 0 73.3%
*-commutative73.3%
Simplified73.3%
Taylor expanded in n around 0 73.5%
if -3.80000000000000022e27 < n < 1.69999999999999996Initial program 25.6%
Taylor expanded in i around 0 63.5%
Final simplification69.6%
(FPCore (i n)
:precision binary64
(let* ((t_0 (+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667))))))
(if (<= n -1.6e-120)
(* n (+ 100.0 (* i t_0)))
(if (<= n 9.5e-190) (/ 0.0 (/ i n)) (+ (* n 100.0) (* i (* n t_0)))))))
double code(double i, double n) {
double t_0 = 50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)));
double tmp;
if (n <= -1.6e-120) {
tmp = n * (100.0 + (i * t_0));
} else if (n <= 9.5e-190) {
tmp = 0.0 / (i / n);
} else {
tmp = (n * 100.0) + (i * (n * 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 = 50.0d0 + (i * (16.666666666666668d0 + (i * 4.166666666666667d0)))
if (n <= (-1.6d-120)) then
tmp = n * (100.0d0 + (i * t_0))
else if (n <= 9.5d-190) then
tmp = 0.0d0 / (i / n)
else
tmp = (n * 100.0d0) + (i * (n * t_0))
end if
code = tmp
end function
public static double code(double i, double n) {
double t_0 = 50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)));
double tmp;
if (n <= -1.6e-120) {
tmp = n * (100.0 + (i * t_0));
} else if (n <= 9.5e-190) {
tmp = 0.0 / (i / n);
} else {
tmp = (n * 100.0) + (i * (n * t_0));
}
return tmp;
}
def code(i, n): t_0 = 50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))) tmp = 0 if n <= -1.6e-120: tmp = n * (100.0 + (i * t_0)) elif n <= 9.5e-190: tmp = 0.0 / (i / n) else: tmp = (n * 100.0) + (i * (n * t_0)) return tmp
function code(i, n) t_0 = Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667)))) tmp = 0.0 if (n <= -1.6e-120) tmp = Float64(n * Float64(100.0 + Float64(i * t_0))); elseif (n <= 9.5e-190) tmp = Float64(0.0 / Float64(i / n)); else tmp = Float64(Float64(n * 100.0) + Float64(i * Float64(n * t_0))); end return tmp end
function tmp_2 = code(i, n) t_0 = 50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))); tmp = 0.0; if (n <= -1.6e-120) tmp = n * (100.0 + (i * t_0)); elseif (n <= 9.5e-190) tmp = 0.0 / (i / n); else tmp = (n * 100.0) + (i * (n * t_0)); end tmp_2 = tmp; end
code[i_, n_] := Block[{t$95$0 = N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.6e-120], N[(n * N[(100.0 + N[(i * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 9.5e-190], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(N[(n * 100.0), $MachinePrecision] + N[(i * N[(n * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\\
\mathbf{if}\;n \leq -1.6 \cdot 10^{-120}:\\
\;\;\;\;n \cdot \left(100 + i \cdot t\_0\right)\\
\mathbf{elif}\;n \leq 9.5 \cdot 10^{-190}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot 100 + i \cdot \left(n \cdot t\_0\right)\\
\end{array}
\end{array}
if n < -1.6e-120Initial program 19.4%
associate-/r/19.8%
associate-*r*19.9%
*-commutative19.9%
associate-*r/19.9%
sub-neg19.9%
distribute-lft-in19.8%
metadata-eval19.8%
metadata-eval19.8%
metadata-eval19.8%
fma-define19.9%
metadata-eval19.9%
Simplified19.9%
Taylor expanded in n around inf 31.4%
sub-neg31.4%
metadata-eval31.4%
metadata-eval31.4%
distribute-lft-in31.4%
metadata-eval31.4%
sub-neg31.4%
expm1-define88.4%
Simplified88.4%
Taylor expanded in i around 0 69.9%
*-commutative69.9%
Simplified69.9%
if -1.6e-120 < n < 9.50000000000000055e-190Initial program 50.2%
associate-*r/50.2%
sub-neg50.2%
distribute-rgt-in50.2%
metadata-eval50.2%
metadata-eval50.2%
Simplified50.2%
Taylor expanded in i around 0 61.3%
if 9.50000000000000055e-190 < n Initial program 21.5%
Taylor expanded in n around inf 31.3%
*-commutative31.3%
associate-/l*31.3%
expm1-define80.5%
Simplified80.5%
Taylor expanded in i around 0 72.1%
Taylor expanded in n around 0 72.1%
*-commutative72.1%
Simplified72.1%
Final simplification69.6%
(FPCore (i n)
:precision binary64
(if (<= n -1.15e-122)
(*
n
(+
100.0
(* i (+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667)))))))
(if (<= n 5.8e-190)
(/ 0.0 (/ i n))
(*
100.0
(*
n
(+
1.0
(*
i
(+
0.5
(* i (+ 0.16666666666666666 (* i 0.041666666666666664)))))))))))
double code(double i, double n) {
double tmp;
if (n <= -1.15e-122) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
} else if (n <= 5.8e-190) {
tmp = 0.0 / (i / n);
} else {
tmp = 100.0 * (n * (1.0 + (i * (0.5 + (i * (0.16666666666666666 + (i * 0.041666666666666664)))))));
}
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-122)) then
tmp = n * (100.0d0 + (i * (50.0d0 + (i * (16.666666666666668d0 + (i * 4.166666666666667d0))))))
else if (n <= 5.8d-190) then
tmp = 0.0d0 / (i / n)
else
tmp = 100.0d0 * (n * (1.0d0 + (i * (0.5d0 + (i * (0.16666666666666666d0 + (i * 0.041666666666666664d0)))))))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -1.15e-122) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
} else if (n <= 5.8e-190) {
tmp = 0.0 / (i / n);
} else {
tmp = 100.0 * (n * (1.0 + (i * (0.5 + (i * (0.16666666666666666 + (i * 0.041666666666666664)))))));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.15e-122: tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))) elif n <= 5.8e-190: tmp = 0.0 / (i / n) else: tmp = 100.0 * (n * (1.0 + (i * (0.5 + (i * (0.16666666666666666 + (i * 0.041666666666666664))))))) return tmp
function code(i, n) tmp = 0.0 if (n <= -1.15e-122) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667))))))); elseif (n <= 5.8e-190) tmp = Float64(0.0 / Float64(i / n)); else tmp = Float64(100.0 * Float64(n * Float64(1.0 + Float64(i * Float64(0.5 + Float64(i * Float64(0.16666666666666666 + Float64(i * 0.041666666666666664)))))))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -1.15e-122) tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))); elseif (n <= 5.8e-190) tmp = 0.0 / (i / n); else tmp = 100.0 * (n * (1.0 + (i * (0.5 + (i * (0.16666666666666666 + (i * 0.041666666666666664))))))); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.15e-122], 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, 5.8e-190], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n * N[(1.0 + N[(i * N[(0.5 + N[(i * N[(0.16666666666666666 + N[(i * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.15 \cdot 10^{-122}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\\
\mathbf{elif}\;n \leq 5.8 \cdot 10^{-190}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n \cdot \left(1 + i \cdot \left(0.5 + i \cdot \left(0.16666666666666666 + i \cdot 0.041666666666666664\right)\right)\right)\right)\\
\end{array}
\end{array}
if n < -1.15000000000000003e-122Initial program 19.4%
associate-/r/19.8%
associate-*r*19.9%
*-commutative19.9%
associate-*r/19.9%
sub-neg19.9%
distribute-lft-in19.8%
metadata-eval19.8%
metadata-eval19.8%
metadata-eval19.8%
fma-define19.9%
metadata-eval19.9%
Simplified19.9%
Taylor expanded in n around inf 31.4%
sub-neg31.4%
metadata-eval31.4%
metadata-eval31.4%
distribute-lft-in31.4%
metadata-eval31.4%
sub-neg31.4%
expm1-define88.4%
Simplified88.4%
Taylor expanded in i around 0 69.9%
*-commutative69.9%
Simplified69.9%
if -1.15000000000000003e-122 < n < 5.8000000000000004e-190Initial program 50.2%
associate-*r/50.2%
sub-neg50.2%
distribute-rgt-in50.2%
metadata-eval50.2%
metadata-eval50.2%
Simplified50.2%
Taylor expanded in i around 0 61.3%
if 5.8000000000000004e-190 < n Initial program 21.5%
Taylor expanded in n around inf 31.3%
*-commutative31.3%
associate-/l*31.3%
expm1-define80.5%
Simplified80.5%
Taylor expanded in i around 0 72.1%
*-commutative72.1%
Simplified72.1%
Final simplification69.6%
(FPCore (i n)
:precision binary64
(if (<= n -1.15e-122)
(* n (+ 100.0 (* i (+ 50.0 (* i 16.666666666666668)))))
(if (<= n 1.95e-227)
(/ (* n 0.0) i)
(if (<= n 1.55)
(* 100.0 (/ i (/ i n)))
(/ (* i (* n (+ 100.0 (* i 50.0)))) i)))))
double code(double i, double n) {
double tmp;
if (n <= -1.15e-122) {
tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
} else if (n <= 1.95e-227) {
tmp = (n * 0.0) / i;
} else if (n <= 1.55) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (i * (n * (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 <= (-1.15d-122)) then
tmp = n * (100.0d0 + (i * (50.0d0 + (i * 16.666666666666668d0))))
else if (n <= 1.95d-227) then
tmp = (n * 0.0d0) / i
else if (n <= 1.55d0) then
tmp = 100.0d0 * (i / (i / n))
else
tmp = (i * (n * (100.0d0 + (i * 50.0d0)))) / i
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (n <= -1.15e-122) {
tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
} else if (n <= 1.95e-227) {
tmp = (n * 0.0) / i;
} else if (n <= 1.55) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = (i * (n * (100.0 + (i * 50.0)))) / i;
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.15e-122: tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))) elif n <= 1.95e-227: tmp = (n * 0.0) / i elif n <= 1.55: tmp = 100.0 * (i / (i / n)) else: tmp = (i * (n * (100.0 + (i * 50.0)))) / i return tmp
function code(i, n) tmp = 0.0 if (n <= -1.15e-122) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * 16.666666666666668))))); elseif (n <= 1.95e-227) tmp = Float64(Float64(n * 0.0) / i); elseif (n <= 1.55) tmp = Float64(100.0 * Float64(i / Float64(i / n))); else tmp = Float64(Float64(i * Float64(n * Float64(100.0 + Float64(i * 50.0)))) / i); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (n <= -1.15e-122) tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))); elseif (n <= 1.95e-227) tmp = (n * 0.0) / i; elseif (n <= 1.55) tmp = 100.0 * (i / (i / n)); else tmp = (i * (n * (100.0 + (i * 50.0)))) / i; end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.15e-122], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.95e-227], N[(N[(n * 0.0), $MachinePrecision] / i), $MachinePrecision], If[LessEqual[n, 1.55], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(i * N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.15 \cdot 10^{-122}:\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\
\mathbf{elif}\;n \leq 1.95 \cdot 10^{-227}:\\
\;\;\;\;\frac{n \cdot 0}{i}\\
\mathbf{elif}\;n \leq 1.55:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;\frac{i \cdot \left(n \cdot \left(100 + i \cdot 50\right)\right)}{i}\\
\end{array}
\end{array}
if n < -1.15000000000000003e-122Initial program 19.4%
associate-/r/19.8%
associate-*r*19.9%
*-commutative19.9%
associate-*r/19.9%
sub-neg19.9%
distribute-lft-in19.8%
metadata-eval19.8%
metadata-eval19.8%
metadata-eval19.8%
fma-define19.9%
metadata-eval19.9%
Simplified19.9%
Taylor expanded in n around inf 31.4%
sub-neg31.4%
metadata-eval31.4%
metadata-eval31.4%
distribute-lft-in31.4%
metadata-eval31.4%
sub-neg31.4%
expm1-define88.4%
Simplified88.4%
Taylor expanded in i around 0 69.6%
*-commutative69.6%
Simplified69.6%
if -1.15000000000000003e-122 < n < 1.95e-227Initial program 54.6%
associate-/r/54.7%
associate-*r*54.7%
*-commutative54.7%
associate-*r/54.7%
sub-neg54.7%
distribute-lft-in54.7%
metadata-eval54.7%
metadata-eval54.7%
metadata-eval54.7%
fma-define54.7%
metadata-eval54.7%
Simplified54.7%
Taylor expanded in n around inf 32.3%
Taylor expanded in i around 0 64.9%
if 1.95e-227 < n < 1.55000000000000004Initial program 14.7%
Taylor expanded in i around 0 62.5%
if 1.55000000000000004 < n Initial program 27.2%
associate-/r/27.7%
associate-*r*27.7%
*-commutative27.7%
associate-*r/27.7%
sub-neg27.7%
distribute-lft-in27.7%
metadata-eval27.7%
metadata-eval27.7%
metadata-eval27.7%
fma-define27.7%
metadata-eval27.7%
Simplified27.7%
Taylor expanded in n around inf 47.0%
Taylor expanded in i around 0 80.3%
+-commutative80.3%
associate-*r*80.3%
distribute-rgt-in80.3%
*-commutative80.3%
Simplified80.3%
Final simplification70.6%
(FPCore (i n)
:precision binary64
(if (or (<= n -1.4e-121) (not (<= n 5.6e-190)))
(*
n
(+
100.0
(* i (+ 50.0 (* i (+ 16.666666666666668 (* i 4.166666666666667)))))))
(/ 0.0 (/ i n))))
double code(double i, double n) {
double tmp;
if ((n <= -1.4e-121) || !(n <= 5.6e-190)) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-1.4d-121)) .or. (.not. (n <= 5.6d-190))) then
tmp = n * (100.0d0 + (i * (50.0d0 + (i * (16.666666666666668d0 + (i * 4.166666666666667d0))))))
else
tmp = 0.0d0 / (i / n)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -1.4e-121) || !(n <= 5.6e-190)) {
tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667))))));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -1.4e-121) or not (n <= 5.6e-190): tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))) else: tmp = 0.0 / (i / n) return tmp
function code(i, n) tmp = 0.0 if ((n <= -1.4e-121) || !(n <= 5.6e-190)) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * Float64(16.666666666666668 + Float64(i * 4.166666666666667))))))); else tmp = Float64(0.0 / Float64(i / n)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -1.4e-121) || ~((n <= 5.6e-190))) tmp = n * (100.0 + (i * (50.0 + (i * (16.666666666666668 + (i * 4.166666666666667)))))); else tmp = 0.0 / (i / n); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -1.4e-121], N[Not[LessEqual[n, 5.6e-190]], $MachinePrecision]], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * N[(16.666666666666668 + N[(i * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.4 \cdot 10^{-121} \lor \neg \left(n \leq 5.6 \cdot 10^{-190}\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -1.4000000000000001e-121 or 5.60000000000000011e-190 < n Initial program 20.4%
associate-/r/20.8%
associate-*r*20.8%
*-commutative20.8%
associate-*r/20.8%
sub-neg20.8%
distribute-lft-in20.8%
metadata-eval20.8%
metadata-eval20.8%
metadata-eval20.8%
fma-define20.8%
metadata-eval20.8%
Simplified20.8%
Taylor expanded in n around inf 31.3%
sub-neg31.3%
metadata-eval31.3%
metadata-eval31.3%
distribute-lft-in31.3%
metadata-eval31.3%
sub-neg31.3%
expm1-define84.7%
Simplified84.7%
Taylor expanded in i around 0 70.9%
*-commutative70.9%
Simplified70.9%
if -1.4000000000000001e-121 < n < 5.60000000000000011e-190Initial program 50.2%
associate-*r/50.2%
sub-neg50.2%
distribute-rgt-in50.2%
metadata-eval50.2%
metadata-eval50.2%
Simplified50.2%
Taylor expanded in i around 0 61.3%
Final simplification69.6%
(FPCore (i n) :precision binary64 (if (or (<= n -1.15e-122) (not (<= n 1.15e-189))) (* n (+ 100.0 (* i (+ 50.0 (* i 16.666666666666668))))) (/ 0.0 (/ i n))))
double code(double i, double n) {
double tmp;
if ((n <= -1.15e-122) || !(n <= 1.15e-189)) {
tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-1.15d-122)) .or. (.not. (n <= 1.15d-189))) then
tmp = n * (100.0d0 + (i * (50.0d0 + (i * 16.666666666666668d0))))
else
tmp = 0.0d0 / (i / n)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -1.15e-122) || !(n <= 1.15e-189)) {
tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
} else {
tmp = 0.0 / (i / n);
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -1.15e-122) or not (n <= 1.15e-189): tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))) else: tmp = 0.0 / (i / n) return tmp
function code(i, n) tmp = 0.0 if ((n <= -1.15e-122) || !(n <= 1.15e-189)) tmp = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * 16.666666666666668))))); else tmp = Float64(0.0 / Float64(i / n)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -1.15e-122) || ~((n <= 1.15e-189))) tmp = n * (100.0 + (i * (50.0 + (i * 16.666666666666668)))); else tmp = 0.0 / (i / n); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -1.15e-122], N[Not[LessEqual[n, 1.15e-189]], $MachinePrecision]], N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.15 \cdot 10^{-122} \lor \neg \left(n \leq 1.15 \cdot 10^{-189}\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -1.15000000000000003e-122 or 1.1499999999999999e-189 < n Initial program 20.4%
associate-/r/20.8%
associate-*r*20.8%
*-commutative20.8%
associate-*r/20.8%
sub-neg20.8%
distribute-lft-in20.8%
metadata-eval20.8%
metadata-eval20.8%
metadata-eval20.8%
fma-define20.8%
metadata-eval20.8%
Simplified20.8%
Taylor expanded in n around inf 31.3%
sub-neg31.3%
metadata-eval31.3%
metadata-eval31.3%
distribute-lft-in31.3%
metadata-eval31.3%
sub-neg31.3%
expm1-define84.7%
Simplified84.7%
Taylor expanded in i around 0 69.1%
*-commutative69.1%
Simplified69.1%
if -1.15000000000000003e-122 < n < 1.1499999999999999e-189Initial program 50.2%
associate-*r/50.2%
sub-neg50.2%
distribute-rgt-in50.2%
metadata-eval50.2%
metadata-eval50.2%
Simplified50.2%
Taylor expanded in i around 0 61.3%
Final simplification68.0%
(FPCore (i n) :precision binary64 (if (or (<= n -1.15e-122) (not (<= n 6e-190))) (* n (+ 100.0 (* i 50.0))) (/ (* n 0.0) i)))
double code(double i, double n) {
double tmp;
if ((n <= -1.15e-122) || !(n <= 6e-190)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = (n * 0.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 <= (-1.15d-122)) .or. (.not. (n <= 6d-190))) then
tmp = n * (100.0d0 + (i * 50.0d0))
else
tmp = (n * 0.0d0) / i
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -1.15e-122) || !(n <= 6e-190)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = (n * 0.0) / i;
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -1.15e-122) or not (n <= 6e-190): tmp = n * (100.0 + (i * 50.0)) else: tmp = (n * 0.0) / i return tmp
function code(i, n) tmp = 0.0 if ((n <= -1.15e-122) || !(n <= 6e-190)) tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); else tmp = Float64(Float64(n * 0.0) / i); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -1.15e-122) || ~((n <= 6e-190))) tmp = n * (100.0 + (i * 50.0)); else tmp = (n * 0.0) / i; end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -1.15e-122], N[Not[LessEqual[n, 6e-190]], $MachinePrecision]], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n * 0.0), $MachinePrecision] / i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.15 \cdot 10^{-122} \lor \neg \left(n \leq 6 \cdot 10^{-190}\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{n \cdot 0}{i}\\
\end{array}
\end{array}
if n < -1.15000000000000003e-122 or 5.9999999999999996e-190 < n Initial program 20.4%
Taylor expanded in n around inf 31.3%
*-commutative31.3%
associate-/l*31.3%
expm1-define84.8%
Simplified84.8%
Taylor expanded in i around 0 67.0%
+-commutative67.0%
associate-*r*67.0%
distribute-rgt-in67.0%
*-commutative67.0%
Simplified67.0%
if -1.15000000000000003e-122 < n < 5.9999999999999996e-190Initial program 50.2%
associate-/r/50.4%
associate-*r*50.4%
*-commutative50.4%
associate-*r/50.4%
sub-neg50.4%
distribute-lft-in50.4%
metadata-eval50.4%
metadata-eval50.4%
metadata-eval50.4%
fma-define50.4%
metadata-eval50.4%
Simplified50.4%
Taylor expanded in n around inf 29.6%
Taylor expanded in i around 0 61.3%
Final simplification66.2%
(FPCore (i n) :precision binary64 (if (or (<= n -3.45e+27) (not (<= n 1.45))) (* n (+ 100.0 (* i 50.0))) (* 100.0 (/ i (/ i n)))))
double code(double i, double n) {
double tmp;
if ((n <= -3.45e+27) || !(n <= 1.45)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-3.45d+27)) .or. (.not. (n <= 1.45d0))) then
tmp = n * (100.0d0 + (i * 50.0d0))
else
tmp = 100.0d0 * (i / (i / n))
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if ((n <= -3.45e+27) || !(n <= 1.45)) {
tmp = n * (100.0 + (i * 50.0));
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
def code(i, n): tmp = 0 if (n <= -3.45e+27) or not (n <= 1.45): tmp = n * (100.0 + (i * 50.0)) else: tmp = 100.0 * (i / (i / n)) return tmp
function code(i, n) tmp = 0.0 if ((n <= -3.45e+27) || !(n <= 1.45)) tmp = Float64(n * Float64(100.0 + Float64(i * 50.0))); else tmp = Float64(100.0 * Float64(i / Float64(i / n))); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if ((n <= -3.45e+27) || ~((n <= 1.45))) tmp = n * (100.0 + (i * 50.0)); else tmp = 100.0 * (i / (i / n)); end tmp_2 = tmp; end
code[i_, n_] := If[Or[LessEqual[n, -3.45e+27], N[Not[LessEqual[n, 1.45]], $MachinePrecision]], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -3.45 \cdot 10^{+27} \lor \neg \left(n \leq 1.45\right):\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\end{array}
\end{array}
if n < -3.45000000000000009e27 or 1.44999999999999996 < n Initial program 23.9%
Taylor expanded in n around inf 41.7%
*-commutative41.7%
associate-/l*41.6%
expm1-define91.0%
Simplified91.0%
Taylor expanded in i around 0 66.8%
+-commutative66.8%
associate-*r*66.8%
distribute-rgt-in66.8%
*-commutative66.8%
Simplified66.8%
if -3.45000000000000009e27 < n < 1.44999999999999996Initial program 25.6%
Taylor expanded in i around 0 63.5%
Final simplification65.5%
(FPCore (i n) :precision binary64 (if (<= n -1.15e-122) (* 100.0 (* n (+ 1.0 (* i 0.5)))) (if (<= n 1.1e-189) (/ 0.0 (/ i n)) (* n (+ 100.0 (* i 50.0))))))
double code(double i, double n) {
double tmp;
if (n <= -1.15e-122) {
tmp = 100.0 * (n * (1.0 + (i * 0.5)));
} else if (n <= 1.1e-189) {
tmp = 0.0 / (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.15d-122)) then
tmp = 100.0d0 * (n * (1.0d0 + (i * 0.5d0)))
else if (n <= 1.1d-189) then
tmp = 0.0d0 / (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.15e-122) {
tmp = 100.0 * (n * (1.0 + (i * 0.5)));
} else if (n <= 1.1e-189) {
tmp = 0.0 / (i / n);
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.15e-122: tmp = 100.0 * (n * (1.0 + (i * 0.5))) elif n <= 1.1e-189: tmp = 0.0 / (i / n) else: tmp = n * (100.0 + (i * 50.0)) return tmp
function code(i, n) tmp = 0.0 if (n <= -1.15e-122) tmp = Float64(100.0 * Float64(n * Float64(1.0 + Float64(i * 0.5)))); elseif (n <= 1.1e-189) tmp = Float64(0.0 / 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.15e-122) tmp = 100.0 * (n * (1.0 + (i * 0.5))); elseif (n <= 1.1e-189) tmp = 0.0 / (i / n); else tmp = n * (100.0 + (i * 50.0)); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.15e-122], N[(100.0 * N[(n * N[(1.0 + N[(i * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.1e-189], N[(0.0 / N[(i / n), $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.15 \cdot 10^{-122}:\\
\;\;\;\;100 \cdot \left(n \cdot \left(1 + i \cdot 0.5\right)\right)\\
\mathbf{elif}\;n \leq 1.1 \cdot 10^{-189}:\\
\;\;\;\;\frac{0}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if n < -1.15000000000000003e-122Initial program 19.4%
Taylor expanded in n around inf 31.4%
*-commutative31.4%
associate-/l*31.3%
expm1-define88.4%
Simplified88.4%
Taylor expanded in i around 0 66.5%
*-commutative66.5%
Simplified66.5%
if -1.15000000000000003e-122 < n < 1.1000000000000001e-189Initial program 50.2%
associate-*r/50.2%
sub-neg50.2%
distribute-rgt-in50.2%
metadata-eval50.2%
metadata-eval50.2%
Simplified50.2%
Taylor expanded in i around 0 61.3%
if 1.1000000000000001e-189 < n Initial program 21.5%
Taylor expanded in n around inf 31.3%
*-commutative31.3%
associate-/l*31.3%
expm1-define80.5%
Simplified80.5%
Taylor expanded in i around 0 67.6%
+-commutative67.6%
associate-*r*67.6%
distribute-rgt-in67.6%
*-commutative67.6%
Simplified67.6%
Final simplification66.2%
(FPCore (i n) :precision binary64 (if (<= n -1.15e-122) (* 100.0 (* n (+ 1.0 (* i 0.5)))) (if (<= n 9.5e-190) (/ (* n 0.0) i) (* n (+ 100.0 (* i 50.0))))))
double code(double i, double n) {
double tmp;
if (n <= -1.15e-122) {
tmp = 100.0 * (n * (1.0 + (i * 0.5)));
} else if (n <= 9.5e-190) {
tmp = (n * 0.0) / i;
} 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.15d-122)) then
tmp = 100.0d0 * (n * (1.0d0 + (i * 0.5d0)))
else if (n <= 9.5d-190) then
tmp = (n * 0.0d0) / i
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.15e-122) {
tmp = 100.0 * (n * (1.0 + (i * 0.5)));
} else if (n <= 9.5e-190) {
tmp = (n * 0.0) / i;
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -1.15e-122: tmp = 100.0 * (n * (1.0 + (i * 0.5))) elif n <= 9.5e-190: tmp = (n * 0.0) / i else: tmp = n * (100.0 + (i * 50.0)) return tmp
function code(i, n) tmp = 0.0 if (n <= -1.15e-122) tmp = Float64(100.0 * Float64(n * Float64(1.0 + Float64(i * 0.5)))); elseif (n <= 9.5e-190) tmp = Float64(Float64(n * 0.0) / i); 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.15e-122) tmp = 100.0 * (n * (1.0 + (i * 0.5))); elseif (n <= 9.5e-190) tmp = (n * 0.0) / i; else tmp = n * (100.0 + (i * 50.0)); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[n, -1.15e-122], N[(100.0 * N[(n * N[(1.0 + N[(i * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 9.5e-190], N[(N[(n * 0.0), $MachinePrecision] / i), $MachinePrecision], N[(n * N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.15 \cdot 10^{-122}:\\
\;\;\;\;100 \cdot \left(n \cdot \left(1 + i \cdot 0.5\right)\right)\\
\mathbf{elif}\;n \leq 9.5 \cdot 10^{-190}:\\
\;\;\;\;\frac{n \cdot 0}{i}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if n < -1.15000000000000003e-122Initial program 19.4%
Taylor expanded in n around inf 31.4%
*-commutative31.4%
associate-/l*31.3%
expm1-define88.4%
Simplified88.4%
Taylor expanded in i around 0 66.5%
*-commutative66.5%
Simplified66.5%
if -1.15000000000000003e-122 < n < 9.50000000000000055e-190Initial program 50.2%
associate-/r/50.4%
associate-*r*50.4%
*-commutative50.4%
associate-*r/50.4%
sub-neg50.4%
distribute-lft-in50.4%
metadata-eval50.4%
metadata-eval50.4%
metadata-eval50.4%
fma-define50.4%
metadata-eval50.4%
Simplified50.4%
Taylor expanded in n around inf 29.6%
Taylor expanded in i around 0 61.3%
if 9.50000000000000055e-190 < n Initial program 21.5%
Taylor expanded in n around inf 31.3%
*-commutative31.3%
associate-/l*31.3%
expm1-define80.5%
Simplified80.5%
Taylor expanded in i around 0 67.6%
+-commutative67.6%
associate-*r*67.6%
distribute-rgt-in67.6%
*-commutative67.6%
Simplified67.6%
Final simplification66.2%
(FPCore (i n) :precision binary64 (if (<= n -2.2e-8) (/ (* (* i n) 100.0) i) (if (<= n 0.0275) (* 100.0 (/ i (/ i n))) (* n (+ 100.0 (* i 50.0))))))
double code(double i, double n) {
double tmp;
if (n <= -2.2e-8) {
tmp = ((i * n) * 100.0) / i;
} else if (n <= 0.0275) {
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 <= (-2.2d-8)) then
tmp = ((i * n) * 100.0d0) / i
else if (n <= 0.0275d0) 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 <= -2.2e-8) {
tmp = ((i * n) * 100.0) / i;
} else if (n <= 0.0275) {
tmp = 100.0 * (i / (i / n));
} else {
tmp = n * (100.0 + (i * 50.0));
}
return tmp;
}
def code(i, n): tmp = 0 if n <= -2.2e-8: tmp = ((i * n) * 100.0) / i elif n <= 0.0275: 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 <= -2.2e-8) tmp = Float64(Float64(Float64(i * n) * 100.0) / i); elseif (n <= 0.0275) 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 <= -2.2e-8) tmp = ((i * n) * 100.0) / i; elseif (n <= 0.0275) 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, -2.2e-8], N[(N[(N[(i * n), $MachinePrecision] * 100.0), $MachinePrecision] / i), $MachinePrecision], If[LessEqual[n, 0.0275], 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 -2.2 \cdot 10^{-8}:\\
\;\;\;\;\frac{\left(i \cdot n\right) \cdot 100}{i}\\
\mathbf{elif}\;n \leq 0.0275:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\
\end{array}
\end{array}
if n < -2.1999999999999998e-8Initial program 21.8%
associate-/r/22.3%
associate-*r*22.3%
*-commutative22.3%
associate-*r/22.4%
sub-neg22.4%
distribute-lft-in22.4%
metadata-eval22.4%
metadata-eval22.4%
metadata-eval22.4%
fma-define22.4%
metadata-eval22.4%
Simplified22.4%
Taylor expanded in n around inf 36.2%
Taylor expanded in i around 0 63.8%
if -2.1999999999999998e-8 < n < 0.0275000000000000001Initial program 25.7%
Taylor expanded in i around 0 62.3%
if 0.0275000000000000001 < n Initial program 27.2%
Taylor expanded in n around inf 47.1%
*-commutative47.1%
associate-/l*47.0%
expm1-define93.8%
Simplified93.8%
Taylor expanded in i around 0 73.2%
+-commutative73.2%
associate-*r*73.2%
distribute-rgt-in73.2%
*-commutative73.2%
Simplified73.2%
Final simplification65.7%
(FPCore (i n) :precision binary64 (if (<= i -2e+82) (* 100.0 (/ i (/ i n))) (if (<= i 3.3e+48) (* n 100.0) (* 50.0 (* i n)))))
double code(double i, double n) {
double tmp;
if (i <= -2e+82) {
tmp = 100.0 * (i / (i / n));
} else if (i <= 3.3e+48) {
tmp = n * 100.0;
} else {
tmp = 50.0 * (i * n);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (i <= (-2d+82)) then
tmp = 100.0d0 * (i / (i / n))
else if (i <= 3.3d+48) then
tmp = n * 100.0d0
else
tmp = 50.0d0 * (i * n)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (i <= -2e+82) {
tmp = 100.0 * (i / (i / n));
} else if (i <= 3.3e+48) {
tmp = n * 100.0;
} else {
tmp = 50.0 * (i * n);
}
return tmp;
}
def code(i, n): tmp = 0 if i <= -2e+82: tmp = 100.0 * (i / (i / n)) elif i <= 3.3e+48: tmp = n * 100.0 else: tmp = 50.0 * (i * n) return tmp
function code(i, n) tmp = 0.0 if (i <= -2e+82) tmp = Float64(100.0 * Float64(i / Float64(i / n))); elseif (i <= 3.3e+48) tmp = Float64(n * 100.0); else tmp = Float64(50.0 * Float64(i * n)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (i <= -2e+82) tmp = 100.0 * (i / (i / n)); elseif (i <= 3.3e+48) tmp = n * 100.0; else tmp = 50.0 * (i * n); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, -2e+82], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 3.3e+48], N[(n * 100.0), $MachinePrecision], N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2 \cdot 10^{+82}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
\mathbf{elif}\;i \leq 3.3 \cdot 10^{+48}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;50 \cdot \left(i \cdot n\right)\\
\end{array}
\end{array}
if i < -1.9999999999999999e82Initial program 61.6%
Taylor expanded in i around 0 18.4%
if -1.9999999999999999e82 < i < 3.30000000000000023e48Initial program 9.6%
associate-/r/10.1%
associate-*r*10.1%
*-commutative10.1%
associate-*r/10.1%
sub-neg10.1%
distribute-lft-in10.1%
metadata-eval10.1%
metadata-eval10.1%
metadata-eval10.1%
fma-define10.1%
metadata-eval10.1%
Simplified10.1%
Taylor expanded in i around 0 77.4%
*-commutative77.4%
Simplified77.4%
if 3.30000000000000023e48 < i Initial program 50.3%
associate-/r/50.4%
associate-*r*50.4%
*-commutative50.4%
associate-*r/50.5%
sub-neg50.5%
distribute-lft-in50.5%
metadata-eval50.5%
metadata-eval50.5%
metadata-eval50.5%
fma-define50.5%
metadata-eval50.5%
Simplified50.5%
Taylor expanded in n around inf 60.2%
Taylor expanded in i around 0 53.1%
+-commutative53.1%
associate-*r*53.1%
distribute-rgt-in53.1%
*-commutative53.1%
Simplified53.1%
Taylor expanded in i around inf 39.0%
(FPCore (i n) :precision binary64 (if (<= i 3.3e+48) (* n 100.0) (* 50.0 (* i n))))
double code(double i, double n) {
double tmp;
if (i <= 3.3e+48) {
tmp = n * 100.0;
} else {
tmp = 50.0 * (i * n);
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (i <= 3.3d+48) then
tmp = n * 100.0d0
else
tmp = 50.0d0 * (i * n)
end if
code = tmp
end function
public static double code(double i, double n) {
double tmp;
if (i <= 3.3e+48) {
tmp = n * 100.0;
} else {
tmp = 50.0 * (i * n);
}
return tmp;
}
def code(i, n): tmp = 0 if i <= 3.3e+48: tmp = n * 100.0 else: tmp = 50.0 * (i * n) return tmp
function code(i, n) tmp = 0.0 if (i <= 3.3e+48) tmp = Float64(n * 100.0); else tmp = Float64(50.0 * Float64(i * n)); end return tmp end
function tmp_2 = code(i, n) tmp = 0.0; if (i <= 3.3e+48) tmp = n * 100.0; else tmp = 50.0 * (i * n); end tmp_2 = tmp; end
code[i_, n_] := If[LessEqual[i, 3.3e+48], N[(n * 100.0), $MachinePrecision], N[(50.0 * N[(i * n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq 3.3 \cdot 10^{+48}:\\
\;\;\;\;n \cdot 100\\
\mathbf{else}:\\
\;\;\;\;50 \cdot \left(i \cdot n\right)\\
\end{array}
\end{array}
if i < 3.30000000000000023e48Initial program 18.0%
associate-/r/18.4%
associate-*r*18.4%
*-commutative18.4%
associate-*r/18.4%
sub-neg18.4%
distribute-lft-in18.4%
metadata-eval18.4%
metadata-eval18.4%
metadata-eval18.4%
fma-define18.4%
metadata-eval18.4%
Simplified18.4%
Taylor expanded in i around 0 65.6%
*-commutative65.6%
Simplified65.6%
if 3.30000000000000023e48 < i Initial program 50.3%
associate-/r/50.4%
associate-*r*50.4%
*-commutative50.4%
associate-*r/50.5%
sub-neg50.5%
distribute-lft-in50.5%
metadata-eval50.5%
metadata-eval50.5%
metadata-eval50.5%
fma-define50.5%
metadata-eval50.5%
Simplified50.5%
Taylor expanded in n around inf 60.2%
Taylor expanded in i around 0 53.1%
+-commutative53.1%
associate-*r*53.1%
distribute-rgt-in53.1%
*-commutative53.1%
Simplified53.1%
Taylor expanded in i around inf 39.0%
(FPCore (i n) :precision binary64 (* n 100.0))
double code(double i, double n) {
return n * 100.0;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = n * 100.0d0
end function
public static double code(double i, double n) {
return n * 100.0;
}
def code(i, n): return n * 100.0
function code(i, n) return Float64(n * 100.0) end
function tmp = code(i, n) tmp = n * 100.0; end
code[i_, n_] := N[(n * 100.0), $MachinePrecision]
\begin{array}{l}
\\
n \cdot 100
\end{array}
Initial program 24.6%
associate-/r/24.9%
associate-*r*24.9%
*-commutative24.9%
associate-*r/25.0%
sub-neg25.0%
distribute-lft-in24.9%
metadata-eval24.9%
metadata-eval24.9%
metadata-eval24.9%
fma-define25.0%
metadata-eval25.0%
Simplified25.0%
Taylor expanded in i around 0 53.3%
*-commutative53.3%
Simplified53.3%
(FPCore (i n) :precision binary64 (* i -50.0))
double code(double i, double n) {
return i * -50.0;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = i * (-50.0d0)
end function
public static double code(double i, double n) {
return i * -50.0;
}
def code(i, n): return i * -50.0
function code(i, n) return Float64(i * -50.0) end
function tmp = code(i, n) tmp = i * -50.0; end
code[i_, n_] := N[(i * -50.0), $MachinePrecision]
\begin{array}{l}
\\
i \cdot -50
\end{array}
Initial program 24.6%
associate-/r/24.9%
associate-*r*24.9%
*-commutative24.9%
associate-*r/25.0%
sub-neg25.0%
distribute-lft-in24.9%
metadata-eval24.9%
metadata-eval24.9%
metadata-eval24.9%
fma-define25.0%
metadata-eval25.0%
Simplified25.0%
Taylor expanded in i around 0 60.8%
*-commutative60.8%
associate-*r/60.8%
metadata-eval60.8%
Simplified60.8%
Taylor expanded in n around 0 2.8%
*-commutative2.8%
Simplified2.8%
(FPCore (i n)
:precision binary64
(let* ((t_0 (+ 1.0 (/ i n))))
(*
100.0
(/
(-
(exp
(*
n
(if (== t_0 1.0)
(/ i n)
(/ (* (/ i n) (log t_0)) (- (+ (/ i n) 1.0) 1.0)))))
1.0)
(/ i n)))))
double code(double i, double n) {
double t_0 = 1.0 + (i / n);
double tmp;
if (t_0 == 1.0) {
tmp = i / n;
} else {
tmp = ((i / n) * log(t_0)) / (((i / n) + 1.0) - 1.0);
}
return 100.0 * ((exp((n * tmp)) - 1.0) / (i / n));
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (i / n)
if (t_0 == 1.0d0) then
tmp = i / n
else
tmp = ((i / n) * log(t_0)) / (((i / n) + 1.0d0) - 1.0d0)
end if
code = 100.0d0 * ((exp((n * tmp)) - 1.0d0) / (i / n))
end function
public static double code(double i, double n) {
double t_0 = 1.0 + (i / n);
double tmp;
if (t_0 == 1.0) {
tmp = i / n;
} else {
tmp = ((i / n) * Math.log(t_0)) / (((i / n) + 1.0) - 1.0);
}
return 100.0 * ((Math.exp((n * tmp)) - 1.0) / (i / n));
}
def code(i, n): t_0 = 1.0 + (i / n) tmp = 0 if t_0 == 1.0: tmp = i / n else: tmp = ((i / n) * math.log(t_0)) / (((i / n) + 1.0) - 1.0) return 100.0 * ((math.exp((n * tmp)) - 1.0) / (i / n))
function code(i, n) t_0 = Float64(1.0 + Float64(i / n)) tmp = 0.0 if (t_0 == 1.0) tmp = Float64(i / n); else tmp = Float64(Float64(Float64(i / n) * log(t_0)) / Float64(Float64(Float64(i / n) + 1.0) - 1.0)); end return Float64(100.0 * Float64(Float64(exp(Float64(n * tmp)) - 1.0) / Float64(i / n))) end
function tmp_2 = code(i, n) t_0 = 1.0 + (i / n); tmp = 0.0; if (t_0 == 1.0) tmp = i / n; else tmp = ((i / n) * log(t_0)) / (((i / n) + 1.0) - 1.0); end tmp_2 = 100.0 * ((exp((n * tmp)) - 1.0) / (i / n)); end
code[i_, n_] := Block[{t$95$0 = N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision]}, N[(100.0 * N[(N[(N[Exp[N[(n * If[Equal[t$95$0, 1.0], N[(i / n), $MachinePrecision], N[(N[(N[(i / n), $MachinePrecision] * N[Log[t$95$0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(i / n), $MachinePrecision] + 1.0), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]], $MachinePrecision] - 1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{i}{n}\\
100 \cdot \frac{e^{n \cdot \begin{array}{l}
\mathbf{if}\;t\_0 = 1:\\
\;\;\;\;\frac{i}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{i}{n} \cdot \log t\_0}{\left(\frac{i}{n} + 1\right) - 1}\\
\end{array}} - 1}{\frac{i}{n}}
\end{array}
\end{array}
herbie shell --seed 2024137
(FPCore (i n)
:name "Compound Interest"
:precision binary64
:alt
(! :herbie-platform default (let ((lnbase (if (== (+ 1 (/ i n)) 1) (/ i n) (/ (* (/ i n) (log (+ 1 (/ i n)))) (- (+ (/ i n) 1) 1))))) (* 100 (/ (- (exp (* n lnbase)) 1) (/ i n)))))
(* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))