Simpson's Method
1. ClrHome
2. Menu("SIMPSON'S METHOD","FIND AREA",1,"FIND ERROR",2
3. Lbl 1
4. Disp "FIND AREA",""
5. Input "Y1=",Str1
6. Str1->Y1
7. Input " A=",A
8. Input " B=",B
9. Input " N=",N
10. ClrHome
11. If N/2int(N/2)
12. Then
13. Disp "ERROR!","N MUST BE EVEN"
14. Stop
15. End
16. (B-A)/2->C
17. 0->I:0->W
18. ClrHome
19. Disp "MULT. FACTOR:","",(B-A)/(3N)
20. (B-A)/N->C
21. Pause
22. For(Z,A,B,C
23. ClrHome
24. Disp "",""
25. Output(1,1,"TERM"
26. I+1->I
27. Output(1,6,I
28. Disp "VAL.="
29. Z->X
30. Output(3,6,Y
31. If fPart(I/2)=0:4->T
32. If fPart(I/2)0:2->T
33. If I=1 or Z=B:1->T
34. Disp "MULT="
35. Output(4,6,T
36. Disp "","PDCT="
37. Output(6,6,TY
38. W+TY->W
39. Disp "TOT.="
40. Output(7,6,W
41. Pause
42. End
43. ClrHome
44. Disp "TOT.="
45. Output(1,6,W
46. Disp " *","MULT:
47. Output(3,6,(B-A)/(3N)
48. Disp ""," ="
49. Output(5,6,W(B-A)/(3N)
50. Stop
51. Lbl 2
52. Disp "--FIND ERR.--",""
53. Input "A=",A
54. Input "B=",B
55. Input "N=",N
56. (B-A)/N->C
57. Input "F4.MAX=",M
58. ClrHome
59. Disp "(B-A)/180*H^4*M",""
60. Disp "(B-A)/180=",(B-A)/180,"H^4="
61. Output(5,5,C^4
62. Disp "M="
63. Output(6,3,M
64. Disp "TOT.="
65. Output(7,6,(B-A)/180(C^4)M