#5652: powermod is slower than Integer.power_mod
------------------------------+---------------------------------------------
 Reporter:  bober             |       Owner:  somebody  
     Type:  defect            |      Status:  new       
 Priority:  minor             |   Milestone:  sage-3.4.2
Component:  basic arithmetic  |    Keywords:            
------------------------------+---------------------------------------------
 Consider the following example:

 {{{
 sage: time a = power_mod(5, 10^2000, 10^3000)
 CPU times: user 3.67 s, sys: 0.00 s, total: 3.67 s
 Wall time: 3.67 s
 sage: time b = 5.powermod(10^2000, 10^3000)
 CPU times: user 2.82 s, sys: 0.00 s, total: 2.83 s
 Wall time: 2.84 s
 sage: a == b
 True
 sage: time a = power_mod(5, 10^4000, 10^7000)
 CPU times: user 27.17 s, sys: 0.01 s, total: 27.18 s
 Wall time: 27.30 s
 sage: time b = 5.powermod(10^4000, 10^7000)
 CPU times: user 21.38 s, sys: 0.04 s, total: 21.42 s
 Wall time: 21.44 s
 sage: a == b
 True
 }}}

 (The problem is that power_mod() uses generic code, while
 Integer.powermod() uses gmp, which is faster.)

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5652>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to