This class provides floating point calculation in the native floating point format of the processor. The extended class stores data with 64bit mantissa instead of 53bit in
The class is intended for calculations depending critically on the mantissa length. Summing a large with a small value generally leads to a truncation error of the small value to fit into the mantissa. The extended precision relaxes this constraint, useful to verify the accuracy of a numerical result.
Unpack the archive in a folder that is part of the MATLAB path. The class functions reside in the '@extended' folder. For Pentium III compatible computers or newer, the folder '@extended/SSE' contains optimized functions. Move them into the '@extended' folder for use, or delete them.
The functions should always reside in a subfolder called '@extended' to make sure they are not called for any data except of type
extended. In general, they do not check the data type of input arguments.
The class provides access to extended precision constants. For a built-in function, MATLAB calls always the double precision function whenever no input argument is given. To get an
extended constant, use:
||uniformly distributed random number|
||normally distributed random number|
The class provides all arithmetic functions, the matrix multiplication, and most elementary functions as with the double class. Currently, none of the inverse matrix functions (division, inversion, decompositions) has been implemented. Wrapper scripts are supplied, which call MATLAB built-in functions.
Due to the native execution by the processor, the performance is affected merely by memory throughput. An
extended value occupies 10bytes instead of 8bytes. Memory access may be faster if the data were aligned at 16byte address boundaries. Though, the current implementation minimizes memory consumption by packing consecutive values closely together.
In general, a statement of
inverseFunction(function(value)) produces value with a relative error of less than 1E-16. The roundoff error of about 1.1E-19 leads to relatively important deviations in exponentiation. Note also that in particular addition/subtraction in the argument of a logarithm are critical operations due to a relative amplification of the rounding error. The logarithm itself works accurate over the full complex plane R x iR. For the sake of performance, the inverse transcendental functions are currently not implemented in that way. See also the summary about complex functions.
These routines are published as freeware. The author reserves the right to modify any of the contained files.
You are allowed to distribute this package as long as you deliver the entire, original package for free.
Any warranty is strictly refused. Don't rely on any financial or technical support in case of malfunction or damage.
Comments are welcome. I will try to track reported problems and fix bugs.
Service relase. Bug fix in
Service release. Function
numel.m and version information added.
Service release due to an error report by Carlos López. Function
num2str.m added and
subsasgn.m fixed for empty inputs.
Bug fixes for
sse/true.dll. Optimized routine for calculating the exponential according to Agner Fog, "Optimizing subroutines in assembly language," at Copenhagen University College of Engineering.
Downloading these files, you accept the copyright terms.
MATLAB is a registered trademark of The MathWorks, Inc. Pentium is a registered trademark of Intel Corporation. Other product or brand names are trademarks or registered trademarks of their respective holders.
© 2011 École Polytechnique Fédérale de Lausanne