A basis that sums to unity reduces error, due to convex hull property:

int n; double min, max;
for ( int i = 0; i <= n; ++ i ) {
   double u    = (double) i / (double) n;
   double _u_1 = 1.0 - u;
   double v    = min * u1 + max * u;
}

-- KAS

On 9/21/11 9:16 AM, Michal Suchanek wrote:
> On 21 September 2011 14:25, masa<masa16.tanaka / gmail.com>  wrote:
>> I haven't explained the reason of the error estimation in
>> Range#step for Float;
>>
>>      double n = (end - beg)/unit;
>>      double err = (fabs(beg) + fabs(end) + fabs(end-beg)) / fabs(unit) *
>> epsilon;
>>
>> The reason is as follows. (including unicode characters)
>> This is based on the theory of the error propagation;
>>    http://en.wikipedia.org/wiki/Propagation_of_uncertainty
>>
>> If f(x,y,z) is given as a function of x, y, z,
>> Δf (the error of f) can be estimated as:
>>
>>    Δf^2 = |∂f/∂x|^2*Δx^2 + |∂f/∂y|^2*Δy^2 + |∂f/∂z|^2*Δz^2
>>
>> This is a kind of `statistical' error.  Instead, `maximum' error
>> can be expressed as:
>>
>>    Δf = |∂f/∂x|*Δx + |∂f/∂y|*Δy + |∂f/∂z|*Δz
>>
>> I considered the latter is enough for this case.
>> Now, the target function here is:
>>
>>    n = f(e,b,u) = (e-b)/u
>>
>> The partial differentiations of f are:
>>
>>    ∂f/∂e = 1/u
>>    ∂f/∂b = -1/u
>>    ∂f/∂u = -(e-b)/u^2
>>
>> The errors of floating point values are estimated as:
>>
>>    Δe = |e|*ε
>>    Δb = |b|*ε
>>    Δu = |u|*ε
>>
>> Finally, the error is derived as:
>>
>>   Δn = |∂n/∂e|*Δe + |∂n/∂b|*Δb + |∂n/∂u|*Δu
>>     = |1/u|*|e|*ε + |1/u|*|b|*ε + |(e-b)/u^2|*|u|*ε
>>     = (|e| + |b| + |e-b|)/|u|*ε
>>
>
> Well, if you can calculate the maximum error and minimum error then
> you can get the range over which you need to check *every* value if it
> exceeds the end of the range. The estimated (~expected ~average) error
> is not useful in this case. Or you can iterate over the intersection
> of the original range and error range again with smaller error.
>
> Thanks
>
> Michal
>