Extend riemann sum to support custom sample points
Extend riemann sum to support custom sample points

Good, e.g. for evaluating at midpoints.

This isn't the most DRY implementation for sure, but it seemed more performant than the obvious alternatives.
numbers/numbers.js,JunaidPaul/numbers.js,xuewei619/numbers.js,SaintDako/numbers.js