Task 8 is done
This commit is contained in:
parent
2efd819d0f
commit
98a608ce96
22 changed files with 1270 additions and 0 deletions
42
2025.04.18/08Ex/contin_func.c
Normal file
42
2025.04.18/08Ex/contin_func.c
Normal file
|
@ -0,0 +1,42 @@
|
|||
#include "contin_func.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
|
||||
double fln (const double x, const double eps)
|
||||
{
|
||||
const double z = (x - 1) / (x + 1);
|
||||
double value = 0;
|
||||
double monom = z, el = z;
|
||||
int i = 1;
|
||||
|
||||
while (el - eps > DBL_EPSILON)
|
||||
{
|
||||
value += el;
|
||||
|
||||
i+=2;
|
||||
monom *= z*z;
|
||||
el = monom / i;
|
||||
}
|
||||
|
||||
return 2 * value;
|
||||
}
|
||||
|
||||
double sln (const double x, const double eps)
|
||||
{
|
||||
const double z = x - 1;
|
||||
double value = 0;
|
||||
double monom = z, el = z;
|
||||
int i = 1;
|
||||
|
||||
while (fabs(el) - eps > DBL_EPSILON)
|
||||
{
|
||||
value += el;
|
||||
|
||||
i++;
|
||||
monom *= -z;
|
||||
el = monom / i;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue