I recently mentioned (again) the fact that you can compute logs through repeated square roots.

log(x) = 2^n (√√...n times...√x - 1)

But it's tricky because if you do too many square roots you lose accuracy.

And I also mentioned that you can do the same with complex numbers to compute the phase.

But what I didn't mention is that because the real and imaginary parts of complex numbers are stored and computed (somewhat) separately you don't need to worry as much about losing accuracy. In the attached Mathematica code I get away with 1000 square roots.

This is the secret behind the complex-step numerical differentiation method.

mdolab.engin.umich.edu/wiki/gu

0

If you have a fediverse account, you can quote this note from your own instance. Search https://mathstodon.xyz/users/dpiponi/statuses/114484237017351663 on your instance and quote it. (Note that quoting is not supported in Mastodon.)