Questions tagged [floating-point]

Approximate representation of numbers as a fixed number of digits multiplied by a logarithmic scale.

32 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
0answers
85 views

What is the state of the algorithmic art for floating point arithmetic on complex numbers?

Most modern compilers and processors implement the IEEE 754 binary formats for floating point numbers. IEEE 754 guarantees that the addition, subtraction, multiplication, division, and square root ...
3
votes
0answers
85 views

Representing Computations on Transcendental Numbers

Consider the set of transcendental numbers that are not compressible to a finite base-2 representation. How can I compute multiples (more generally, any algebraic computation) of one of these numbers,...
2
votes
0answers
63 views

Stable and fast computation of the squared euclidean distance matrix

Let's say I want to compute the matrix $M$ of the squared euclidean distances between each pair of vectors $(x, y)$ belonging to two sets $X$ and $Y$ respectively. The sets of vectors $X$ and $Y$ have ...
2
votes
0answers
28 views

Heuristic Consistency with float multiplications

I'm running A* search with a theoretically consistent heuristic. I'm doing a lot of float multiplications, and I'm not sure how best to ensure that my heuristic remains consistent down to the last ...
2
votes
0answers
32 views

numeric stability of map reduce operations

I am building a small library for computing information retrieval metrics for classifiers (precision, recall, f1, accuracy, whatever). Typically each metric is built by calculating a single value for ...
2
votes
0answers
210 views

Why mantissa and exponent are stored differently in a float?

As we know, in IEEE 754 standard, float number's exponent and mantissa are stored differently. While the exponent is stored as an unsigned number, taking advantage of the bias, the mantissa is in sign-...
2
votes
0answers
59 views

Normalised Floating Point System

I have a floating point number system and I have a number for which I need to calculate the exact relative error after rounding. The number is clearly an overflow. Does anyone know what I should do? ...
1
vote
0answers
43 views

Accuracy and performance between a division and subtraction for a ratio in decibels

For comparing two images, one can use the Peak Signal-to-Noise Ratio (PSNR) metric, defined as follows: $\mathrm{PSNR} = 10 \cdot \log_{10}\left(\frac{\mathrm{MAX}^2}{\mathrm{MSE}}\right) = 20 \cdot \...
1
vote
0answers
149 views

Why is the method of im2col with GEMM is more efficient than the method of direction implementation with SIMD in CNN

The convolutional layers are most computationally intense parts of Convolutional neural networks (CNNs).Currently the common approach to impement convolutional layers is to expand the image into a ...
1
vote
0answers
53 views

Dual Signed Kahan Summation

NOTE: This is for a project I'm working on for fun, NOT production code. So I'm working on a pet project that involves reading data in from a sensor and summing it up. The values are mostly ...
1
vote
0answers
48 views

Understanding exponential computation by digit recurrence

I've met in a book the following algorithm that computes the exponential: Input: $t, n$ ($n$ is the number of steps) Output: $E_n$ $\begin{array}{l} \mbox{define $t_0 = 0$ ; $E_0 = 1$} \\ \mbox{...
1
vote
0answers
48 views

Why have only 15 bits been apportioned for the exponent in the 128-bit quad-precision datatype?

I look forward to the day we can start using quad-precision numbers, but was disappointed to see that in the specification, only 15 bits out of a whopping 128 were assigned to the exponent as shown by ...
1
vote
0answers
187 views

Addition in IEEE 754

Hi I have this simple question. When adding a positive number with a negative number, both of same exponent. Imagine that after complementing the negative we have something like this: 1.111 + 0.001 .....
0
votes
0answers
21 views

Floating point substraction

if $x=1.0e38=1.0 * 10^{38}$ and $y=3.0$ i want to find $ (x-x)+y $ and $(x+y)-x$ i think the value of (x-x)+y will be just substract $x-x=0 + y=3.0 = 3.0$ but how can i perfom addition of different ...
0
votes
0answers
24 views

How does normalised floating point binary work with two's complement?

I'm doing AQA a-level computer science, and the specification for which states that: Exam questions on floating point numbers will use a format in which both the normalised mantissa and exponent are ...
0
votes
0answers
848 views

Understanding denormalized numbers in floating point representation

I am confused about how denormalized numbers work in floating point representation. I was referring to Stallings book and this article. The book initially explains floating point number format in ...
0
votes
0answers
24 views

Numbers lying between single and double precision

The IEEE floating point number format is defined as $$s\underbrace{c_1\dots c_m}_\text{exponent}\underbrace{f_1\dots f_n}_\text{fraction}\text{ (*)}$$ with $s, c_i, f_j$ being either $1$ or $0$. The ...
0
votes
0answers
23 views

IEEE-754 and machine numbers

I've been trying to wrap my head around machine numbers like the unit roundoff (u) and epsilon (e) in combination with the IEEE 754 standard. My textbook states some things that don't really make ...
0
votes
1answer
36 views

algorithm for correctly rounded floating point radix conversion

Is there any generic algorithm which implements a floating point radix conversion? Lets say we have a $p$-digit FP number $A = \sum_{i=0}^{p-1} A_i \beta^{e-i}$ in radix $\beta$ and with $0 \leq ...
0
votes
1answer
128 views

How to compute relative error for the rounding of floating point numbers when the rounded number is 0?

I have asked this question on Stack Overflow, I am asking it here in the hope to get more traction. The relative rounding error for a floating point number x is defined as $e_r = |\frac{(round(x) -...
0
votes
1answer
103 views

Using a 16-bit 2,s Complement normalised floating-point representation; 10-bit fractional mantissa and a 6-bit integer exponent: express 2.171875

So far I know how to normalize when you are given, say: 1111010010 Mantissa, and 000100 exponent and are told that it's a positive number: ...
0
votes
0answers
36 views

Using half float to represent scaled short (int16), do I lose precision comparing to using double?

A device is generating 14-bit integer which is stored as int16 (short), a scaling process will then scale the data to value of order 10E-3. Does it then matter if I store these number with half float ...
0
votes
1answer
94 views

Computing the error bound of floating-point expression

How should I compute the maximum absolute and relative error of the following IEEE-754 floating-point expression? a.y + (x - a.x) * ((b.y - a.y) / (b.x - a.x)) ...
0
votes
0answers
57 views

Inverting an IEEE 754 double

While preparing for an exam I've come across this problem: Let $x$ be an IEEE 754 double precision number. Show that $$ \texttt{fl}(x * \texttt{fl}(1/x)) $$ has only 2 possible results ...
0
votes
0answers
31 views

When do you know whether an exponent represents a movement of the decimal point to the left?

I'm learning about floating point numbers and I don't quite understand when one should interpret an exponent as moving the decimal point to the left. By book shows an example of converting -10.5 ...
0
votes
0answers
106 views

How can a Number Represented without Normalization Technique?

Consider the following floating point Representation Mantissa is pure fraction in signed magnitude form . What is the representation of the binary number 1111.1111 $\times 2^{2} $ in hexadecimal ...
0
votes
0answers
3k views

How do the Guard, sticky, and round bits work and affect floating point Representation?

I've got a test on this tomorrow, my instructor's lectures aren't up, and the notes are ambiguous... Anyhow, we've been covering floating point operations, specifically addition, and he mentioned ...
0
votes
0answers
89 views

How to determine the range of a number represented in IEEE-754 format?

Given a format: say 12-bit floating point with sign bit, 5 - bit biased exponent and 6- bit significant with implied bit, how do i go about determining the range of ...
0
votes
0answers
42 views

Logarithms using digit recurrence, how many bits to store in a LUT?

In a known method for approximating logarithms the following decomposition is adopted (assuming $x \in [1,2)$): $$ log_2(x) = 1 + \sum_{j=1}^{+\infty} w_i log_2(1+2^{-j}) $$ Where all the ...
0
votes
0answers
327 views

Are floats abstract data types?

Source:https://en.wikipedia.org/wiki/Abstract_data_type Can we say that float data types (or all primitive data types or only integer) are abstract data types?
0
votes
0answers
696 views

Calculating sums of floating point numbers by hand

how do you calculate the sum of 2.6125 * 10^1 and 4.150390625 * 10-1 by hand, assuming A and B are stored in the 16-bit half precision. i cant figure out how to do this by hand with out losing most of ...
-1
votes
1answer
516 views

Convert between IEEE 754-2008 decimal64 and IEEE double precision floating point number

I need to know the algorithm for converting between IEEE 754-2008 decimal64 and IEEE 754-1985 double precision floating point number. I have been working on this for the past 2 days and I match the ...