From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.99.173.12 with SMTP id g12mr11261937pgf.39.1482191376772; Mon, 19 Dec 2016 15:49:36 -0800 (PST) X-Received: by 10.157.38.168 with SMTP id l37mr252719otb.19.1482191376723; Mon, 19 Dec 2016 15:49:36 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!75no1826967ite.0!news-out.google.com!c1ni10496itd.0!nntp.google.com!b123no1837099itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 19 Dec 2016 15:49:36 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=185.3.147.187; posting-account=ow8VOgoAAAAfiGNvoH__Y4ADRwQF1hZW NNTP-Posting-Host: 185.3.147.187 References: <8d0f7f03-9324-4702-9100-d6b8a1f16fc5@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <18af86db-21fd-4fa0-90a3-c87b6486b439@googlegroups.com> Subject: Re: Trigonometric operations on x86 and x64 CPUs From: already5chosen@yahoo.com Injection-Date: Mon, 19 Dec 2016 23:49:36 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:32918 Date: 2016-12-19T15:49:36-08:00 List-Id: On Tuesday, December 20, 2016 at 1:11:26 AM UTC+2, Randy Brukardt wrote: > wrote in message=20 > news:a6734b29-5ffc-4938-bbc2-453f7ae92325@googlegroups.com... > ... > >> Creating a package which does the range reduction right, and passes > >> small values through to the hardware instructions is not all that hard= . > > > >Such implementations are common, due the hype created by sensationalists= . >=20 > Yeah, like the people at Intel who document how to use these instructions= .=20 > :-)=20 > They recommend (at least in the documents I have seen) to do argument=20 > reduction before using the instructions. >=20 I don't know what documents you had seen. In "Intel 64 and IA-32 Architectures Software Developer=E2=80=99s Manual" I= ntel recommend to use argument reduction when the argument is out of suppor= ted range [-2**63..+2**63]. Of course trigs with double precision argument outside of range [-2**54..+2= **54] are no more than equivalents of bad PRNG, so Intel's advice does not = have a lot of practical significance. IMHO, for x outside of [-2**63..+2**63] it would be o.k. for sin(x) and cos= (x) to return any value in range [-1..1]. They are all equally meaningless. > There's also the little matter of meeting the Ada language requirements. = The=20 > people who put accuracy requirements on Ada numeric libraries might have= =20 > been "sensationalists"", but those of us implementing Ada have to abide b= y=20 > those requirements.=20 Unfortunately, I don't know where to look for Ada language requirement. Can you tell me what are requirements for sin/cos in Ada numeric library? > (Argubly, one of the advantages of Ada is that there are=20 > requirements, so you have some asssurance out of the box that the numeric= s=20 > will work predicably, no matter what target you use.) >=20 > Randy. Yes, before IEEE-754 that was a significant advantage*. Today - less so. ---------- * - I wonder what happened in real world on machines with bad arithmetic, l= ike CRAY-1? Did not it lead to situation where significant parts of Ada num= eric library were so slow that users concerned with speed were rolling thei= r own alternatives.