> Here is a simple function that uses trigsimp, but seems to work better than > simply using trigsimp alone. Of course it takes longer. How difficult > would it > be to have a hypersimp for hyperbolic identities to go along with trigsimp?
I think it could be implemented in a similar way as trigsimp() is implemented. Thanks for the code below, nice application of Robert's cse(). > > > def TrigSimp(f): ^^^ generally we use the trig_simp() naming scheme. > """ > Recursive application of sympy.trigsimp(). Works in many applications > where simple application of sympy.trigsimp() does not. > """ > (w,g) = sympy.cse(f) > g = sympy.trigsimp(g[0]) > for sub in reversed(w): > g = g.subs(sub[0],sub[1]) > g = sympy.trigsimp(g) > return(g) I'll try to play with this soon --- do you have particular tests that this function simplifies but trigsimp not? Let's write tests for this and maybe find a better name for the function and commit it. Ondrej --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy" 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/sympy?hl=en -~----------~----~----~----~------~----~------~--~---
