File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -47,18 +47,18 @@ function simplify(x, ctx=DefaultCtx();
4747 rules= default_rules (x, ctx),
4848 fixpoint= true ,
4949 applyall= true ,
50- mpoly= false ,
5150 kwargs... )
52- if mpoly
53- x = to_term (to_mpoly (x)... )
54- end
5551 if fixpoint
5652 SymbolicUtils. fixpoint (rules, x, ctx; applyall= applyall)
5753 else
5854 rules (x, ctx; applyall= applyall, kwargs... )
5955 end
6056end
6157
58+ function polynormalize (x)
59+ to_term (to_mpoly (x)... )
60+ end
61+
6262
6363Base. @deprecate simplify (x, rules:: RuleSet ; kwargs... ) simplify (x, rules= rules; kwargs... )
6464
Original file line number Diff line number Diff line change 11using SymbolicUtils, Test
2+ using SymbolicUtils: polynormalize
23@testset " polyform" begin
34 @syms a b c d
4- @test simplify (a * (b + - 1 * c) + - 1 * (b * a + - 1 * c * a), mpoly= true ) == 0
5- @eqtest simplify (sin ((a+ b)^ 2 )^ 2 ; mpoly= true ) == sin (a^ 2 + b^ 2 + 2 * a* b)^ 2
6- # fixme: can this be made faster?
7- @test simplify (sin ((a+ b)^ 2 )^ 2 + cos ((a+ b)^ 2 )^ 2 ; mpoly= true ) == 1
5+ @test polynormalize (a * (b + - 1 * c) + - 1 * (b * a + - 1 * c * a)) == 0
6+ @eqtest simplify (polynormalize (sin ((a+ b)^ 2 )^ 2 )) == simplify (sin (a^ 2 + 2 * (b* a)+ b^ 2 )^ 2 )
7+ @test simplify (polynormalize (sin ((a+ b)^ 2 )^ 2 + cos ((a+ b)^ 2 )^ 2 )) == 1
88end
You can’t perform that action at this time.
0 commit comments