Return a random variable between [-1, 1].
double crand(Random rand) => 1.0 - 2.0 * rand.nextDouble();