---
title: "multiply(addition:addition:result:)"
framework: accelerate
role: symbol
role_heading: Type Method
path: "accelerate/vdsp/multiply(addition:addition:result:)-89hgk"
---

# multiply(addition:addition:result:)

Calculates the double-precision element-wise product of the sums of two pairs of vectors.

## Declaration

```swift
static func multiply<S, T, U, V>(addition additionAB: (a: S, b: T), addition additionCD: (c: U, d: U), result: inout V) where S : AccelerateBuffer, T : AccelerateBuffer, U : AccelerateBuffer, V : AccelerateMutableBuffer, S.Element == Double, T.Element == Double, U.Element == Double, V.Element == Double
```

## Parameters

- `additionAB`: A tuple that contains the vectors A and B in E = (A + B) * (C + D).
- `additionCD`: A tuple that contains the vectors C and D in E = (A + B) * (C + D).
- `result`: The output vector E in E = (A + B) * (C + D).

## Discussion

Discussion This function calculates the products of the first N elements of the addition of vectors A and B and the addition of vectors C and D.  for (n = 0; n < N; ++n)     E[n] = (A[n]+B[n]) * (C[n]+D[n]);

The following code shows an example of using this function:     let count = 5          let a: [Double] = [ 1,  2,  3,  4,  5]     let b: [Double] = [10, 20, 30, 40, 50]     let c: [Double] = [ 5,  4,  3,  2,  1]     let d: [Double] = [50, 40, 30, 20, 10]          let e = [Double](unsafeUninitializedCapacity: count) {         buffer, initializedCount in                  vDSP.multiply(addition: (a, b),                       addition: (c, d),                       result: &buffer)                  initializedCount = count     }          // Prints "[605.0, 968.0, 1089.0, 968.0, 605.0]".     print(e)

## See Also

### Multiplication

- [multiply(_:_:)](accelerate/vdsp/multiply(_:_:)-9dxnc.md)
- [multiply(_:_:)](accelerate/vdsp/multiply(_:_:)-1ckqt.md)
- [multiply(_:_:)](accelerate/vdsp/multiply(_:_:)-993yp.md)
- [multiply(_:_:)](accelerate/vdsp/multiply(_:_:)-9zgw.md)
- [multiply(_:_:result:)](accelerate/vdsp/multiply(_:_:result:)-4xorc.md)
- [multiply(_:_:result:)](accelerate/vdsp/multiply(_:_:result:)-358cn.md)
- [multiply(_:_:result:)](accelerate/vdsp/multiply(_:_:result:)-3ptjl.md)
- [multiply(_:_:result:)](accelerate/vdsp/multiply(_:_:result:)-155f3.md)
- [multiply(_:by:count:useConjugate:result:)](accelerate/vdsp/multiply(_:by:count:useconjugate:result:)-4idx8.md)
- [multiply(_:by:count:useConjugate:result:)](accelerate/vdsp/multiply(_:by:count:useconjugate:result:)-79r8u.md)
- [multiply(_:by:result:)](accelerate/vdsp/multiply(_:by:result:)-8b9eq.md)
- [multiply(_:by:result:)](accelerate/vdsp/multiply(_:by:result:)-8jyhd.md)
- [multiply(addition:_:)](accelerate/vdsp/multiply(addition:_:)-4c9in.md)
- [multiply(addition:_:)](accelerate/vdsp/multiply(addition:_:)-1wt61.md)
- [multiply(addition:_:)](accelerate/vdsp/multiply(addition:_:)-4fnbx.md)
