Skip to content

Commit 8aaa7e0

Browse files
committed
benchmark the important stuff
1 parent 91a1afc commit 8aaa7e0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

benchmark/benchmarks.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,22 @@ let r = @rule(~x => ~x), rs = RuleSet([r]),
6666
overhead["substitute"]["a,b,c"] = @benchmarkable substitute(subs_expr, $(Dict(a=>1, b=>2, c=>3))) setup=begin
6767
subs_expr = (sin(a+b) + cos(b+c)) * (sin(b+c) + cos(c+a)) * (sin(c+a) + cos(a+b))
6868
end
69+
70+
71+
end
72+
73+
let
74+
pform = SUITE["polyform"] = BenchmarkGroup()
75+
@syms a b c d e f g h i
76+
ex = (f + ((((g*(c^2)*(e^2)) / d - e*h*(c^2)) / b + (-c*e*f*g) / d + c*e*i) /
77+
(i + ((c*e*g) / d - c*h) / b + (-f*g) / d) - c*e) / b +
78+
((g*(f^2)) / d + ((-c*e*f*g) / d + c*f*h) / b - f*i) /
79+
(i + ((c*e*g) / d - c*h) / b + (-f*g) / d)) / d
80+
81+
o = (d + (e*((c*(g + (-d*g) / d)) / (i + (-c*(h + (-e*g) / d)) / b + (-f*g) / d))) / b +
82+
(-f*(g + (-d*g) / d)) / (i + (-c*(h + (-e*g) / d)) / b + (-f*g) / d)) / d
83+
pform["simplify_fractions"] = @benchmarkable simplify_fractions($ex)
84+
pform["iszero"] = @benchmarkable SymbolicUtils.fraction_iszero($ex)
85+
pform["isone"] = @benchmarkable SymbolicUtils.fraction_isone($o)
86+
pform["easy_iszero"] = @benchmarkable SymbolicUtils.fraction_iszero($((b*(h + (-e*g) / d)) / b + (e*g) / d - h))
6987
end

0 commit comments

Comments
 (0)