<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vDSP_vtabiD",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@vDSP_vtabiD"
  },
  "title" : "vDSP_vtabiD"
}
-->

# vDSP_vtabiD

Generates a double-precision vector by interpolating values from a lookup table.

```
extern void vDSP_vtabiD(const double *__A, vDSP_Stride __IA, const double *__S1, const double *__S2, const double *__C, vDSP_Length __M, double *__D, vDSP_Stride __ID, vDSP_Length __N);
```

## Parameters

`__A`

The input vector that defines the offsets into the lookup table.

`__IA`

The distance between the elements in the offsets vector.

`__S1`

The scale factor.

`__S2`

The base offset.

`__C`

The input vector that defines the lookup table.

`__M`

The number of elements in the lookup table.

`__D`

The output vector.

`__ID`

The distance between the elements in the output vector.

`__N`

The number of elements in the offsets and output vectors.

## Discussion

The following code shows the result of linearly interpolating a lookup table that contains the values `[-10, 0, 100]` using the offsets `[0, 0.5, 1, 1.5, 2]`.  The integer offsets, `0`, `1`, and `2`, return the corresponding values in the lookup table, `-10`, `0`, and `2`. The noninteger offsets, `0.5` and `1.5`, return the linearly interpolated values between the lookup table values, `-5` and `50`.

```swift
    let offsets: [Double] = [0, 0.5, 1, 1.5, 2]
    let lookupTable: [Double] = [-10, 0, 100]
    
    var scale: Double = 1
    var baseOffset: Double = 0
    
    let n = offsets.count
    let m = lookupTable.count
    
    let stride = 1
    
    let values = [Double](unsafeUninitializedCapacity: n) {
        buffer, initializedCount in
        
        vDSP_vtabiD(offsets, stride,
                    &scale,
                    &baseOffset,
                    lookupTable, vDSP_Length(m),
                    buffer.baseAddress!, stride, vDSP_Length(n))
        
        initializedCount = n
    }
    
    // Prints "[-10.0, -5.0, 0.0, 50.0, 100.0]".
    print(values)
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)