feat: More progress

- Add C
- Time the different languages.
- Wrap Squiggle in a js runtime.
This commit is contained in:
NunoSempere 2022-12-01 15:04:37 +00:00
parent 6c997e4e2c
commit 57fc886bed
14 changed files with 706 additions and 5 deletions

3
C/hello-world/build.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
gcc -std=c99 -Wall -lm hello-world.c -o hello-world

BIN
C/hello-world/hello-world Executable file

Binary file not shown.

7
C/hello-world/hello-world.c Executable file
View File

@ -0,0 +1,7 @@
#include <stdlib.h>
#include <stdio.h>
int main(void){
printf("Hello world!\n");
return EXIT_SUCCESS;
}

15
C/samples/build-and-run.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
root="$1"
gcc -std=c99 -Wall -lm "$root".c -o "$root" -I/usr/local/include -L/usr/local/lib -lgsl -lgslcblas -lm -g
# Link libraries, for good measure
LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH
# Increase stack size limit
ulimit -Ss 256000
# -Ss: the soft limit. If you set the hard limit, you then can't raise it
# 256000: around 250Mbs, if I'm reading it correctly.
# run
./samples

13
C/samples/build-gsl.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
root="$1"
gcc -std=c99 -Wall -lm "$root".c -o "$root" -I/usr/local/include -L/usr/local/lib -lgsl -lgslcblas -lm -g
# Link libraries, for good measure
LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH
# Increase stack size limit
ulimit -Ss 256000
# -Ss: the soft limit. If you set the hard limit, you then can't raise it
# 256000: around 250Mbs, if I'm reading it correctly.

BIN
C/samples/samples Executable file

Binary file not shown.

141
C/samples/samples.c Executable file
View File

@ -0,0 +1,141 @@
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
#define N 10000000
/*
* For very high values of N, you will want to increase the maximum stack trace, otherwise you will suffer a segmentation fault
* In Ubuntu/bash you can do this with $ ulimit -Ss 256000 ## ~256Mbs
* And confirm it with $ ulimit -a
*/
/* Helpers */
void print(double *ys){
for(int i=0; i<N; i++){
printf("%f\n", ys[i]);
}
printf("\n");
}
void fill(double *ys, float f){
for(int i=0; i<N; i++){
ys[i] = f;
}
}
double sum(double *ps, int n){
double result = 0;
for(int i=0; i<n; i++){
result += ps[i];
}
return(result);
}
void cumsum(double *ps, double *rs, int n){
double counter = 0;
for(int i=0; i<n; i++){
counter += ps[i];
rs[i] = counter;
}
}
/* Distributions*/
void normal(gsl_rng * r, double *ys, double mean, double std){
for(int i=0; i<N; i++){
ys[i] = mean + gsl_ran_gaussian(r, std);
}
}
void lognormal(gsl_rng * r, double *ys, double zeta, double sigma){
for(int i=0; i<N; i++){
ys[i] = gsl_ran_lognormal(r, zeta, sigma);
}
}
void to(gsl_rng * r, double *ys, double low, double high){
double normal95confidencePoint = 1.6448536269514722;
double log_low = log(low);
double log_high = log(high);
double zeta = (log_low + log_high)/2;
double sigma = (log_high - log_low) / (2.0 * normal95confidencePoint);
lognormal(r, ys, zeta, sigma);
}
/* Mixture of distributions */
void mixture(gsl_rng * r, double *dists[], double *weights, int n, double *results){
/* Get cummulative, normalized weights */
double sum_weights = sum(weights, n);
double normalized_weights[n];
for(int i=0; i<n; i++){
normalized_weights[i] = weights[i]/sum_weights;
}
double cummulative_weights[n];
cumsum(normalized_weights, cummulative_weights, n);
/* Get N uniformly distributed vars */
for(int i=0; i<N; i++){
double p_1 = gsl_rng_uniform(r);
double p_2 = gsl_rng_uniform(r);
int index_found = 0;
int index_counter = 0;
while ((index_found == 0) && (index_counter < n) ){
if(p_1 < cummulative_weights[index_counter]){
index_found = 1;
}else{
index_counter++;
}
}
if(index_found == 0) {
printf("\nThis shouldn't have happened");
// gsl_rng_free (r);
// abort(); // this shouldn't have happened.
}else{
int sample_index = (int) floor(p_2 * N);
results[i] = dists[index_counter][sample_index];
}
}
}
/* Main */
int main(void){
/* Initialize GNU Statistical Library (GSL) stuff */
const gsl_rng_type * T;
gsl_rng * r;
// gsl_rng_env_setup();
T = gsl_rng_default;
r = gsl_rng_alloc (T);
/* Toy example */
/* Declare variables in play */
double p_a, p_b, p_c;
double dist_none[N], dist_one[N], dist_few[N], dist_many[N], dist_mixture[N];
/* Initialize variables */
p_a = 0.8;
p_b = 0.5;
p_c = p_a * p_b;
fill(dist_none, 0);
fill(dist_one, 1);
to(r, dist_few, 1, 3);
to(r, dist_many, 2, 10);
/* Generate mixture */
int n = 4;
double weights[] = { 1 - p_c, p_c/2, p_c/4, p_c/4};
double *dists[] = { dist_none, dist_one, dist_few, dist_many };
mixture(r, dists, weights, n, dist_mixture);
printf("%f\n", sum(dist_mixture, N)/N);
/* Clean up GSL */
gsl_rng_free (r);
/* Return success*/
return EXIT_SUCCESS;
}

View File

@ -1,5 +1,5 @@
# Three simple functions # Three simple functions
DEFAULT_N = 10000 DEFAULT_N = 1000000
normal <- function (mean, std, n=DEFAULT_N){ normal <- function (mean, std, n=DEFAULT_N){
return(rnorm(n, mean, std)) return(rnorm(n, mean, std))
} }
@ -24,7 +24,8 @@ mixture <- function(samples_list, weights_array, n=DEFAULT_N){ # note that this
results = vector(mode='numeric', length=n) results = vector(mode='numeric', length=n)
for(i in c(1:n)){ for(i in c(1:n)){
helper_which_list = which(cummulative_sums > helper_probs[i]) helper_which_list = which(cummulative_sums > helper_probs[i])
helper_loc = ifelse(is.na(helper_which_list[1]), 1, helper_which_list[1]) # helper_loc = ifelse(is.na(helper_which_list[1]), 1, helper_which_list[1])
helper_loc = helper_which_list[1]
target_samples = samples_list[[helper_loc]] target_samples = samples_list[[helper_loc]]
result = sample(target_samples, 1) result = sample(target_samples, 1)
results[i] = result results[i] = result

View File

@ -4,7 +4,7 @@ import stdlib_normal from '@stdlib/random/base/normal/lib/main.js';
import stdlib_lognormal from '@stdlib/random/base/lognormal/lib/main.js'; import stdlib_lognormal from '@stdlib/random/base/lognormal/lib/main.js';
// Functions // Functions
const DEFAULT_N = 10**5 const DEFAULT_N = 10**6
function generator(f) { function generator(f) {
let g = (a, b, n = DEFAULT_N) => { let g = (a, b, n = DEFAULT_N) => {
let result = new Array(n) let result = new Array(n)
@ -38,7 +38,7 @@ const mixture = (dists_array, weights_array, n = DEFAULT_N) => {
const helper_probs = [...new Array(n)].map(_ => Math.random()) const helper_probs = [...new Array(n)].map(_ => Math.random())
const results = helper_probs.map(p => { const results = helper_probs.map(p => {
let match_index = cummulative_sums.findIndex(x => x > p) let match_index = cummulative_sums.findIndex(x => x > p)
let target_loc = match_index == -1 ? 0 : match_index let target_loc = match_index // == -1 ? 0 : match_index
let target_samples = dists_array[target_loc] let target_samples = dists_array[target_loc]
return target_samples[Math.floor(Math.random() * target_samples.length)]; return target_samples[Math.floor(Math.random() * target_samples.length)];
}) })

View File

@ -1,7 +1,7 @@
# imports # imports
import numpy as np import numpy as np
rng = np.random.default_rng(123) rng = np.random.default_rng(123)
DEFAULT_N = 100000 DEFAULT_N = 1000000
# three simple functions # three simple functions

6
squiggle/package.json Normal file
View File

@ -0,0 +1,6 @@
{
"dependencies": {
"@quri/squiggle-lang": "^0.5.1"
},
"type": "module"
}

13
squiggle/samples.js Normal file
View File

@ -0,0 +1,13 @@
import { run } from "@quri/squiggle-lang";
let squiggle_code = `
p_a = 0.8
p_b = 0.5
p_c = p_a * p_b
result = mx([0, 1, 1 to 3, 2 to 10], [(1 - p_c), p_c/2, p_c/4, p_c/4 ])
mean(result)
`
let output = run(squiggle_code)
console.log(output.result.value)

463
squiggle/yarn.lock Normal file
View File

@ -0,0 +1,463 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@commander-js/extra-typings@^9.4.1":
version "9.4.1"
resolved "https://registry.yarnpkg.com/@commander-js/extra-typings/-/extra-typings-9.4.1.tgz#acb75021594519799f509bde8f9210b114f1a0f1"
integrity sha512-v0BqORYamk1koxDon6femDGLWSL7P78vYTyOU5nFaALnmNALL+ktgdHvWbxzzBBJIKS7kv3XvM/DqNwiLcgFTA==
"@quri/squiggle-lang@^0.5.1":
version "0.5.1"
resolved "https://registry.yarnpkg.com/@quri/squiggle-lang/-/squiggle-lang-0.5.1.tgz#e9708079a301833bc96c986c704a0ecd47b17358"
integrity sha512-MG0vUe1DHjsvUj827bRFYHoA4yTxI8gSPB++RibmFHETNrdeGcNUPhpNPtSl9DJFSqJFSj/knyMN76iVtLpp7Q==
dependencies:
"@commander-js/extra-typings" "^9.4.1"
"@rescript/std" "^10.0.0"
"@stdlib/stats" "^0.0.13"
commander "^9.4.1"
jstat "^1.9.5"
lodash "^4.17.21"
open "^8.4.0"
"@rescript/std@^10.0.0":
version "10.0.1"
resolved "https://registry.yarnpkg.com/@rescript/std/-/std-10.0.1.tgz#2ffa229f3345fea3341fed4bbc9b15949cf182ba"
integrity sha512-cchIxAI/zVU2sITZgVWz/QOKSRDGEhGyzMTWfsZdgNf6QD9+S/CUVfS1lBqPaX9GaGy1FCWHAqGYwIIaVqAS4Q==
"@stdlib/array@^0.0.x":
version "0.0.12"
resolved "https://registry.yarnpkg.com/@stdlib/array/-/array-0.0.12.tgz#12f40ab95bb36d424cdad991f29fc3cb491ee29e"
integrity sha512-nDksiuvRC1dSTHrf5yOGQmlRwAzSKV8MdFQwFSvLbZGGhi5Y4hExqea5HloLgNVouVs8lnAFi2oubSM4Mc7YAg==
dependencies:
"@stdlib/assert" "^0.0.x"
"@stdlib/blas" "^0.0.x"
"@stdlib/complex" "^0.0.x"
"@stdlib/constants" "^0.0.x"
"@stdlib/math" "^0.0.x"
"@stdlib/symbol" "^0.0.x"
"@stdlib/types" "^0.0.x"
"@stdlib/utils" "^0.0.x"
"@stdlib/assert@^0.0.x":
version "0.0.12"
resolved "https://registry.yarnpkg.com/@stdlib/assert/-/assert-0.0.12.tgz#1648c9016e5041291f55a6464abcc4069c5103ce"
integrity sha512-38FxFf+ZoQZbdc+m09UsWtaCmzd/2e7im0JOaaFYE7icmRfm+4KiE9BRvBT4tIn7ioLB2f9PsBicKjIsf+tY1w==
dependencies:
"@stdlib/array" "^0.0.x"
"@stdlib/cli" "^0.0.x"
"@stdlib/complex" "^0.0.x"
"@stdlib/constants" "^0.0.x"
"@stdlib/fs" "^0.0.x"
"@stdlib/math" "^0.0.x"
"@stdlib/ndarray" "^0.0.x"
"@stdlib/number" "^0.0.x"
"@stdlib/os" "^0.0.x"
"@stdlib/process" "^0.0.x"
"@stdlib/regexp" "^0.0.x"
"@stdlib/streams" "^0.0.x"
"@stdlib/string" "^0.0.x"
"@stdlib/symbol" "^0.0.x"
"@stdlib/types" "^0.0.x"
"@stdlib/utils" "^0.0.x"
"@stdlib/bigint@^0.0.x":
version "0.0.11"
resolved "https://registry.yarnpkg.com/@stdlib/bigint/-/bigint-0.0.11.tgz#c416a1d727001c55f4897e6424124199d638f2fd"
integrity sha512-uz0aYDLABAYyqxaCSHYbUt0yPkXYUCR7TrVvHN+UUD3i8FZ02ZKcLO+faKisDyxKEoSFTNtn3Ro8Ir5ebOlVXQ==
dependencies:
"@stdlib/utils" "^0.0.x"
"@stdlib/blas@^0.0.x":
version "0.0.12"
resolved "https://registry.yarnpkg.com/@stdlib/blas/-/blas-0.0.12.tgz#7e93e42b4621fc6903bf63264f045047333536c2"
integrity sha512-nWY749bWceuoWQ7gz977blCwR7lyQ/rsIXVO4b600h+NFpeA2i/ea7MYC680utIbeu2cnDWHdglBPoK535VAzA==
dependencies:
"@stdlib/array" "^0.0.x"
"@stdlib/assert" "^0.0.x"
"@stdlib/math" "^0.0.x"
"@stdlib/number" "^0.0.x"
"@stdlib/types" "^0.0.x"
"@stdlib/utils" "^0.0.x"
"@stdlib/buffer@^0.0.x":
version "0.0.11"
resolved "https://registry.yarnpkg.com/@stdlib/buffer/-/buffer-0.0.11.tgz#6137b00845e6c905181cc7ebfae9f7e47c01b0ce"
integrity sha512-Jeie5eDDa1tVuRcuU+cBXI/oOXSmMxUUccZpqXzgYe0IO8QSNtNxv9mUTzJk/m5wH+lmLoDvNxzPpOH9TODjJg==
dependencies:
"@stdlib/array" "^0.0.x"
"@stdlib/assert" "^0.0.x"
"@stdlib/process" "^0.0.x"
"@stdlib/types" "^0.0.x"
"@stdlib/utils" "^0.0.x"
"@stdlib/cli@^0.0.x":
version "0.0.10"
resolved "https://registry.yarnpkg.com/@stdlib/cli/-/cli-0.0.10.tgz#28e2fbe6865d7f5cd15b7dc5846c99bd3b91674f"
integrity sha512-OITGaxG46kwK799+NuOd/+ccosJ9koVuQBC610DDJv0ZJf8mD7sbjGXrmue9C4EOh8MP7Vm/6HN14BojX8oTCg==
dependencies:
"@stdlib/utils" "^0.0.x"
minimist "^1.2.0"
"@stdlib/complex@^0.0.x":
version "0.0.12"
resolved "https://registry.yarnpkg.com/@stdlib/complex/-/complex-0.0.12.tgz#3afbc190cd0a9b37fc7c6e508c3aa9fda9106944"
integrity sha512-UbZBdaUxT2G+lsTIrVlRZwx2IRY6GXnVILggeejsIVxHSuK+oTyapfetcAv0FJFLP+Rrr+ZzrN4b9G3hBw6NHA==
dependencies:
"@stdlib/array" "^0.0.x"
"@stdlib/assert" "^0.0.x"
"@stdlib/types" "^0.0.x"
"@stdlib/utils" "^0.0.x"
"@stdlib/constants@^0.0.x":
version "0.0.11"
resolved "https://registry.yarnpkg.com/@stdlib/constants/-/constants-0.0.11.tgz#78cd56d6c2982b30264843c3d75bde7125e90cd2"
integrity sha512-cWKy0L9hXHUQTvFzdPkTvZnn/5Pjv7H4UwY0WC1rLt+A5CxFDJKjvnIi9ypSzJS3CAiGl1ZaHCdadoqXhNdkUg==
dependencies:
"@stdlib/array" "^0.0.x"
"@stdlib/assert" "^0.0.x"
"@stdlib/number" "^0.0.x"
"@stdlib/utils" "^0.0.x"
"@stdlib/fs@^0.0.x":
version "0.0.12"
resolved "https://registry.yarnpkg.com/@stdlib/fs/-/fs-0.0.12.tgz#662365fd5846a51f075724b4f2888ae88441b70d"
integrity sha512-zcDLbt39EEM3M3wJW6luChS53B8T+TMJkjs2526UpKJ71O0/0adR57cI7PfCpkMd33d05uM7GM+leEj4eks4Cw==
dependencies:
"@stdlib/array" "^0.0.x"
"@stdlib/assert" "^0.0.x"
"@stdlib/cli" "^0.0.x"
"@stdlib/math" "^0.0.x"
"@stdlib/process" "^0.0.x"
"@stdlib/string" "^0.0.x"
"@stdlib/utils" "^0.0.x"
debug "^2.6.9"
"@stdlib/math@^0.0.x":
version "0.0.11"
resolved "https://registry.yarnpkg.com/@stdlib/math/-/math-0.0.11.tgz#eb6638bc03a20fbd6727dd5b977ee0170bda4649"
integrity sha512-qI78sR1QqGjHj8k/aAqkZ51Su2fyBvaR/jMKQqcB/ML8bpYpf+QGlGvTty5Qdru/wpqds4kVFOVbWGcNFIV2+Q==
dependencies:
"@stdlib/assert" "^0.0.x"
"@stdlib/constants" "^0.0.x"
"@stdlib/ndarray" "^0.0.x"
"@stdlib/number" "^0.0.x"
"@stdlib/strided" "^0.0.x"
"@stdlib/symbol" "^0.0.x"
"@stdlib/types" "^0.0.x"
"@stdlib/utils" "^0.0.x"
debug "^2.6.9"
"@stdlib/ndarray@^0.0.x":
version "0.0.13"
resolved "https://registry.yarnpkg.com/@stdlib/ndarray/-/ndarray-0.0.13.tgz#2e8fc645e10f56a645a0ab81598808c0e8f43b82"
integrity sha512-Z+U9KJP4U2HWrLtuAXSPvhNetAdqaNLMcliR6S/fz+VPlFDeymRK7omRFMgVQ+1zcAvIgKZGJxpLC3vjiPUYEw==
dependencies:
"@stdlib/array" "^0.0.x"
"@stdlib/assert" "^0.0.x"
"@stdlib/bigint" "^0.0.x"
"@stdlib/buffer" "^0.0.x"
"@stdlib/complex" "^0.0.x"
"@stdlib/constants" "^0.0.x"
"@stdlib/math" "^0.0.x"
"@stdlib/number" "^0.0.x"
"@stdlib/string" "^0.0.x"
"@stdlib/types" "^0.0.x"
"@stdlib/utils" "^0.0.x"
"@stdlib/nlp@^0.0.x":
version "0.0.11"
resolved "https://registry.yarnpkg.com/@stdlib/nlp/-/nlp-0.0.11.tgz#532ec0f7267b8d639e4c20c6de864e8de8a09054"
integrity sha512-D9avYWANm0Db2W7RpzdSdi5GxRYALGAqUrNnRnnKIO6sMEfr/DvONoAbWruda4QyvSC+0MJNwcEn7+PHhRwYhw==
dependencies:
"@stdlib/array" "^0.0.x"
"@stdlib/assert" "^0.0.x"
"@stdlib/math" "^0.0.x"
"@stdlib/random" "^0.0.x"
"@stdlib/string" "^0.0.x"
"@stdlib/utils" "^0.0.x"
"@stdlib/number@^0.0.x":
version "0.0.10"
resolved "https://registry.yarnpkg.com/@stdlib/number/-/number-0.0.10.tgz#4030ad8fc3fac19a9afb415c443cee6deea0e65c"
integrity sha512-RyfoP9MlnX4kccvg8qv7vYQPbLdzfS1Mnp/prGOoWhvMG3pyBwFAan34kwFb5IS/zHC3W5EmrgXCV2QWyLg/Kg==
dependencies:
"@stdlib/array" "^0.0.x"
"@stdlib/assert" "^0.0.x"
"@stdlib/constants" "^0.0.x"
"@stdlib/math" "^0.0.x"
"@stdlib/os" "^0.0.x"
"@stdlib/string" "^0.0.x"
"@stdlib/types" "^0.0.x"
"@stdlib/utils" "^0.0.x"
"@stdlib/os@^0.0.x":
version "0.0.12"
resolved "https://registry.yarnpkg.com/@stdlib/os/-/os-0.0.12.tgz#08bbf013c62a7153099fa9cbac086ca1349a4677"
integrity sha512-O7lklZ/9XEzoCmYvzjPh7jrFWkbpOSHGI71ve3dkSvBy5tyiSL3TtivfKsIC+9ZxuEJZ3d3lIjc9e+yz4HVbqQ==
dependencies:
"@stdlib/assert" "^0.0.x"
"@stdlib/cli" "^0.0.x"
"@stdlib/fs" "^0.0.x"
"@stdlib/process" "^0.0.x"
"@stdlib/utils" "^0.0.x"
"@stdlib/process@^0.0.x":
version "0.0.12"
resolved "https://registry.yarnpkg.com/@stdlib/process/-/process-0.0.12.tgz#123325079d89a32f4212f72fb694f8fe3614cf18"
integrity sha512-P0X0TMvkissBE1Wr877Avi2/AxmP7X5Toa6GatHbpJdDg6jQmN4SgPd+NZNp98YtZUyk478c8XSIzMr1krQ20g==
dependencies:
"@stdlib/assert" "^0.0.x"
"@stdlib/buffer" "^0.0.x"
"@stdlib/cli" "^0.0.x"
"@stdlib/fs" "^0.0.x"
"@stdlib/streams" "^0.0.x"
"@stdlib/string" "^0.0.x"
"@stdlib/utils" "^0.0.x"
"@stdlib/random@^0.0.x":
version "0.0.12"
resolved "https://registry.yarnpkg.com/@stdlib/random/-/random-0.0.12.tgz#e819c3abd602ed5559ba800dba751e49c633ff85"
integrity sha512-c5yND4Ahnm9Jx0I+jsKhn4Yrz10D53ALSrIe3PG1qIz3kNFcIPnmvCuNGd+3V4ch4Mbrez55Y8z/ZC5RJh4vJQ==
dependencies:
"@stdlib/array" "^0.0.x"
"@stdlib/assert" "^0.0.x"
"@stdlib/blas" "^0.0.x"
"@stdlib/buffer" "^0.0.x"
"@stdlib/cli" "^0.0.x"
"@stdlib/constants" "^0.0.x"
"@stdlib/fs" "^0.0.x"
"@stdlib/math" "^0.0.x"
"@stdlib/process" "^0.0.x"
"@stdlib/stats" "^0.0.x"
"@stdlib/streams" "^0.0.x"
"@stdlib/symbol" "^0.0.x"
"@stdlib/types" "^0.0.x"
"@stdlib/utils" "^0.0.x"
debug "^2.6.9"
readable-stream "^2.1.4"
"@stdlib/regexp@^0.0.x":
version "0.0.13"
resolved "https://registry.yarnpkg.com/@stdlib/regexp/-/regexp-0.0.13.tgz#80b98361dc7a441b47bc3fa964bb0c826759e971"
integrity sha512-3JT5ZIoq/1nXY+dY+QtkU8/m7oWDeekyItEEXMx9c/AOf0ph8fmvTUGMDNfUq0RetcznFe3b66kFz6Zt4XHviA==
dependencies:
"@stdlib/assert" "^0.0.x"
"@stdlib/utils" "^0.0.x"
"@stdlib/stats@^0.0.13", "@stdlib/stats@^0.0.x":
version "0.0.13"
resolved "https://registry.yarnpkg.com/@stdlib/stats/-/stats-0.0.13.tgz#87c973f385379d794707c7b5196a173dba8b07e1"
integrity sha512-hm+t32dKbx/L7+7WlQ1o4NDEzV0J4QSnwFBCsIMIAO8+VPxTZ4FxyNERl4oKlS3hZZe4AVKjoOVhBDtgEWrS4g==
dependencies:
"@stdlib/array" "^0.0.x"
"@stdlib/assert" "^0.0.x"
"@stdlib/blas" "^0.0.x"
"@stdlib/constants" "^0.0.x"
"@stdlib/math" "^0.0.x"
"@stdlib/ndarray" "^0.0.x"
"@stdlib/random" "^0.0.x"
"@stdlib/string" "^0.0.x"
"@stdlib/symbol" "^0.0.x"
"@stdlib/types" "^0.0.x"
"@stdlib/utils" "^0.0.x"
"@stdlib/streams@^0.0.x":
version "0.0.12"
resolved "https://registry.yarnpkg.com/@stdlib/streams/-/streams-0.0.12.tgz#07f5ceae5852590afad8e1cb7ce94174becc8739"
integrity sha512-YLUlXwjJNknHp92IkJUdvn5jEQjDckpawKhDLLCoxyh3h5V+w/8+61SH7TMTfKx5lBxKJ8vvtchZh90mIJOAjQ==
dependencies:
"@stdlib/assert" "^0.0.x"
"@stdlib/buffer" "^0.0.x"
"@stdlib/cli" "^0.0.x"
"@stdlib/fs" "^0.0.x"
"@stdlib/types" "^0.0.x"
"@stdlib/utils" "^0.0.x"
debug "^2.6.9"
readable-stream "^2.1.4"
"@stdlib/strided@^0.0.x":
version "0.0.12"
resolved "https://registry.yarnpkg.com/@stdlib/strided/-/strided-0.0.12.tgz#86ac48e660cb7f64a45cf07e80cbbfe58be21ae1"
integrity sha512-1NINP+Y7IJht34iri/bYLY7TVxrip51f6Z3qWxGHUCH33kvk5H5QqV+RsmFEGbbyoGtdeHrT2O+xA+7R2e3SNg==
dependencies:
"@stdlib/assert" "^0.0.x"
"@stdlib/math" "^0.0.x"
"@stdlib/ndarray" "^0.0.x"
"@stdlib/types" "^0.0.x"
"@stdlib/utils" "^0.0.x"
"@stdlib/string@^0.0.x":
version "0.0.14"
resolved "https://registry.yarnpkg.com/@stdlib/string/-/string-0.0.14.tgz#4feea4f9089ab72428eebb65fe7b93d90a7f34f4"
integrity sha512-1ClvUTPysens7GZz3WsrkFYIFs8qDmnXkyAd3zMvTXgRpy7hqrv6nNzLMQj8BHv5cBWaWPOXYd/cZ+JyMnZNQQ==
dependencies:
"@stdlib/assert" "^0.0.x"
"@stdlib/cli" "^0.0.x"
"@stdlib/constants" "^0.0.x"
"@stdlib/fs" "^0.0.x"
"@stdlib/math" "^0.0.x"
"@stdlib/nlp" "^0.0.x"
"@stdlib/process" "^0.0.x"
"@stdlib/regexp" "^0.0.x"
"@stdlib/streams" "^0.0.x"
"@stdlib/types" "^0.0.x"
"@stdlib/utils" "^0.0.x"
"@stdlib/symbol@^0.0.x":
version "0.0.12"
resolved "https://registry.yarnpkg.com/@stdlib/symbol/-/symbol-0.0.12.tgz#b9f396b0bf269c2985bb7fe99810a8e26d7288c3"
integrity sha512-2IDhpzWVGeLHgsvIsX12RXvf78r7xBkc4QLoRUv3k7Cp61BisR1Ym1p0Tq9PbxT8fknlvLToh9n5RpmESi2d4w==
dependencies:
"@stdlib/assert" "^0.0.x"
"@stdlib/utils" "^0.0.x"
"@stdlib/time@^0.0.x":
version "0.0.14"
resolved "https://registry.yarnpkg.com/@stdlib/time/-/time-0.0.14.tgz#ea6daa438b1d3b019b99f5091117ee4bcef55d60"
integrity sha512-1gMFCQTabMVIgww+k4g8HHHIhyy1tIlvwT8mC0BHW7Q7TzDAgobwL0bvor+lwvCb5LlDAvNQEpaRgVT99QWGeQ==
dependencies:
"@stdlib/assert" "^0.0.x"
"@stdlib/cli" "^0.0.x"
"@stdlib/constants" "^0.0.x"
"@stdlib/fs" "^0.0.x"
"@stdlib/math" "^0.0.x"
"@stdlib/string" "^0.0.x"
"@stdlib/utils" "^0.0.x"
"@stdlib/types@^0.0.x":
version "0.0.14"
resolved "https://registry.yarnpkg.com/@stdlib/types/-/types-0.0.14.tgz#02d3aab7a9bfaeb86e34ab749772ea22f7b2f7e0"
integrity sha512-AP3EI9/il/xkwUazcoY+SbjtxHRrheXgSbWZdEGD+rWpEgj6n2i63hp6hTOpAB5NipE0tJwinQlDGOuQ1lCaCw==
"@stdlib/utils@^0.0.x":
version "0.0.12"
resolved "https://registry.yarnpkg.com/@stdlib/utils/-/utils-0.0.12.tgz#670de5a7b253f04f11a4cba38f790e82393bcb46"
integrity sha512-+JhFpl6l7RSq/xGnbWRQ5dAL90h9ONj8MViqlb7teBZFtePZLMwoRA1wssypFcJ8SFMRWQn7lPmpYVUkGwRSOg==
dependencies:
"@stdlib/array" "^0.0.x"
"@stdlib/assert" "^0.0.x"
"@stdlib/blas" "^0.0.x"
"@stdlib/buffer" "^0.0.x"
"@stdlib/cli" "^0.0.x"
"@stdlib/constants" "^0.0.x"
"@stdlib/fs" "^0.0.x"
"@stdlib/math" "^0.0.x"
"@stdlib/os" "^0.0.x"
"@stdlib/process" "^0.0.x"
"@stdlib/random" "^0.0.x"
"@stdlib/regexp" "^0.0.x"
"@stdlib/streams" "^0.0.x"
"@stdlib/string" "^0.0.x"
"@stdlib/symbol" "^0.0.x"
"@stdlib/time" "^0.0.x"
"@stdlib/types" "^0.0.x"
debug "^2.6.9"
commander@^9.4.1:
version "9.4.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-9.4.1.tgz#d1dd8f2ce6faf93147295c0df13c7c21141cfbdd"
integrity sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==
core-util-is@~1.0.0:
version "1.0.3"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85"
integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==
debug@^2.6.9:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
dependencies:
ms "2.0.0"
define-lazy-prop@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f"
integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==
inherits@~2.0.3:
version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
is-docker@^2.0.0, is-docker@^2.1.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa"
integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==
is-wsl@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271"
integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==
dependencies:
is-docker "^2.0.0"
isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==
jstat@^1.9.5:
version "1.9.6"
resolved "https://registry.yarnpkg.com/jstat/-/jstat-1.9.6.tgz#60e801b0d4c26e37aab0f375d1859fe9d60e10c0"
integrity sha512-rPBkJbK2TnA8pzs93QcDDPlKcrtZWuuCo2dVR0TFLOJSxhqfWOVCSp8aV3/oSbn+4uY4yw1URtLpHQedtmXfug==
lodash@^4.17.21:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
minimist@^1.2.0:
version "1.2.7"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18"
integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==
ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==
open@^8.4.0:
version "8.4.0"
resolved "https://registry.yarnpkg.com/open/-/open-8.4.0.tgz#345321ae18f8138f82565a910fdc6b39e8c244f8"
integrity sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==
dependencies:
define-lazy-prop "^2.0.0"
is-docker "^2.1.1"
is-wsl "^2.2.0"
process-nextick-args@~2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
readable-stream@^2.1.4:
version "2.3.7"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==
dependencies:
core-util-is "~1.0.0"
inherits "~2.0.3"
isarray "~1.0.0"
process-nextick-args "~2.0.0"
safe-buffer "~5.1.1"
string_decoder "~1.1.1"
util-deprecate "~1.0.1"
safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
string_decoder@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
dependencies:
safe-buffer "~5.1.0"
util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==

39
time.txt Normal file
View File

@ -0,0 +1,39 @@
# C
0.888458
real 0m0,442s
user 0m0,378s
sys 0m0,064s
# Squiggle
real 0m0,488s
user 0m0,567s
sys 0m0,099s
# NodeJS
0.8849940532403973
real 0m0,732s
user 0m0,769s
sys 0m0,131s
## Python
0.8887373869178242
real 0m16,641s
user 0m16,693s
sys 0m0,517s
## R
[1] 0.885141
real 0m7,000s
user 0m6,944s
sys 0m0,052s