[J3] C TS 18661
Steven G. Kargl
kargl at troutmask.apl.washington.edu
Wed Jan 30 14:01:59 EST 2019
On Wed, Jan 30, 2019 at 12:55:45PM -0500, Steve Lionel via J3 wrote:
> 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.
I mentioned it my original reply to Van.
If sincos() were included as an intrinsic subroutine by the standard,
then a programmer is not subject to the whims of the dependency
analysis of compilers.
As for expm1 and log1p, if the companion C compiler for a Fortran
processor is C90 compliant, then these functions are already present
in the math library.
--
Steve
More information about the J3
mailing list