2 comments

  • jaymzcampbell 1 day ago
    This is really nicely done! Great work. I fell in love with just how efficient these can be and it explained a lot about why many of the trig and other mathematical functions implemented in 8-bit computers are they way they are.

    Here's a rather wonderful original document from the BBC Research Department (I had no idea that was a thing) back in 1969 going over just what makes them so great (https://downloads.bbc.co.uk/rd/pubs/reports/1969-10.pdf).

    If all you've come across are Taylor approximations, these things can seem a little like magic at first.

    • stuffmatic 1 day ago
      Thank you! Yes it does feel a bit magical, both the mathematical aspects and the fact that it all boils down to a few lines of code in practice.
  • hggigg 1 day ago
    Rather nice that. I like it.

    Doesn't handle divide by zero very well though i.e. f(x)=1/x. Should probably consider that as undefined rather than a bad expression.

    • tgv 1 day ago
      You could also set the x_min to 0.001 or so.