回答編集履歴
1
実行結果が抜けていたので追加
test
CHANGED
@@ -15,3 +15,53 @@
|
|
15
15
|
return 1 + Horner(ORD, i+1) / i
|
16
16
|
|
17
17
|
```
|
18
|
+
|
19
|
+
実行結果は以下です。
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
```python
|
24
|
+
|
25
|
+
>>> for i in range(18):
|
26
|
+
|
27
|
+
... print(f'Horner({i}) = {Horner(i)}')
|
28
|
+
|
29
|
+
...
|
30
|
+
|
31
|
+
Horner(0) = 1
|
32
|
+
|
33
|
+
Horner(1) = 2.0
|
34
|
+
|
35
|
+
Horner(2) = 2.5
|
36
|
+
|
37
|
+
Horner(3) = 2.6666666666666665
|
38
|
+
|
39
|
+
Horner(4) = 2.7083333333333335
|
40
|
+
|
41
|
+
Horner(5) = 2.716666666666667
|
42
|
+
|
43
|
+
Horner(6) = 2.7180555555555554
|
44
|
+
|
45
|
+
Horner(7) = 2.7182539682539684
|
46
|
+
|
47
|
+
Horner(8) = 2.7182787698412696
|
48
|
+
|
49
|
+
Horner(9) = 2.7182815255731922
|
50
|
+
|
51
|
+
Horner(10) = 2.7182818011463845
|
52
|
+
|
53
|
+
Horner(11) = 2.718281826198493
|
54
|
+
|
55
|
+
Horner(12) = 2.7182818282861687
|
56
|
+
|
57
|
+
Horner(13) = 2.718281828446759
|
58
|
+
|
59
|
+
Horner(14) = 2.7182818284582297
|
60
|
+
|
61
|
+
Horner(15) = 2.7182818284589945
|
62
|
+
|
63
|
+
Horner(16) = 2.7182818284590424
|
64
|
+
|
65
|
+
Horner(17) = 2.718281828459045
|
66
|
+
|
67
|
+
```
|