All Questions
Tagged with floating-point approximation
16
questions
4
votes
2
answers
110
views
pow and its relative error
Investigating the floating-point implementation of the $\operatorname{pow}(x,b)=x^b$ with $x,b\in\Bbb R$ in some library implementations, I found that some pow ...
3
votes
0
answers
152
views
Justification for the definition of relative error, why is it not a metric?
The absolute error and relative error operators are very commonly encountered while reading about topics from the fields of floating-point arithmetics or approximation theory.
Absolute error is
${ae(a,...
0
votes
0
answers
40
views
How are results guaranteed in algorithms that include intermediate approximation?
Let me elucidate this vague question with an example. Consider for example the following Gauss sum of roots of unity
$N=(e^{2\pi i/5} + e^{2\pi i/4} e^{4\pi i/5} + e^{4\pi i/4} e^{8\pi i/5} + e^{6\pi ...
0
votes
1
answer
632
views
What is the meaning of $1$ in a relative error?
If we measure a length and is measured as $12.5$ meters long, accurate to $0.1$ of a meter this means the absolute error is $0.05$m.
The relative error is: $\frac{0.05}{12.5} = 0.004$. This means that ...
2
votes
2
answers
2k
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
2
answers
76
views
Easy example of $Ax =b$ floating point arithmetic.
Solve $Ax =b$ with two-digit floating-point arithmetic.
We have $$ A=
\begin{pmatrix}
1 & 1\\
1 & 0,99\\
\end{pmatrix}
$$ and
$$ b =
\begin{pmatrix}
-1 \\
1 \\
\...
3
votes
1
answer
365
views
Double-precision algorithm for inverse log gamma or log factorial?
Question in a nutshell:
Can anyone point me to an algorithm for computing to double-precision floating-point (roughly 16 digits) the inverse of either log gamma or log factorial?
In other words, if y =...
4
votes
2
answers
613
views
How to convert $\ln x - \ln y$ into a more accurate floating point representation?
I have an equation $\ln(x) - \ln(y)$ where x and y are very close to eachother. For example if $x = 5.1234$ then something like $fl(\ln(5.1234)) = 1.6338$ (with 4 significant digits). If $y = 5.1233$ ...
2
votes
1
answer
1k
views
How to approximate relative error further?
Background and original problem:
I want to minimize the difference (error) of a numerical derivative approximation of a function and its true derivative.
Let $f(x) = \sin(x) $ be the anti-derivative ...
1
vote
0
answers
92
views
If $0.2349$ is approximated to $0.2299$, what is number of significant figures in such approximation?
If $0.2349$ is approximated to $0.2299$, what is number of significant figures in such approximation?
Let $x_T=0.2349$, $x_A=0.2299$, then absolute error = $|x_T-x_A|=0.0050=\frac{1}{2}\times 10^{-2}=...
2
votes
0
answers
190
views
How are Floating Point approximations done by integer operations? (Source Wikipedia)
Please help me understand the mathematics involved in Wikipedia page of Floating point, section of Piecewise Linear approximation to exponential and logarithm. Following is the link
Piecewise linear ...
1
vote
1
answer
268
views
error bound in function approximation algorithm
Suppose we have the set of floating point number with "m" bit mantissa and "e" bits for exponent. Suppose more over we want to approximate a function "f".
From the theory we know that usually a "...
4
votes
0
answers
251
views
Can trigonometric functions for double precision be implemented in terms of those for single precision?
In some program environments like GLSL there is support for single and double precision numbers for arithmetic and square roots computation, but only single precision trigonometric functions are ...
0
votes
1
answer
65
views
approximation using floating point arithmetic
Let $x=2.14366$ and $y=2.14363$ and $d=x-y.$ If $d*$ is the value of d computed using $5-$digit decimal floating point arithmetic, find the relative error.
For this question I know how to calculate ...
5
votes
4
answers
4k
views
How to extract fraction from a floating point number
I'm making some tests with float type (floating point number) with programming and in some of my tests I need to extract the fraction that originates the float value.
Let $ x $ be a floating point ...