From: Andreas E. <ar...@us...> - 2012-01-04 23:07:16
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Maxima, A Computer Algebra System". The branch, master has been updated via 524d694ae4ee0b056d3efda2e0e77eaadfe75ea6 (commit) from 2805dab44948a1193d157a3208195b537130e9f1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 524d694ae4ee0b056d3efda2e0e77eaadfe75ea6 Author: Andreas Eder (are_muc) <and...@gm...> Date: Thu Jan 5 00:04:57 2012 +0100 gcexpt now log complexity instead of linear diff --git a/src/numth.lisp b/src/numth.lisp index e9c82a5..b091857 100644 --- a/src/numth.lisp +++ b/src/numth.lisp @@ -195,8 +195,9 @@ (defun gcexpt (a n) (cond ((zerop n) '(1 0)) - ((equal n 1) a) - (t (gctime1 a (gcexpt a (1- n)))))) + ((equal n 1) a) + ((evenp n) (gcexpt (gctime1 a a) (truncate n 2))) + (t (gctime1 a (gcexpt (gctime1 a a) (truncate n 2)))))) (defun gctime1 (a b) (gctimes (car a) (cadr a) (car b) (cadr b))) ----------------------------------------------------------------------- Summary of changes: src/numth.lisp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) hooks/post-receive -- Maxima, A Computer Algebra System |