simplify expression in magenium.funcs.poly function