mathematica generated function