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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,acba876b1e3c9639 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!o5g2000hsb.googlegroups.com!not-for-mail From: David Smith Newsgroups: comp.lang.ada Subject: Re: GNAT Optimization of Constant Expressions Date: 18 May 2007 08:39:46 -0700 Organization: http://groups.google.com Message-ID: <1179502786.146161.217520@o5g2000hsb.googlegroups.com> References: <1179355028.624745.258370@q75g2000hsh.googlegroups.com> NNTP-Posting-Host: 72.211.146.117 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1179502788 31629 127.0.0.1 (18 May 2007 15:39:48 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 18 May 2007 15:39:48 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20070321 Firefox/2.0.0.3 (Swiftfox),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: o5g2000hsb.googlegroups.com; posting-host=72.211.146.117; posting-account=hjwdNg0AAADrWbU8BVPocB6GQuDF5upL Xref: g2news1.google.com comp.lang.ada:15831 Date: 2007-05-18T08:39:46-07:00 List-Id: Thanks for the interesting discussion. I always learn so much on this group. > Can you please post your C equivalent. Of course: #include #include int main() { const int N = 10000; int i, j; double x[N], y[N], z[N]; //const double sinx = sin(0.5); //const double siny = sin(2.0*0.5); //const double sinz = sin(3.0*0.5); //const double logx = log(0.5); //const double logy = log(2.0*0.5); //const double logz = log(3.0*0.5); //const double sqrtx = sqrt(0.5); //const double sqrty = sqrt(2.0*0.5); //const double sqrtz = sqrt(3.0*0.5); for (j=1; j<=10000; ++j) for (i=0; i