A vector of four 32-bit single-precision values.

SDKs

- iOS 11.0+
- macOS 10.13+
- Mac Catalyst 13.0+Beta
- tvOS 11.0+
- watchOS 4.0+

Framework

- simd

Type Alias# simd_float4

A vector of four 32-bit single-precision values.

SDKs

- iOS 11.0+
- macOS 10.13+
- Mac Catalyst 13.0+Beta
- tvOS 11.0+
- watchOS 4.0+

Framework

- simd

`simd`_make_float4

Returns a new vector by truncating the specified vector.

`simd`_make_float4

Returns a new vector by truncating the specified vector.

`simd`_make_float4

Returns a new vector with the first element set to a scalar value, and other elements set to zero.

`simd`_make_float4

Returns a new vector with the first and second elements from a two-element vector, and other elements set to zero.

`simd`_make_float4

Returns a new vector with the first, second, and third elements from a three-element vector, and other elements set to zero.

`simd`_make_float4

Returns a new vector from a four-element vector.

`simd`_make_float4

Returns a new vector from 4 scalar values.

`simd`_make_float4

Returns a new vector from 2 scalar values and a two-element vector.

`simd`_make_float4

Returns a new vector from 2 scalar values and a two-element vector.

`simd`_make_float4

Returns a new vector from 2 scalar values and a two-element vector.

`simd`_make_float4

Returns a new vector from 2 two-element vectors.

`simd`_make_float4

Returns a new vector from a scalar value and a three-element vector.

`simd`_make_float4

Returns a new vector from a scalar value and a three-element vector.

`simd`_make_float4_undef

Returns a new vector with the first element set to a scalar value, and other elements undefined.

`simd`_make_float4_undef

Returns a new vector with the first and second elements from a two-element vector, and other elements undefined.

`simd`_make_float4_undef

Returns a new vector with the first, second, and third elements from a three-element vector, and other elements undefined.

`simd`_abs

Returns the absolute value of each element in a vector.

`simd`_clamp

Returns each element in a vector clamped to a specified range.

`simd`_sign

Returns the sign of each element in a vector.

`simd`_fract

Returns the fractional part of each element in a vector.

`simd`_step

Returns zero for each element in a vector less than a specified edge; one otherwise.

`simd`_equal

Returns true if all elements of a vector are equal; false otherwise.

`simd`_reduce_add

Returns the sum of all elements in a vector.

`simd`_reduce_max

Returns the maximum value in a vector.

`simd`_reduce_min

Returns the minimum value in a vector.

`simd`_mix

Returns an elementwise linearly interpolated value between two vectors.

`simd`_smoothstep

Returns an elementwise smoothly interpolated value between two vectors.

`simd`_recip

Returns the reciprocal of each element in a vector.

`simd`_rsqrt

Returns the reciprocal square root of each element in a vector.

`simd`_precise_recip

Returns the precise reciprocal of each element in a vector.

`simd`_precise_rsqrt

Returns the precise reciprocal square root of each element in a vector.

`simd`_fast_recip

Returns the fast reciprocal of each element in a vector.

`simd`_fast_rsqrt

Returns the fast reciprocal square root of each element in a vector.

`exp`

Returns *e* raised to the power of each element in a vector.

`exp2`

Returns 2 raised to the power of each element in a vector.

`exp10`

Returns 10 raised to the power of each element in a vector.

`expm1`

Returns *eˣ-1* for each element in a vector.

`log`

Returns the natural logarithm of each element in a vector.

`log2`

Returns the base 2 logarithm of each element in a vector.

`log10`

Returns the base 10 logarithm of each element in a vector.

`log1p`

Returns *log(1+x)* for each element in a vector.

`simd`_dot

Returns the dot product of two vectors.

`simd`_normalize

Returns a vector pointing in the same direction of the supplied vector with a length of 1.

`simd`_project

Returns the first vector projected onto the second vector.

`simd`_precise_normalize

Returns the precise normalized vector.

`simd`_precise_project

Returns the precise projected vector.

`simd`_fast_normalize

Returns the fast normalized vector.

`simd`_fast_project

Returns the fast projected vector.

`simd`_distance_squared

Returns the square of the distance between two vectors.

`simd`_length

Returns the length of a vector.

`simd`_length_squared

Returns the square of the length of a vector.

`simd`_norm_inf

Returns the *inf-norm* (the maximum absolute value) of a vector.

`simd`_norm_one

Returns the *one-norm* (the sum of absolute values) of a vector.

`simd`_refract

Returns the refraction direction of an incident vector, a unit normal vector, and an index of refraction eta.

`simd`_reflect

Returns the reflection direction of an incident vector and a unit normal vector.

`acosh`

Returns the inverse hyperbolic cosine of each element in a vector.

`asinh`

Returns the inverse hyperbolic sine of each element in a vector.

`atanh`

Returns the inverse hyperbolic tangent of each element in a vector.

`cosh`

Returns the hyperbolic cosine of each element in a vector.

`sinh`

Returns the hyperbolic sine of each element in a vector.

`tanh`

Returns the hyperbolic tangent of each element in a vector.

`simd`_select

Returns a vector containing elements from either the first or second parameter, depending on the high-order bit of the corresponding element in the third parameter.

`simd`_bitselect

Returns a vector containing elements from either the first or second parameter, depending on the corresponding element in the third parameter.

`cbrt`

Returns the cube root of each element in a vector.

`copysign`

Returns each element of a vector, with the sign of the corresponding element in a second vector.

`erf`

Returns the error function for each element in a vector.

`erfc`

Returns the complementary error function for each element in a vector.

`fabs`

Returns the absolute value of each element in a vector.

`fdim`

Returns the positive difference between corresponding elements in two vectors.

`fma`

Returns the multiply-add result for corresponding elements in three vectors.

`fmod`

Returns the modulus after dividing each element in a vector by the corresponding element in a second vector.

`hypot`

Returns the hypotenuse of a right-angled triangle with the sides that are adjacent to the right angle defined by two vectors.

`nextafter`

Returns the next representable value of each element in a vector in the direction of the corresponding element in a second vector.

`pow`

Returns each element in a vector raised to the power of the corresponding element in a second vector.

`remainder`

Returns the remainder after dividing each element in an array by the corresponding element in a second array of double-precision values.

`rint`

Returns each element in a vector rounded to the nearest integer in the specified direction.

`round`

Returns each element in a vector rounded to the nearest integer.

`simd`_muladd

Returns the multiply-add result for corresponding elements in three vectors.

`sqrt`

Returns the square root of each element in a vector.

`tgamma`

Returns the gamma function for each element in a vector.

`acos`

Returns the arccosine of each element in a vector.

`asin`

Returns the arcsine of each element in a vector.

`atan`

Returns the arctangent of each element in a vector.

`atan2`

Returns the arctangent of each pair of corresponding elements in two vectors.

`cos`

Returns the cosine of each element in a vector.

`cospi`

Returns the cosine of each element in a vector multiplied by pi.

`sin`

Returns the sine of each element in a vector.

`sinpi`

Returns the sine of each element in a vector multiplied by pi.

`tan`

Returns the tangent of each element in a vector.

`tanpi`

Returns the tangent of each element in a vector multiplied by pi.

`simd`_float2

A vector of two 32-bit single-precision values.

`simd`_float3

A vector of three 32-bit single-precision values.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software