Oooops! It seems did incorrectly your formula. Your formula is better! Thank you a lot!
http://i.imgur.com/xefq0ub.png
Glad to have helped.
I also mentioned you here http://blender.stackexchange.com/questions/30597/python-up-vector-math-for-curve
Thank you again.
Thank you @mifth
One thing to note, is that the expression with cross and the expression with dot that I showed, give exactly the same result. The difference is that the dot informs a value more.
If the value “dot” is not necessary, it is more appropriate then use the expression with cross (it has fewer internal calculations).
Thanks. I’ll take into account.
Thanks. I changed it to cross. https://github.com/mifth/mifthtools/commit/6b0469faea18d3375c3f3257963d7c85f327c44c