Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-7591

pow(2,x) has fairly significant rounding error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • Code Generation Tools
    • CODEGEN-62
    • SDSCM00008652
    • Hide
      C2000_16.9.0.LTS
      C2000_18.1.0.LTS
      C2000_6.4.0B1
      MSP430_20.2.0.LTS
      MSP430_21.6.0.LTS
      C2000_21.6.0.LTS
      MSP430_15.12.0.LTS
      C2000_20.2.0.LTS
      MSP430_18.1.0.LTS
      C2000_22.6.0.LTS
      C2000_15.12.0.LTS
      MSP430_4.4.0B1
      MSP430_18.12.0.LTS
      MSP430_16.9.0.LTS
      C2000_18.12.0.LTS
      C2000_22.6.0.B1
      Show
      C2000_16.9.0.LTS C2000_18.1.0.LTS C2000_6.4.0B1 MSP430_20.2.0.LTS MSP430_21.6.0.LTS C2000_21.6.0.LTS MSP430_15.12.0.LTS C2000_20.2.0.LTS MSP430_18.1.0.LTS C2000_22.6.0.LTS C2000_15.12.0.LTS MSP430_4.4.0B1 MSP430_18.12.0.LTS MSP430_16.9.0.LTS C2000_18.12.0.LTS C2000_22.6.0.B1
    • Hide

      Please describe the workaround for this problem.


      Show
      Please describe the workaround for this problem.

      Description:
      The algorithm used for pow [exp(log(x),y)] is correct but sometimes leads to a precision error for some inputs, due to rounding bugs in floating-point handling.

      ==========================================================

      Additional Fields:

      StepsToReproduce:

      All of these results are exactly representable (powers of two)

      % cl2000 -v28 SDSsq34243.c -z -llnk2800.cmd -lrts2800.lib
      % load2000 -v28 a.out
      pow(2,12) == 45800000 == 4.096000e+03
      pow(2,13) == 45fffff8 == 8.191996e+03
      pow(2,14) == 46800000 == 1.638400e+04
      pow(2,15) == 46fffff8 == 3.276798e+04
      pow(2,16) == 47800000 == 6.553600e+04
      pow(2,17) == 48000004 == 1.310721e+05
      pow(2,18) == 48800000 == 2.621440e+05
      pow(2,19) == 49000004 == 5.242882e+05
      pow(2,20) == 49800000 == 1.048576e+06
      pow(2,21) == 4a000004 == 2.097153e+06
      pow(2,22) == 4a800000 == 4.194304e+06
      pow(2,23) == 4b000004 == 8.388612e+06
      pow(2,24) == 4b800000 == 1.67772

      FoundInBuildVersion:

      IntegratedBuildState:

      IntegratedBuildType:

      IntegrationBuildType:

      IntegrationBuildVersion:

      IntegrationEngineer:

      IntegrationEngineerName:

      Phase Found In:

      Environment:

      Host:
      Solaris 7

      Target :

      Custom List :

      Custom Data:
      DAYS OF EFFORT : 10

      CCB Data:

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: