---
title: vDSP_vaddsubD
framework: Accelerate
role: symbol
role_heading: Function
platforms: [iOS 8.0+, iPadOS 8.0+, Mac Catalyst 13.1+, macOS 10.10+, visionOS 1.0+, watchOS 2.0+]
path: accelerate/vdsp_vaddsubd
---

# vDSP_vaddsubD

Calculates the double-precision element-wise sum and subtraction of two vectors, using the specified stride.

## Declaration

```occ
void vDSP_vaddsubD(const double *__I0, vDSP_Stride __I0S, const double *__I1, vDSP_Stride __I1S, double *__O0, vDSP_Stride __O0S, double *__O1, vDSP_Stride __O1S, vDSP_Length __N);
```

## Parameters

- `__I0`: The first input vector, A.
- `__I0S`: The distance between the elements in the first input vector.
- `__I1`: The second input vector, B.
- `__I1S`: The distance between the elements in the second input vector.
- `__O0`: The addition output vector, O0.
- `__O0S`: The distance between the elements in the addition output vector.
- `__O1`: The subtraction output vector, O1.
- `__O1S`: The distance between the elements in the subtraction output vector.
- `__N`: The number of elements that the function processes.

## Discussion

Discussion This function calculates the addition and subtraction of the first N elements of input vectors A and B, and writes the result to output vector C, as follows:  for (i = 0; i < N; ++i)  {      i1 = I1[i*I1S];      i0 = I0[i*I0S];      O0[i*O0S] = i1 + i0;      O1[i*O1S] = i1 - i0;  }

The following code shows an example of using this function:

## See Also

### Binary addition and subtraction operations

- [vDSP_vaddsub](accelerate/vdsp_vaddsub.md)
