| Framework | Accelerate/vecLib |
| Declared in | vDSP.h |
Describes the C API for the vecLib functions that perform arithmetic operations combining the elements of two vectors.
vDSP_vadd
vDSP_vaddD
vDSP_vsub
vDSP_vsubD
vDSP_vam
vDSP_vamD
vDSP_vsbm
vDSP_vsbmD
vDSP_vaam
vDSP_vaamD
vDSP_vsbsbm
vDSP_vsbsbmD
vDSP_vasbm
vDSP_vasbmD
vDSP_vasm
vDSP_vasmD
vDSP_vsbsm
vDSP_vsbsmD
vDSP_vmsa
vDSP_vmsaD
vDSP_vdiv
vDSP_vdivD
vDSP_vdivi
vDSP_vmul
vDSP_vmulD
vDSP_vma
vDSP_vmaD
vDSP_vmsb
vDSP_vmsbD
vDSP_vmma
vDSP_vmmaD
vDSP_vmmsb
vDSP_vmmsbD
vDSP_zrvdiv
vDSP_zrvdivD
vDSP_zrvmul
vDSP_zrvmulD
vDSP_zrvsub
vDSP_zrvsubD
vDSP_zrvadd
vDSP_zrvaddD
vDSP_zvadd
vDSP_zvaddD
vDSP_zvcmul
vDSP_zvcmulD
vDSP_zvmul
vDSP_zvmulD
vDSP_zvsub
vDSP_zvsubD
vDSP_zvcma
vDSP_zvcmaD
Difference equation, 2 poles, 2 zeros; single precision.
void vDSP_deq22 (float * A, vDSP_Stride I, float * B, float * C, vDSP_Stride K, vDSP_Length N);
Single-precision real input vector; must have at least N+2 elements
Stride for A
5 single-precision inputs, filter coefficients
Single-precision real output vector; must have at leastN+2elements
Stride for C
Number of new output elements to produce
Performs two-pole two-zero recursive filtering on real input vector A. Since the computation is recursive, the first two elements in vector C must be initialized prior to calling deq22D. deq22D creates N new values for vector C beginning with its third element and requires N+2 input values from vector A. This function can only be done out of place.

vDSP.h Difference equation, 2 poles, 2 zeros; double precision.
void vDSP_deq22D (double * A, vDSP_Stride I, double * B, double * C, vDSP_Stride K, vDSP_Length N);
Double-precision real input vector; must have at least N+2 elements
Stride for A
5 double-precision inputs, filter coefficients
Double-precision real output vector; must have at leastN+2elements
Stride for C
Number of new output elements to produce
Performs two-pole two-zero recursive filtering on real input vector A. Since the computation is recursive, the first two elements in vector C must be initialized prior to calling deq22x. deq22x creates N new values for vector C beginning with its third element and requires N+2 input values from vector A. This function can only be done out of place.

vDSP.h Vector add, add, and multiply; single precision.
void vDSP_vaam (float * A, vDSP_Stride I, float * B, vDSP_Stride J, float * C, vDSP_Stride K, float * D, vDSP_Stride L, float * E, vDSP_Stride M, vDSP_Length N);
Single-precision real input vector
Stride for A
Single-precision real input vector
Stride for B
Single-precision real input vector
Stride for C
Single-precision real input vector
Stride for D
Single-precision real output vector
Stride for E
Count ; each vector must have at least N elements
This performs the operation
Multiplies the sum of vectors A and B by the sum of vectors C and D. Results are stored in vector E.
vDSP.h Vector add, add, and multiply; double precision.
void vDSP_vaamD (double * A, vDSP_Stride I, double * B, vDSP_Stride J, double * C, vDSP_Stride K, double * D, vDSP_Stride L, double * E, vDSP_Stride M, vDSP_Length N);
Double-precision real input vector
Stride for A
Double-precision real input vector
Stride for B
Double-precision real input vector
Stride for C
Double-precision real input vector
Stride for D
Double-precision real output vector
Stride for E
Count ; each vector must have at least N elements
This performs the operation
Multiplies the sum of vectors A and B by the sum of vectors C and D. Results are stored in vector E.
vDSP.h Adds vector A to vector B and leaves the result in vector C; single precision.
void vDSP_vadd (const float input1[], vDSP_Stride stride1, const float input2[], vDSP_Stride stride2, float result[], vDSP_Stride strideResult, vDSP_Length size);
This performs the operation
vDSP.h Adds vector A to vector B and leaves the result in vector C; double precision.
void vDSP_vaddD (const double input1[], vDSP_Stride stride1, const double input2[], vDSP_Stride stride2, double result[], vDSP_Stride strideResult, vDSP_Length size);
This performs the operation
vDSP.h Adds vectors A and B, multiplies the sum by vector C, and leaves the result in vector D; single precision.
void vDSP_vam (const float input1[], vDSP_Stride stride1, const float input2[], vDSP_Stride stride2, const float input3[], vDSP_Stride stride3, float result[], vDSP_Stride strideResult, vDSP_Length size);
This performs the operation
vDSP.h Adds vectors A and B, multiplies the sum by vector C, and leaves the result in vector D; double precision.
void vDSP_vamD (const double input1[], vDSP_Stride stride1, const double input2[], vDSP_Stride stride2, const double input3[], vDSP_Stride stride3, double result[], vDSP_Stride strideResult, vDSP_Length size);
This performs the operation
vDSP.h Vector add, subtract, and multiply; single precision.
void vDSP_vasbm (float * A, vDSP_Stride I, float * B, vDSP_Stride J, float * C, vDSP_Stride K, float * D, vDSP_Stride L, float * E, vDSP_Stride M, vDSP_Length N);
Single-precision real input vector
Stride for A
Single-precision real input vector
Stride for B
Single-precision real input vector
Stride for C
Single-precision real input vector
Stride for D
Single-precision real output vector
Stride for E
Count ; each vector must have at least N elements
This performs the operation
Multiplies the sum of vectors A and B by the result of subtracting vector D from vector C. Results are stored in vector E.
vDSP.h Vector add, subtract, and multiply; double precision.
void vDSP_vasbmD (double * A, vDSP_Stride I, double * B, vDSP_Stride J, double * C, vDSP_Stride K, double * D, vDSP_Stride L, double * E, vDSP_Stride M, vDSP_Length N);
Double-precision real input vector
Stride for A
Double-precision real input vector
Stride for B
Double-precision real input vector
Stride for C
Double-precision real input vector
Stride for D
Double-precision real output vector
Stride for E
Count ; each vector must have at least N elements
This performs the operation
Multiplies the sum of vectors A and B by the result of subtracting vector D from vector C. Results are stored in vector E.
vDSP.h Vector add and scalar multiply; single precision.
void vDSP_vasm (float * A, vDSP_Stride I, float * B, vDSP_Stride J, float * C, float * D, vDSP_Stride L, vDSP_Length N);
Single-precision real input vector
Stride for A
Single-precision real input vector
Stride for B
Single-precision real input scalar
Single-precision real output vector
Stride for D
Count ; each vector must have at least N elements
This performs the operation
Multiplies the sum of vectors A and B by scalar C. Results are stored in vector D.
vDSP.h Vector add and scalar multiply; double precision.
void vDSP_vasmD (double * A, vDSP_Stride I, double * B, vDSP_Stride J, double * C, double * D, vDSP_Stride L, vDSP_Length N);
Double-precision real input vector
Stride for A
Double-precision real input vector
Stride for B
Double-precision real input scalar
Double-precision real output vector
Stride for D
Count ; each vector must have at least N elements
This performs the operation
Multiplies the sum of vectors A and B by scalar C. Results are stored in vector D.
vDSP.h Vector distance; single precision.
void vDSP_vdist (float * A, vDSP_Stride I, float * B, vDSP_Stride J, float * C, vDSP_Stride K, vDSP_Length N);
Single-precision real input vector
Stride for A
Single-precision real input vector
Stride for B
Single-precision real output vector
Stride for C
Count
Performs the operation
Computes the square root of the sum of the squares of corresponding elements of vectors A and B, and stores the result in the corresponding element of vector C.
vDSP.h Vector distance; double precision.
void vDSP_vdistD (double * A, vDSP_Stride I, double * B, vDSP_Stride J, double * C, vDSP_Stride K, vDSP_Length N);
Double-precision real input vector
Stride for A
Double-precision real input vector
Stride for B
Double-precision real output vector
Stride for C
Count
Performs the operation
Computes the square root of the sum of the squares of corresponding elements of vectors A and B, and stores the result in the corresponding element of vector C.
vDSP.h Vector divide; single precision.
void vDSP_vdiv (float * A, vDSP_Stride I, float * B, vDSP_Stride J, float * C, vDSP_Stride K, vDSP_Length N);
Single-precision real input vector
Stride for A
Single-precision real input vector
Stride for B
Single-precision real output vector
Stride for C
Count
Performs the operation
Divides elements of vector A by corresponding elements of vector B, and stores the results in corresponding elements of vector C.
vDSP.h Vector divide; double precision.
void vDSP_vdivD (double * A, vDSP_Stride I, double * B, vDSP_Stride J, double * C, vDSP_Stride K, vDSP_Length N);
Double-precision real input vector
Stride for A
Double-precision real input vector
Stride for B
Double-precision real output vector
Stride for C
Count
Performs the operation
Divides elements of vector A by corresponding elements of vector B, and stores the results in corresponding elements of vector C.
vDSP.h Vector divide; integer.
void vDSP_vdivi (int * A, vDSP_Stride I, int * B, vDSP_Stride J, int * C, vDSP_Stride K, vDSP_Length N);
Integer input vector
Stride for A
Integer input vector
Stride for B
Integer output vector
Stride for C
Count
Performs the operation
Divides elements of vector A by corresponding elements of vector B, and stores the results in corresponding elements of vector C.
vDSP.h Vector envelope; single precision.
void vDSP_venvlp (float * A, vDSP_Stride I, float * B, vDSP_Stride J, float * C, vDSP_Stride K, float * D, vDSP_Stride L, vDSP_Length N);
Single-precision real input vector: high envelope
Stride for A
Single-precision real input vector: low envelope
Stride for B
Single-precision real input vector
Stride for C
Single-precision real output vector
Stride for D
Count
Performs the operation

Finds the extrema of vector C. For each element of C, the corresponding element of A provides an upper-threshold value, and the corresponding element of B provides a lower-threshold value. If the value of an element of C falls outside the range defined by these thresholds, it is copied to the corresponding element of vector D. If its value is within the range, the corresponding element of vector D is set to zero.
vDSP.h Vector envelope; double precision.
void vDSP_venvlpD (double * A, vDSP_Stride I, double * B, vDSP_Stride J, double * C, vDSP_Stride K, double * D, vDSP_Stride L, vDSP_Length N);
Double-precision real input vector: high envelope
Stride for A
Double-precision real input vector: low envelope
Stride for B
Double-precision real input vector
Stride for C
Double-precision real output vector
Stride for D
Count
Performs the operation

Finds the extrema of vector C. For each element of C, the corresponding element of A provides an upper-threshold value, and the corresponding element of B provides a lower-threshold value. If the value of an element of C falls outside the range defined by these thresholds, it is copied to the corresponding element of vector D. If its value is within the range, the corresponding element of vector D is set to zero.
vDSP.h Vector equivalence, 32-bit logical.
void vDSP_veqvi (int * A, vDSP_Stride I, int * B, vDSP_Stride J, int * C, vDSP_Stride K, vDSP_Length N);
Integer input vector
Stride for A
Integer input vector
Stride for B
Integer output vector
Stride for C
Count
Performs the operation
Outputs the bitwise logical equivalence, exclusive NOR, of the integers of vectors A and B. For each pair of input values, bits in each position are compared. A bit in the output value is set if both input bits areset, or both are clear; otherwise it is cleared.
vDSP.h Vector linear interpolation between vectors; single precision.
void vDSP_vintb (float * A, vDSP_Stride I, float * B, vDSP_Stride J, float * C, float * D, vDSP_Stride L, vDSP_Length N);
Single-precision real input vector
Stride for A
Single-precision real input vector
Stride for B
Single-precision real input scalar: interpolation constant
Single-precision real output vector
Stride for D
Count
Performs the operation
Creates vector D by interpolating between vectors A and B.
vDSP.h Vector linear interpolation between vectors; double precision.
void vDSP_vintbD (double * A, vDSP_Stride I, double * B, vDSP_Stride J, double * C, double * D, vDSP_Stride L, vDSP_Length N);
Double-precision real input vector
Stride for A
Double-precision real input vector
Stride for B
Double-precision real input scalar: interpolation constant
Double-precision real output vector
Stride for D
Count
Performs the operation
Creates vector D by interpolating between vectors A and B.
vDSP.h Vector multiply and add; single precision.
void vDSP_vma (float * A, vDSP_Stride I, float * B, vDSP_Stride J, float * C, vDSP_Stride K, float * D, vDSP_Stride L, vDSP_Length N);
Single-precision real input vector
Stride for A
Single-precision real input vector
Stride for B
Single-precision real input vector
Stride for C
Single-precision real output vector
Stride for D
Count
This performs the operation
Multiplies corresponding elements of vectors A and B, add the corresponding elements of vector C, and stores the results in vector D.
vDSP.h Vector multiply and add; double precision.
void vDSP_vmaD (double * A, vDSP_Stride I, double * B, vDSP_Stride J, double * C, vDSP_Stride K, double * D, vDSP_Stride L, vDSP_Length N);
Double-precision real input vector
Stride for A
Double-precision real input vector
Stride for B
Double-precision real input vector
Stride for C
Double-precision real output vector
Stride for D
Count
This performs the operation
Multiplies corresponding elements of vectors A and B, add the corresponding elements of vector C, and stores the results in vector D.
vDSP.h Vector maxima; single precision.
void vDSP_vmax (float * A, vDSP_Stride I, float * B, vDSP_Stride J, float * C, vDSP_Stride K, vDSP_Length N);
Single-precision real input vector
Stride for A
Single-precision real input vector
Stride for B
Single-precision real output vector
Stride for C
Count
This performs the operation
Each element of output vector D is the greater of the corresponding values from input vectors A and B.
vDSP.h Vector maxima; double precision.
void vDSP_vmaxD (double * A, vDSP_Stride I, double * B, vDSP_Stride J, double * C, vDSP_Stride K, vDSP_Length N);
Double-precision real input vector
Stride for A
Double-precision real input vector
Stride for B
Double-precision real output vector
Stride for C
Count
This performs the operation
Each element of output vector D is the greater of the corresponding values from input vectors A and B.
vDSP.h Vector maximum magnitudes; single precision.
void vDSP_vmaxmg (float * A, vDSP_Stride I, float * B, vDSP_Stride J, float * C, vDSP_Stride K, vDSP_Length N);
Single-precision real input vector
Stride for A
Single-precision real input vector
Stride for B
Single-precision real output vector
Stride for C
Count
This performs the operation
Each element of output vector D is the larger of the magnitudes of corresponding values from input vectors A and B.
vDSP.h Vector maximum magnitudes; double precision.
void vDSP_vmaxmgD (double * A, vDSP_Stride I, double * B, vDSP_Stride J, double * C, vDSP_Stride K, vDSP_Length N);
Double-precision real input vector
Stride for A
Double-precision real input vector
Stride for B
Double-precision real output vector
Stride for C
Count
This performs the operation
Each element of output vector D is the larger of the magnitudes of corresponding values from input vectors A and B.
vDSP.h Vector minima; single precision.
void vDSP_vmin (float * A, vDSP_Stride I, float * B, vDSP_Stride J, float * C, vDSP_Stride K, vDSP_Length N);
Single-precision real input vector
Stride for A
Single-precision real input vector
Stride for B
Single-precision real output vector
Stride for C
Count
This performs the operation
Each element of output vector D is the lesser of the corresponding values from input vectors A and B.
vDSP.h Vector minima; double precision.
void vDSP_vminD (double * A, vDSP_Stride I, double * B, vDSP_Stride J, double * C, vDSP_Stride K, vDSP_Length N);
Double-precision real input vector
Stride for A
Double-precision real input vector
Stride for B
Double-precision real output vector
Stride for C
Count
This performs the operation
Each element of output vector D is the lesser of the corresponding values from input vectors A and B.
vDSP.h Vector minimum magnitudes; single precision.
void vDSP_vmin (float * A, vDSP_Stride I, float * B, vDSP_Stride J, float * C, vDSP_Stride K, vDSP_Length N);
Single-precision real input vector
Stride for A
Single-precision real input vector
Stride for B
Single-precision real output vector
Stride for C
Count
This performs the operation
Each element of output vector D is the smaller of the magnitudes of corresponding values from input vectors A and B.
vDSP.h Vector minimum magnitudes; double precision.
void vDSP_vminD (double * A, vDSP_Stride I, double * B, vDSP_Stride J, double * C, vDSP_Stride K, vDSP_Length N);
Double-precision real input vector
Stride for A
Double-precision real input vector
Stride for B
Double-precision real output vector
Stride for C
Count
This performs the operation
Each element of output vector D is the smaller of the magnitudes of corresponding values from input vectors A and B.
vDSP.h Vector multiply, multiply, and add; single precision.
void vDSP_vmma (float * A, vDSP_Stride I, float * B, vDSP_Stride J, float * C, vDSP_Stride K, float * D, vDSP_Stride L, float * E, vDSP_Stride M, vDSP_Length N);
Single-precision real input vector
Stride for A
Single-precision real input vector
Stride for B
Single-precision real input vector
Stride for C
Single-precision real input vector
Stride for D
Single-precision real output vector
Stride for E
Count
This performs the operation
Corresponding elements of A and B are multiplied, corresponding values of C and D are multiplied, and these products are added together and stored in E.
vDSP.h Vector multiply, multiply, and add; double precision.
void vDSP_vmmaD (double * A, vDSP_Stride I, double * B, vDSP_Stride J, double * C, vDSP_Stride K, double * D, vDSP_Stride L, double * E, vDSP_Stride M, vDSP_Length N);
Double-precision real input vector
Stride for A
Double-precision real input vector
Stride for B
Double-precision real input vector
Stride for C
Double-precision real input vector
Stride for D
Double-precision real output vector
Stride for E
Count
This performs the operation
Corresponding elements of A and B are multiplied, corresponding values of C and D are multiplied, and these products are added together and stored in E.
vDSP.h Vector multiply, multiply, and subtract; single precision.
void vDSP_vmmsb (float * A, vDSP_Stride I, float * B, vDSP_Stride J, float * C, vDSP_Stride K, float * D, vDSP_Stride L, float * E, vDSP_Stride M, vDSP_Length N);
Single-precision real input vector
Stride for A
Single-precision real input vector
Stride for B
Single-precision real input vector
Stride for C
Single-precision real input vector
Stride for D
Single-precision real output vector
Stride for E
Count
This performs the operation
Corresponding elements of A and B are multiplied, corresponding values of C and D are multiplied, and the second product is subtracted from the first. The result is stored in E.
vDSP.h Vector multiply, multiply, and subtract; double precision.
void vDSP_vmmsbD (double * A, vDSP_Stride I, double * B, vDSP_Stride J, double * C, vDSP_Stride K, double * D, vDSP_Stride L, double * E, vDSP_Stride M, vDSP_Length N);
Double-precision real input vector
Stride for A
Double-precision real input vector
Stride for B
Double-precision real input vector
Stride for C
Double-precision real input vector
Stride for D
Double-precision real output vector
Stride for E
Count
This performs the operation
Corresponding elements of A and B are multiplied, corresponding values of C and D are multiplied, and the second product is subtracted from the first. The result is stored in E.
vDSP.h Vector multiply and scalar add; single precision.
void vDSP_vmsa (float * A, vDSP_Stride I, float * B, vDSP_Stride J, float * C, float * D, vDSP_Stride L, vDSP_Length N);
Single-precision real input vector
Stride for A
Single-precision real input vector
Stride for B
Single-precision real input scalar
Single-precision real output vector
Stride for D
Count
This performs the operation
Corresponding elements of A and B are multiplied and the scalar C is added. The result is stored in D.
vDSP.h Vector multiply and scalar add; double precision.
void vDSP_vmsaD (double * A, vDSP_Stride I, double * B, vDSP_Stride J, double * C, double * D, vDSP_Stride L, vDSP_Length N);
Double-precision real input vector
Stride for A
Double-precision real input vector
Stride for B
Double-precision real input scalar
Double-precision real output vector
Stride for D
Count
This performs the operation
Corresponding elements of A and B are multiplied and the scalar C is added. The result is stored in D.
vDSP.h Vector multiply and subtract, single precision.
void vDSP_vmsb (float * A, vDSP_Stride I, float * B, vDSP_Stride J, float * C, vDSP_Stride K, float * D, vDSP_Stride L, vDSP_Length N);
Single-precision real input vector
Stride for A
Single-precision real input vector
Stride for B
Single-precision real input vector
Stride for C
Single-precision real output vector
Stride for D
Count
This performs the operation
Corresponding elements of A and B are multiplied and the corresponding value of C is subtracted. The result is stored in D.
vDSP.h Vector multiply and subtract; double precision.
void vDSP_vmsbD (double * A, vDSP_Stride I, double * B, vDSP_Stride J, double * C, vDSP_Stride K, double * D, vDSP_Stride L, vDSP_Length N);
Double-precision real input vector
Stride for A
Double-precision real input vector
Stride for B
Double-precision real input vector
Stride for C
Double-precision real output vector
Stride for D
Count
This performs the operation
Corresponding elements of A and B are multiplied and the corresponding value of C is subtracted. The result is stored in D.
vDSP.h Multiplies vector signal1 by vector signal2 and leaves the result in vector result; single precision.
void vDSP_vmul (const float input1[], vDSP_Stride stride1, const float input2[], vDSP_Stride stride2, float result[], vDSP_Stride strideResult, vDSP_Length size);
This performs the operation
vDSP.h Multiplies vector signal1 by vector signal2 and leaves the result in vector result; double precision.
void vDSP_vmulD (const double input1[], vDSP_Stride stride1, const double input2[], vDSP_Stride stride2, double result[], vDSP_Stride strideResult, vDSP_Length size);
This performs the operation
vDSP.h Vector polynomial evaluation; single precision.
void vDSP_vpoly (float * A, vDSP_Stride I, float * B, vDSP_Stride J, float * C, vDSP_Stride K, vDSP_Length N, vDSP_Length P);
Single-precision real input vector: coefficients
Stride for A
Single-precision real input vector: variable values
Stride for B
Single-precision real output vector
Stride for C
Count
Degree of polynomial
Performs the operation

Evaluates polynomials using vector B as independent variables and vector A as coefficients. A polynomial of degree p requires p+1 coefficients, so vector A should contain P+1 values.
vDSP.h Vector polynomial evaluation; double precision.
void vDSP_vpolyD (double * A, vDSP_Stride I, double * B, vDSP_Stride J, double * C, vDSP_Stride K, vDSP_Length N, vDSP_Length P);
Double-precision real input vector: coefficients
Stride for A
Double-precision real input vector: variable values
Stride for B
Double-precision real output vector
Stride for C
Count
Degree of polynomial
Performs the operation

Evaluates polynomials using vector B as independent variables and vector A as coefficients. A polynomial of degree p requires p+1 coefficients, so vector A should contain P+1 values.
vDSP.h Vector pythagoras; single precision.
void vDSP_vpythg (float * A, vDSP_Stride I, float * B, vDSP_Stride J, float * C, vDSP_Stride K, float * D, vDSP_Stride L, float * E, vDSP_Stride M, vDSP_Length N);
Single-precision real input vector
Stride for A
Single-precision real input vector
Stride for B
Single-precision real input vector
Stride for C
Single-precision real input vector
Stride for D
Single-precision real output vector
Stride for E
Count
Performs the operation
Subtracts vector C from A and squares the differences, subtracts vector D from B and squares the differences, adds the two sets of squared differences, and then writes the square roots of the sums to vector E.
vDSP.h Vector pythagoras; double precision.
void vDSP_vpythgD (double * A, vDSP_Stride I, double * B, vDSP_Stride J, double * C, vDSP_Stride K, double * D, vDSP_Stride L, double * E, vDSP_Stride M, vDSP_Length N);
Double-precision real input vector
Stride for A
Double-precision real input vector
Stride for B
Double-precision real input vector
Stride for C
Double-precision real input vector
Stride for D
Double-precision real output vector
Stride for E
Count
Performs the operation
Subtracts vector C from A and squares the differences, subtracts vector D from B and squares the differences, adds the two sets of squared differences, and then writes the square roots of the sums to vector E.
vDSP.h Vector quadratic interpolation; single precision.
void vDSP_vqint (float * A, float * B, vDSP_Stride J, float * C, vDSP_Stride K, vDSP_Length N, vDSP_Length M);
Single-precision real input vector
Single-precision real input vector: integer parts are indices into A and fractional parts are interpolation constants
Stride for B
Single-precision real output vector
Stride for