Multiple Precision Toolbox Exclusive for Matlab under Microsoft Windows

Mar­tin Ander­s­son, Tokyo, Fri­day, Jan­u­ary 4, 2008 (last update, Jan­u­ary 28, 2010)

The Mul­ti­ple Pre­ci­sion Tool­box for Mat­lab (mp_toolbox) enables you to to increase your numer­i­cal pre­ci­sion of all your cal­cu­la­tions. It is becomes very easy to use hun­dreds or even thou­sands of dec­i­mals. Exam­ples of appli­ca­tions are for com­par­i­son of numer­i­cal sta­bil­ity of algo­rithms, for solv­ing for high order poly­no­mial roots, eigen­vec­tor algo­rithms, numer­i­cal analy­sis of con­ver­gence and errors, and when solv­ing dif­fer­en­tial equa­tions. Pi and e can be com­puted with thou­sands of dec­i­mals. The numer­i­cal per­for­mance and numer­i­cal sta­bil­ity, even in cases where it is extremely com­pli­cated to com­pare alge­braically, can be com­pared in a new way.

All the ben­e­fits of the matrix alge­bra nota­tions and cal­cu­la­tions in Mat­lab are inher­ited. The tool­box is fairly easy to install and has been con­firmed to run on sev­eral Win­dows instal­la­tions like Win­dows 2000, Win­dows XP. The draw­back is that cal­cu­la­tions become extremely slow.

Example: Numerical Stability of Algorithms

The mul­ti­ple pre­ci­sion tool­box for Mat­lab, was a key for con­clu­sions within the field of chemo­met­rics and par­tial least squares, PLS, in M. Ander­s­son, A com­par­i­son of nine PLS1 algo­rithms, J. Chemom., 2009; 23, 518 — 529 (DOI: 10.1002/cem.1248). This paper led to the Kowal­ski Prize 2010 for the best the­o­ret­i­cal paper in 2008 and 2009. There is a long story behind it, see also the press release from FOSS Ana­lyt­i­cal. With­out the mul­ti­ple pre­ci­sion tool­box, it would be impos­si­ble to objec­tively com­pare the numer­i­cal sta­bil­ity of the dif­fer­ent PLS algo­rithms. As a result of the paper, Eigen­vec­tor Research, a lead­ing soft­ware com­pany within the field of chemo­met­rics, decided to use a the new Direct Scores PLS in their PLS_Toolbox for Mat­lab from ver­sion 5.5.

Installation Procedure

Down­load this zip-file. Fol­low the below exam­ple, but please adjust the folder names accord­ing to your own spe­cific sit­u­a­tion on your Win­dows file system.

  1. Extract the zip file to C:\Matlab6p5\work\mp . Note that the extracted files should now be located in C:\Matlab6p5\work\mp, in C:\Matlab6p5\work\mp\@mp, and in C:\Matlab6p5\work\mp\@mp\private
  2. Add C:\Matlab6p5\work\mp to your path. Do this by typ­ing “edit pathdef” with­out quotes and add it at the end. As an exam­ple, the end of the file pathdef.m may look like the following:
    matlabroot,’\toolbox\signal\sptoolgui;’,…
    matlabroot,’\toolbox\signal\sigdemos;’,…
    matlabroot,’\toolbox\splines;’,…
    matlabroot,’\toolbox\stats;’,…
    ‘c:\matlab6p5\work;’,…
    ‘c:\matlab6p5\work\imtools;’,…
    ‘c:\matlab6p5\work\music;’,…
    ‘c:\matlab6p5\work\owntools;’,…
    ‘c:\matlab6p5\work\cricket;’,…
    ‘c:\local\ann\startinfo;’,…
    ‘c:\matlab6p5\work\nlfit;’,…
    ‘c:\matlab6p5\work\mp;’,…
    ‘c:\matlab6p5\work\mpwork;’,…
    ];

    Of course, you prob­a­bly don’t have the same folder struc­ture on your PC. Make sure that you have a folder named …\work\mp and that you unzipped the files to this folder.
  3. After unzip­ping, RESTART Mat­lab and ini­tial­ize the tool­box by typ­ing “mp_init(250)” with­out any quotes. This means that the pre­ci­sion is set to 250 binary digits.
  4. Check that all func­tions of the tool­box are work­ing. Type “mp_TESTING” and “mp_TESTING2″. Con­firm that all func­tions are be OK.

Acknowledgements

The tool­box was made by Ben­jamin Bar­rowes. All cred­its, dona­tions and dol­lars should go to him for an excel­lent work. The dll-files for Microsoft Win­dows were com­piled by Car­los López  who also enhanced some of the func­tions in the tool­box. All I did was to make an ini­tial­iza­tion file and to adjust a few of the m‑files to get all func­tions work­ing on my machine — and to make it avail­able with an easy instal­la­tion guide.

  • IMPORTANT NOTE 1
    If you need so many dig­its to suc­ceed with your cal­cu­la­tions, it can be because the way you are approach­ing the prob­lem wrongly from a numer­i­cal point of view. Instead of using many dig­its to suc­ceed as is offered by the mp_toolbox, it may be a bet­ter idea to try to find a bet­ter way to solve the prob­lem, using another algorithm.
  • IMPORTANT NOTE 2
    This has been con­firmed to work on MATLAB Ver­sion 6.5.0.180913a (R13), Mat­lab 7(R14) and 7.2 on Win­dows XP. It has not been tested it on any other versions.
  • IMPORTANT NOTE 3
    Make sure that all the func­tions you are using in your own algo­rithms are over­loaded by the mp_toolbox. The func­tions are over­loaded if you can find their name in the mp direc­tory or in the mp\@mp directory.
  • IMPORTANT NOTE 4
    You may down­load newer ver­sions of the Mul­ti­ple Pre­ci­sion Tool­box from the Math­works site, but then be aware that you may need some hands on to adjust the files to get them all run­ning on a Win­dows based Mat­lab instal­la­tion. There­fore, it is rec­om­mended to try the above zip file to first.

This website uses cookies. By continuing to use this site, you accept our use of cookies. 

Scroll to Top