squiggle.c/examples/16_100_lognormal_samples/example.c

19 lines
394 B
C
Raw Normal View History

2023-11-17 20:48:23 +00:00
#include "../../squiggle.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
2023-11-17 20:48:23 +00:00
// Estimate functions
int main()
{
2023-11-17 20:48:23 +00:00
// set randomness seed
uint64_t* seed = malloc(sizeof(uint64_t));
*seed = 1000; // xorshift can't start with 0
for (int i = 0; i < 100; i++) {
double sample = sample_lognormal(0, 10, seed);
printf("%f\n", sample);
}
free(seed);
2023-11-17 20:48:23 +00:00
}