Use component-wise math to avoid too many allocations, see #46
Merge remote-tracking branch 'origin/master'