Changeset 84929b0 in mainline for uspace/lib/math/generic/trig.c
- Timestamp:
- 2018-08-29T20:06:00Z (6 years ago)
- Children:
- ed9043f7
- Parents:
- 184ff675
- git-author:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-29 19:44:33)
- git-committer:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-29 20:06:00)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/math/generic/trig.c
r184ff675 r84929b0 35 35 36 36 #include <math.h> 37 #include <trig.h>38 37 39 38 #define TAYLOR_DEGREE_32 13 … … 41 40 42 41 /** Precomputed values for factorial (starting from 1!) */ 43 static float64_tfactorials[TAYLOR_DEGREE_64] = {42 static double factorials[TAYLOR_DEGREE_64] = { 44 43 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 45 44 479001600, 6227020800.0L, 87178291200.0L, 1307674368000.0L, … … 60 59 * 61 60 */ 62 static float 32_t taylor_sin_32(float32_t arg)63 { 64 float 32_tret = 0;65 float 32_tnom = 1;61 static float taylor_sin_32(float arg) 62 { 63 float ret = 0; 64 float nom = 1; 66 65 67 66 for (unsigned int i = 0; i < TAYLOR_DEGREE_32; i++) { … … 89 88 * 90 89 */ 91 static float64_t taylor_sin_64(float64_targ)92 { 93 float64_tret = 0;94 float64_tnom = 1;90 static double taylor_sin_64(double arg) 91 { 92 double ret = 0; 93 double nom = 1; 95 94 96 95 for (unsigned int i = 0; i < TAYLOR_DEGREE_64; i++) { … … 118 117 * 119 118 */ 120 static float 32_t taylor_cos_32(float32_t arg)121 { 122 float 32_tret = 1;123 float 32_tnom = 1;119 static float taylor_cos_32(float arg) 120 { 121 float ret = 1; 122 float nom = 1; 124 123 125 124 for (unsigned int i = 0; i < TAYLOR_DEGREE_32; i++) { … … 147 146 * 148 147 */ 149 static float64_t taylor_cos_64(float64_targ)150 { 151 float64_tret = 1;152 float64_tnom = 1;148 static double taylor_cos_64(double arg) 149 { 150 double ret = 1; 151 double nom = 1; 153 152 154 153 for (unsigned int i = 0; i < TAYLOR_DEGREE_64; i++) { … … 176 175 * 177 176 */ 178 static float 32_t base_sin_32(float32_t arg)177 static float base_sin_32(float arg) 179 178 { 180 179 unsigned int period = arg / (M_PI / 4); … … 209 208 * 210 209 */ 211 static float64_t base_sin_64(float64_targ)210 static double base_sin_64(double arg) 212 211 { 213 212 unsigned int period = arg / (M_PI / 4); … … 242 241 * 243 242 */ 244 static float 32_t base_cos_32(float32_t arg)243 static float base_cos_32(float arg) 245 244 { 246 245 unsigned int period = arg / (M_PI / 4); … … 275 274 * 276 275 */ 277 static float64_t base_cos_64(float64_targ)276 static double base_cos_64(double arg) 278 277 { 279 278 unsigned int period = arg / (M_PI / 4); … … 305 304 * 306 305 */ 307 float 32_t float32_sin(float32_t arg)308 { 309 float 32_t base_arg = fmod_f32(arg, 2 * M_PI);306 float sinf(float arg) 307 { 308 float base_arg = fmodf(arg, 2 * M_PI); 310 309 311 310 if (base_arg < 0) … … 324 323 * 325 324 */ 326 float64_t float64_sin(float64_targ)327 { 328 float64_t base_arg = fmod_f64(arg, 2 * M_PI);325 double sin(double arg) 326 { 327 double base_arg = fmod(arg, 2 * M_PI); 329 328 330 329 if (base_arg < 0) … … 343 342 * 344 343 */ 345 float 32_t float32_cos(float32_t arg)346 { 347 float 32_t base_arg = fmod_f32(arg, 2 * M_PI);344 float cosf(float arg) 345 { 346 float base_arg = fmodf(arg, 2 * M_PI); 348 347 349 348 if (base_arg < 0) … … 362 361 * 363 362 */ 364 float64_t float64_cos(float64_targ)365 { 366 float64_t base_arg = fmod_f64(arg, 2 * M_PI);363 double cos(double arg) 364 { 365 double base_arg = fmod(arg, 2 * M_PI); 367 366 368 367 if (base_arg < 0)
Note:
See TracChangeset
for help on using the changeset viewer.