directed rounding in MATLAB?
Cleve, Penny,
nearly four years ago, I had asked you to provide faster Matlab
access to rounding mode switches in IEEE floating-point arithmetic.
Today I'd like to repeat my request to provide in Matlab the support
for two fast routines
roundup and rounddn
which set the rounding mode to round-to-infinity and round-to-m,
and two fast routines
pred, succ
for the next floating-point number below and above the input
(except for +-inf and NaN, which are returned themselves).
The background of my renewed request is that there is now a
IEEE Interval Standard Working Group
http://grouper.ieee.org/groups/1788/
that prepares an IEEE standard for interval arithmetic.
This reflects the increased interest in interval methods for
applications, particularly in global optimization, robotics,
chemical engineering, and computer vision (ray tracing).
Interval arithmetic is now part of all global optimization solvers
which are based upon the branch and bound principle, and of all
solvers for constraint satisfaction solvers with continuous constraints.
In particular, it is part of the software package BARON for
global optimization, for which the creators, Nick Sahinidis and
Mohit Tawarmalani, obtained the prestigious
2006 Beale-Orchard-Hays Prize of the Mathematical Programming Society.
http://www.mathprog.org/prz/citations/boh_2006.htm
BARON is the best global optimization package around that solves
constrained global optimization problems. It can be tried online
via the NEOS server at
http://www-neos.mcs.anl.gov/neos/solvers/go:BARON/GAMS.html
In the patent
Nathan T. Hayes
System and Method to Compute Narrow Bounds on a Modal Interval
Polynomial Function
http://www.faqs.org/patents/app/20080256155
Nate Hayes
http://www.zoominfo.com/people/Hayes_Nathan_231527274.aspx
recently introduced a linear interpolation operation in terms of modal
intervals that allows one to compute realistic interval enclosures for
Bezier curves and NURBS (nonuniform rational B-splines), two basic
data structures in computational geometry. The quality of the
enclosures is impressive.
Nate Hayes is the president of the company Sunfish Studio
http://www.sunfishstudio.com/software.htm
which specializes on ray tracing software for high resolution computer
graphics. He holds several other patents: A patent on interval ray
tracing technology,
System and method visible surface determination in computer
graphics using interval analysis
http://www.wipo.int/pctdb/en/wo.jsp?wo=2006115716
and three patents on modal intervals
http://www.faqs.org/patents/inv/126712
with the titles
- Reliable and Efficient Computation of Modal Interval Arithmetic
Operations
- Representation of Modal Intervals within a Computer
- System and Method to Compute Narrow Bounds on a Modal Interval
Polynomial Function (quoted above),
and one apparently still pending patent
Modal interval processor
http://www.wipo.int/pctdb/en/wo.jsp?wo=2006107996
It would be a pity if the slow rounding mode switches which Matlab
at present offers (over hundred times slower than comparable C code)
remain a bottleneck for users of global optimization techniques and
computer vision tools, to an extent that Matlab cannot be considered
as a platform for these appications.
Best wishes,
Arnold
=======================================================
Penny Anderson wrote on 2005-01-05 16:23
> Arnold,
>
> I will add these four functions to our enhancement request database for
> consideration in a later release.
>
> For now, you have:
>
> System_dependent('setround',Inf)
> System_dependent('setround',-Inf)
>
> And you could probably implement pred and succ yourself via the new R14
> behavior of eps:
>
> D = EPS(X), is the positive distance from ABS(X) to the next larger
> in
> magnitude floating point number of the same precision as X.
>
> Penny.
>
> -----Original Message-----
> From: Arnold Neumaier [mailto:Arnold.Neumaier@xxxxxxxxxxxx]
> Sent: Wednesday, January 05, 2005 9:10 AM
> To: Penny Anderson
> Cc: Cleve Moler; Bobby Cheng
> Subject: Re: directed rounding in MATLAB?
>
>
> Penny,
> >
> > I quickly hacked together a built-in "roundup" function (takes no
> input
> > arguments) to replace system_dependent('setround',Inf). Because of
> the
> > lack of string processing and error checking needed, my new roundup
> > function is 6 times faster than the existing
> > system_dependent('setround',Inf) alternative but still hundreds of
> times
> > slower than the scalar multiplies that you compared it against in
> your
> > MATLAB program below.
>
> Thanks. An improvement by a factor of six is already quite useful,
> though still limiting. Please let me know when a matlab release with
> the new roundup (and hopefully also rounddn, pred, succ) is available.
>
>
> > Once again, while hundreds of thousands of people use MATLAB's scalar
> > multiply and with the advent of the JIT in R13 are happy to have it
> sped
> > up, almost no one asks for the control over the FPU that you already
>
> I can understand your priorities. But there are probably a few
> thousand people using Intlab with the current setround who don't
> ask simply because they live with the current limitations.
> And those concerned about speedy rounding control just turn away
> from Matlab to C or Fortran since these allow fast rounding control.
>
>
> > were, we cannot in good faith supply a function that simply doesn't
> work
> > with all of MATLAB's underlying optimizations (like p-coded
> constants).
>
> setround doesn't (and shouldn't) promise rounding error control
> but to set the floating point control word. Mentioning caveats in
> its use is all that is needed. Rounding error control itself is
> anyway more complicated than setting the floating point control word,
> since one needs to monitor the monotonicity behavior in a sequence
> of oerations, and can therefore be done well only by experienced
> people.
>
>
> > If you end up writing MEX-files that give the user finer control with
> > less string processing / error checking, please contribute them to
> > MATLAB Central at http://www.mathworks.com/matlabcentral/
>
> Rump had such a routine; as I understood, it worked very well
> in the early versions of Matlab, until MathWorks decided to
> reset the floating point control word after each external call.
> Since then it is impossible to set it from a mex file.
>
> I think Rump would be happy to contribute a fast routine in
> Fortran or C if it would become built-in in the next release of
> Matlab.
>
>
> I wish you a happy and successful new year,
>
>
> Arnold
>
>
>