# Boost :

From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2001-04-24 12:54:29

Matthew Austern wrote:
>
> "Peter Schmitteckert (boost)" wrote:

> > You will need just one function call to check if x has a
> > zero in the interval -1..1:
> > if f( interval<double>(-1,1) ) contains no zero then it is proven that there
> > is no zero.
>
> But isn't that just a matter of redefining the problem away?
> When you write f(interval<double>(-1, 1)), what you really mean
> is "the ordered pair (a, b) such that a is less than or equal
> to f(x) for all x in [-1, 1] and b is greater than or equal to
> f(x) for all x in [-1, 1]".

The assumption is that f() is continuous and composed of arithmetic
operations, constants and "simple" functions such as sin, cos, tan
and functions for interval type arguments. Then, computing
f(interval<double>(-1,1)) is (in C++) as easy as computing
f((double)1.0), provided that you've only used "allowed" operations
and functions and you've defined f() as template<class T> T f(T x) .