Questions tagged [machine-precision]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
38 views

How to find machine numbers with certain properties?

I would be really glad if somebody could help me with examples or hints. I tried a Brute Force Approach and failed. Let F = F (2, 5, −3, 3) (base, length of mantissa, min exponent, max exponent). (i) ...
  • 11
0 votes
0 answers
6 views

Is there a convention for comparative thresholds?

I want to compare the results obtained from applying two algorithms to the same dataset using a precision threshold of $10^{-8}$. Typically, results within the same dataset will have the same order, ...
  • 629
1 vote
0 answers
32 views

Method for finding the largest positive difference between two pairs of IEEE 754 double precision floating point numbers and fixed-point numbers

I have two pairs of IEEE 754 double precision (64-bit) floating-point numbers and unsigned fixed-point numbers, and I'm trying to find which pair has the greatest difference. The fixed-point numbers ...
1 vote
1 answer
54 views

Machine Precison for Roundoff

Given the machine precision (machine epsilon) whose definition is that it is the smallest $\epsilon_{mach}$ such that 1 + $\epsilon_{mach}$ > 1. I found an explanation online to show that for ...
0 votes
0 answers
55 views

Are there any ways to increase the precision in MATLAB without built in functions?

I am a beginner learning about MATLAB scientific computation, floating point numbers, and numerical error. When I am using a very small $x$ value for some equations, such as $y(x) = (\exp(x)-1-x)/x^2$,...
  • 31
1 vote
5 answers
114 views

How can we calculate $\ln(x) - 1$ at $x \approx e$ using standard double precision arithmetic?

This question is inspired by the fact that decent mathematical libraries in programming languages compute sine of double precision approximation of $\pi$ correctly to the last bit (example is in Julia)...
  • 3,599
1 vote
0 answers
29 views

Computing log of a number with low precision calculator

Say I have a low-precision calculator that displays numbers with only 8-digits mantissa. For example, 0.00432137378 would read ...
14 votes
1 answer
376 views

Why does this desmos plot of the integral of $\sqrt{1+e^x}$ have these discontinuities?

I computed the integral of $\sqrt{1+e^x}$ by hand and got $$2\sqrt{1+e^x} + \ln\left(\sqrt{1+e^x} - 1\right) - \ln\left(\sqrt{1+e^x} + 1\right) + C,$$ or $$2\sqrt{1+e^x} + \ln\left(\frac{\left(\sqrt{1+...
26 votes
3 answers
1k views

Why do different calculators disagree on $\cos(452175521116192774 )$?

I want to calculate cosine of 452175521116192774 radians (it is around $4.52\cdot10^{17}$) Here is what different calculators say: Wolframalpha Desmos Geogebra Python 3.9 (standard math module) ...
0 votes
0 answers
31 views

Relative error notation

Is anyone familiar with the subscript notation, for instance $0.0233_2$, which is somehow supposed to denote precision or error? I have encountered this in the following paper Phase Diagram of Planar ...
  • 111
8 votes
2 answers
294 views

Reduce precision of fraction

Say I have a reduced fraction where the numerator and denominator can only be integers: $$ \frac{1071283}{28187739} $$ and I want to reduce it more, accepting the lose of precision. I could just ...
  • 191
0 votes
0 answers
45 views

Discrete power series?

I have a pattern. I have a box made of $n\times n\times n$ boxes where n is a power of 2. I flatten this box into an $n^3$ flat sequence of boxes. I then have an $n/2 \times n / 2 \times n/2$ box, ...
  • 2,425
0 votes
0 answers
22 views

Minimum of floating-point numbers

I'm reading the book Numerical Analysis by Gautschi, and in the first chapter the author makes the following assertion: The set of floating-point numbers on a computer is denoted $\mathbb R(t,s)$ such ...
1 vote
1 answer
41 views

Computing nested functions to arbitrary precision

Let's say I want to compute $e^\pi$ to arbitrary precision. I have a function $pi()$ which computes $\pi$ to arbitrary precision and $exp(x)$ which computes $e^x$ to arbitrary precision. Now, how can ...
0 votes
0 answers
66 views

How precise is the result after calculating a/b?

I have two numbers, $a$ and $b$, where the precision of $a$ is $n$ bits and the precision of $b$ is $m$ bits. How many bits of precision are preserved after calculating a/b on a normal computer ...
  • 111
3 votes
0 answers
82 views

Limit of Euler's number failing due to precision errors - A surprising case. Why does it happen?

It is a known fact that floating point precision errors are bound to happen when one forces a computer to deal with very large or very small numbers, especially when both things are done at the same ...
3 votes
1 answer
182 views

Avoiding catastrophic cancellation in $1-\operatorname{sinc}x$

When I try to calculate the function $f(x)=1-\operatorname{sinc}x$ for small values of $x$ I get large relative errors due to catastrophic cancellation. I want an accurate way to calculate $f(x)$ ...
1 vote
0 answers
70 views

Relative error of a number in machine epsilon units

I came across an estimation of the relative error between two representations of the same number, one implemented in C++ and another one via a computer algebra program, that was in units of machine ...
  • 121
1 vote
1 answer
100 views

Help Simplifying Function with Bessel Functions

I'm trying to calculate a function that includes Bessel functions and am running into precision issues, generally due to a small difference between large numbers. The function is $$F=\frac{J_0(K\phi)...
  • 127
1 vote
0 answers
48 views

How to avoid overflows and numerical issues when computing derivatives?

I'm trying to compute the derivative of this quantity w.r.t to $\mu$ and $k$: $$ \mathcal{L}(t) = - \eta_n\log\left(1-P(t)\right) $$ Where $\eta_n$ is just a weighting factor and P(t) is the cdf of ...
0 votes
1 answer
678 views

Roundoff errors and finite difference approximation

Let us consider the centered finite difference approximation of the first derivative of a smooth function $$f'(x_i) = \frac{f(x+h) - f(x-h)}{2h}$$ It's well known that if we do a $\text{loglog}$ plot ...
  • 675
1 vote
1 answer
182 views

Explanation of the precision and the accuracy used by Wolfram Mathematica when performing arithmetic operations on floating point numbers

The numerical value for the precision in mathematica is given out by $MachinePrecision, and this is also the number of relevant digits showed in the output console ...
1 vote
1 answer
92 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....
  • 53
0 votes
1 answer
29 views

Given an analytic function can I derive to what precision I need to evaluate its arguments to get a result of a given precision?

Suppose I have some arbitrary analytic function over the reals e.g.: $$ x \mapsto \frac{\sqrt{\sin(x)+2e^x}}{x^2 - \ln(x^x)} $$ Given some input of arbitrary precision $x$ how can I evaluate such an ...
0 votes
0 answers
26 views

Exponencial mantissa

I try to compute a function of type $e^x$. Since its natural fast-growing behaviour, the most natural behaviour is to decompose the resulting number into its mantissa and exponent components. However, ...
1 vote
1 answer
66 views

Why is this function not being graphed as expected?

I am interested in the Rastrigin function: https://en.wikipedia.org/wiki/Rastrigin_function. I have read that the local minimums of this function occur at integer coordinates. However, when I plug ...
  • 118
0 votes
1 answer
90 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 ...
1 vote
1 answer
1k 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 ...
  • 2,838
1 vote
1 answer
73 views

How to Calculate the Precision Required to Exactly Produce the Repeating Sequence of Digits in the Decimal Expansion of a Fraction

Say I am given a fraction $\frac{p}{q}$ and wish to express it as a decimal such that the repeating sequence of digits is accurately displayed at least once and preferably twice in the printed output. ...
  • 2,563
2 votes
0 answers
32 views

Tough test polynomials for (finite precision) complex root finding methods, especially Aberth's method

Today I have implemented Aberth's method for complex polynomial root finding. And I have to say I am enchanted about its astonishing performance and its intriguing simplicity. Before I go on believing ...
  • 355
1 vote
0 answers
254 views

Floating-point rounding error in numerical differentiation formula

In Numerical Analysis by Timothy Sauer (Pearson, 2nd Edition) it says that $\tilde{f'}(x+h) = f(x+h) + \epsilon_{\text{mach}}$, where $\tilde{f'}(x)$ is the floating-point representation of the given ...
2 votes
0 answers
46 views

Finding the real roots of a univariate polynomial on the interval [0,1]

I have numerous, univariate polynomials with degree in excess of 100 and with very, very large coefficients (Here's an example coefficient ...
  • 267
2 votes
1 answer
103 views

Calculator Confusion using Windows and Androids

I just came across this calculation, it's really confusing. I ran the following calculations in windows and android calculators. $1/98\cdot 98 = 1$ $1/98 = 0.0102040816326531$ $0.0102040816326531 * ...
  • 123
1 vote
0 answers
50 views

computing standard deviation without mean produces illegal result!

I would like to compute STD in one-pass, without first computing the mean: Hence, I decided to use the following [formula][1]: std dev = sqrt [(B - A^2/N)/N] ...
  • 111
0 votes
0 answers
82 views

Rounding in IEEE double precision computer arithmetic

Wanted to check whether I executed this arithmetic expression correctly: $$(1 + (2^{-51} + 2^{-52} + 2^{-53})) − 1$$ My process follows: $1.[00...00]\cdot 2^{0}+0.[0...010]\cdot 2^{0}+0.[0...001]\...
  • 123
0 votes
0 answers
43 views

Bounds on real numbers

Suppose that $\{\epsilon _1 , · · · , \epsilon_m \} $are real numbers that all satisfy $|\epsilon_i | ≤ \eta$. Show that given $C > 1$, we have that $$ \Pi_{j=1}^m(1+\epsilon_j) = 1 + \epsilon$$...
  • 61
2 votes
0 answers
579 views

How to prove the bound for Relative Round Off error

Machine precision is defined as the smallest machine number ε. Anything smaller when added to 1 will be lost at roundoff. Prove that ε is the bound for relative round-off error. ...
0 votes
0 answers
485 views

How to prove fl(x^k) definition

How would I show that fl(x^k)= (x^k)(1 + δ)^(k−1), where |δ| ≤ ,ε if x is a floating-point machine number in a computer that has machine precision . Edit: I was thinking I can use induction to ...
1 vote
0 answers
198 views

Numerical Analysis- Finding two closest machine numbers in single precision.

There is a question that is similar to this that was asked already, but the answer did not really make too much sense to me. Let's say I have a number 4096.000244 and I want to find the two closest ...
  • 33
2 votes
0 answers
525 views

SVD - near-zero singular value

I have difficulties to handle singular values close to zero. My SVD implementation $A = U \Sigma V {}^{T}$ performs first an Eigen decomposition of the matrix $A {}^{T} A$. That is done with the QR-...
2 votes
1 answer
373 views

Intersection of three planes and precision of computing

I have a simple 3D object made of a triangle mesh. Here is a rendering of the mesh. I would like to make a 'coat' which is another mesh over the primary one, where all new faces have equal distance ...
  • 43
4 votes
2 answers
1k views

Numerically find cubic polynomial roots where coefficients widely vary in magnitude

Consider the following polynomial: $$ p(x) = x^3 + (C_b+K_a)x^2 - (C_aK_a + K_w)x - K_aK_w $$ Where: $x, C_a, C_b$ are concentrations, positive real numbers typically within $[10^{-7};1]$. The ...
  • 480
2 votes
1 answer
657 views

Verification: Machine number immediately to right and left of $2^m$

The question I'm given is what are the machine numbers immediately to the right and left of $2^m$? How far is each from $2^m$? I'm given the machine epsilon, $\epsilon$ is $2^{-23}$. (I believe we ...
  • 773
1 vote
0 answers
432 views

Convergence of Newton method and machine precision

I implemented the Newton method to find the non-zero root of $f(x) = 1-bx-e^{-x}$ in Excel and I have tested it for various values of $0<b<1$. However, what I am seeing for some values of $b$ (e....
2 votes
1 answer
7k views

Machine Epsilon meaning

Say we have the floating-point system $(2,3,-1,2)$ and we want to find machine epsilon. According to my textbook, this can be found as $\epsilon_m=\beta^{1-t} = 2^{1-3}=0.25$. However, my textbook ...
  • 265
1 vote
1 answer
256 views

Numerically approximating limit with large numbers, bumping up against machine precision

Consider $\lim_{x\rightarrow\infty}(1+\frac1x)^{x}=e$. Using standard calculus techniques, this limit can be evaluated, however, approximating it directly with numerical code can be difficult ...
  • 5,673
1 vote
1 answer
57 views

When will A+(B+C) != (A+B)+ C, in a finite precision system

A, B, C, have finite precisions with machine epsilon of $10^{-16}$. When will the associative law A + (B+C) = (A+B) + C fail in this finite precision system? I have difficulty to find A, B and C. ...
  • 491
0 votes
0 answers
126 views

Subtracting a diagonal matrix from an ill-conditioned one

I've written Python 3 + NumPy code where I perform the following calculation: $$(B - \lambda I)^{-1}$$ where $B$ is a symmetric negative semidefinite matrix where some elements can be huge (greater ...
2 votes
1 answer
146 views

Why are SDP solvers inherently inaccurate?

It's common to read in textbooks that semidefinite programming solvers are inherently inaccurate. Are the authors referring to the general machine inaccuracy (things like $10^{-16}=0$) or a special ...
  • 881
0 votes
1 answer
47 views

Spreadsheet: Significant figures function [closed]

1 AU is 149597870700 meters. This is much more information than typically needed, so 150 million kilometers would be precise enough in most situations. Does spreadsheets have a function to handle ...
  • 111