home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.fortran      Putting John Backus on a giant pedestal      5,127 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 4,537 of 5,127   
   Thomas Koenig to David Jones   
   Re: SCALE intrinsic subprogram (aka a Fo   
   19 Nov 23 13:28:18   
   
   From: tkoenig@netcologne.de   
      
   David Jones  schrieb:   
      
   > There seems no reason why the standard might not be extended to allow   
   > the two different types of representations of complex variables to   
   > exist in the same program, as separate data-types, and to interact when   
   > required. Two major questions are:   
   >   
   > (i) whether there are any applications that would be more readily and   
   > usefully programmed using the modulus-phase representation?   
   >   
   > (ii) the relative speed of both addition and multiplication in the two   
   > representations.?   
      
   Multiplication and especially division would likely be faster - you   
   would have to multiply the two moduli and add and normalize the   
   modulus to lie between 0 and 2*pi.   
      
   However, the normalization step can have unintended execution   
   speed consequences if the processor implements it via branches,   
   and branches can be quite expensive if mispredicted.   
      
   _Addition_ is very expensive indeed in polar notation.  You have   
   to calculate the sin() and cos() of each number, add them, and then   
   call atan2() (with a normalization) to get back the original   
   representation.   
      
   If you're doing a lot of multiplication, and not a lot of addition,   
   that could actually pay off.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca