I’m sorry I haven’t had a chance to look at this until now, school and mock trial have been hitting me hard!

I understand your algorithm and while it is very elegant and well-implemented, I’m convinced it can be tweaked for more efficiency. Although you do have the question of when it’s worth it to sacrifice simplicity for the sake of efficiency, and as you say, it’s better to have a logical solution than an efficient one.

Though, I wonder how well we could do with a simple Pade Approximation (read: better version of trunucated power series). For example, just a quick calculation with Mathematica gives:

ln (1+y)/(1-y) = 2y*(15 - 4y^2 )/(15 - 9y^2 )

With a maximum error of -0.000025.

I’ll have to take some time with my IPad tonight and see if I can optimize anything, though. Thank you for tagging me about this!

Slightly unrelated, but this reminds me of this bit-hacky way to calculate logarithms in O(log n) time that I absolutely love:

https://graphics.stanford.edu/~seander/bithacks.html#IntegerLog

It would be impossible to implement in Hopscotch though.