bench_expand.py 427 B

1234567891011121314151617181920212223
  1. from sympy.core import symbols, I
  2. x, y, z = symbols('x,y,z')
  3. p = 3*x**2*y*z**7 + 7*x*y*z**2 + 4*x + x*y**4
  4. e = (x + y + z + 1)**32
  5. def timeit_expand_nothing_todo():
  6. p.expand()
  7. def bench_expand_32():
  8. """(x+y+z+1)**32 -> expand"""
  9. e.expand()
  10. def timeit_expand_complex_number_1():
  11. ((2 + 3*I)**1000).expand(complex=True)
  12. def timeit_expand_complex_number_2():
  13. ((2 + 3*I/4)**1000).expand(complex=True)