Updates:
        Labels: -NeedsReview

Comment #1 on issue 1475 by ondrej.certik: New implementation of .eval in  
trigonometric functions, implementing sec, csc
http://code.google.com/p/sympy/issues/detail?id=1475

Hi Luke

thanks for working on this! The right command to switch to the branch is  
actually:

git co -b trigsimp origin/trigsimp

also I suggest you push the main sympy branch into the master branch to  
your repo. I
am on IRC if you need help with this.

I have some small comments, like why are you adding the print statements  
etc. in the
first patch.

Let's just concentrate on sin/cos/tan/cot for now, lets get it fixed and  
pushed in
and then let's implement the other ones.

As to the rewrite stuff, it works like this:

In [6]: tan(x).rewrite(cos)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)

/tmp/a/sympy/<ipython console> in <module>()

/tmp/a/sympy/sympy/core/basic.pyc in rewrite(self, *args, **hints)
    1512
    1513             if not pattern:
-> 1514                 return self._eval_rewrite(None, rule, **hints)
    1515             else:
    1516                 if isinstance(pattern[0], (tuple, list)):

/tmp/a/sympy/sympy/core/function.pyc in _eval_rewrite(self, pattern, rule,  
**hints)
     333         if pattern is None or isinstance(self.func, pattern):
     334             if hasattr(self, rule):
--> 335                 rewritten = getattr(self, rule)(*args)
     336
     337                 if rewritten is not None:

/tmp/a/sympy/sympy/functions/elementary/trigonometric.pyc in
_eval_rewrite_as_cos(self, arg)
     660
     661     def _eval_rewrite_as_cos(self, arg):
--> 662         return -cos(x + S.Pi/2)/cos(x)
     663
     664     def _eval_rewrite_as_cot(self, arg):

NameError: global name 'x' is not defined


E.g. the function _eval_rewrite_as_cos gets called and it breaks because  
its wrong,
as you said. Thanks for looking into this! It needed fixing for a long  
time. All
tests pass, so ping me if you think it should go in, we will do final  
polish and push
it in.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to