2 hours ago · Tech · 0 comments

A couple months ago I wrote about how to compute the sine and cosine of a complex number using only real functions of real variables using the equations You can do something analogous for all the elementary functions, though some of the equations are quite a bit more complicated than the ones above. See the equations here. The equations come from a paper by Henry G. Baker, cited in the linked page. I wrote up Baker’s equations in LaTeX, then used ChatGPT to generate Python code from the LaTeX to numerically verify the equations and my typesetting of them. The test code evaluated the equations at points from each quadrant, implying that Baker and NumPy use the same branch cuts.The post Building complex functions out of real parts first appeared on John D. Cook.

No comments yet. Log in to reply on the Fediverse. Comments will appear here.