SymbolicML / DynamicExpressions.jl

Ridiculously fast symbolic expressions
https://symbolicml.org/DynamicExpressions.jl/dev
Apache License 2.0
92 stars 12 forks source link

Reduce specialization in evaluation methods #10

Closed MilesCranmer closed 1 year ago

MilesCranmer commented 1 year ago

This makes it so that the evaluation will only specialize to individual operators, rather than the entire set of operators. Thus, if you start with OperatorEnum(; unary_operators=[sin, cos]), and then run with OperatorEnum(; unary_operators=[sin, cos, exp]), it won't have to recompile the functions!

Surprisingly the evaluation is faster with the decreased specialization.... maybe because there's less function inference?