Skip to content
fn

vsma_f32

void vsma_f32(const float * a, float scalar, const float * b, float * out, int n)

Single-precision scaled vector plus vector, out=a⋅s+bout = a \cdot s + b.

The three-buffer form of a scaled accumulation: unlike a BLAS axpy the addend and the destination are separate, so the first term of a linear combination can be written straight into a fresh output without copying the base into it first.

Math

outi=s⋅ai+bi\text{out}_i = s \cdot a_i + b_i

References

Accelerate.framework vDSP_vsma.

Parameters

aconst float*
Vector to scale.
scalarfloat
Scale applied to a.
bconst float*
Vector added to the scaled result; may alias out.
outfloat*
Output buffer.
nstd::size_t
Element count.