// gcc -Wall -O3 makedat.c -o makedat -lm
// ./makedat | ./lsqpoly 2
// time ./makedat | dm x2 1 x1 x1*x1 | regress

#include <stdlib.h>
#include <stdio.h>
#include "rng-kmb.c"

const double a=1,b=1e-2,c=3;

int main(int argc, char* argv[]) {
  int i, n=2000000;
  double x,y;
  if (argc>1) n=atoi(argv[1]);
  for (i=0; i<n; i++) {
    x=i/(double)n;
    y=a+b*x+c*x*x+10*normal01();
    printf("%g %g\n",x,y);
  }
  return 0;
}
