|
1 | 1 | using SymbolicUtils, Test |
2 | | -using SymbolicUtils: polynormalize, Term, symtype |
| 2 | +using SymbolicUtils: Term, symtype |
3 | 3 | @testset "polyform" begin |
4 | 4 | @syms a b c d |
5 | | - @test polynormalize(a * (b + -1 * c) + -1 * (b * a + -1 * c * a)) == 0 |
6 | | - @eqtest polynormalize(sin(a+b)+sin(c+d)) == sin(a+b) + sin(c+d) |
7 | | - @eqtest simplify(polynormalize(sin((a+b)^2)^2)) == simplify(sin(a^2+2*(b*a)+b^2)^2) |
8 | | - @test simplify(polynormalize(sin((a+b)^2)^2 + cos((a+b)^2)^2)) == 1 |
| 5 | + @test expand(a * (b + -1 * c) + -1 * (b * a + -1 * c * a)) == 0 |
| 6 | + @eqtest expand(sin(a+b)+sin(c+d)) == sin(a+b) + sin(c+d) |
| 7 | + @eqtest simplify(expand(sin((a+b)^2)^2)) == simplify(sin(a^2+2*(b*a)+b^2)^2) |
| 8 | + @test simplify(expand(sin((a+b)^2)^2 + cos((a+b)^2)^2)) == 1 |
9 | 9 | @syms x1::Real f(::Real)::Real |
10 | 10 |
|
11 | 11 | # issue 193 |
12 | | - @test isequal(polynormalize(f(x1 + 2.0)), f(2.0 + x1)) |
13 | | - @test symtype(polynormalize(f(x1 + 2.0))) == Real |
| 12 | + @test isequal(expand(f(x1 + 2.0)), f(2.0 + x1)) |
| 13 | + @test symtype(expand(f(x1 + 2.0))) == Real |
14 | 14 |
|
15 | 15 | # cleanup rules |
16 | | - @test polynormalize(Term{Number}(identity, 0)) == 0 |
17 | | - @test polynormalize(Term{Number}(one, 0)) == 1 |
18 | | - @test polynormalize(Term{Number}(zero, 0)) == 0 |
19 | | - @test polynormalize(identity(a * b) - b * a) == 0 |
20 | | - @test polynormalize(a * b - b * a) == 0 |
| 16 | + @test expand(Term{Number}(identity, 0)) == 0 |
| 17 | + @test expand(Term{Number}(one, 0)) == 1 |
| 18 | + @test expand(Term{Number}(zero, 0)) == 0 |
| 19 | + @test expand(identity(a * b) - b * a) == 0 |
| 20 | + @test expand(a * b - b * a) == 0 |
21 | 21 | end |
0 commit comments