Merge accumulate function from branch debjit