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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bcdac28207102750 X-Google-Attributes: gid103376,public From: Gautier Subject: Re: Ada95 speed Date: 1999/05/31 Message-ID: <3752A1D1.CC20510@Maths.UniNe.CH>#1/1 X-Deja-AN: 484090613 Content-Transfer-Encoding: 7bit References: <374182F2.B10AD449@Maths.UniNe.CH> <3741aa37.3892645@news.pacbell.net> <3741B203.4890880B@Maths.UniNe.CH> <7ht4ss$4mu$1@nnrp1.deja.com> Content-Type: text/plain; charset=us-ascii MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-05-31T00:00:00+00:00 List-Id: Robert Dewar wrote: > > and the removal of the hidden Sqrt helps surely > > even more... > Don't assume that a square root is necesarily that expensive. > On some architectures, square root is comparable in speed > to a floating-point division, not so terrible .... OK - but it might be useful to mention to uninformed readers that generally floating-point division is still terribly slower than a multiplication or an addition, so in that case a Sqrt less could improve things. Here is an excerpt from the Intel(R) Pentium(TM) clock cycle table: FADD [reg,reg] fadd 3, 1 FADD memreal fadd shortreal 3, 1 FADDP reg,ST faddp st(6),st 3, 1 FIADD memint fiadd int16 7, 4 FMUL [reg,reg] fmul st(5),st 3, 1 FMULP reg,ST fmulp st(6),st 3, 1 FIMUL memint fimul warray[di] 7, 4 FDIV [reg,reg] fdiv st(5),st 39 FDIV memreal fdiv longreal 39 FDIVP reg,ST fdivp st(6),st 39 FIDIV memint didiv warray[di] 42 FDIVR [reg,reg] fdivr st(5),st 39 FDIVR memreal fdivr longreal 39 FDIVRP reg,ST fdivrp st(6),st 39 FIDIVR memint didivr warray[di] 42 FSQRT fsqrt 70 -- Gautier -------- http://members.xoom.com/gdemont/