Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucla-cs!ucla-ma!euphemia!pmontgom From: pmontgom@euphemia.math.ucla.edu (Peter Montgomery) Newsgroups: comp.arch Subject: Re: IEEE arithmetic (Goldberg paper) Message-ID: <1991Jun8.224715.18882@math.ucla.edu> Date: 8 Jun 91 22:47:15 GMT References: <9106052113.AA14439@ucbvax.Berkeley.EDU> <3652@charon.cwi.nl> Sender: news@math.ucla.edu Organization: UCLA Mathematics Dept. Lines: 27 In article <3652@charon.cwi.nl> dik@cwi.nl (Dik T. Winter) writes: >I still have a question here: do you know realistic cases where inferior >code will be generated? I do not think that 'a = 0.0 * b' is realistic. The literal zero will probably not appear, but it will not be unusual to have const double coef_friction = 0.0; /* Ignore friction */ early in a program and coef_friction multiplied by other quantities later on. Macro expansion (or inline expansion of procedures) is another possibility, if one argument is 0.0. A third possibility is loop unrolling: do i = 0, 2 deriv(i) = REAL(i)*poly(i) end do will expand into deriv(0) = 0.0*poly(0), deriv(1) = 1.0*poly(1), deriv(2) = 2.0*poly(2). The benefit of this unrolling really comes when it simplifies this to deriv(0) = 0, deriv(1) = poly(1), deriv(2) = poly(2) + poly(2). -- Peter L. Montgomery pmontgom@MATH.UCLA.EDU Department of Mathematics, UCLA, Los Angeles, CA 90024-1555 If I spent as much time on my dissertation as I do reading news, I'd graduate.