Changeset 9adb61d in mainline for uspace/lib/math/generic/exp.c


Ignore:
Timestamp:
2015-09-05T11:50:00Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
996dc042, ba8eecf
Parents:
e6f5766
Message:

Add single-precision variant for all functions. Allow generic implementations to call other functions while selecting the number of bits of precision, but not the implementation (generic or arch-specific).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/math/generic/exp.c

    re6f5766 r9adb61d  
    4949};
    5050
    51 /** Exponential approximation by Taylor series (32-))
     51/** Exponential approximation by Taylor series (32-bit floating point)
    5252 *
    5353 * Compute the approximation of exponential by a Taylor
     
    6161 *
    6262 */
    63 static float64_t taylor_exp_32(float64_t arg)
     63static float32_t taylor_exp_32(float32_t arg)
    6464{
    65         float64_t ret = 1;
    66         float64_t nom = 1;
     65        float32_t ret = 1;
     66        float32_t nom = 1;
    6767       
    6868        for (unsigned int i = 0; i < TAYLOR_DEGREE_32; i++) {
     
    7474}
    7575
    76 /** Exponential approximation by Taylor series
     76/** Exponential approximation by Taylor series (64-bit floating point)
    7777 *
    7878 * Compute the approximation of exponential by a Taylor
     
    9999}
    100100
    101 /** Single precision exponential
     101/** Exponential (32-bit floating point)
    102102 *
    103103 * Compute exponential value.
     
    121121         */
    122122
    123         i = float32_trunc(arg * M_LOG2E);
     123        i = trunc_f32(arg * M_LOG2E);
    124124        f = arg * M_LOG2E - i;
    125125
     
    129129}
    130130
    131 /** Double precision exponential
     131/** Exponential (64-bit floating point)
    132132 *
    133133 * Compute exponential value.
     
    151151         */
    152152
    153         i = float64_trunc(arg * M_LOG2E);
     153        i = trunc_f64(arg * M_LOG2E);
    154154        f = arg * M_LOG2E - i;
    155155
Note: See TracChangeset for help on using the changeset viewer.