アットウィキロゴ

えx0502

Private Sub Command1_Click()
Dim ls As Single
Dim cs As Single
Dim ys As Single
Dim us As Single
Dim ws As Single
Dim l1 As Single
Dim c1 As Single
Dim y1 As Single
Dim u1 As Single
Dim w1 As Single
Dim l2 As Single
Dim c2 As Single
Dim y2 As Single
Dim u2 As Single
Dim w2 As Single
Dim th As Single
Dim the As Single
Dim h As Single
Dim t1 As Single
Dim t2 As Single
Dim lp As Single
Dim barw As Single
Dim b As Single
b = 0.08
barw = Log(0.47) + Log(0.47)
h = 0.1
th = 1
the = 1.1
ls = b / th + 0.01
ys = th * ls
cs = ys - b
us = Log(cs) + Log(1 - ls)
ws = Log(cs) + Log(1 - ys / the)
t2 = 0
Do Until t2 > 10
t1 = 0
Do Until t1 > 100
l1 = ls + h
y1 = th * l1
c1 = y1 - b
u1 = Log(c1) + Log(1 - l1)
w1 = Log(c1) + Log(1 - y1 / the)
If w1 > barw Then u1 = -999
l2 = ls - h
If l2 < 0.01 Then l2 = ls
y2 = th * l2
c2 = y2 - b
u2 = Log(c2) + Log(1 - l2)
w2 = Log(c2) + Log(1 - y2 / the)
If w2 > barw Then u2 = -999
If u1 > us Then ls = l1
If u1 > us Then us = u1
If u2 > us Then ls = l2
If u2 > us Then us = u2
If (lp - ls) ^ (2) < 10 ^ (-5) Then t1 = 1000
lp = ls
t1 = t1 + 1
Debug.Print t1, ls
Loop
h = h / 2
t2 = t2 + 1
Loop
End Sub
最終更新:2009年08月03日 23:27