Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

1
vote
0answers
6 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 ...
0
votes
1answer
19 views

Floating point Euclidean norm optimization

Past few days I've been struggling with floating point number exercises, trying to learn how they work and what are their limitations. The exercise I've encountered today is as follows: The ...
0
votes
1answer
19 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) -...
2
votes
2answers
45 views

Double floating precision exercise

today I had to deal with this exercise: If $x \approx y$, we might expect some cancellation in computing $log(x)- log(y)$. On the other hand, $log(x) - log(y) = log(\frac{x}{y})$, and the latter ...
0
votes
1answer
24 views

Floating point number fractions excercise

During my preparation for an exam, I've come across an exercise that was focused on precision calculation with floating point numbers. It goes like this: Consider the expression : $$\frac{1}{1-x}-\...
0
votes
0answers
13 views

Special operands in floating point standards

An interview with William Kahan, the primary force behind the adoption of the IEEE 754 floating point standard, said the following in an interview. "From that time on the standard ground slowly ...
0
votes
1answer
24 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: ...
1
vote
1answer
18 views

Number of IEEE 754 doubles between two adjacent single-precision floats

Between an adjacent pair of nonzero IEEE single precision real numbers, how many IEEE double precision numbers are there? I was also wondering if this question has something to do with the hidden ...
0
votes
1answer
48 views

Why are floats converted from different integers sometimes equal?

I'm trying to understand the following algorithm: ...
0
votes
2answers
26 views

Can area-partitioning lose included points due to floating point precision?

I'm currently partitioning a big area $A$ into $n$ areas $B_i$ such that $$\bigcup_{i=1}^n B_i = A$$ I have geo-coordinates which I know are in $A$ (also with the finite precision of floats). ...
1
vote
2answers
39 views

Hypothetical question on floating point normalization

I've seen a few questions posted regarding the upsides/downsides of floating point formats that have explicit integrals vs. formats that have implicit integrals, but have not seen an answer that ...
1
vote
1answer
51 views

Algorithm for implementing the modulus “%” operator?

How can an efficient modulus operator be implemented? Here's a naive way of defining A % B: given $(a,b) \in \mathbb{Z}$ (represented as ...
1
vote
3answers
57 views

How does computer store non-repeating decimal very accurately?

Maybe it is not accurate at all, but it looks very accurate for me. I'm making a scientific calculator for my portfolio, and I found an interesting phenomenon. Because computers store decimals not ...
0
votes
0answers
28 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 ...
2
votes
1answer
31 views

Implementing Gauss–Legendre algorithm using arbitrary-length rationals

I am trying to re-implement SuperPI myself in Rust, but the results I get are not very accurate. SuperPI computes pi using the Gauss-Legendre algorithm. The Gauss–Legendre algorithm is quite simple, ...
1
vote
1answer
93 views

How to calculate machine epsilon

In a binary system we know that the next floating point number after 4 is 4+1/32. What is the machine epsilon? Is it 1/32 and if yes, why?
1
vote
1answer
37 views

What does floating point biased notation have to do with 2's complement?

During lecture the professor talked about Integer Compare for floats and kept mentioning two's complement. What's the relation between them? All I understand is that two's complement can take us ...
0
votes
0answers
9 views

Why does economising the power series give me more error?

Suppose I want to economise $\sin x$ with the following taylor series: $$P_{2n-1}(x) = \sum^n_{i=1}(-1)^{i-1}\frac{x^{2i-1}}{(2i-1)!}$$ for the interval $[-1, 1]$ for $P_5(x)$. For $P_5(x)$, I have ...
0
votes
1answer
44 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)) ...
3
votes
1answer
46 views

Understanding truncation and rounding error in IEEE floating point system?

I'm trying to understand the theory behind finding the optimal $h$ value for differentiation in this definition: $$ \frac{f(x+h) - f(x)}{h}$$ as $h$ tends to 0. Here is my understanding: ...
1
vote
1answer
97 views

How to Add IEEE 754 Floating Point Numbers

I'm trying to add two 16 bit numbers that use a similar format as IEEE 754. The format is in the image below: I can't figure out how to add together two numbers for the life of me. Specifically, ...
3
votes
1answer
47 views

Why do I get really different results with my benchmarking code I made?

I'm doing research work for my last year in high school. My work is about processors and for the experimental part i've coded an app that can mesure how many Floating Point Operation can a processor ...
4
votes
1answer
78 views

Imaginary numbers and negative zero

I've been studying the low-level hardware implementations of floating point numbers and doing an exercise to design a custom floating point implementation. I know that being able to represent ...
1
vote
2answers
106 views

Is IEEE 754 float arithmetic associative, commutative, distributive, etc? Why?

Does the associative/commutative/distributive/etc property hold for arithmetic performed with IEEE 754 floats? Obviously the answer is no to most of those questions, but do any of the properties of ...
4
votes
2answers
43 views

Union of fixed and floating point types

Say I have two real number types. They may be floating or fixed point. How can I construct a new type whose values are at least the union of the two with the minimal number of bits? There are 3 cases ...
1
vote
4answers
87 views

Float multiplication

While doing the multiplication 1.4*0.8 in a python program, I got the result as 1.1199999999999999. Why didn't I get ...
1
vote
2answers
38 views

Float type variable uncertainty

I developed an image processing software and I need to do a numerical analysis of it, considering the error propagation associated to its operations and the uncertainty of float type variables caused ...
0
votes
0answers
34 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
8 views

Presentation problem and issues with transmission

My lecture notes on that say: "The presentation problem is to ensure that we have the same meaning on any system. We can easily copy bits from system to system, but our interpretation of those bits ...
0
votes
1answer
141 views

What is exponent of denormalized real in IEEE 754 floating point format?

I was reading this link. Here I noticed that, in table titles "Float Values (b = bias)", in exponent column, entry for denormalized reals is $00..00$, but in value column, the entry is $-b+1$. Why is ...
0
votes
1answer
82 views

Genetic Algorithm Getting Stuck on Certain Values

I'm attempting to teach myself something about genetic algorithms. I found a simple tutorial on it here, and it made enough sense that I was able implement the suggested example of generating a string ...
1
vote
1answer
40 views

How do proof assistants nowadays avoid floatpoint error?

I heard that Coq is using "Dedekind cut", but how's that related to floatpoint errors? Can we just use something like ...
1
vote
1answer
23 views

Exact Value of Denormalised number related to floating point numbers

I faced with the following issue: if the value of a floating point format number is in the range of underflow, it must be 0 or a denormal number.If the value is not 0 than what is the exact value of ...
3
votes
1answer
125 views

Why do floating point values have infinity?

Why do floating point values have infinity instead of just a higher exponent?
1
vote
1answer
37 views

Converting a 32-bit bit pattern into floating point number

In The Scientist and Engineer's Guide to Digital Signal Processing By Steven W. Smith, Ph.D. i have read something like that, Single precision or 32-bit floating point forms the floating point number,...
1
vote
1answer
243 views

How does conversion from fixed-point to floating-point happen?

I came across to the code that convert 32-bit signed fixed-point number (16.16) to a float and it looks like (pseudocode) floating = fixed / 65536.0 Could you ...
0
votes
1answer
28 views

Shortest decimal expansion within binary interval

Consider an interval $[x-2^n,x+2^n]$ defined by a binary float $x$ and a power of two $2^n$ typically much smaller than $x$. I would like to know an efficient algorithm exists to determine the ...
2
votes
0answers
23 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 ...
1
vote
1answer
60 views

how to convert any fraction to decimal

So for a project I am working on. I need to take a string representation of a floating point number, lets say "1.5" and do arithmetic on it with another floating point number. The catch is I cannot ...
0
votes
2answers
359 views

Convert a decimal floating-point number into a binary floating-point number

Let's say I have a decimal floating-point number, i.e. a mantissa and precision (negative exponent), both represented as integers. How do I convert this into a binary floating point number (of the ...
2
votes
0answers
126 views

Simple algorithm for IEEE-754 division on 8-bit CPU?

IEEE Std 754-2008 is the modern definition of Floating-Point Arithmetic. It requires that division (among other operations) performs as if it first produced an intermediate result correct to ...
1
vote
1answer
35 views

Compress 32 bit integer into a normalized float

and sorry if this is a duplicate of some sort, my poor technical vocabulary doesn't get me very far with google. I am trying to implement some well-known PRNG algorithms. For the time, the algorithm ...
1
vote
1answer
66 views

What are some of the practical applications of functions that extract the exponent and mantissa of a floating point number?

I'm talking about functions such as Python's math.frexp() : math.frexp(x) Return the mantissa and exponent of x as the pair (m, e). m is a float and e is an integer such that x == m * 2**e ...
1
vote
1answer
330 views

Neural Networks: Simulate the working of Dynamic Fixed Point representation of the weights on hardware

I am looking to implement a neural network on hardware using Verilog. I have completed and tested with floating point representation and a 20 bit fixed point representation. I want to further reduce ...
1
vote
0answers
27 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 ...
0
votes
0answers
28 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 ...
2
votes
2answers
567 views

How to estimate floating-point precision of function?

Let's say I have a function that consists solely of floating-point operations where the last operation rounds the computed value to a predefined number of digits. And I feed this function with a range ...
1
vote
2answers
660 views

What are the reasons for and against using normalized floating point?

Floating point number formats can be normalized or not, meaning that ‘normal’ floating point numbers have an implicit (hidden) leading bit 1 in the significand. For example, the binary IEEE 754 ...
2
votes
1answer
178 views

Are IEEE floating point numbers intervals or point values?

The context is IEEE 754-2008 floating point number systems. The systems defined by the standard comprise, as far as I understand it, a bit-level representation and a set of guarantees on the precision ...
3
votes
1answer
161 views

Why a separate ALU is needed, since any integer can be represented as floating point numbers?

Most of the operations in computer are using floating point arithmetic.Put it simply why a Floating Point Unit alone is not sufficient? Can we do away with ALU?Is FP operations are resource intensive ...