[J3] C TS 18661

Steve Lionel steve at stevelionel.com
Wed Jan 30 12:55:45 EST 2019


On 1/30/2019 12:29 PM, Steven G. Kargl wrote:
>
> What do you consider as convincing cases?
>
> In time harmonic analysis, one often computes exp(cmplx(0.,tau)).
> Many people, including me, do cmplx(cos(tau),sin(tau)).  Thus,
> cos() and sin() are computed in pairs, and the argument reduction
> for large arguments (tau > pi/4) is performed twice.  With
> sincos() argument reduction is done once and the number of function
> calls is cut in half.  As I happen to be the person who wrote the
> sincos() implementation that appears in FreeBSD's libm, I have timing
> codes
>
> Are there guidelines on the J3 website for writing a case paper?
>
I don't recall sincos being discussed here. The compilers I have worked 
on all recognized uses of sin and cos on the same argument and optimized 
that into a call to a sincos routine, the benefits of which I fully 
agree. In my (admittedly skewed) view, there is little benefit to a 
sincos intrinsic since (at least some) compilers for decades have done a 
good job on this and any that don't could be taught to do so, if a 
benefit was seen. Programmers are unlikely to rewrite their code to use 
a new intrinsic if it provides no tangible benefit.

This also makes me wonder if compilers couldn't also optimize rsqrt on 
their own, the way they do for other idioms such as real to an integer 
power, etc. And, indeed, a quick test using ifort show that at least one 
does so, utilizing the SSE rsqrt instructions plus additional N-R 
iterations.

I'd be interested to learn more about expm1 and log1p - I have not yet 
researched what these do or what they're used for. I'd certainly defer 
to the judgement of people closer to applications that might make use of 
these. I will repeat my usual mantra that no feature has a zero cost - 
not to the committee nor to implementors.

There are no specific guidelines for a case paper, but there are many 
examples.

Steve



More information about the J3 mailing list