Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.2.02.1901302320110.28837@key0.esi.com.au>
Date: Wed, 30 Jan 2019 23:56:05 +1100 (AEDT)
From: Damian McGuckin <damianm@....com.au>
To: Szabolcs Nagy <nsz@...t70.net>
cc: musl@...ts.openwall.com
Subject: Re: Possible Mistype in exp.c


I have Muller's book. Good for the math. Not for any ideas about the 
actual implementation.

As a matter of interest, what was the benchmark against which you get a 2x 
speed gain?

I got 1.75 against GLIBC for what that is worth. I used a faster scaling 
routine. But I was not chasing a improved ULP performance ike you were as 
that was too much extra work. Your work there sounds like seriously smart 
stuff to me.

I used super-scalar friendly code which adds an extra multiplication. It 
made a miniscule tiny net benefit on the Xeons (not Xeon Gold).

I had 2 versions of the fast scaling routine replacing ldexp. One used a 
single ternary if/then/else and other grabbed the sign and did a table 
looking which meant one extra multiplication all the time but no branches. 
The one extra multiplication instead of a branch in the 2-line scaling 
routine made no difference.

I saw a tiny but measurable difference when I used a Xeon with an FMA 
compared to one which did not.

Discarding the last term in the SUN routine and that net loss of one 
multiplication still made no serious difference to the timing and of 
course, the results were affected.

My timings showed on my reworked code (for doubles)

 	21+%	the preliminary comparisons
 	43+%	polynomial computation super-scalar friendly way
 	35+%	y = 1 + (x*c/(2-c) - lo + hi);
 		return k == 0 ? y : scalbn-FAST(y, k);

I have slightly increased the work load in the comparisons because I avoid 
pulling 'x' apart into 'hx'. I used only doubles or floats.

Regards - Damian

Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037
Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here
Views & opinions here are mine and not those of any past or present employer

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.