Home
last modified time | relevance | path

Searched refs:k (Results 1 – 25 of 82) sorted by relevance

1234

/picolibc-3.7.0-3.6.0/newlib/libm/common/
Dsf_scalbln.c27 long int k; in scalblnf() local
31 k = hx>>23; /* extract exponent */ in scalblnf()
32 if (k==0) { /* 0 or subnormal x */ in scalblnf()
36 k = ((ix&0x7f800000)>>23) - 25; in scalblnf()
40 if (k==0xff) return x+x; /* NaN or Inf */ in scalblnf()
41 k = k+n; in scalblnf()
42 if (n> 50000 || k > 0xfe) in scalblnf()
44 if (k > 0) /* normal result */ in scalblnf()
45 {SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); return x;} in scalblnf()
46 if (k <= -25) in scalblnf()
[all …]
Ds_scalbln.c32 long int k; in scalbln64() local
34 k = (hx&0x7ff00000)>>20; /* extract exponent */ in scalbln64()
35 if (k==0) { /* 0 or subnormal x */ in scalbln64()
39 k = ((hx&0x7ff00000)>>20) - 54; in scalbln64()
42 if (k==0x7ff) return x+x; /* NaN or Inf */ in scalbln64()
43 k = k+n; in scalbln64()
44 if (n> 50000 || k > 0x7fe) in scalbln64()
46 if (k > 0) /* normal result */ in scalbln64()
47 {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;} in scalbln64()
48 if (k <= -54) in scalbln64()
[all …]
Dsf_scalbn.c32 __int32_t k,ix; in scalbnf() local
37 k = hx>>23; /* extract exponent */ in scalbnf()
38 if (k == 0) { in scalbnf()
42 k = ((ix&0x7f800000)>>23) - 25; in scalbnf()
48 if (k == 0xff) return x + x; /* NaN or Inf */ in scalbnf()
51 k = k+n; in scalbnf()
52 if (k > FLT_LARGEST_EXP) in scalbnf()
54 if (k > 0) /* normal result */ in scalbnf()
55 {SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); return x;} in scalbnf()
56 if (k <= -25) in scalbnf()
[all …]
Ds_scalbn.c75 __int32_t k,hx,lx; in scalbn64() local
77 k = (hx&0x7ff00000)>>20; /* extract exponent */ in scalbn64()
78 if (k==0) { /* 0 or subnormal x */ in scalbn64()
82 k = ((hx&0x7ff00000)>>20) - 54; in scalbn64()
87 if (k==0x7ff) return x+x; /* NaN or Inf */ in scalbn64()
92 k = k+n; in scalbn64()
93 if (k > 0x7fe) return __math_oflow(hx<0); /* overflow */ in scalbn64()
94 if (k > 0) /* normal result */ in scalbn64()
95 {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;} in scalbn64()
96 if (k <= -54) in scalbn64()
[all …]
Dsf_log1p.c37 __int32_t k,hx,hu,ax; in log1pf() local
42 k = 1; in log1pf()
59 k=0;f=x;hu=1;} /* -0.2929<x<0.41422 */ in log1pf()
61 if(k!=0) { in log1pf()
65 k = (hu>>23)-127; in log1pf()
67 c = (k>0)? (float)1.0-(u-x):x-(u-(float)1.0); in log1pf()
72 k = (hu>>23)-127; in log1pf()
79 k += 1; in log1pf()
87 if(f==zero) { if(k==0) return zero; in log1pf()
88 else {c += k*ln2_lo; return k*ln2_hi+c;}} in log1pf()
[all …]
Ds_log1p.c138 __int32_t k,hx,hu,ax; in log1p64() local
143 k = 1; in log1p64()
159 k=0;f=x;hu=1;} /* -0.2929<x<0.41422 */ in log1p64()
162 if(k!=0) { in log1p64()
166 k = (hu>>20)-1023; in log1p64()
167 c = (k>0)? _F_64(1.0)-(u-x):x-(u-_F_64(1.0));/* correction term */ in log1p64()
172 k = (hu>>20)-1023; in log1p64()
179 k += 1; in log1p64()
187 if(f==zero) { if(k==0) return zero; in log1p64()
188 else {c += k*ln2_lo; return k*ln2_hi+c;}} in log1p64()
[all …]
Dsf_expm1.c40 __int32_t k,xsb; in expm1f() local
66 {hi = x - ln2_hi; lo = ln2_lo; k = 1;} in expm1f()
68 {hi = x + ln2_hi; lo = -ln2_lo; k = -1;} in expm1f()
70 k = invln2*x+((xsb==0)?0.5f:-0.5f); in expm1f()
71 t = k; in expm1f()
82 else k = 0; in expm1f()
90 if(k==0) return x - (x*e-hxs); /* c is 0 */ in expm1f()
94 if(k== -1) return 0.5f*(x-e)-0.5f; in expm1f()
95 if(k==1) { in expm1f()
99 if (k <= -2 || k>56) { /* suffice to return exp(x)-1 */ in expm1f()
[all …]
Ds_expm1.c168 __int32_t k,xsb; in _NAME_64() local
198 {hi = x - ln2_hi; lo = ln2_lo; k = 1;} in _NAME_64()
200 {hi = x + ln2_hi; lo = -ln2_lo; k = -1;} in _NAME_64()
202 k = invln2*x+((xsb==0)?_F_64(0.5):_F_64(-0.5)); in _NAME_64()
203 t = k; in _NAME_64()
214 else k = 0; in _NAME_64()
222 if(k==0) return x - (x*e-hxs); /* c is 0 */ in _NAME_64()
226 if(k== -1) return _F_64(0.5)*(x-e)_F_64(-0.5); in _NAME_64()
227 if(k==1) { in _NAME_64()
231 if (k <= -2 || k>56) { /* suffice to return exp(x)-1 */ in _NAME_64()
[all …]
/picolibc-3.7.0-3.6.0/newlib/libc/stdlib/
Dmprec.c141 Balloc (int k) in Balloc() argument
146 x = 1 << k; in Balloc()
152 rv->_k = k; in Balloc()
225 int i, k; in s2b() local
229 for (k = 0, y = 1; x > y; y <<= 1, k++); in s2b()
231 b = Balloc (k); in s2b()
237 b = Balloc (k + 1); in s2b()
263 register int k = 0; in hi0bits() local
267 k = 16; in hi0bits()
272 k += 8; in hi0bits()
[all …]
Dgdtoa-gethex.c72 int k) in rshift() argument
78 n = k >> kshift; in rshift()
82 if (k &= kmask) { in rshift()
83 n = ULbits - k; in rshift()
84 y = *x++ >> k; in rshift()
87 y = *x++ >> k; in rshift()
156 int esign, havedig, irv, k, n, nbits, up, zret; in gethex() local
234 for(k = 0; n > 7; n >>= 1) in gethex()
235 k++; in gethex()
236 b = Balloc(k); in gethex()
[all …]
Dstrtorx.c61 ULtox(L, bits, exp, k) __UShort *L; __ULong *bits; Long exp; int k; in ULtox() argument
63 ULtox(__UShort *L, __ULong *bits, Long exp, int k)
66 switch(k & STRTOG_Retmask) {
96 if (k & STRTOG_Neg)
112 int k; local
120 k = _strtodg_l(s, sp, fpi, &exp, bits, loc);
121 ULtox((__UShort*)L, bits, exp, k);
122 return k;
Drand_r.c31 long k; in rand_r() local
35 k = s / 127773; in rand_r()
36 s = 16807 * (s - k * 127773) - 2836 * k; in rand_r()
/picolibc-3.7.0-3.6.0/newlib/libm/ld/common/
Ds_scalbnl.c33 __int32_t k; in scalbnl() local
35 k = u.bits.exp; /* extract exponent */ in scalbnl()
36 if (k==0) { /* 0 or subnormal x */ in scalbnl()
39 k = u.bits.exp - 128; in scalbnl()
42 if (k==0x7fff) return x+x; /* NaN or Inf */ in scalbnl()
47 k = k+n; in scalbnl()
48 if (k >= 0x7fff) return __math_oflowl(u.bits.sign); /* overflow */ in scalbnl()
49 if (k > 0) /* normal result */ in scalbnl()
50 {u.bits.exp = k; return u.e;} in scalbnl()
51 if (k <= -128) in scalbnl()
[all …]
Ds_cbrtl.c34 int k; in cbrtl() local
38 k = expsign & 0x7fff; in cbrtl()
44 if (k == BIAS + LDBL_MAX_EXP) in cbrtl()
47 if (k == 0) { in cbrtl()
54 k = u.bits.exp; in cbrtl()
55 k -= BIAS + 514; in cbrtl()
57 k -= BIAS; in cbrtl()
62 switch (k % 3) { in cbrtl()
66 k--; in cbrtl()
71 k -= 2; in cbrtl()
[all …]
/picolibc-3.7.0-3.6.0/newlib/libm/math/
Dsf_log.c36 __int32_t k, ix, i, j; in logf() local
40 k = 0; in logf()
48 k -= 25; in logf()
52 k += (ix >> 23) - 127; in logf()
56 k += (i >> 23); in logf()
60 if (k == 0) in logf()
63 dk = (float)k; in logf()
68 if (k == 0) in logf()
71 dk = (float)k; in logf()
76 dk = (float)k; in logf()
[all …]
Ds_log.c87 __int32_t k, hx, i, j; in log64() local
92 k = 0; in log64()
98 k -= 54; in log64()
104 k += (hx >> 20) - 1023; in log64()
108 k += (i >> 20); in log64()
112 if (k == 0) in log64()
115 dk = (__float64)k; in log64()
120 if (k == 0) in log64()
123 dk = (__float64)k; in log64()
128 dk = (__float64)k; in log64()
[all …]
Dsf_log10.c27 __int32_t i, k, hx; in log10f() local
31 k = 0; in log10f()
39 k -= 25; in log10f()
43 k += (hx >> 23) - 127; in log10f()
44 i = ((__uint32_t)k & 0x80000000) >> 31; in log10f()
46 y = (float)(k + i); in log10f()
Ds_pow.c102 __int32_t i, j, k, yisint, n; in pow64() local
137 k = (iy >> 20) - 0x3ff; /* exponent */ in pow64()
138 if (k > 20) { in pow64()
139 __uint32_t uj = ly >> (52 - k); in pow64()
140 if ((uj << (52 - k)) == ly) in pow64()
143 j = iy >> (20 - k); in pow64()
144 if ((j << (20 - k)) == iy) in pow64()
249 k = 0; /* |x|<sqrt(3/2) */ in pow64()
251 k = 1; /* |x|<sqrt(3) */ in pow64()
253 k = 0; in pow64()
[all …]
Ds_log10.c61 __int32_t i, k, hx; in log1064() local
66 k = 0; in log1064()
72 k -= 54; in log1064()
78 k += (hx >> 20) - 1023; in log1064()
79 i = ((__uint32_t)k & 0x80000000) >> 31; in log1064()
81 y = (__float64)(k + i); in log1064()
Dsf_exp.c44 __int32_t k = 0, xsb, sx; in expf() local
66 k = 1 - xsb - xsb; in expf()
68 k = invln2 * x + halF[xsb]; in expf()
69 t = k; in expf()
82 if (k == 0) in expf()
86 if (k >= -125) { in expf()
89 SET_FLOAT_WORD(y, hy + (k << 23)); /* add k to y's exponent */ in expf()
94 SET_FLOAT_WORD(y, hy + ((k + 100) << 23)); /* add k to y's exponent */ in expf()
Dsf_pow.c61 __int32_t i, j, k, yisint, n; in powf() local
94 k = (iy >> 23) - 0x7f; /* exponent */ in powf()
95 j = iy >> (23 - k); in powf()
96 if ((j << (23 - k)) == iy) in powf()
184 k = 0; /* |x|<sqrt(3/2) */ in powf()
186 k = 1; /* |x|<sqrt(3) */ in powf()
188 k = 0; in powf()
195 u = ax - bp[k]; /* bp[0]=1.0, bp[1]=1.5 */ in powf()
196 v = one / (ax + bp[k]); in powf()
202 SET_FLOAT_WORD(t_h, ((ix >> 1) | 0x20000000) + 0x0040000 + (k << 21)); in powf()
[all …]
/picolibc-3.7.0-3.6.0/newlib/libc/string/
Dstr-two-way.h98 size_t k; /* Offset into current period. */ in critical_factorization() local
114 k = p = 1; in critical_factorization()
115 while (j + k < needle_len) in critical_factorization()
117 a = CANON_ELEMENT (needle[j + k]); in critical_factorization()
118 b = CANON_ELEMENT (needle[(size_t)(max_suffix + k)]); in critical_factorization()
122 j += k; in critical_factorization()
123 k = 1; in critical_factorization()
129 if (k != p) in critical_factorization()
130 ++k; in critical_factorization()
134 k = 1; in critical_factorization()
[all …]
/picolibc-3.7.0-3.6.0/newlib/libm/ld/ld128/
De_logl.c193 int k, e; in logl() local
199 k = m & 0x7fffffff; in logl()
201 if ((k | u.parts32.mswlo | u.parts32.lswhi | u.parts32.lswlo) == 0) in logl()
211 if (k >= 0x7fff0000) in logl()
237 k = (m - 0xff00) >> 9; in logl()
240 t.parts32.mswhi = 0x3fff0000 + (k << 9); in logl()
246 k += 64; in logl()
250 k = (m - 0xfe00) >> 10; in logl()
251 t.parts32.mswhi = 0x3ffe0000 + (k << 10); in logl()
260 k = 64; in logl()
[all …]
/picolibc-3.7.0-3.6.0/newlib/testsuite/newlib.iconv/
Diconvru.c392 unsigned k; in main() local
450 for (k = 0; k < data[j].len; k++) in main()
452 if (ob[k] != data[j].data[k]) in main()
456 printf("Error: byte %d is wrong\n", k); in main()
459 (int)ob[k], (int)(data[i].data[k]), in main()
460 (int)(data[j].data[k])); in main()
Diconvjp.c881 unsigned k; in main() local
939 for (k = 0; k < data[j].len; k++) in main()
941 if (ob[k] != data[j].data[k]) in main()
945 printf("Error: byte %d is wrong\n", k); in main()
948 (int)ob[k], (int)(data[i].data[k]), in main()
949 (int)(data[j].data[k])); in main()

1234