Code generation for maths functions on persistent vectors