/device/google/contexthub/firmware/os/algos/common/math/ |
D | vec.h | 49 float x, y, z; member 53 float x, y, z, w; member 57 static inline void initVec3(struct Vec3 *v, float x, float y, float z) { in initVec3() argument 61 v->z = z; in initVec3() 70 v->z += w->z; in vec3Add() 81 u->z = v->z + w->z; in vec3AddVecs() 90 v->z -= w->z; in vec3Sub() 101 u->z = v->z - w->z; in vec3SubVecs() 109 v->z *= c; in vec3ScalarMul() 116 return v->x * w->x + v->y * w->y + v->z * w->z; in vec3Dot() [all …]
|
D | kasa.c | 18 void kasaAccumulate(struct KasaFit *kasa, float x, float y, float z) { in kasaAccumulate() argument 19 float w = x * x + y * y + z * z; in kasaAccumulate() 23 kasa->acc_z += z; in kasaAccumulate() 28 kasa->acc_xz += x * z; in kasaAccumulate() 32 kasa->acc_yz += y * z; in kasaAccumulate() 35 kasa->acc_zz += z * z; in kasaAccumulate() 36 kasa->acc_zw += z * w; in kasaAccumulate() 105 initVec3(&v, out.x, out.y, out.z); in kasaFit() 111 initVec3(bias, v.x, v.y, v.z); in kasaFit()
|
D | quat.c | 28 q->z = sqrtf(clamp(-Hx - My + Az + 1.0f) * 0.25f); in initQuat() 32 q->z = copysignf(q->z, R->elem[0][1] - R->elem[1][0]); in initQuat() 39 float q3 = q->z; in quatToMatrix() 65 q->z = -q->z; in quatNormalize() 70 1.0f / sqrtf(q->x * q->x + q->y * q->y + q->z * q->z + q->w * q->w); in quatNormalize() 74 q->z *= invNorm; in quatNormalize()
|
D | vec.c | 25 float x, y, z; in findOrthogonalVector() local 31 z = -inY; in findOrthogonalVector() 35 z = -inX; in findOrthogonalVector() 39 z = 0.0f; in findOrthogonalVector() 42 float magSquared = x * x + y * y + z * z; in findOrthogonalVector() 51 *outZ = z * invMag; in findOrthogonalVector()
|
/device/google/contexthub/firmware/lib/libm/ |
D | kf_cos.c | 38 float a,hz,z,r,qx; local 45 z = x*x; 46 r = z*(C1+z*(C2+z*(C3+z*(C4+z*(C5+z*C6))))); 48 return one - ((float)0.5*z - (z*r - x*y)); 55 hz = (float)0.5*z-qx; 57 return a - (hz - (z*r-x*y));
|
D | ef_pow.c | 66 float z,ax,z_h,z_l,p_h,p_l; local 121 z = ax; /*x is +-0,+-inf,+-1*/ 122 if(hy<0) z = one/z; /* z = (1/|x|) */ 125 z = (z-z)/(z-z); /* (-1)**non-int is NaN */ 127 z = -z; /* (x<0)**odd = -(|x|**odd) */ 129 return z; 212 z = p_l+p_h; 213 GET_FLOAT_WORD(j,z); 219 if(p_l+ovt>z-p_h) return s*huge*huge; /* overflow */ 224 if(p_l<=z-p_h) return s*tiny*tiny; /* underflow */ [all …]
|
D | ef_rem_pio2.c | 105 float z,w,t,r,fn; local 116 z = x - pio2_1; 118 y[0] = z - pio2_1t; 119 y[1] = (z-y[0])-pio2_1t; 121 z -= pio2_2; 122 y[0] = z - pio2_2t; 123 y[1] = (z-y[0])-pio2_2t; 127 z = x + pio2_1; 129 y[0] = z + pio2_1t; 130 y[1] = (z-y[0])+pio2_1t; [all …]
|
D | kf_rem_pio2.c | 63 float z,fw,f[20],fq[20],q[20]; local 87 for(i=0,j=jz,z=q[jz];j>0;i++,j--) { 88 fw = (float)((__int32_t)(twon8* z)); 89 iq[i] = (__int32_t)(z-two8*fw); 90 z = q[j-1]+fw; 94 z = scalbnf(z,(int)q0); /* actual value of z */ 95 z -= (float)8.0*floorf(z*(float)0.125); /* trim off integer >= 8 */ 96 n = (__int32_t) z; 97 z -= (float)n; 105 else if(z>=(float)0.5) ih=2; [all …]
|
D | kf_sin.c | 38 float z,r,v; local 44 z = x*x; 45 v = z*x; 46 r = S2+z*(S3+z*(S4+z*(S5+z*S6))); 47 if(iy==0) return x+v*(S1+z*r); 48 else return x-((z*(half*y-v*r)-y)-v*S1);
|
D | ef_atan2.c | 38 float z; local 86 if(k > 60) z=pi_o_2+(float)0.5*pi_lo; /* |y/x| > 2**60 */ 87 else if(hx<0&&k<-60) z=0.0; /* |y|/x < -2**60 */ 88 else z=atanf(fabsf(y/x)); /* safe to do y/x */ 90 case 0: return z ; /* atan(+,+) */ 93 GET_FLOAT_WORD(zh,z); 94 SET_FLOAT_WORD(z,zh ^ 0x80000000); 96 return z ; /* atan(-,+) */ 97 case 2: return pi-(z-pi_lo);/* atan(+,-) */ 99 return (z-pi_lo)-pi;/* atan(-,-) */
|
D | sf_atan.c | 74 float w,s1,s2,z; local 105 z = x*x; 106 w = z*z; 108 s1 = z*(aT[0]+w*(aT[2]+w*(aT[4]+w*(aT[6]+w*(aT[8]+w*aT[10]))))); 112 z = atanhi[id] - ((x*(s1+s2) - atanlo[id]) - x); 113 return (hx<0)? -z:z;
|
D | ef_sqrt.c | 31 float z; local 76 z = one-tiny; /* trigger inexact flag */ 77 if (z>=one) { 78 z = one+tiny; 79 if (z>one) 87 SET_FLOAT_WORD(z,ix); 88 return z;
|
D | wf_pow.c | 33 float z; 35 z=__ieee754_powf(x,y); 36 if(_LIB_VERSION == _IEEE_|| isnan(y)) return z; 56 return z; 96 return z; 98 if(!finitef(z)) { 100 if(isnan(z)) { 146 if(z==(float)0.0&&finitef(x)&&finitef(y)) { 163 return z;
|
D | wf_asin.c | 35 float z; 37 z = __ieee754_asinf(x); 38 if(_LIB_VERSION == _IEEE_ || isnan(x)) return z; 55 return z;
|
D | wf_fmod.c | 33 float z; 35 z = __ieee754_fmodf(x,y); 36 if(_LIB_VERSION == _IEEE_ ||isnan(y)||isnan(x)) return z; 57 return z;
|
D | wf_exp.c | 43 float z; 45 z = __ieee754_expf(x); 46 if(_LIB_VERSION == _IEEE_) return z; 89 return z;
|
/device/google/contexthub/firmware/external/freebsd/lib/msun/src/ |
D | e_atan2f.c | 35 float z; in __ieee754_atan2f() local 84 z=pi_o_2+(float)0.5*pi_lo; in __ieee754_atan2f() 87 else if(k<-26&&hx<0) z=0.0; /* 0 > |y|/x > -2**-26 */ in __ieee754_atan2f() 88 else z=atanf(fabsf(y/x)); /* safe to do y/x */ in __ieee754_atan2f() 90 case 0: return z ; /* atan(+,+) */ in __ieee754_atan2f() 91 case 1: return -z ; /* atan(-,+) */ in __ieee754_atan2f() 92 case 2: return pi-(z-pi_lo);/* atan(+,-) */ in __ieee754_atan2f() 94 return (z-pi_lo)-pi;/* atan(-,-) */ in __ieee754_atan2f()
|
D | s_atanf.c | 51 float w,s1,s2,z; in atanf() local 82 z = x*x; in atanf() 83 w = z*z; in atanf() 85 s1 = z*(aT[0]+w*(aT[2]+w*aT[4])); in atanf() 89 z = atanhi[id] - ((x*(s1+s2) - atanlo[id]) - x); in atanf() 90 return (hx<0)? -z:z; in atanf()
|
D | math_private.h | 449 #define REALPART(z) ((z).a[0]) argument 450 #define IMAGPART(z) ((z).a[1]) argument 465 float_complex z; in cpackf() local 467 REALPART(z) = x; in cpackf() 468 IMAGPART(z) = y; in cpackf() 469 return (z.f); in cpackf() 475 double_complex z; in cpack() local 477 REALPART(z) = x; in cpack() 478 IMAGPART(z) = y; in cpack() 479 return (z.f); in cpack() [all …]
|
/device/google/contexthub/firmware/variant/nucleo/inc/variant/ |
D | variant.h | 43 #define BMI160_TO_ANDROID_COORDINATE(x, y, z) \ argument 45 float xi = x, yi = y, zi = z; \ 46 x = xi; y = yi; z = zi; \ 49 #define BMM150_TO_ANDROID_COORDINATE(x, y, z) \ argument 51 float xi = x, yi = y, zi = z; \ 52 x = xi; y = -yi; z = -zi; \
|
/device/google/contexthub/firmware/variant/lunchbox/inc/variant/ |
D | variant.h | 50 #define BMI160_TO_ANDROID_COORDINATE(x, y, z) \ argument 52 float xi = x, yi = y, zi = z; \ 53 x = -yi; y = xi; z = zi; \ 56 #define BMM150_TO_ANDROID_COORDINATE(x, y, z) \ argument 58 float xi = x, yi = y, zi = z; \ 59 x = xi; y = -yi; z = -zi; \
|
/device/google/contexthub/firmware/variant/neonkey/inc/variant/ |
D | variant.h | 61 #define BMI160_TO_ANDROID_COORDINATE(x, y, z) \ argument 63 float xi = x, yi = y, zi = z; \ 64 x = xi; y = yi; z = zi; \ 67 #define BMM150_TO_ANDROID_COORDINATE(x, y, z) \ argument 69 float xi = x, yi = y, zi = z; \ 70 x = xi; y = -yi; z = -zi; \
|
/device/google/contexthub/firmware/os/algos/calibration/magnetometer/mag_cal/ |
D | mag_cal.c | 67 evmax = (eigenvals.z > evmax) ? eigenvals.z : evmax; in moc_eigen_test() 70 evmin = (eigenvals.z < evmin) ? eigenvals.z : evmin; in moc_eigen_test() 72 float eigenvals_sum = eigenvals.x + eigenvals.y + eigenvals.z; in moc_eigen_test() 141 float x, float y, float z) { in magCalUpdate() argument 145 diversityCheckerUpdate(&moc->diversity_checker, x, y, z); in magCalUpdate() 148 kasaAccumulate(&moc->kasa, x, y, z); in magCalUpdate() 170 CAL_ENCODE_FLOAT(bias.z, 3), CAL_ENCODE_FLOAT(radius, 3), in magCalUpdate() 179 bias.z) && in magCalUpdate() 193 CAL_ENCODE_FLOAT(bias.z, 3), CAL_ENCODE_FLOAT(radius, 3), in magCalUpdate() 212 moc->z_bias = bias.z; in magCalUpdate() [all …]
|
/device/google/contexthub/firmware/os/algos/ |
D | fusion.c | 207 findOrthogonalVector(up.x, up.y, up.z, &east.x, &east.y, &east.z); in fusion_init_complete() 237 out->elem[1][0] = p->z; in matrixCross() 238 out->elem[0][1] = -p->z; in matrixCross() 315 O.elem[3][2] = -psi.z; in fusionPredict() 320 O.elem[2][3] = psi.z; in fusionPredict() 349 fusion->x0.z = -fusion->x0.z; in fusionPredict() 424 F[0].x = q->w; F[1].x = -q->z; F[2].x = q->y; in getF() 425 F[0].y = q->z; F[1].y = q->w; F[2].y = -q->x; in getF() 426 F[0].z = -q->y; F[1].z = q->x; F[2].z = q->w; in getF() 427 F[0].w = -q->x; F[1].w = -q->y; F[2].w = -q->z; in getF() [all …]
|
/device/google/contexthub/firmware/os/inc/ |
D | toolchain.h | 70 #define SET_EXTERNAL_APP_ATTRIBUTES(x, y, z) argument 72 #define SET_EXTERNAL_APP_VERSION(x, y, z) argument 113 #define SET_EXTERNAL_APP_ATTRIBUTES(x, y, z) __attribute__((x, y, z)) 115 #define SET_EXTERNAL_APP_VERSION(x, y, z) __attribute__((x, y, z))
|