Changeset b1b201f in mainline
- Timestamp:
- 2018-08-29T20:05:41Z (6 years ago)
- Children:
- b2acdf32
- Parents:
- e43d658
- git-author:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-29 15:41:30)
- git-committer:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-29 20:05:41)
- Location:
- uspace
- Files:
-
- 4 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/float/float2.c
re43d658 rb1b201f 43 43 }; 44 44 45 static double arguments_acos[OPERANDS] = {46 -0.936456687291, -0.504846104600, 0.862318872288, 0.964966028492,47 0.987353618220, 1.0, -0.194939922623, 0.978471923925, -0.999023478833,48 0.54030230586849 };50 51 static double arguments_asin[OPERANDS] = {52 -0.350783227690, -0.863209366649, -0.506365641110, -0.262374853704,53 0.158533380044, 0.0, 0.980815184715, -0.206379975025, -0.044182448332,54 0.84147098480855 };56 57 45 static double arguments_atan[OPERANDS] = { 58 46 3.5, 100.0, 50.0, 768.3156, 1080.499999, 1.0, 66.0, … … 76 64 static double arguments_tanh[OPERANDS] = { 77 65 3.5, -2.1, 50.0, 0.0, 1.0, 13.2, -1.1, -5.5, 0.000001, -66000000.0 78 };79 80 static double results_acos[OPERANDS] = {81 2.783185307180, 2.100000000000, 0.530964914873, 0.265482457437,82 0.159205070272, 0.000000000000, 1.766992524091, 0.207873834887,83 3.097395817941, 1.00000000000084 };85 86 static double results_asin[OPERANDS] = {87 -0.358407346411, -1.041592653590, -0.530964914874, -0.265482457437,88 0.159205070273, 0.000000000000, 1.374600129498, -0.207873834889,89 -0.044196835651, 1.00000000000090 66 }; 91 67 … … 217 193 218 194 for (unsigned int i = 0; i < OPERANDS; i++) { 219 double res = acos(arguments_acos[i]);220 221 if (!cmp_double(res, results_acos[i])) {222 TPRINTF("Double precision acos failed "223 "(%lf != %lf, arg %u)\n", res, results_acos[i], i);224 fail = true;225 }226 }227 228 for (unsigned int i = 0; i < OPERANDS; i++) {229 float res = acosf(arguments_acos[i]);230 231 if (!cmp_float(res, results_acos[i])) {232 TPRINTF("Single precision acos failed "233 "(%f != %lf, arg %u)\n", res, results_acos[i], i);234 fail = true;235 }236 }237 238 for (unsigned int i = 0; i < OPERANDS; i++) {239 double res = asin(arguments_asin[i]);240 241 if (!cmp_double(res, results_asin[i])) {242 TPRINTF("Double precision asin failed "243 "(%lf != %lf, arg %u)\n", res, results_asin[i], i);244 fail = true;245 }246 }247 248 for (unsigned int i = 0; i < OPERANDS; i++) {249 float res = asinf(arguments_asin[i]);250 251 if (!cmp_float(res, results_asin[i])) {252 TPRINTF("Single precision asin failed "253 "(%f != %lf, arg %u)\n", res, results_asin[i], i);254 fail = true;255 }256 }257 258 for (unsigned int i = 0; i < OPERANDS; i++) {259 195 double res = atan(arguments_atan[i]); 260 196 -
uspace/lib/math/Makefile
re43d658 rb1b201f 34 34 35 35 SOURCES = \ 36 generic/acos.c \37 generic/asin.c \38 36 generic/atan.c \ 39 37 generic/atan2.c \ -
uspace/lib/math/include/math.h
re43d658 rb1b201f 37 37 #define LIBMATH_MATH_H_ 38 38 39 #include <acos.h>40 #include <asin.h>41 39 #include <atan.h> 42 40 #include <atan2.h> … … 64 62 #define HUGE_VAL FLOAT64_INF 65 63 66 static inline float64_t acos_f64(float64_t val)67 {68 return float64_acos(val);69 }70 71 static inline float32_t acos_f32(float32_t val)72 {73 return float32_acos(val);74 }75 76 static inline float64_t asin_f64(float64_t val)77 {78 return float64_asin(val);79 }80 81 static inline float32_t asin_f32(float32_t val)82 {83 return float32_asin(val);84 }85 86 64 static inline float64_t atan_f64(float64_t val) 87 65 { … … 301 279 { 302 280 return float32_trunc(val); 303 }304 305 static inline float64_t acos(float64_t val)306 {307 return acos_f64(val);308 }309 310 static inline float32_t acosf(float32_t val)311 {312 return acos_f32(val);313 }314 315 static inline float64_t asin(float64_t val)316 {317 return asin_f64(val);318 }319 320 static inline float32_t asinf(float32_t val)321 {322 return asin_f32(val);323 281 } 324 282
Note:
See TracChangeset
for help on using the changeset viewer.