@@ -5,7 +5,7 @@ using Random
5
5
6
6
SUITE = BenchmarkGroup ()
7
7
8
- @syms a b c d; Random. seed! (123 );
8
+ @syms a b c d x y[ 1 : 3 ] z[ 1 : 2 , 1 : 2 ] ; Random. seed! (123 );
9
9
10
10
let r = @rule (~ x => ~ x), rs = RuleSet ([r]),
11
11
acr = @rule (~ x:: is_literal_number + ~ y => ~ y)
@@ -67,7 +67,19 @@ let r = @rule(~x => ~x), rs = RuleSet([r]),
67
67
subs_expr = (sin (a+ b) + cos (b+ c)) * (sin (b+ c) + cos (c+ a)) * (sin (c+ a) + cos (a+ b))
68
68
end
69
69
70
+ overhead[" get_degrees" ] = BenchmarkGroup ()
70
71
72
+ let y1 = term (getindex, y, 1 , type= Number),
73
+ y2 = term (getindex, y, 2 , type= Number),
74
+ y3 = term (getindex, y, 3 , type= Number),
75
+ z11 = term (getindex, z, 1 , 1 , type= Number),
76
+ z12 = term (getindex, z, 1 , 2 , type= Number),
77
+ z23 = term (getindex, z, 2 , 3 , type= Number),
78
+ # create a relatively large polynomial
79
+ large_poly = SymbolicUtils. expand ((x^ 2 + 2 y1 + 3 z12 + y2* z23 + x* y1* z12 - x^ 2 * z12 + x* z11 + y3 + y2 + z23 + 1 )^ 8 )
80
+
81
+ overhead[" get_degrees" ][" large_poly" ] = @benchmarkable SymbolicUtils. get_degrees ($ large_poly)
82
+ end
71
83
end
72
84
73
85
let
0 commit comments