I've been meaning to turn this into a proper github repo with tests and the like (pretty sure this is the working version), but in the meantime:
https://gist.github.com/wickedgrey/9fbcffb3f33e26eb475c
This approach is A) exact, B) fast, C) decomposed into functions, and D) doesn't require any math(s) beyond basic high school. It does require understanding recursion, but that's about it. Comments and constructive criticism welcome.
Note that it expects python2.7, as that's what I use at work.