Ряд явно не сходится к функции:
Код:
--------------------------
x | F | n | real function)
-1 | 0 | 0 | 0.0625
-0.9 | 0 | 0 | 0.0767336
-0.8 | 0 | 0 | 0.09525987
-0.7 | -2 | 32 | 0.1197304
-0.6 | -2 | 32 | 0.1525879
-0.5 | -1.#QNAN | 6 | 0.1975309
-0.4 | -2 | 32 | 0.2603082
-0.3 | -2.353437e-185 | 2 | 0.3501278
-0.2 | -9.255963e+061 | 2 | 0.4822531
-0.1 | -2 | 32 | 0.6830135
-1.4e-016 | -2 | 32 | 1
0.1 | -2 | 32 | 1.524158
0.2 | -2 | 32 | 2.441406
0.3 | -2 | 32 | 4.164931
0.4 | -2 | 32 | 7.716049
0.5 | -2 | 32 | 16
0.6 | -2 | 32 | 39.0625
0.7 | -2 | 32 | 123.4568
0.8 | -2 | 32 | 625
0.9 | -2 | 32 | 10000
1 | -2 | 32 | 4.113761e+062
Если делать как написано на картинке, то получается так:
Код:
precision=0.1
step=0.1
max(n)=30
--------------------------
x | f | realF | fabs(f-realF) | n | df |
-1.00 | 2856.0000000 | 0.0625000 | 2855.9375000 | 30 | 32736.0000000 |
-0.90 | 115.0506380 | 0.0767336 | 114.9739044 | 30 | 1387.7169573 |
-0.80 | 3.2540949 | 0.0952599 | 3.1588351 | 30 | 40.5252051 |
-0.70 | 0.1731763 | 0.1197304 | 0.0534459 | 30 | 0.7378478 |
-0.60 | 0.1550833 | 0.1525879 | 0.0024954 | 26 | 0.0373983 |
-0.50 | 0.1993942 | 0.1975309 | 0.0018634 | 18 | 0.0304413 |
-0.40 | 0.2628344 | 0.2603082 | 0.0025262 | 12 | 0.0458018 |
-0.30 | 0.3489074 | 0.3501278 | 0.0012204 | 9 | -0.0259816 |
-0.20 | 0.4834560 | 0.4822531 | 0.0012029 | 6 | 0.0322560 |
-0.10 | 0.6835000 | 0.6830135 | 0.0004865 | 4 | 0.0210000 |
-0.00 | 1.0000000 | 1.0000000 | 0.0000000 | 1 | -0.0000000 |
0.10 | 1.5235000 | 1.5241579 | 0.0006579 | 4 | 0.0210000 |
0.20 | 2.4392960 | 2.4414062 | 0.0021102 | 6 | 0.0322560 |
0.30 | 4.1622159 | 4.1649313 | 0.0027154 | 9 | 0.0259816 |
0.40 | 7.7088083 | 7.7160494 | 0.0072411 | 12 | 0.0458018 |
0.50 | 15.9931564 | 16.0000000 | 0.0068436 | 18 | 0.0304413 |
0.60 | 39.0502607 | 39.0625000 | 0.0122393 | 26 | 0.0373983 |
0.70 | 123.0628347 | 123.4567901 | 0.3939554 | 30 | 0.7378478 |
0.80 | 581.2462473 | 625.0000000 | 43.7537527 | 30 | 40.5252051 |
0.90 | 4461.8495183 | 10000.0000000 | 5538.1504817 | 30 | 1387.7169573 |
1.00 | 46376.0000000 | 411376139330301510000000000000000000000000000000000000000000000.0000000 | 41137613933030
1510000000000000000000000000000000000000000000000.0000000 | 30 | 32736.0000000 |
почему-то не получилось заставить его работать с long double (Глюк gcc?)