For finite values v0, v1 and value r in [0, 1] range, will the value v, computed as below, always belong to [v0, v1] range, or can it be (slightly) outside due to round off errors?
double v0; // Finite
double v1; // Finite
double r; // In [0, 1]
double v = v0 * r + v1 * (1.0 - r);
if (v0 <= v1)
assert(v0 <= v && v <= v1);
else
assert(v1 <= v && v <= v0);