There are some great math functions here:
digilander.libero.it/foxes/SoftwareDownload.htm
Many are open source so you can learn a lot from them.
From what I heard, the Variant type is slower for computing compared
to the Double type. The simpler the types such as Single and Long
have less bit resolution, but are faster for math, however the
Variant is handy and saves code. For example, you can copy a variant
array with a simple A=B assignment. You can make a routine to time
calculations with the Timer function.