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.66.254.198 with SMTP id ak6mr147328pad.21.1470367108533; Thu, 04 Aug 2016 20:18:28 -0700 (PDT) X-Received: by 10.157.45.97 with SMTP id v88mr9053ota.4.1470367108494; Thu, 04 Aug 2016 20:18:28 -0700 (PDT) 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!f6no7443396ith.0!news-out.google.com!d130ni24997ith.0!nntp.google.com!f6no7443386ith.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 4 Aug 2016 20:18:28 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8380:7220:5985:2c17:9409:aa9c; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8380:7220:5985:2c17:9409:aa9c References: <04e12bd0-2c9d-f90d-2497-bf58593addfd@spam.spam> <845e12db-9e2c-4d0f-a3b0-19ac50f14d24@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <588a93bb-b39a-4196-b6ca-5e673fd256dd@googlegroups.com> Subject: Re: Profiling Ada binaries From: rieachus@comcast.net Injection-Date: Fri, 05 Aug 2016 03:18:28 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:31289 Date: 2016-08-04T20:18:28-07:00 List-Id: On Monday, August 1, 2016 at 7:36:45 PM UTC-4, Jeffrey R. Carter wrote: > If you look at the requirements for the Cos function in Annex A and Annex= G (if > implemented, which it is for GNAT), you'll find a number of requirements = for > accuracy and special cases. If you look at the definition of the built-in > function, you'll likely find that it doesn't meet all of those requiremen= ts. Any > call to Cos has to involve wrapping a call to the built-in function in co= de to > ensure those requirements are met, so you won't find a call to the built-= in > function in the generated code. Yes, any "strict" LRM matching implementation probably won't use the built-= in functions. The problem is not the one parameter (radian) versions, it i= s the two-parameter versions, especially the cases where Ada provides two p= arameter versions of the arc- (reverse) trig functions. The problem is not= the special case values, but testing for the two parameter versions. Wher= e "all cases" requires just 2^32 tests, no big deal and I have tests for th= ose. Two 32-bit parameters is tough, but actually can be done for some fun= ctions. Two 64-bit parameters? Forget about it. You have 2^128 cases, wh= ich will take about 10^24 CPU years. Providing a non-strict implementation is much easier. I don't have to spec= ial case the exact cases, and while I would test a decent subset of the ful= l parameter space to to compute mean LSB error statistics, I wouldn't look = for special cases. (Years ago someone -- was it Mike Woodger? -- found FOU= R cases where X*X*X*X is not equal to (X*X)*(X*X) for floating point values= . This is why the strict mode should only be used if you really need it. ;= -)