Private Sub TrigonometryBenchmark()
' Run a benchmark of many of the trigonometric routines.
'See also:
' ComplexNumbersBenchmark Subroutine
' MathBuiltInBenchmark Subroutine
Dim lngMax As Long
Dim lngTry As Long
Dim varRtn As Variant
lngMax = 1024
Debug.Print "Count = " & lngMax
Debug.Print "Sine I: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = Sine(RealToComplex(0, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "Sine C: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = Sine(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "Cosine I: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = Cosine(RealToComplex(0, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "Cosine C: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = Cosine(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "Tangent I: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = Tangent(RealToComplex(0, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "Tangent C: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = Tangent(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "Cotangent: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = Cotangent(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "Secant: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = Secant(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "Cosecant: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = Cosecant(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
lngMax = 256
Debug.Print "Count = " & lngMax
Debug.Print "ASin I: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ASin(RealToComplex(0, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "ASin C: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ASin(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "ACos I: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ACos(RealToComplex(0, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "ACos C: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ACos(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "ATan I: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ATAN(RealToComplex(0, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "ATan C: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ATAN(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "ACot: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ACot(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "ASec: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ASec(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "ACsc: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ACsc(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "SinH: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = SinH(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "CosH: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = CosH(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "TanH: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = TanH(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "CotH: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = CotH(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "SecH: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = SecH(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "CscH: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = CscH(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "ASinH: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ASinH(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "ACosH: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ACosH(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "ATanH: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ATanH(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "ACotH: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ACotH(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "ASecH: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ASecH(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
Debug.Print "ACscH: ";
DebugTimerOn
For lngTry = 1 To lngMax
varRtn = ACscH(RealToComplex(Rnd * 6 - 3, Rnd * 6 - 3))
Next lngTry
Debug.Print DebugTimerOff
End SubCopyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.