Changeset b2acdf32 in mainline


Ignore:
Timestamp:
2018-08-29T20:05:52Z (5 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Children:
184ff675
Parents:
b1b201f
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-29 15:48:16)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-29 20:05:52)
Message:

Remove unused and not well tested atan()/atan2()

Location:
uspace
Files:
4 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/float/float2.c

    rb1b201f rb2acdf32  
    4343};
    4444
    45 static double arguments_atan[OPERANDS] = {
    46         3.5, 100.0, 50.0, 768.3156, 1080.499999, 1.0, 66.0,
    47         2.718281828459045, 9.9, 0.001
    48 };
    49 
    5045static double arguments_exp[OPERANDS] = {
    5146        3.5, -2.1, 50.0, 0.0, 1.0, 13.2, -1.1, -5.5, 0.1, -66.0
     
    6459static double arguments_tanh[OPERANDS] = {
    6560        3.5, -2.1, 50.0, 0.0, 1.0, 13.2, -1.1, -5.5, 0.000001, -66000000.0
    66 };
    67 
    68 static double results_atan[OPERANDS] = {
    69         1.292496667790, 1.560796660108, 1.550798992822, 1.569494779052,
    70         1.569870829603, 0.785398163397, 1.555645970920, 1.218282905017,
    71         1.470127674637, 0.000999999667
    7261};
    7362
     
    193182
    194183        for (unsigned int i = 0; i < OPERANDS; i++) {
    195                 double res = atan(arguments_atan[i]);
    196 
    197                 if (!cmp_double(res, results_atan[i])) {
    198                         TPRINTF("Double precision atan failed "
    199                             "(%.12lf != %.12lf, arg %u)\n", res, results_atan[i], i);
    200                         fail = true;
    201                 }
    202         }
    203 
    204         for (unsigned int i = 0; i < OPERANDS; i++) {
    205                 float res = atanf(arguments_atan[i]);
    206 
    207                 if (!cmp_float(res, results_atan[i])) {
    208                         TPRINTF("Single precision atan failed "
    209                             "(%f != %lf, arg %u)\n", res, results_atan[i], i);
    210                         fail = true;
    211                 }
    212         }
    213 
    214         for (unsigned int i = 0; i < OPERANDS; i++) {
    215184                double res = ceil(arguments[i]);
    216185
  • uspace/lib/math/Makefile

    rb1b201f rb2acdf32  
    3434
    3535SOURCES = \
    36         generic/atan.c \
    37         generic/atan2.c \
    3836        generic/ceil.c \
    3937        generic/cosh.c \
  • uspace/lib/math/include/math.h

    rb1b201f rb2acdf32  
    3737#define LIBMATH_MATH_H_
    3838
    39 #include <atan.h>
    40 #include <atan2.h>
    4139#include <ceil.h>
    4240#include <cosh.h>
     
    6260#define HUGE_VAL FLOAT64_INF
    6361
    64 static inline float64_t atan_f64(float64_t val)
    65 {
    66         return float64_atan(val);
    67 }
    68 
    69 static inline float32_t atan_f32(float32_t val)
    70 {
    71         return float32_atan(val);
    72 }
    73 
    74 static inline float64_t atan2_f64(float64_t y, float64_t x)
    75 {
    76         return float64_atan2(y, x);
    77 }
    78 
    79 static inline float32_t atan2_f32(float32_t y, float32_t x)
    80 {
    81         return float32_atan2(y, x);
    82 }
    83 
    8462static inline float64_t ceil_f64(float64_t val)
    8563{
     
    279257{
    280258        return float32_trunc(val);
    281 }
    282 
    283 static inline float64_t atan(float64_t val)
    284 {
    285         return atan_f64(val);
    286 }
    287 
    288 static inline float32_t atanf(float32_t val)
    289 {
    290         return atan_f32(val);
    291 }
    292 
    293 static inline float64_t atan2(float64_t y, float64_t x)
    294 {
    295         return atan2_f64(y, x);
    296 }
    297 
    298 static inline float32_t atan2f(float32_t y, float32_t x)
    299 {
    300         return atan2_f32(y, x);
    301259}
    302260
Note: See TracChangeset for help on using the changeset viewer.