|
@ -46,4 +46,24 @@ double exponential(double x){ |
|
|
sum += (1.0/fac(i)*(expIN(i,x))); |
|
|
sum += (1.0/fac(i)*(expIN(i,x))); |
|
|
} |
|
|
} |
|
|
return sum; |
|
|
return sum; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double absD(double x){ |
|
|
|
|
|
if(x<0){ |
|
|
|
|
|
return -1 * x; |
|
|
|
|
|
} |
|
|
|
|
|
return x; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double logN(double x, double eps){ |
|
|
|
|
|
double yn = x - 1.0; |
|
|
|
|
|
double yn1 = yn; |
|
|
|
|
|
|
|
|
|
|
|
do |
|
|
|
|
|
{ |
|
|
|
|
|
yn = yn1; |
|
|
|
|
|
yn1 = yn + 2 * (x - exponential(yn)) / (x + exponential(yn)); |
|
|
|
|
|
} while (absD(yn - yn1) > eps); |
|
|
|
|
|
|
|
|
|
|
|
return yn1; |
|
|
} |
|
|
} |