Finished porting formulas

I absolutely do not guarantee that these computations work. That's
next up....