.Q.fu[x;y]
Where x is a unary function and y is
x[y] after evaluating x only on distinct items of yx[y]q)vec:100000 ? 30 / long vector with few different values
q)f:{exp x*x} / e raised to x*x
q)\t:1000 r1:f vec
745
q)\t:1000 r2:.Q.fu[f;vec]
271
q)r1~r2
1b