Home > freetb4matlab > fenv > fetestenv.m

fetestenv

PURPOSE ^

% Check some properties of floating point arithmetics:

SYNOPSIS ^

function [macheps, round, machepsb, roundb] = fetestenv

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {} [@var{macheps}, @var{round}, @var{machepsb}, @var{roundb}] = fetestenv 
% Check some properties of floating point arithmetics: 
% the rounding mode and the machine epsilon, as seen by
% Octave's interpreted code (@var{round} and @var{macheps}, respectively) and, if requested, as seen by BLAS (@var{roundb} and @var{machepsb}, respectively). 
%
% The function performs a variant of the standard 
% @display
% 1 + @var{macheps} ~= 1
% @end display
% test in order to check the actual machine epsilon @var{macheps} 
% and the present rounding mode @var{round} used in all interpreted 
% expressions in Octave.
%
% As Octave interpreted code cannot achieve more than double precision,
% and some BLAS implementations may impose their internal precision and rounding modes,
% the user may request to check the actual rounding and precision used in BLAS calls.
% To this end, we perform a machine epsilon/rounding mode check of the form 
% @display
% [1, @var{machepsb}, -1]*[1; 1; 1] ~= 0.
% @end display
% This Octave code results in a call to a BLAS routine, which in turn may use different floating point arithmetic settings than
% available to Octave. 
% Rounding mode and machine epsilon (both as seen by BLAS) are returned 
% in @var{roundb} and @var{machepsb}, respectively.
%
% See the manual pages of @command{fesetprec} for more details and subtleties.
%
% Note that the results of this test may or may not apply to library functions called by Octave. The simplest way to verify if the function you use in Octave is affected by the change of the rounding mode or the precision, is to run your function on the same data with different settings. Small differences between various modes indicate these modes do affect the behaviour of your function. No differences mean they probably do not apply. Big differences most likely indicate either an instability of your function or ill conditioning of your problem.
%
%
% @seealso{fesetround, fesetprec, system_dependent, eps, fe_system_dependent}
% @end deftypefn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:13:00 by m2html © 2003