Boost logo

Boost :

From: boost (boost_at_[hidden])
Date: 2001-05-28 04:47:06


On Saturday 26 May 2001 23:44, you wrote:

> > double:
> > 1.0000000000000000818e-05 9.9999999998333335331e-06
> > 0.99999999998333333195 0.99999999998333333195 0.99999999998333333195
> [SNIP]
> Thanks, but could you in addition give me the output of
> ::std::cout << ::std::numeric_limits<float>::epsilon() << ::std::endl;
> ::std::cout << ::std::numeric_limits<double>::epsilon() << ::std::endl;
> ::std::cout << ::std::numeric_limits<long double>::epsilon() <<
> ::std::endl;
> for your platform?
Well,can't find numerics<..> for ma poor man gcc, but from float,h I have the
#define FLT_EPSILON 1.19209290e-07F
#define DBL_EPSILON 2.2204460492503131e-16
#define LDBL_EPSILON (__extension__ ((union __convert_long_double)
{__convert_long_double_i: {0x0, 0x80000000, 0x3fc0,

   cout << FLT_EPSILON << " " << DBL_EPSILON << " " <<LDBL_EPSILON << endl;

1.1920928955078125e-07 2.2204460492503130808e-16 1.084202172485504434e-19

> If these are comparable to the discrepancy you indicated,
> then i guess I'll let things stand as they are. Otherwise, I'll aim for
> a more ambitious (annd somewhet slower) aproach: instead of just two
> zones (smaller than epsilon, or not), I'll add an intermediate (say
> between epsilon and sqrt(epsilon)), with perhaps small continuity
> matching zones.
In a region between zero and epsilon my solution will give you the same
answer as your solution: 1.

for x=sqrt( sqrt(epsilon) ), the x*x will be of the order of epsilon,
due to the small prefactor of the next term, you could extend my idea
even to pow( eps, 1/6 ), when x^6 = epsilon.

> > > 2) this is, as noted in the docs, a "stop-gap" library, we will have
> > > to fine-tune it for various hardware/software combinations... so this
> > > situation will probably require some extensive list of ifdefs.
six(x) is well behaved at x=0, and so is sinc(x). The only problem is that
sometime trigonometric functio are poorly designed..
Note that since you elready need the if .. else clause my solution
will have better performance or small argument, i.e.|x| < pow(x, 1/6),
since most processor need much more time to evaluate sin(x) than
1- (1/6) * x *x.
I guess the problem with long douible is an internal rounding issue.
But with arctan functions one has to be more careful.

Has a link to a nice article by John Baez (I like his book on knots)

> FWIW, when I use that function for my math, I spell it Argth
> (argument tangente hyperbolique)... And let's not enter the highly
> controvertial log/Log/ln/Ln... In the end, it boils down to a matter of
Someone once said that theoretical physicist (yes, at least I was one)
will rather use the underwear of their follow worker that using their naming
for functions/constant/variables.

> taste. I would rather keep the name sinc_pi (I changed it to that from
> just sinc for the reasons I gave), and later introduce the one
> parameter family under the name sinc, but frankly I'll go along with
> whatever proves most popular.
I was only confused, that's all. SInce you introduced the sinc_a family,
I was always searching for one a != pi.

> For that matter, what would interval< complex< float> > mean?
A rectangle enclosing your soulution, like interval<double> is
an 1D section that enclose your solution.

Best wishes,

Boost list run by bdawes at, gregod at, cpdaniel at, john at