On Friday, 24 May 2019 at 12:24:02 UTC, Alex wrote:
If it truly is a 27x faster then then that is very relevant and knowing why is important.

Of course, a lot of that might simply be due to LDC and I wasn't able to determine this.

Just one more thing you really ought to consider:

It isn't obvious that a LUT using double will be more precise than computing sin using single precision float.

So when I use single precision float with ldc and "-O3 -ffast-math" then I get roughly 300ms. So in that case the LUT is only 3 times faster.

Perhaps not worth it then. You might as well just use float instead of double.

The downside is that -ffast-math makes all your computations more inaccurate.

It is also possible that recent processors can do multiple sin/cos as simd.

Too many options… I know.

Reply via email to