Re: single precision



On Feb 19, 2:58 pm, James Tursa <aclassyguywithakno...@xxxxxxxxxxx>
wrote:
I am not convinced you are getting my point. Yes, MATLAB is very
likely calling single-precision versions of the underlying libraries,
but *those libraries* may in fact be doing intermediate calculations
in higher precision, even if *none* of the local variables in those
libraries are explicitly declared as higer precision variables in the
original source code.

James, my comments included that possibility; in fact I had actually
started to write about it in a parenthetical comment, and then deleted
it as too complicated and unnecessary before I posted. Yes, the
compiler may automatically do some intermediate calculations in double
precision (or even extended precision) depending upon the language,
compiler, and the FPU mode. However, it will generally only do that
for variables when they are stored in registers, not when they are
spilled to the stack, and will certainly not do that when they are
explicitly written to an array at intermediate stages of the
algorithm.

So, this is not really that different in effect from asking whether
the underlying code uses a (bounded number) of local double-precision
variables; the overall precision of a multi-stage algorithm (where all
calculations don't fit into local variables or registers) like an FFT
or an LU decomposition is then limited by single-precision roundoff
characteristics.

Steven
.



Relevant Pages

  • Re: Raising a Number doubt..?
    ... I've to do xtremely large calculations. ... Probably there are existing libraries that can already do ... those systems to solve the problem (setting precision through whatever ... Then just create some functions for add, multiply, power, print and so on.. ...
    (comp.lang.c)
  • Re: single precision
    ... FFT, it's possible for local variables to be in double precision (or ... underlying libraries. ... higher precision for intermediate calculations. ...
    (comp.soft-sys.matlab)
  • naive questions about nested intervals with Farey fractions
    ... in a table as the numerator and denominator of a rational number, ... possible to calculate the rational numbers to double precision, ... the values up and store them in single precision cells, then execute ... requires no calculations beyond the booleans within the SELECT ...
    (comp.databases.theory)
  • Precision
    ... All my comments relate to common accounting practice in normal double-entry ... remember what the associated actuarial calculations were. ... again I would use floating point and isolate the programs. ... Change PRECISION 4 to 5 and you lost a leading significant digit. ...
    (comp.databases.pick)
  • RE: When double precision isnt very precise
    ... not be using floating point calculations for financial analysis, ... correct that there is a bug in the floating point arithmetic in VB.Net. ... assign the result to another double precision variable, ... payments to show a running balance on someone's ledger. ...
    (microsoft.public.dotnet.languages.vb)