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
2
votes
4answers
80 views

Computing continued fraction expansions

My question concerns the numerical accuracy of a continued fraction expansion. A typical algorithm for computing a continued fraction can be written in Python as : ...
0
votes
1answer
23 views

Approach to address errors from float precision limits by its storage limit

Background In computer, the limited float precision due to the storage limit e.g. 64 bit can cause problems. Trying to understand what approaches are available and being used to cope with or overcome ...
4
votes
0answers
122 views

$x^{x^{1/x}}$ has the same first $\lfloor x \rfloor$ decimals as the number $3\sqrt{\lfloor x\rfloor}$ when $x=\pi$ and $x=e$. Why? Are there others? [closed]

Suppose we are in year $0$ (I mean no computers), and someone gave us this question: (edited) The real number $\pi^{\pi^{1/\pi}}$ has the same first $\lfloor \pi \rfloor$ decimals as the number $3\...
2
votes
0answers
27 views

Backward Stability solving linear system with unitary matrices

Let $Q \in \mathbb{C}^{n\times n}$ be a unitary matrix that can be exactly stored in floating point arithmetic. Suppose we want to solve the following linear system: \begin{equation} Qx=b \end{...
1
vote
1answer
60 views

0.1+0.2=0.30000000000000004 in floating point IEEE representations arithmetic addition manual proof.

I am trying to prove the 0.1+0.2=0.30000000000000004 by adding the numbers 0.1, and 0.2 in IEEE floating-point representation. I have added the operand values in IEEE format, with the general addition ...
0
votes
0answers
13 views

Existence of an example of biased function in double precision computations using round-to-nearest.

When performing an operation on a computer, the result (often) needs to be rounded to fit mantissa length of double precision, i.e. the last digit of the mantissa is chosen based on the rounding ...
2
votes
2answers
61 views

How can I simplify this lerp arithmetic to avoid floating point precision errors?

I am making a "cinematic camera" that pans around a scene. Each step has a position for the camera and a point that the camera should be looking at. For instance: ...
0
votes
0answers
25 views

How does all 1 exponent and all 0 fraction represent infinity?

I am studying IEEE 754 FLOATING POINT STANDARD. Standard says The number is infinity when: e (Biased Exponent) = 255 f = 0 I am unable to understand this because if fraction (f) = 0 and exponent = ...
1
vote
0answers
45 views

Proof of accuracy of converting decimal to binary floating-point number to decimal

As mentioned in the book, "we may think of its value not as exact but as exact within a factor of $1+\epsilon$. Thus for example, IEEE single format numbers are accurate to whitin a factor of ...
2
votes
1answer
56 views

How to improve the precision of this approximation

I have to approximate $\pi$ by using $\pi=\lim_{n\to\infty}z_n$ with $z_2=2, z_{n+1}=2^{n-1/2}\sqrt{1-\sqrt{1-4^{1-n}z_{n}^2}}, n=2,3,...$ How can I improve the accuracy of this approximation when ...
4
votes
1answer
109 views

Bisection method with geometric mean

The bisection method is a well-known method for root-finding. Given a continuous function $f$ and an interval $[a,b]$ where $f(a)$ and $f(b)$ have opposite signs, a root can be guaranteed to be in $(a,...
-2
votes
1answer
26 views

A question from floating point number representation.

The numbers in a floating-point system are defined by a base B, a mantissa length t, and an exponent range [L, U]. A nonzero floating-point number x has the form x = +/-(o.b1b2.....bt)B^e ---1 then ...
0
votes
1answer
100 views

machine epsilon value for IEEE double precision standard alternative proof using relative error

From the textbook, I know that the machine epsilon number for IEEE double precision standard $F(\beta=2, t = 53, L = -1022, U = 1023)$ is: $$ \epsilon_{M} = 2 \mu $$ where $\mu$ is the unit round-off ...
0
votes
0answers
44 views

What numbers can fractional binary notation represent?

In Computer Systems: a Programmer's Perspective: Consider a notation of the form $b_m b_{m - 1} \dots b_1 b_0 . b_{-1} b_{-2} \dots b_{-n + 1} b_{- n}$, where each binary digit, or bit, $b_i$ ranges ...
0
votes
1answer
29 views

With what exponent rules does $-(2^{-55} + .4\times2^{-56})+(2^{-54})$ become $.1\times2^{-52}$?

I have a math class focusing on numerical analysis so I'm working with very small numbers. My professor has set $0.4 − 2^{−55} − 0.4×2^{−56} + 2^{−54} = 0.4 + 0.1×2^{-52}$ but shown no steps in ...
0
votes
1answer
31 views

Converting decimal number to a floating point system

I am trying to convert $1.5\times10^{8}$ to a normalized floating point system defined as $0.d_1d_2d_3...d_t\times B^c$ for $t=20, B=2$ I don't know how I can change my base 10 to a base 2 without ...
0
votes
0answers
57 views

Accuracy in rounding

I want to see if the following two rounding statements are true or false. If it is true, I want to prove it, and if it is false, I want to give a counterexample. I assume no overflow occurs in the ...
1
vote
0answers
31 views

A different type of IEEE single format

To practice with different kinds of IEEE single format types, I am trying a format where the width of the exponent field is $4$ instead of $8$ and the width of the fraction field is $4$ instead of $23$...
5
votes
1answer
164 views

Why computing $\sin(x)$ is not backward stable?

It is said in Trefethen's Numerical Linear Algebra that computing $\sin(x)$ shall not be expected to be backward stable, because "the function has derivative equal to zero at certain points",...
4
votes
0answers
116 views

mean of two floating point numbers: why $a+\frac{b-a}{2}$ is better than $\frac{a+b}{2}$?

$a$ and $b$ are the floating point representation of two real numbers with no constraints (they can be both negative or both positive or one positive and the other negative and so on). I read in the ...
-1
votes
2answers
37 views

least integer not represented in floating point system

Given a floating point system defined as: $F = \{x = (\frac{m}{\beta^t})\beta^e = m\beta^{e-t}\}$, where $m$ is an integer $m \in [1, \beta^t]$, $e$ is an arbitrary integer, and $\beta$ is an integer $...
1
vote
1answer
38 views

Floating Point Arithmetics

I have been experimenting with understanding floating-point arithmetic. I have a 64-bit processor. I have asked Matlab to use format longe, which should display a floating-point with doubt precision. ...
0
votes
0answers
25 views

Floating point number in IEEE Standard

I consider the significand of a floating point number with 23 bits. Therefore the highest reachable number is $0.11111111...111= (1-2^{-23})$ In IEEE standard the most significand bit is always 1. ...
1
vote
0answers
15 views

Floating Point Rounding of 2 multiplied single precision numbers

I have built a floating point multiplier in Logisim (digital design tool) for only single precision normal inputs. I have realised 2 different round to even rounding algorithms and I am not sure which ...
1
vote
1answer
36 views

How to subtract IEEE754 floating point?

I have two numbers represented in floating point: $A: 10101001001110000000000000000000$ $B: 01000011011000000000000000000000$ For $A$ I know $e=82$ and for $B$, $e=134$ ($e$=exponent), but I don't ...
0
votes
0answers
21 views

Can stability of computation of best least squares polynomial 1d approximation depend on x scale/shift?

I am using a least square polynomial approximation to find smooth curves approximating data coming from image analysis. More specifically I've blobs of pixels that I know are a reasonably smooth ...
0
votes
0answers
38 views

What is the $2-norm$ relative Condition Number of $f$ with respect to pertubations of x. If $f(x)=||x||_2^2$ for $ x \in \mathbb{R} $,

if $f(x)=||x||_2^2$ for $ x \in \mathbb{R} $, What is the $2-norm$ relative condition number of $f$ with respect to pertubations of x? What I have tried: I have tried the following formula from ...
0
votes
0answers
63 views

Square root backwards stable

I want to show that taking the square root of a real number is backwards stable in the sense that for any $x \in \mathbb{R}$ there exists a $\tilde{x} \in \mathbb{R}$ s.t. $$\frac{\vert x - \tilde{x} \...
0
votes
1answer
44 views

Computing number of significant digits

Consider the problem of computing the volume of a hollow sphere via the formula $$ V(w) = \frac{4}{3} \pi ((r + w)^3 - r^3)$$ where $r > 0$ is the (inner) radius of the sphere and $w \geq 0$ is the ...
1
vote
1answer
92 views

How many digits of of accuracy do I expect the have the solution $x$ of $||Ax-b||=0$

A least-square problem $||Ax-b||=0$ is solved using a backward stable algorithm (In my case, QR decomposition using householder projectors). The condition number is $\kappa(A)=10^5$. If the problem is ...
0
votes
0answers
21 views

Getting the right precision of an inverse fraction

This may be a trivial question, but I can't seem to wrap my head around how to achieve this. I have an integer optimization problem, where I want to minimize a ratio. For the sake of exposition, let's ...
1
vote
0answers
27 views

Simulations and floating point error?

Dear math stack exchange, I'm curious about what would floating point error would look as i've been hoping to conduct some simulations of gravitational phenomenon. Is it highly random or somewhat ...
0
votes
0answers
28 views

Unique single value for a 3D point

I have 3D points like this: Vertex { X float , Y float , Z float } Is there any single value of type float or ...
0
votes
1answer
60 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
65 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 ...
0
votes
1answer
50 views

Why do we need numerical method of differentiation?

This link shows that we can calculate the derivative of a function using the following formula: ...
1
vote
1answer
92 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
27 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
35 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
106 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
2answers
51 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
62 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
20 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
79 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
46 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
60 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
557 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
41 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
37 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
26 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
2 3 4 5
8