Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jun 2013 09:12:04 -0700
From:      enh <>
To:        Steve Kargl <>
Subject:   Re: sincos?
Message-ID:  <>
In-Reply-To: <>
References:  <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
well, that was Intel and the code's not been accepted, but yes --- that's
another reason for me not to accept their patch!

Intel claimed "The reason for this fix [beside workaround for O0 switch] -
it helps to remove some sin[f]+cos[f] code duplication (which is the whole
reason for introduction of such function at all), which results in
1.58-1.81x performance gain on intervals |x|<100." i've not seen their
benchmark code, so i don't know what their distribution of values was, and
i don't understand why they covered a range as large as +/- 100.

when looking at i7 performance though, remember that x86 Android will
usually be running on Atom (and most Android devices are actually ARM, not

On Wed, Jun 26, 2013 at 6:35 PM, Steve Kargl <> wrote:

> On Wed, Jun 26, 2013 at 04:45:34PM -0700, enh wrote:
> > i'm a recent lurker on this list; i've inherited Android's C library, and
> > among other things i'm trying to track FreeBSD's lib/msun much more
> closely
> > than we have traditionally.
> >
> > i was just reminded of the existence of a change submitted to us
> (Android)
> > a while back that adds a sincos/sincosf implementation cobbled together
> > from your s_sin.c/s_sinf.c and s_cos.c/s_cosf.c implementations:
> ><;
> >
> A quick glance at the code shows that the android project has
> slapped its Copyright on fdlibm code.  I suspect that you'll
> want to restore proper attribution to Sun Microsystems.
> > the submitter (Intel) rightly points out that at the moment GCC carefully
> > optimizes paired sin/cos calls into a sincos call which we deoptimize
> back
> > into separate sin/cos calls. i personally don't want to take on
> maintenance
> > of this, but i would be happy to include you guys' sincos implementation
> if
> > you had one. is there a reason you don't have one?
> I haven't submitted the versions of sincos[fl], which I've
> developed over the last year or so, yet.  First, I need to
> redo some testing.  Second, I need to convince Bruce that
> the implementation would be a nice addition to libm.
> --
> Steve

Want to link to this message? Use this URL: <>