home bbs files messages ]

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

   sci.math.symbolic      Symbolic algebra discussion      10,432 messages   

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

   Message 10,077 of 10,432   
   jacob navia to All   
   square roots algo   
   11 Jan 21 15:39:36   
   
   From: jacob@jacob.remcomp.fr   
      
   Hi math wizards!   
      
   I have developed an extended precision math package with 448 bits. The   
   basic operations are written all in assembly, and I am now approx twice   
   as fast as MPFR.   
      
   BUT...   
      
   (yes there is always a "but" :-)   
      
   MPFR does more square roots than me per millisecond!   
      
   Surely MPFR has a better algo than my pathetic newton iteration... I was   
   at 1720 square roots/ms, and MPFR is at 6899. I have tried to improve it   
   with Halley's method and now I am at 2200/ms, still MUCH TOO SLOW.   
      
   Can you point me to some method that would be more appropiate?   
      
   Thanks in advance!   
      
   P.S.   
   Here are the timings for the 4 operations:   
      
   MPFR   
   The four operations with    5000000 iterations. Mon Jan 11 15:32:50 2021   
   Addition      :     2.2837e-05 ms. (43788.58869) per ms   
   Subtraction   :    1.39152e-05 ms. (71863.86110) per ms   
   Multiplication:     4.5159e-05 ms. (22143.98016) per ms   
   Mult. (int)   :    1.59318e-05 ms. (62767.54667) per ms   
   Division      :     0.00011619 ms. (8606.57784) per ms   
   Division(int) :     4.0373e-05 ms. (24769.02881) per ms   
      
   My software:   
   The four operations with    5000000 iterations. Mon Jan 11 15:35:28 2021   
   Addition      :    1.00136e-05 ms. (99864.18471) per ms   
   Subtraction   :      9.862e-06 ms. (101399.31048) per ms   
   Multiplication:    2.06244e-05 ms. (48486.25899) per ms   
   Mult. (int)   :    6.87133e-06 ms. (145532.16261) per ms   
   Squaring      :    2.18158e-05 ms. (45838.33735) per ms   
   Division      :    0.000120662 ms. (8287.59960) per ms   
   Division(int) :     4.5838e-05 ms. (21815.96056) per ms   
      
   Note that I also use newton iteration for division... I am almost as   
   slow as MPFR...   
      
   --- 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