@@ -310,7 +310,7 @@ def frange(*args, **kwargs):
310310 >>> frange('lambda x: sqrt(x)', 1, 4) # doctest: +ELLIPSIS
311311 <__main__.c_double_Array_3 object at ...>
312312 >>> for i in _:
313- ... print i
313+ ... print(i)
314314 ...
315315 1.0
316316 1.41421356237
@@ -544,8 +544,8 @@ def fbenchmark(f, var=[Symbol('x')]):
544544 global cf , pf , psyf
545545 start = time ()
546546 cf = clambdify (var , f )
547- print 'compile time (including sympy overhead): %f s' % (
548- time () - start )
547+ print ( 'compile time (including sympy overhead): %f s' % (
548+ time () - start ))
549549 pf = lambdify (var , f , 'math' )
550550 psyf = None
551551 psyco = import_module ('psyco' )
@@ -560,14 +560,14 @@ def fbenchmark(f, var=[Symbol('x')]):
560560 t3 = Timer (code , 'from __main__ import psyf as f' )
561561 else :
562562 t3 = None
563- print 'for x = (0, 1, 2, ..., 999)/1000'
564- print '20 times in 3 runs'
565- print 'compiled: %.4f %.4f %.4f' % tuple (t1 .repeat (3 , 20 ))
566- print 'Python lambda: %.4f %.4f %.4f' % tuple (t2 .repeat (3 , 20 ))
563+ print ( 'for x = (0, 1, 2, ..., 999)/1000' )
564+ print ( '20 times in 3 runs' )
565+ print ( 'compiled: %.4f %.4f %.4f' % tuple (t1 .repeat (3 , 20 ) ))
566+ print ( 'Python lambda: %.4f %.4f %.4f' % tuple (t2 .repeat (3 , 20 ) ))
567567 if t3 :
568- print 'Psyco lambda: %.4f %.4f %.4f' % tuple (t3 .repeat (3 , 20 ))
568+ print ( 'Psyco lambda: %.4f %.4f %.4f' % tuple (t3 .repeat (3 , 20 ) ))
569569
570- print 'big function:'
570+ print ( 'big function:' )
571571 from sympy import _exp , _sin , _cos , pi , lambdify
572572 x = Symbol ('x' )
573573## f1 = diff(_exp(x)**2 - _sin(x)**pi, x) \
@@ -577,33 +577,33 @@ def fbenchmark(f, var=[Symbol('x')]):
577577 + 4 * (10 * pi ** 3 * x ** 2 + 10 * pi ** 2 * x ** 3 + 5 * pi * x ** 4 + 5 * x * pi ** 4 + pi ** 5
578578 + x ** 5 )* _exp (123 + x + 2 * x ** 4 - x ** 5 ) - 2 * x ** 3 - 3 * x ** 7
579579 fbenchmark (f1 )
580- print
581- print 'simple function:'
580+ print ()
581+ print ( 'simple function:' )
582582 y = Symbol ('y' )
583583 f2 = sqrt (x * y ) + x * 5
584584 fbenchmark (f2 , [x , y ])
585585 times = 100000
586586 fstr = '_exp(_sin(_exp(-x**2)) + sqrt(pi)*_cos(x**5/(x**3-x**2+pi*x)))'
587587 print
588- print 'frange with f(x) ='
589- print fstr
590- print 'for x=1, ..., %i' % times
591- print 'in 3 runs including full compile time'
588+ print ( 'frange with f(x) =' )
589+ print ( fstr )
590+ print ( 'for x=1, ..., %i' % times )
591+ print ( 'in 3 runs including full compile time' )
592592 t4 = Timer ("frange('lambda x: %s', 0, %i)" % (fstr , times ),
593593 'from __main__ import frange' )
594594
595595 numpy = import_module ('numpy' )
596596
597- print 'frange: %.4f %.4f %.4f' % tuple (t4 .repeat (3 , 1 ))
597+ print ( 'frange: %.4f %.4f %.4f' % tuple (t4 .repeat (3 , 1 ) ))
598598 if numpy :
599599 t5 = Timer ('x = arange(%i); result = %s' % (times , fstr ),
600600 'from numpy import arange, sqrt, exp, sin, cos, exp, pi' )
601- print 'numpy: %.4f %.4f %.4f' % tuple (t5 .repeat (3 , 1 ))
601+ print ( 'numpy: %.4f %.4f %.4f' % tuple (t5 .repeat (3 , 1 ) ))
602602 # TODO: integration into fbenchmark
603603
604604if __name__ == '__main__' :
605605 if __debug__ :
606- print 'Running tests...' ,
606+ print ( 'Running tests...' ,)
607607 numpy = import_module ('numpy' )
608608 test_cexpr ()
609609 test_clambdify ()
@@ -614,7 +614,7 @@ def fbenchmark(f, var=[Symbol('x')]):
614614 test_use_cse ()
615615 import doctest
616616 doctest .testmod ()
617- print 'OK'
617+ print ( 'OK' )
618618 print
619- print 'Running benchmark...'
619+ print ( 'Running benchmark...' )
620620 benchmark ()
0 commit comments