Please enter what you're looking for to continue your search
 

vec_sqrt
ADD TO COMPARE ADDED TO COMPARE

 IBM-Z (64 bits)/ IBM-Z  View official documentation
Purpose:
Returns a vector containing the square root of each element in the given vector. Minimum Arch: Z11.

Prototypes

Usage:
vector float result = vec_sqrt( vector float a )
Example:
#include <stdio.h>
#include <vecintrin.h>
int main() {
 vector float a = {
  4.0f, 9.0f, 16.0f, 25.0f
 };
 vector float d = vec_sqrt(a);
 float *a_array = (float*)&a;
 float *d_array = (float*)&d;
 for (int i = 0; i < 4; i++) {
   printf("sqrt(%.1f) = %.1f\n",               a_array[i], d_array[i]);
  }

  return 0;
 }
Usage:
vector double result = vec_sqrt( vector double a )
Example:
#include <stdio.h>
#include <vecintrin.h>
int main() {
 vector double a = {
  4.0, 9.0
 };
 vector double d = vec_sqrt(a);
 double *a_array = (double*)&a;
 double *d_array = (double*)&d;
 for (int i = 0; i < 2; i++) {
   printf("sqrt(%.1f) = %.1f\n",               a_array[i], d_array[i]);
  }

  return 0;
 }
SIMD Intrinsics Summary
SIMD Engines: 6
C Intrinsics: 10444
NEON: 4353
AVX2: 405
AVX512: 4717
SSE4.2: 598
VSX: 192
IBM-Z: 179