On Fri, 28 Dec 2018 at 20:50, 9il via Digitalmars-d-announce <[email protected]> wrote: > > ldexp and frexp are base building blocks for a lot of math > functions. > > Here is a small benchmark that compares Mir, C and Phobos > implementations: > > https://github.com/libmir/mir-core/blob/master/bench_ldexp_frexp.d > > Mir ldexp is 2.5 (5.5 - dmd) times faster for double and float. >
You could double the speed of ldexp if you actually used the checkedint compiler intrinsics rather than implementing it yourself. Using libm's ldexp() is also likely going to be 2-5x slower than using the implementation you've written for mir.ldexp(). For one, your version will be inlined! -- Iain
