Sub Activity_Create(FirstTime As Boolean)
InitPolyArray
Dim UseThisPoly() As Byte = Polywaffle(17) 'arbitrary example, could be any from 0..PollyWaffle.Length-1
Dim X As Double
For X = 4.56 To 7.89 Step 0.125
Log(X & " = " & CalcPoly(UseThisPoly, X))
Next
End Sub
Sub CalcPoly(C() As Byte, X As Double) As Double
Dim Y As Double = 0
For I = 0 To C.Length - 1
Y = Y * X + C(I)
Next
Return Y
End Sub
Sub InitPolyArray
Dim Polywaffle(100) As Object
Polywaffle(0) = Array As Byte(96 ,-71 ,-9 ,71 ,22 ,-116)
Polywaffle(1) = Array As Byte(64 ,52 ,36 ,65 ,30 ,45)
Polywaffle(2) = Array As Byte(-111 ,-89 ,-56 ,-104 ,-65 ,71)
Polywaffle(3) = Array As Byte(-75 ,98 ,-64 ,-72 ,33 ,12)
Polywaffle(4) = Array As Byte(118 ,42 ,14 ,-34 ,-55 ,107)
Polywaffle(5) = Array As Byte(9 ,-99 ,-93 ,49 ,-89 ,114)
Polywaffle(6) = Array As Byte(38 ,-43 ,-27 ,78 ,75 ,56)
Polywaffle(7) = Array As Byte(114 ,-13 ,33 ,-80 ,16 ,89)
Polywaffle(8) = Array As Byte(-114 ,-49 ,111 ,-51 ,59 ,118)
Polywaffle(9) = Array As Byte(88 ,-34 ,-62 ,-34 ,-3 ,43)
Polywaffle(10) = Array As Byte(70 ,102 ,58 ,52 ,-50 ,5)
Polywaffle(11) = Array As Byte(39 ,99 ,78 ,29 ,86 ,97)
Polywaffle(12) = Array As Byte(42 ,-112 ,27 ,-55 ,69 ,43)
Polywaffle(13) = Array As Byte(-58 ,36 ,-106 ,-83 ,44 ,-106)
Polywaffle(14) = Array As Byte(-8 ,18 ,-3 ,-77 ,69 ,115)
Polywaffle(15) = Array As Byte(84 ,117 ,106 ,100 ,15 ,-66)
Polywaffle(16) = Array As Byte(80 ,69 ,21 ,19 ,16 ,75)
Polywaffle(17) = Array As Byte(98 ,-12 ,84 ,40 ,-32 ,81)
Polywaffle(18) = Array As Byte(9 ,59 ,97 ,-50 ,-72 ,81)
Polywaffle(19) = Array As Byte(-72 ,-85 ,114 ,-2 ,73 ,-100)
Polywaffle(20) = Array As Byte(84 ,-96 ,-11 ,-70 ,-107 ,-5)
Polywaffle(21) = Array As Byte(-89 ,18 ,117 ,59 ,-46 ,-19)
Polywaffle(22) = Array As Byte(95 ,92 ,12 ,75 ,-41 ,48)
Polywaffle(23) = Array As Byte(93 ,-30 ,-31 ,29 ,-118 ,107)
Polywaffle(24) = Array As Byte(20 ,-87 ,98 ,109 ,-62 ,32)
Polywaffle(25) = Array As Byte(116 ,-103 ,-95 ,15 ,68 ,-33)
Polywaffle(26) = Array As Byte(98 ,-25 ,95 ,-52 ,62 ,-100)
Polywaffle(27) = Array As Byte(-118 ,-13 ,43 ,65 ,-33 ,65)
Polywaffle(28) = Array As Byte(22 ,-44 ,-99 ,43 ,17 ,-111)
Polywaffle(29) = Array As Byte(-44 ,27 ,53 ,104 ,-64 ,-58)
Polywaffle(30) = Array As Byte(69 ,-78 ,-43 ,34 ,99 ,31)
Polywaffle(31) = Array As Byte(-41 ,18 ,-27 ,22 ,-25 ,94)
Polywaffle(32) = Array As Byte(-75 ,109 ,-58 ,-95 ,-77 ,70)
Polywaffle(33) = Array As Byte(-21 ,-88 ,-103 ,80 ,112 ,103)
Polywaffle(34) = Array As Byte(19 ,98 ,-58 ,-12 ,108 ,85)
Polywaffle(35) = Array As Byte(-110 ,-59 ,20 ,64 ,-57 ,-67)
Polywaffle(36) = Array As Byte(-47 ,-117 ,29 ,-4 ,-21 ,-3)
Polywaffle(37) = Array As Byte(-96 ,-105 ,-61 ,-21 ,29 ,87)
Polywaffle(38) = Array As Byte(-44 ,-114 ,109 ,111 ,-6 ,-120)
Polywaffle(39) = Array As Byte(71 ,-59 ,-62 ,-115 ,-82 ,84)
Polywaffle(40) = Array As Byte(-53 ,23 ,-120 ,10 ,-94 ,-85)
Polywaffle(41) = Array As Byte(114 ,-86 ,-11 ,1 ,-59 ,84)
Polywaffle(42) = Array As Byte(46 ,87 ,-28 ,-74 ,48 ,44)
Polywaffle(43) = Array As Byte(-19 ,23 ,-91 ,-108 ,-90 ,42)
Polywaffle(44) = Array As Byte(-58 ,67 ,88 ,32 ,-57 ,48)
Polywaffle(45) = Array As Byte(73 ,83 ,-115 ,-70 ,6 ,62)
Polywaffle(46) = Array As Byte(-103 ,12 ,85 ,74 ,-1 ,80)
Polywaffle(47) = Array As Byte(-91 ,-31 ,109 ,-33 ,-45 ,81)
Polywaffle(48) = Array As Byte(-83 ,120 ,-108 ,-7 ,-76 ,-69)
Polywaffle(49) = Array As Byte(30 ,104 ,56 ,88 ,114 ,41)
Polywaffle(50) = Array As Byte(34 ,11 ,-113 ,-42 ,-93 ,-16)
Polywaffle(51) = Array As Byte(107 ,110 ,-14 ,49 ,-25 ,-6)
Polywaffle(52) = Array As Byte(94 ,80 ,88 ,35 ,81 ,48)
Polywaffle(53) = Array As Byte(-15 ,44 ,-10 ,18 ,-89 ,-39)
Polywaffle(54) = Array As Byte(-78 ,75 ,63 ,-85 ,92 ,-7)
Polywaffle(55) = Array As Byte(15 ,35 ,96 ,-83 ,-12 ,92)
Polywaffle(56) = Array As Byte(63 ,-38 ,30 ,56 ,70 ,8)
Polywaffle(57) = Array As Byte(27 ,16 ,-7 ,67 ,5 ,-115)
Polywaffle(58) = Array As Byte(-22 ,-12 ,13 ,45 ,-45 ,97)
Polywaffle(59) = Array As Byte(-69 ,-96 ,45 ,-85 ,92 ,-45)
Polywaffle(60) = Array As Byte(-12 ,-89 ,-42 ,120 ,-9 ,-9)
Polywaffle(61) = Array As Byte(-11 ,-15 ,-70 ,-76 ,-29 ,-56)
Polywaffle(62) = Array As Byte(91 ,-25 ,26 ,-11 ,-91 ,91)
Polywaffle(63) = Array As Byte(11 ,-31 ,-35 ,-81 ,-83 ,115)
Polywaffle(64) = Array As Byte(26 ,28 ,72 ,19 ,107 ,89)
Polywaffle(65) = Array As Byte(99 ,56 ,93 ,-32 ,53 ,-38)
Polywaffle(66) = Array As Byte(-41 ,-12 ,-82 ,71 ,-51 ,-23)
Polywaffle(67) = Array As Byte(95 ,54 ,77 ,-60 ,-4 ,-90)
Polywaffle(68) = Array As Byte(-90 ,71 ,114 ,22 ,114 ,-33)
Polywaffle(69) = Array As Byte(27 ,99 ,66 ,-1 ,89 ,-12)
Polywaffle(70) = Array As Byte(-50 ,101 ,112 ,46 ,69 ,17)
Polywaffle(71) = Array As Byte(-108 ,-89 ,-72 ,13 ,34 ,55)
Polywaffle(72) = Array As Byte(4 ,46 ,19 ,16 ,24 ,51)
Polywaffle(73) = Array As Byte(93 ,-49 ,-15 ,-43 ,-80 ,30)
Polywaffle(74) = Array As Byte(116 ,-97 ,-35 ,61 ,-59 ,106)
Polywaffle(75) = Array As Byte(-23 ,95 ,16 ,18 ,101 ,-69)
Polywaffle(76) = Array As Byte(-26 ,-65 ,71 ,60 ,43 ,63)
Polywaffle(77) = Array As Byte(-98 ,119 ,118 ,-63 ,-13 ,56)
Polywaffle(78) = Array As Byte(-73 ,-17 ,-54 ,26 ,6 ,105)
Polywaffle(79) = Array As Byte(-120 ,-49 ,32 ,-52 ,-57 ,-13)
Polywaffle(80) = Array As Byte(70 ,82 ,-12 ,-87 ,-89 ,-89)
Polywaffle(81) = Array As Byte(116 ,15 ,51 ,52 ,-91 ,-90)
Polywaffle(82) = Array As Byte(-43 ,-72 ,118 ,26 ,48 ,-38)
Polywaffle(83) = Array As Byte(-107 ,-13 ,1 ,35 ,-101 ,-80)
Polywaffle(84) = Array As Byte(-77 ,-47 ,34 ,-54 ,31 ,-113)
Polywaffle(85) = Array As Byte(99 ,71 ,-94 ,-17 ,24 ,50)
Polywaffle(86) = Array As Byte(-53 ,52 ,-33 ,103 ,-94 ,105)
Polywaffle(87) = Array As Byte(-90 ,27 ,-90 ,18 ,20 ,92)
Polywaffle(88) = Array As Byte(-32 ,7 ,16 ,38 ,42 ,96)
Polywaffle(89) = Array As Byte(69 ,-61 ,52 ,71 ,-88 ,73)
Polywaffle(90) = Array As Byte(-71 ,25 ,33 ,-55 ,-86 ,-106)
Polywaffle(91) = Array As Byte(87 ,59 ,45 ,44 ,-11 ,73)
Polywaffle(92) = Array As Byte(106 ,85 ,27 ,22 ,10 ,19)
Polywaffle(93) = Array As Byte(-54 ,16 ,-115 ,87 ,-25 ,-18)
Polywaffle(94) = Array As Byte(104 ,31 ,-52 ,17 ,-23 ,-23)
Polywaffle(95) = Array As Byte(20 ,75 ,95 ,43 ,89 ,-81)
Polywaffle(96) = Array As Byte(-6 ,-34 ,-29 ,64 ,-57 ,-45)
Polywaffle(97) = Array As Byte(-4 ,-56 ,47 ,-77 ,-117 ,34)
Polywaffle(98) = Array As Byte(29 ,-85 ,-71 ,-77 ,98 ,92)
Polywaffle(99) = Array As Byte(53 ,-98 ,-99 ,-99 ,-37 ,28)
End Sub