473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

precision problem

CBLAS function dgemv (all operations of type double) returns a vector,
some of whose components are:

-4.7195321e-16
2.6001879e-16
-6.1531184e-16
2.3054204e-16
-2.2817035e-16

Should I assume these to be essentially 0?
MATLAB does similar computation and returns values:

0.00000004361293
0.000000080393098
0.000000036770758
0.000000009778969
0.000000016177475

which look something like x.ye-8. Which of the two should I believe as
these components are used in further computations.

Thanks

May 28 '06 #1
3 1545
someone wrote:
CBLAS function dgemv (all operations of type double) returns a vector,
some of whose components are:

-4.7195321e-16
2.6001879e-16
-6.1531184e-16
2.3054204e-16
-2.2817035e-16

Should I assume these to be essentially 0?
MATLAB does similar computation and returns values:

0.00000004361293
0.000000080393098
0.000000036770758
0.000000009778969
0.000000016177475

which look something like x.ye-8. Which of the two should I believe as
these components are used in further computations.


a) This is like: I asked two of my best friends which color my new shirt is.
One said green the other said blue. Whom should I believe?

How are we supposed to know which result is better without even knowing what
computation was done?

b) No please *do not post* your computation: the whole thing is *off topic*
anyway. See the FAQ for which questions legitimately go here.
Best

Kai-Uwe Bux

May 28 '06 #2
"someone" <bo***********@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
CBLAS function dgemv (all operations of type double) returns a vector,
some of whose components are:

-4.7195321e-16
2.6001879e-16
-6.1531184e-16
2.3054204e-16
-2.2817035e-16

Should I assume these to be essentially 0?
MATLAB does similar computation and returns values:

0.00000004361293
0.000000080393098
0.000000036770758
0.000000009778969
0.000000016177475

which look something like x.ye-8. Which of the two should I believe as
these components are used in further computations.
It depends on the formulas you used. If these were the same formulas for
both, I would note that in your first one:
-4.7195321e-16 and 0.00000004361293


that CBLAS says it's a negative number, MATLAB says it's a positive number.
That's a pretty big difference. Look at your original formula (I don't care
to see it) and see if it should be a negative or positive value. If it
should be positive, use MATLAB, if it should be negative, use CBLAS. If you
can't decide, neither can I.
May 28 '06 #3
res
You can do some experiments to figure out how are they implemented
internally.

It's possible that one is using 64-bit double, and the other is using 80-bit
long double.

"someone" <bo***********@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
Which of the two should I believe as these components are used in further
computations.

May 31 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: John Benson | last post by:
I got the multiplication precision rule wrong: relative precision is defined as the uncertainty divided by the magnitude of the measured quantity, e.g. 10 meters +/- 1 meter gives an...
1
by: Tariq | last post by:
I've a SQL view performing a number of very precise calculations ie. 495/(1.112 - (.00043499*((Col1 + Col2 + Col3))) + ( .00000055 * ((Col1 + Col2 + Col3)) * ((Col1 + Col2 + Col3))) - (.00028826...
5
by: DAVID SCHULMAN | last post by:
I've been trying to perform a calculation that has been running into an underflow (insufficient precision) problem in Microsoft Excel, which calculates using at most 15 significant digits. For this...
21
by: syntax | last post by:
hi, i need to get high presion float numbers. say, i need pi = 22/7.0 = 3.142857....(upto 80 digits) is it possible ? does gcc/g++ compiler can give such type of high precision?? plz...
15
by: michael.mcgarry | last post by:
Hi, I have a question about floating point precision in C. What is the minimum distinguishable difference between 2 floating point numbers? Does this differ for various computers? Is this...
3
by: Madan | last post by:
Hi all, I had problem regarding float/double arithmetic only with + and - operations, which gives inaccurate precisions. I would like to know how the arithmetic operations are internally handled...
5
by: rocknbil | last post by:
Hello everyone! I'm new here but have been programming for the web in various languages for 15 years or so. I'm certainly no "expert" but can keep myself out of trouble (or in it?) most of the time....
10
by: Artemio | last post by:
Hello all! I just stumbled across a weird problem with precision of a division operation. I am on Mac OS X, GCC 4.0.1. Say I have two float or double numbers, and I want to divide one by...
3
by: Gugale at Lincoln | last post by:
Hi, I am working on an application which uses date as a primary key. All my records are at least a few millisecond apart and are in the form "20070630T12:50:24.207". SQL Server has a precision...
137
by: mathieu.dutour | last post by:
Dear all, I want to do multiprecision floating point, i.e. I want to go beyond single precision, double precision and have quadruple precision, octuple precision and the like, and possibly with...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.