Questions tagged [floating-point]

Mathematical questions concerning floating point numbers, a finite approximation of the real numbers used in computing.

Filter by
Sorted by
Tagged with
0
votes
1answer
48 views

The floating point function of Chopping. Absolute error and Relative error.

Consider a number $(x)_\beta$ : $$x = \pm 0.d_1d_2 \ldots d_pd_{p+1}d_{p+2} \ldots \times \beta^E$$ The function $chop(x)$ considers only the first $p$ digits ignoring digits from $(p+1)$th to ...
2
votes
1answer
54 views

How to deal with underflow issues in high-dimensional entropy calculation?

I was not sure if the question makes sense here or should better be placed in a computational/CS forum, but I hope you can give me some insights. I am working in image processing and use the ...
1
vote
1answer
27 views

Error Propagation in Floating-Point Multiplication

Wikipedia (Machine epsilon) tells me that the result of a multiplication between 2 floating-point numbers, with a rounding induced relative error ϵ, still only has the relative error ϵ. Why do the ...
1
vote
1answer
23 views

Alternative expression for Rounding Function on Floating Point Arithmetic

Let $\mathbb{F}(\beta,t,e_{\min},e_{\max})$ be a Floating Point Arithmetic. Let $\text{domain}(\mathbb{F}) = [x_{\min},x_{\max}] \subseteq \mathbb{R}$ for minimal and maximal elements $x_{\min},x_{\...
0
votes
1answer
33 views

Compute $\frac{\sum_{i=1}^nx_iy_i}{\sum_{i=1}^nx_i}$ in logarithmic space

Let $x,y\in(0,\infty)^n$. Is there a clever way to compute $$\frac{\sum_{i=1}^nx_iy_i}{\sum_{i=1}^nx_i}\tag1$$ by calculating $\ln\frac{\sum_{i=1}^nx_iy_i}{\sum_{i=1}^nx_i}$ instead? My problem is ...
2
votes
2answers
68 views

Simplify $(1+x^2 )^{1/2}-(1-x^2)^{1/2}$

I need to simplify the following expression in a way that introduces minimal floating point cancellation errors. $$(1+x^2 )^{\frac{1}{2}}-(1-x^2 )^{\frac{1}{2}}$$ The errors accumulate when numbers ...
1
vote
1answer
41 views

Calculate the error bound for the rounding errors of an expression

I need to calculate the error bounds for the following expression when computed under the IEEE 64-bit standard for $x\in[0,\pi/2] $: $$ f(x)=2*\cos(x)^2-1-\cos(2x) $$ I understand that I need to ...
0
votes
1answer
27 views

LU-factorization and floating-point operations

The LU-factorisation of $A\in\mathbb{R}^{n\times n}$ is given by $$A=LU,$$ where $L$ is a unit lower triangular matrix and $U$ is an upper triangular matrix. I am trying to understand why it ...
0
votes
0answers
19 views

How many numbers $\in \mathbb{G}(10,3)$ are in $[99,101]$?

10=basis, 3=mantissa I think 12 number are in the interval: $9.90\cdot 10^2=99$ $9.91\cdot 10^2=99.1$ $9.92\cdot 10^2=99.2$ $9.93\cdot 10^2=99.3$ $9.94\cdot 10^2=99.4$ $9.95\cdot 10^2=99.5$ $9.96\...
4
votes
2answers
76 views

Numerical operations when numbers are very large?

Explain the best way to evaluate $f(x,y) = \sqrt{(x^2 + y^2)}$ numerically when $x$ or $y$ are very large. Does anyone have any insight to this? I'm lost. I usually know how to deal with these types ...
2
votes
0answers
44 views

Random sum of Random variable with floating numbers

Let $L$ and $S$ integer valued random variables $(0,1,2, \ldots).$ $R$ is another random variable which can be a floating numbers. The RV $S$ is the least required number of $R$ to be equal or ...
0
votes
1answer
49 views

Why is 1.4 - 1.3 == 0.9999+ but 0.4 - 0.3 == 1.000000003

I'm not sure if this is a maths question or a programming question or a how-does-your-computer-work question. Sorry about that. I remember from university that 0.999999 ... == 1 since 1 - 0.999999 ......
2
votes
2answers
284 views

Square roots by Newton’s method

The following Python program implements Newton’s method for computing the square root of a number: ...
0
votes
0answers
16 views

Solution for matrix equation with gaussian + column pivoting

\begin{array}{ccc|c} 7.000E+0 & 1.000E+0 & 1.000E+0 & 1.000E+1\\ 1.000E+1 & 1.000E+0 & 1.000E+0 & 1.300E+1\\ 1.000E+3 & 0.000E+0 & 1.000E+0 & 1.001E+3\\\...
0
votes
0answers
36 views

loss of significance in the cumulative distribution function of a K-distribution

I'm working on laser scintillation in the atmoshpere using a book, and I'm using a distribution that the book call "Gamma-Gamma", defined as: $$p(I)=\frac{2(\alpha\beta)^{(\alpha+\beta)/2}}{\Gamma(\...
0
votes
0answers
30 views

Machine 32-bit Word to Decimal Conversion

Given the machine 32-bit word 1100 0001 1011 0000 0000 0000 0000 0000 can I find the decimal number represented by this word assuming that it is (a) a two’s ...
0
votes
0answers
33 views

Question About Floating Point Number System

I have begun reading Numerical Analysis by Walter Gautschi. On page $3$, the author introduces the floating point number system as follows: a floating point number is a number representible as $$ \...
0
votes
1answer
22 views

Max Mantissa $2^{bits}-1$

if we look at a $5$ bit mantissa, the max value will be $11111$ which is $2^5-1$, Why is it in the form of $2^{bits}-1$ is it a combinatorial explanation?
1
vote
1answer
41 views

Floating Point Arithmetic dealing with a Taylor expansion for e^-x

Suppose we want to compute $e^{-a}$ for $a>>1$. Which of the following techniques should I use? (a) Taylor expansion for $e^{-x}$ about $x=0$ or (b) Taylor expansion for $e^x$ about $x=0$, ...
0
votes
0answers
26 views

Floating point operation/arithmetic

I read my lecture script and I have a question regarding this statement. "The approximation using floating point numbers with fixed mantissa length is useful, because the cost of each floating point ...
1
vote
1answer
48 views

Rounding in floating point operations

I'm given this set of floating point numbers: And I'm given the function: I'm then asked to find the value of f for: So I've done this: Now my guess is that I need to convert the exact value (1....
1
vote
0answers
53 views

Floating point and LU decomposition

So in a numerical linear algebra book I'm studying (Matrix Computations 4th edition) there is this example on floating points and LU decomposition: Suppose 3-digit floating point arithmetic is used ...
3
votes
2answers
66 views

Why is $0.09 + 0.01$ not exactly representable as $0.1$ in floating-point systems but $0.085 + 0.015$ is?

I understand that $0.09 + 0.01$ in floating-point systems cannot be exactly represented as $0.1$ because the binary equivalent of $0.1$ does not exist—it has infinitely repeating bits. But why can a ...
0
votes
0answers
18 views

Absolute error bound for floating-point number?

For a input real number $x$ with some interval $[-a, b)$, which is not performed by any computation for now, how can we bound the absolute error of it for IEEE-754 binary64? Most of the articles ...
0
votes
0answers
14 views

How many discrete points can be expressed in $[-1/2, 1/2)$with IEEE 754 double floats and what is the meaning of precision?

I know that IEEE754 double floats (64-bit floating number) is known to provide 52 bits of precision (or 53 bits including implicit 1). But I do not know the exact meaning of the precision. Suppose we ...
1
vote
1answer
150 views

Minimum number of bits to represent negative number

Minimum number of bits required to represent $(+32)_{base10}$ and $(-32)_{base10}$ in signed two's compliment form? My attempt: $32 = 0100000$ (1st bit $0$ - sign bit as positive) So to represent $...
0
votes
1answer
83 views

Show that formula is backwards stable

Have to prove the backwards stability of the following equations: $$x+y$$ $$x,y \in \mathbb{R}$$ with the norm $$\mid \mid \cdot \mid \mid_{\infty} $$ $$x \cdot y$$ $$x,y \in \mathbb{R}$$ with the ...
0
votes
0answers
8 views

What is the upper bound of error to represent a rational number $a \in [- \frac{1}{2}, \frac{1}{2})$ with IEEE 754 floating-point?

When we want to represent a rational number $a \in [- \frac{1}{2}, \frac{1}{2})$ using IEEE 754 floating-points of double precision, what is the bound of error? Which one is correct, $a \leq 2^{-53}$...
0
votes
0answers
17 views

Floating number and rounding error (machine number)

First off i don't get the formulate what is the second term bis just $b^{---}$. Could you help me understand all that and solving this? Researched for floating number calculation so $x = a_{i}* b^{i-...
1
vote
1answer
53 views

For rational numbers $a, b$, what is the range of $b$ such that $\lceil a + b \rfloor = \lceil a \rfloor$ holds?

For rational numbers $a, b$, what is the range of $b$ such that $\lceil a + b \rfloor = \lceil a \rfloor$ holds? Clearly, b=0 gives us the result. What are the lower and upper bounds of $b$? $\...
0
votes
2answers
95 views

Catastrophic and subtractive cancellation - floating point arithmetic

Could someone please explain to me why $\sqrt{1+x} - \sqrt{1-x}$ is a subtractive cancellation when $x \approx 0$ and $1-\cos(x)$ is a Catastrophic cancellation when $x \approx \pi$ I've been ...
7
votes
0answers
121 views

Topological nature of IEEE floating-point numbers

If IEEE floating-point numbers had countably infinite precisions, its domain would be: $$ \{-\infty\}\cup\mathbb{R}^-\cup\{-0,+0\}\cup\mathbb{R}^+\cup\{+\infty\}\cup\{\text{NaN}\} $$ Let's denote ...
0
votes
1answer
85 views

Question about machine epsilon

I am studying over my notes, and there is something I don't understand about $e_m$. We represent the floating point numbers as $1.d_1d_2...d_t \times \beta^e$. Now, my professor defines $\epsilon_m$ ...
0
votes
0answers
36 views

Associativity vs commutativity in context of floating point addition

Messing around with floating point numbers with Python shows that floating point addition can be wonky: ...
1
vote
0answers
24 views

Relative error floating point number multiplication/division

Given two floating point representations of x and y as $x'=x(1+\delta_x)$ and $y'=y(1+\delta_y)$ with $|\delta_x|,|\delta_y|\leq \epsilon_M<<1$. How do I find the relative error in $x'\cdot y'$ ...
2
votes
1answer
88 views

$\exp(-i \infty)$ is “Not a Number” according to MATLAB. Why? [closed]

I ran into this problem while trying to understand the Laplace transform via MATLAB. exp(-i*Inf) NaN + NaNi But, exp(-Inf) 0 Furthermore, syms t fun= exp(-(0+i)*t) answer=int(fun,0,...
0
votes
1answer
40 views

Finding a machine number such that $fl(x)=x(1+\delta)$.

The guide book asks me for A real number $x$ in range of a machine with $\beta=2$ (binary) and $n=24$ (24 mantissa positions), such that it satisfy $fl(x)=x(1+\delta)$, with $|\delta|$ as big ...
2
votes
2answers
101 views

Show that the accuracy of z is much better than y

Here is the problem I want to ask in my homework The following Matlab script computes (1 − cos(x))/x2 in two ways: ...
0
votes
1answer
56 views

Methods for confirming that a polynomial root with errors is complex?

For large degree polynomials (>=5) with real coefficients, the only general root-finding algorithms are approximate. Since polynomials might have complex roots, any algorithm for finding the real ...
2
votes
1answer
62 views

Computer science FLOPs question (complexity): We have $100$ vectors, each with $10^5$ elements.

Our numerical analysis textbook has this problem: How many bytes does it take to store $100$ vectors of length $10^5$? How many flops does it take to form a linear combination of them (with $100$ ...
0
votes
1answer
166 views

Hypothetical Computer Marc-32

I'm studying numerical analysis and i am stuck with one of my exercises. In the book "Numerical Analysis: Mathematics of scientific Computing" they introduce a hypothetical computer called MARC-32. In ...
0
votes
1answer
54 views

Math problem: Underflow and gradual underflow

My book has the following question but doesn't come with an answer key; I was hoping someone could verify my work and/or help me understand this. Just to clarify, this is not homework (though I ...
1
vote
1answer
247 views

Machine epsilon: why is $(1 + \epsilon) + \epsilon = 1$?

My book on real analysis has the following statement: I don't understand how the first equation can possibly be true, by definition of machine epsilon. Machine epsilon is defined as the smallest ...
0
votes
1answer
32 views

Floating-point arithmetic and loss of precision: Shifting mantissa until exponents match

My book says the following about floating-point arithmetic involving the addition/subtraction of two numbers, $x$ and $y$, that differ in their exponent: In adding or subtracting two floating-point ...
0
votes
1answer
287 views

Floating-point systems: Is the mantissa the whole thing or just the “fraction” part after the decimal?

In the context of floating-point systems, our numerical analysis book defines the terms mantissa and fraction as follows: I am unable to find any consistent definition of the terms "mantissa" and "...
2
votes
1answer
96 views

Why subtracting 1 is considered ill-conditioned?

I was reading the following to better understand stability: Consider evaluating $f(x) = \sqrt{1+x}-1$ for $x$ near $0$. $C_f(x) = \frac{\sqrt{1+x}+1}{2\sqrt{1+x}}$ so $C_f(0) = 1$ so it is not ...
0
votes
2answers
140 views

Solving overflow for quadratic roots

Suppose a machine with a floating point system ($\beta$,$t$,$L$,$U$) $ = (10, 8, -50, 50)$ is used to calculate the roots of the quadratic equation $$ax^2+bx+c=0$$ where $a,b,$ and $c$ are given, ...
-2
votes
2answers
38 views

binary floating point perform substraction and addition

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
23 views

Check if two points are symmetrics/asymmetrics

I'm working on an Android app which lets a group of child to draw whatever they want in a specific area. I need to check if the lines and figure that they draw are symmetric. The problem is that since ...
1
vote
1answer
39 views

maximum error when rounding off multiple times

So I am aware that when you round to n decimal places accuracy, the maximum error is $~0.5 × 10^n~$ But if I use the rounded result, and use multiply it by another un-rounded number and round the ...

1
2 3 4 5
8