Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

how test ln(x+1) in C++ without using cmath or recursion.... C++ link: http://ww

ID: 670912 • Letter: H

Question

how test ln(x+1) in C++ without using cmath or recursion....

C++

link: http://www.geofhagopian.net/CS007A/assignments/Assignments_F15/cs7a_f15_tanscendents.pdf

double ln(double t) {
    double accumulator = 0;
    double term = t;
    int sign = 1;
    double n = 1;
    //if(x >-1 && x <=2){ /// Limit the domain from 0<x<=2
         ///used as denominator
        while(abs(term) > 0.0005) {
            sign *=- 1;
            term *= sign*(t-1)/n;
            ++n;
            accumulator += term;
      // }

   // }
    //else if(x<0 || x >2){
    //    cout << " Enter a number greater than 0 and less than 2";

    }
    return accumulator;
}

SO i need a working function that computers the power series ln(x+1) without using cmath or recursion and it must have a domain within -1 < x <= 2. Please show me how to do this with comments.

Thanks

Explanation / Answer

cmath recursion function :