[Info-vax] Floating Point, Machine Epsilon, Rust, Swift, Etc (was: Re: VMS Software Q1 '23 Update)
Arne Vajhøj
arne at vajhoej.dk
Thu Feb 2 18:45:53 EST 2023
On 2/2/2023 5:44 PM, Dan Cross wrote:
> In article <tre863$ecn5$1 at dont-email.me>,
> Arne Vajhøj <arne at vajhoej.dk> wrote:
>> On 2/1/2023 11:52 AM, Stephen Hoffman wrote:
>>> Swift has a deliberately-obscurely-named equivalent to machine epsilon,
>>> as do some other languages.
>>
>> The reality is that a relevant epsilon for floating point comparison
>> depends on the context.
>>
>> When I am exposed to the problem then it is typical regarding
>> testing for convergence of iterative algorithms. Is Xt
>> the same as Xt-1.
>>
>> And the right epsilon depends on the scale of the data.
>
> I interpreted Stephen Hoffman's mention of epsilon as
> referring to the constant (e.g., in IEEE754 floating
> point). This is well defined for each representation.
> https://en.wikipedia.org/wiki/Machine_epsilon
That is possible. It sort of fit the context.
But that is very rarely a good epsilon/delta/whatever
value when testing for equality.
Arne
More information about the Info-vax
mailing list