52 double Dither::update()
56 has_saved_value_ =
false;
63 std::uniform_real_distribution<double> distribution(-1.0, std::nextafter(1.0, std::numeric_limits<double>::max()));
64 for (
int i = 0; i < 100; ++i)
66 v1 = distribution(generator_);
67 v2 = distribution(generator_);
75 double f = sqrt(-2.0 * log(r) / r);
76 double current = amplitude_ *
f * v1;
77 saved_value_ = amplitude_ *
f * v2;
78 has_saved_value_ =
true;