sleef-sys 0.1.2

Rust FFI bindings to the SLEEF Vectorized Math Library
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>

#define N 256
__attribute__ ((__aligned__(16))) double a[N];

int main(int argc, char **argv) {
  srand(time(NULL));
  for(int i = 0;i < N;i++) a[i] = rand();
  for(int i = 0;i < N;i++) a[i] = sin(a[i]);
  for(int i = 0;i < N;i++) printf("%g\n", a[i]);
}