On Tue, 3 Mar 2020 at 00:17, Tels <nospam-pg-ab...@bloodgate.com> wrote: > > Thank you for these patches, these sound like really nice improvements.
Thanks for looking! > One thing can to my mind while reading the patch: > > + * If r < 0 Then > + * Let r = r + 2*s - 1 > + * Let s = s - 1 > > This can be reformulated as: > > + * If r < 0 Then > + * Let r = r + s > + * Let s = s - 1 > + * Let r = r + s > > which would remove one mul/shift and the temp. variable. Good point, that's a neat little optimisation. I wasn't able to detect any difference in performance, because those corrections are only triggered about 1 time in every 50 or so, but it looks neater to me, especially in the numeric iterations, where it saves a sub_var() by const_one as well as not using the temporary variable. Regards, Dean