<story><title>Show HN: Chebyshev approximation calculator</title><url>https://stuffmatic.com/chebyshev/</url><text>Hi everyone,&lt;p&gt;here&amp;#x27;s a web app I made that generates code for efficiently approximating mathematical functions. This is useful when performance matters more than perfect accuracy, for example in embedded systems.&lt;p&gt;The app uses Chebyshev expansions, which despite their theoretical depth result in suprisingly compact and readable code in practice. This code is generated for you and using it does not require any knowledge of the underlying theory.&lt;p&gt;Source code and more info: 
&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;stuffmatic&amp;#x2F;chebyshev-calculator&quot;&gt;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;stuffmatic&amp;#x2F;chebyshev-calculator&lt;/a&gt;</text></story><parent_chain></parent_chain><comment><author>herodotus</author><text>Lovely. In about 1974 I was paid to write a function, in IBM 360 assembly language, to compute square roots. I was asked to make it as efficient as possible. I was in my last year as an undergraduate student. I used a Chebyshev approximation for the initial guess (after scaling the input to lie between 0 and 1), and then used two (or was it three) unrolled iterations of Newton&amp;#x27;s method to get the solution. First money I ever received for writing code!</text></comment>
<story><title>Show HN: Chebyshev approximation calculator</title><url>https://stuffmatic.com/chebyshev/</url><text>Hi everyone,&lt;p&gt;here&amp;#x27;s a web app I made that generates code for efficiently approximating mathematical functions. This is useful when performance matters more than perfect accuracy, for example in embedded systems.&lt;p&gt;The app uses Chebyshev expansions, which despite their theoretical depth result in suprisingly compact and readable code in practice. This code is generated for you and using it does not require any knowledge of the underlying theory.&lt;p&gt;Source code and more info: 
&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;stuffmatic&amp;#x2F;chebyshev-calculator&quot;&gt;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;stuffmatic&amp;#x2F;chebyshev-calculator&lt;/a&gt;</text></story><parent_chain></parent_chain><comment><author>jaymzcampbell</author><text>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.&lt;p&gt;Here&amp;#x27;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 (&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;downloads.bbc.co.uk&amp;#x2F;rd&amp;#x2F;pubs&amp;#x2F;reports&amp;#x2F;1969-10.pdf&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;downloads.bbc.co.uk&amp;#x2F;rd&amp;#x2F;pubs&amp;#x2F;reports&amp;#x2F;1969-10.pdf&lt;/a&gt;).&lt;p&gt;If all you&amp;#x27;ve come across are Taylor approximations, these things can seem a little like magic at first.</text></comment>