Changeset 184ff675 in mainline for uspace/app/tester/float/float2.c
- Timestamp:
- 2018-08-29T20:05:59Z (6 years ago)
- Children:
- 84929b0
- Parents:
- b2acdf32
- git-author:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-29 16:15:41)
- git-committer:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-29 20:05:59)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/float/float2.c
rb2acdf32 r184ff675 43 43 }; 44 44 45 static double arguments_exp[OPERANDS] = {46 3.5, -2.1, 50.0, 0.0, 1.0, 13.2, -1.1, -5.5, 0.1, -66.047 };48 49 static double arguments_log[OPERANDS] = {50 3.5, 100.0, 50.0, 768.3156, 1080.499999, 1.0, 66.0,51 2.718281828459045, 9.9, 0.00152 };53 54 static double arguments_sqrt[OPERANDS] = {55 3.5, 100.0, 50.0, 768.3156, 1080.499999, 1.0, 66.0,56 2.718281828459045, 9.9, 0.00157 };58 59 static double arguments_tanh[OPERANDS] = {60 3.5, -2.1, 50.0, 0.0, 1.0, 13.2, -1.1, -5.5, 0.000001, -66000000.061 };62 63 static double results_ceil[OPERANDS] = {64 4.0, -2.0, 100.0, 50.0, -1024.0, 0.0, 769.0, 1081.0, -600.0, 1.065 };66 67 45 static double results_cos[OPERANDS] = { 68 46 -0.936456687291, -0.504846104600, 0.862318872288, 0.964966028492, … … 71 49 }; 72 50 73 static double results_cosh[OPERANDS] = {74 16.572824671057, 4.144313170410, 2592352764293536022528.000000000000,75 1.000000000000, 1.543080634815, 270182.468624271103, 1.668518553822,76 122.348009517829, 1.005004168056, 23035933171656458903220125696.077 };78 79 static double results_fabs[OPERANDS] = {80 3.5, 2.1, 100.0, 50.0, 1024.0, 0.0, 768.3156, 1080.499999, 600.0, 1.081 };82 83 static double results_floor[OPERANDS] = {84 3.0, -3.0, 100.0, 50.0, -1024.0, 0.0, 768.0, 1080.0, -600.0, 1.085 };86 87 static double results_exp[OPERANDS] = {88 33.115451958692, 0.122456428253, 5184705528587072045056.0,89 1.000000000000, 2.718281828459, 540364.937246691552, 0.332871083698,90 0.004086771438, 1.105170918076, 0.00000000000091 };92 93 static double results_log[OPERANDS] = {94 1.252762968495, 4.605170185988, 3.912023005428, 6.644200586236,95 6.985179175021, 0.000000000000, 4.189654742026, 1.000000000000,96 2.292534757141, -6.90775527898297 };98 99 static double results_log10[OPERANDS] = {100 0.544068044350, 2.000000000000, 1.698970004336, 2.885539651261,101 3.033624770817, 0.000000000000, 1.819543935542, 0.434294481903,102 0.995635194598, -3.000000000000103 };104 105 static double results_log2[OPERANDS] = {106 1.807354922058, 6.643856189775, 5.643856189775, 9.585555236434,107 10.077483355524, 0.000000000000, 6.044394119358, 1.442695040889,108 3.307428525192, -9.965784284662109 };110 111 51 static double results_sin[OPERANDS] = { 112 52 -0.350783227690, -0.863209366649, -0.506365641110, -0.262374853704, 113 53 0.158533380044, 0.0, 0.980815184715, -0.206379975025, -0.044182448332, 114 54 0.841470984808 115 };116 117 static double results_sinh[OPERANDS] = {118 16.542627287635, -4.021856742157, 2592352764293536022528.000000000000,119 0.000000000000, 1.175201193644, 270182.468622420449, -1.335647470124,120 -122.343922746391, 0.100166750020, -23035933171656458903220125696.0121 };122 123 static double results_sqrt[OPERANDS] = {124 1.870828693387, 10.000000000000, 7.071067811865, 27.718506453271,125 32.870959812576, 1.000000000000, 8.124038404636, 1.648721270700,126 3.146426544510, 0.031622776602127 };128 129 static double results_tan[OPERANDS] = {130 0.374585640159, 1.709846542905, -0.587213915157, -0.271900611998,131 0.160563932839, 0.000000000000, -5.031371570891, -0.210920691722,132 0.044225635601, 1.557407724655133 };134 135 static double results_tanh[OPERANDS] = {136 0.998177897611, -0.970451936613, 1.000000000000, 0.000000000000,137 0.761594155956, 0.999999999993, -0.800499021761, -0.999966597156,138 0.000001000000, -1.000000000000139 55 }; 140 56 … … 182 98 183 99 for (unsigned int i = 0; i < OPERANDS; i++) { 184 double res = ceil(arguments[i]);185 186 if (!cmp_double(res, results_ceil[i])) {187 TPRINTF("Double precision ceil failed "188 "(%lf != %lf, arg %u)\n", res, results_ceil[i], i);189 fail = true;190 }191 }192 193 for (unsigned int i = 0; i < OPERANDS; i++) {194 float res = ceilf(arguments[i]);195 196 if (!cmp_float(res, results_ceil[i])) {197 TPRINTF("Single precision ceil failed "198 "(%f != %lf, arg %u)\n", res, results_ceil[i], i);199 fail = true;200 }201 }202 203 for (unsigned int i = 0; i < OPERANDS; i++) {204 100 double res = cos(arguments[i]); 205 101 … … 222 118 223 119 for (unsigned int i = 0; i < OPERANDS; i++) { 224 double res = cosh(arguments_exp[i]);225 226 if (!cmp_double(res, results_cosh[i])) {227 TPRINTF("Double precision cosh failed "228 "(%lf != %lf, arg %u)\n", res, results_cosh[i], i);229 fail = true;230 }231 }232 233 for (unsigned int i = 0; i < OPERANDS; i++) {234 float res = coshf(arguments_exp[i]);235 236 if (!cmp_float(res, results_cosh[i])) {237 TPRINTF("Single precision cosh failed "238 "(%f != %lf, arg %u)\n", res, results_cosh[i], i);239 fail = true;240 }241 }242 243 for (unsigned int i = 0; i < OPERANDS; i++) {244 double res = exp(arguments_exp[i]);245 246 if (!cmp_double(res, results_exp[i])) {247 TPRINTF("Double precision exp failed "248 "(%lf != %lf, arg %u)\n", res, results_exp[i], i);249 fail = true;250 }251 }252 253 for (unsigned int i = 0; i < OPERANDS; i++) {254 float res = expf(arguments_exp[i]);255 256 if (!cmp_float(res, results_exp[i])) {257 TPRINTF("Single precision exp failed "258 "(%f != %lf, arg %u)\n", res, results_exp[i], i);259 fail = true;260 }261 }262 263 for (unsigned int i = 0; i < OPERANDS; i++) {264 double res = fabs(arguments[i]);265 266 if (!cmp_double(res, results_fabs[i])) {267 TPRINTF("Double precision fabs failed "268 "(%lf != %lf, arg %u)\n", res, results_fabs[i], i);269 fail = true;270 }271 }272 273 for (unsigned int i = 0; i < OPERANDS; i++) {274 float res = fabsf(arguments[i]);275 276 if (!cmp_float(res, results_fabs[i])) {277 TPRINTF("Single precision fabs failed "278 "(%f != %lf, arg %u)\n", res, results_fabs[i], i);279 fail = true;280 }281 }282 283 for (unsigned int i = 0; i < OPERANDS; i++) {284 double res = floor(arguments[i]);285 286 if (!cmp_double(res, results_floor[i])) {287 TPRINTF("Double precision floor failed "288 "(%lf != %lf, arg %u)\n", res, results_floor[i], i);289 fail = true;290 }291 }292 293 for (unsigned int i = 0; i < OPERANDS; i++) {294 float res = floorf(arguments[i]);295 296 if (!cmp_float(res, results_floor[i])) {297 TPRINTF("Single precision floor failed "298 "(%f != %lf, arg %u)\n", res, results_floor[i], i);299 fail = true;300 }301 }302 303 for (unsigned int i = 0; i < OPERANDS; i++) {304 double res = log(arguments_log[i]);305 306 if (!cmp_double(res, results_log[i])) {307 TPRINTF("Double precision log failed "308 "(%lf != %lf, arg %u)\n", res, results_log[i], i);309 fail = true;310 }311 }312 313 for (unsigned int i = 0; i < OPERANDS; i++) {314 float res = logf(arguments_log[i]);315 316 if (!cmp_float(res, results_log[i])) {317 TPRINTF("Single precision log failed "318 "(%f != %lf, arg %u)\n", res, results_log[i], i);319 fail = true;320 }321 }322 323 for (unsigned int i = 0; i < OPERANDS; i++) {324 double res = log10(arguments_log[i]);325 326 if (!cmp_double(res, results_log10[i])) {327 TPRINTF("Double precision log10 failed "328 "(%lf != %lf, arg %u)\n", res, results_log10[i], i);329 fail = true;330 }331 }332 333 for (unsigned int i = 0; i < OPERANDS; i++) {334 float res = log10f(arguments_log[i]);335 336 if (!cmp_float(res, results_log10[i])) {337 TPRINTF("Single precision log10 failed "338 "(%f != %lf, arg %u)\n", res, results_log10[i], i);339 fail = true;340 }341 }342 343 for (unsigned int i = 0; i < OPERANDS; i++) {344 double res = log2(arguments_log[i]);345 346 if (!cmp_double(res, results_log2[i])) {347 TPRINTF("Double precision log2 failed "348 "(%lf != %lf, arg %u)\n", res, results_log2[i], i);349 fail = true;350 }351 }352 353 for (unsigned int i = 0; i < OPERANDS; i++) {354 float res = log2f(arguments_log[i]);355 356 if (!cmp_float(res, results_log2[i])) {357 TPRINTF("Single precision log2 failed "358 "(%f != %lf, arg %u)\n", res, results_log2[i], i);359 fail = true;360 }361 }362 363 for (unsigned int i = 0; i < OPERANDS; i++) {364 120 double res = sin(arguments[i]); 365 121 … … 377 133 TPRINTF("Single precision sin failed " 378 134 "(%f != %lf, arg %u)\n", res, results_sin[i], i); 379 fail = true;380 }381 }382 383 for (unsigned int i = 0; i < OPERANDS; i++) {384 double res = sinh(arguments_exp[i]);385 386 if (!cmp_double(res, results_sinh[i])) {387 TPRINTF("Double precision sinh failed "388 "(%lf != %lf, arg %u)\n", res, results_sinh[i], i);389 fail = true;390 }391 }392 393 for (unsigned int i = 0; i < OPERANDS; i++) {394 float res = sinhf(arguments_exp[i]);395 396 if (!cmp_float(res, results_sinh[i])) {397 TPRINTF("Single precision sinh failed "398 "(%f != %lf, arg %u)\n", res, results_sinh[i], i);399 fail = true;400 }401 }402 403 for (unsigned int i = 0; i < OPERANDS; i++) {404 double res = sqrt(arguments_sqrt[i]);405 406 if (!cmp_double(res, results_sqrt[i])) {407 TPRINTF("Double precision sqrt failed "408 "(%lf != %lf, arg %u)\n", res, results_sqrt[i], i);409 fail = true;410 }411 }412 413 for (unsigned int i = 0; i < OPERANDS; i++) {414 float res = sqrtf(arguments_sqrt[i]);415 416 if (!cmp_float(res, results_sqrt[i])) {417 TPRINTF("Single precision sqrt failed "418 "(%f != %lf, arg %u)\n", res, results_sqrt[i], i);419 fail = true;420 }421 }422 423 for (unsigned int i = 0; i < OPERANDS; i++) {424 double res = tan(arguments[i]);425 426 if (!cmp_double(res, results_tan[i])) {427 TPRINTF("Double precision tan failed "428 "(%lf != %lf, arg %u)\n", res, results_tan[i], i);429 fail = true;430 }431 }432 433 for (unsigned int i = 0; i < OPERANDS; i++) {434 float res = tanf(arguments[i]);435 436 if (!cmp_float(res, results_tan[i])) {437 TPRINTF("Single precision tan failed "438 "(%f != %lf, arg %u)\n", res, results_tan[i], i);439 fail = true;440 }441 }442 443 for (unsigned int i = 0; i < OPERANDS; i++) {444 double res = tanh(arguments_tanh[i]);445 446 if (!cmp_double(res, results_tanh[i])) {447 TPRINTF("Double precision tanh failed "448 "(%lf != %lf, arg %u)\n", res, results_tanh[i], i);449 fail = true;450 }451 }452 453 for (unsigned int i = 0; i < OPERANDS; i++) {454 float res = tanhf(arguments_tanh[i]);455 456 if (!cmp_float(res, results_tanh[i])) {457 TPRINTF("Single precision tanh failed "458 "(%f != %lf, arg %u)\n", res, results_tanh[i], i);459 135 fail = true; 460 136 }
Note:
See TracChangeset
for help on using the changeset viewer.