```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
>

```