vectorize a three parameter function
const linear = (x, a, b) => a * x + bconst arrX = new Float32Array(10_000).map(() => 123 * (Math.random() - 0.5))const arrA = new Float32Array(10_000).map(() => 321 * (Math.random() - 0.5))const arrB = new Float32Array(10_000).fill(42)const arr = new Float32Array(10_000)vectorize3(linear, arr, arrX, arrA, arrB) Copy
const linear = (x, a, b) => a * x + bconst arrX = new Float32Array(10_000).map(() => 123 * (Math.random() - 0.5))const arrA = new Float32Array(10_000).map(() => 321 * (Math.random() - 0.5))const arrB = new Float32Array(10_000).fill(42)const arr = new Float32Array(10_000)vectorize3(linear, arr, arrX, arrA, arrB)
Rest
vectorize a three parameter function
Example