exp(-x) problem....three algorithms

Discussion in 'C' started by dolby home, Mar 9, 2013.

  1. dolby home

    dolby home New Member

    Mar 9, 2013
    Likes Received:
    Trophy Points:
    hiiiii c fanatics!!! i have a problem over here. i did for nearly everything but then i got stuck.. please help me.:confused:. i think that the point of this problem is to show that errors are here for every variable (float and double becouse of their size) and not to eliminate them. so here it is: :D :p

    Apply three different algorithms in calculating values of the function exp(-x) for x=0-100 in steps of 10(for 0,10,20..), and explore possible sources of error in numerical calculation of the function. Calculate separately the cases using float and double types of variables. Write the results in the form of tables.
    1) apply direct expansion

    exp(-x)= sum(0->oo) ((-1)^n) (x^n)/n!

      2) apply recursion relation

    exp(-x)=sum(0->infinity) S_n

      3) calculate exp(x) with recursion relation, and then take the inverse
    exp(x)=sum(0->infinity) S_n


Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice