This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Errors with expsp() and MATHLIB on C674x

Other Parts Discussed in Thread: MATHLIB

Hi, I have a customer that is using mathlib c674x 3_1_1_0 with C674x and cannot get any correct output for expsp(). The EVM he is using is the TMDX0SKL138BET (Spectrum Digital).

Some examples provided below of the output he is seeing:

 

This code:

 

   printf ("expsp(%f) = %f\n", -1.0f, expsp (-1.0f));

   printf ("expsp(%f) = %f\n", -0.5f, expsp (-0.5f));

   printf ("expsp(%f) = %f\n", 0.0f, expsp (0.0f));

   printf ("expsp(%f) = %f\n", 0.5f, expsp (0.5f));

   printf ("expsp(%f) = %f\n", 1.0f, expsp (1.0f));

   printf ("expsp_c(%f) = %f\n", -1.0f, expsp_c (-1.0f));

   printf ("expsp_c(%f) = %f\n", -0.5f, expsp_c (-0.5f));

   printf ("expsp_c(%f) = %f\n", 0.0f, expsp_c (0.0f));

   printf ("expsp_c(%f) = %f\n", 0.5f, expsp_c (0.5f));

   printf ("expsp_c(%f) = %f\n", 1.0f, expsp_c (1.0f));

 

Gives these answers:

 

expsp(-1.000000) = -inf

expsp(-0.500000) = -inf

expsp(0.000000) = 1.000000

expsp(0.500000) = 0.000000

expsp(1.000000) = 0.000000

expsp_c(-1.000000) = 0.367879

expsp_c(-0.500000) = 0.606531

expsp_c(0.000000) = 1.000000

expsp_c(0.500000) = 1.648721

expsp_c(1.000000) = 2.718282

 

Anyone seen anything similar using the assembly functions? Could it be a setup issue? Thanks in advance.

 

Bill

  • I moved this thread to the device forum.

    Todd
  • HI Bill,

    I will have a look at it and get back to you.

    Thanks for your patience.

  • HI Bill,

    I have just experimented the functions, "expsp" and the "expsp_c" of mathlib c674x 3_1_1_0 with C674x

    and got the results. Please compare it with yours.

  • To add to Shankari

    I did the same (in parallel with Shankari) and got the same results

    Here is the code and the results:

     {
          float x_in, y_ass, y_c   ;

          x_in = -1.0   ;
          y_ass = expsp(x_in) ;
          y_c = expsp_c(x_in) ;
          printf("x_in = %f  y_ass = %f  y_c = %f  \n", x_in, y_ass, y_c) ;




          x_in = -0.5   ;
          y_ass = expsp(x_in) ;
          y_c = expsp_c(x_in) ;
          printf("x_in = %f  y_ass = %f  y_c = %f  \n", x_in, y_ass, y_c) ;


          x_in = 0.0   ;
          y_ass = expsp(x_in) ;
          y_c = expsp_c(x_in) ;
          printf("x_in = %f  y_ass = %f  y_c = %f  \n", x_in, y_ass, y_c) ;


          x_in = 0.5   ;
          y_ass = expsp(x_in) ;
          y_c = expsp_c(x_in) ;
          printf("x_in = %f  y_ass = %f  y_c = %f  \n", x_in, y_ass, y_c) ;


          x_in = 1.0   ;
          y_ass = expsp(x_in) ;
          y_c = expsp_c(x_in) ;
          printf("x_in = %f  y_ass = %f  y_c = %f  \n", x_in, y_ass, y_c) ;









          printf ("expsp(%f) = %f\n", -1.0f, expsp (-1.0f));

            printf ("expsp(%f) = %f\n", -0.5f, expsp (-0.5f));

            printf ("expsp(%f) = %f\n", 0.0f, expsp (0.0f));

            printf ("expsp(%f) = %f\n", 0.5f, expsp (0.5f));

            printf ("expsp(%f) = %f\n", 1.0f, expsp (1.0f));

            printf ("expsp_c(%f) = %f\n", -1.0f, expsp_c (-1.0f));

            printf ("expsp_c(%f) = %f\n", -0.5f, expsp_c (-0.5f));

            printf ("expsp_c(%f) = %f\n", 0.0f, expsp_c (0.0f));

            printf ("expsp_c(%f) = %f\n", 0.5f, expsp_c (0.5f));

            printf ("expsp_c(%f) = %f\n", 1.0f, expsp_c (1.0f));



      }

    And the results are correct

    x_in = -0.500000  y_ass = 0.606531  y_c = 0.606531  
    x_in = 0.000000  y_ass = 1.000000  y_c = 1.000000  
    x_in = 0.500000  y_ass = 1.648721  y_c = 1.648721  
    x_in = 1.000000  y_ass = 2.718282  y_c = 2.718282  
    expsp(-1.000000) = 0.367879
    expsp(-0.500000) = 0.606531
    expsp(0.000000) = 1.000000
    expsp(0.500000) = 1.648721
    expsp(1.000000) = 2.718282
    expsp_c(-1.000000) = 0.367879
    expsp_c(-0.500000) = 0.606531
    expsp_c(0.000000) = 1.000000
    expsp_c(0.500000) = 1.648721
    expsp_c(1.000000) = 2.718282

    Ran

  • William,

    Would you please try out the sample example ( expsp_674LE_LE_COFF ) provided in the Mathlib package and get back to us with the results??

  • Thanks Shankari, Ran. Sorry for the delay, I was out for a while. I will ask the customer to run the above and provide the results.

    Bill