Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Bisection methods: a use-case example



Michel Hack wrote:
Nate Hayes wrote (about using a "pragmatic" midpoint2() that returns a
finite result for an unbounded interval):
I think everyone agrees Sally did something really pragmatic, but one
might ask the question: is Sally really following the standard or is
she just working around it?

Nate seems to have a different interpretation of what a standard does,
compared to my understanding.

In my opionion at least, a standard defines precisely how the things
it covers are supposed to behave, and what things must be provided.
It DOES NOT specify any particular programming style!  The standard
does not apply to a program, it applies to a programming environment.

I think we have the same understanding, Michel.

For example, the moral of the story is how in both cases the midpoint operation is provided, but in Case A the standard environment requires the behavior:
   midpoint([1,5]) = 3
   midpoint([1,+Inf]) = NaN
as opposed to Case B where the standard environment requires the behavior:
   midpoint([1,5]) = 3
   midpoint([1,+omega]) = REALMAX
and hence:

Michel Hack wrote:
The quality of the standard may decide how easy it is for Sally to
write a correct, efficient and clear program.

Nate