News for hackers. Stuff that matters.
Re:Approximating sin(x) to 5 ULP with Chebyshev polynomials by jlg23 on Saturday May 13, 2017 @05:33AM (#14330133)
> Not sure it would be much more efficient

It won't - and I don't have to measure to know.

* OP uses standard optimization techniques. Their use has been justified over decades of actual research.

* OP uses a compiled language. OP can look at disassembly and see what's happening on the CPU.

* Your use of +reduce+ does not make sense at all - it's just syntactic sugar (you of course can use HOFs to handle constants, but that's completely missing the idea of function composition, which arguably is the only reason +reduce+ exists).

Re:Approximating sin(x) to 5 ULP with Chebyshev polynomials by raiph on Saturday May 13, 2017 @09:35AM (#14330881)
I hear your basic points, and this is a tangent on a tangent, but:

Rakudo, the existing implementation of standard Perl 6, is a compiler.

(I wouldn't be surprised if the code currently generated by Rakudo for this algorithm is far slower than the code generated by rustc but that isn't because it isn't a compiler.)