相关代码 |
|
Sub QROMB(A, B, SS) EPS = 0.000001 JMAX = 20 JMAXP = JMAX + 1 K = 5 KM = K - 1 Dim S(21), H(21) H(1) = 1# For J = 1 To JMAX Call TRAPZD(A, B, S(J), J) If J >= K Then Call POLINT(H(), S(), K, 0#, SS, DSS) If Abs(DSS) < EPS * Abs(SS) Then Exit Sub End If S(J + 1) = S(J) H(J + 1) = 0.25 * H(J) Next J Print "Too many steps." End Sub