Questions tagged [numerical-analysis]
The numerical-analysis tag has no usage guidance.
93
questions
1
vote
1
answer
88
views
Computing an initial ellipsoid for solving a convex program
Suppose we want to find a vector $x\in R^n$ that satisfies the constraints $g_i(x)\leq 0$, for $i\in 1,\ldots, m$, where all $g_i$ are convex functions. The functions can be given by an oracle access: ...
0
votes
0
answers
10
views
Clustering data to recover individual functions of a lower-hemicontinuous correspondence/bifurcation diagram
I have a data (from simulations) that is coming from something similar to a bifurcation diagram: it is a lower hemicontinuous correspondence (actually limit points of each branch is included), or in ...
0
votes
0
answers
13
views
Help with Boundary Integral Equation Method with laplace equation (Given NURBS curve)
I am trying to use a boundary integral equation method to solve for laplace equation given the control points of a NURBS curve. But my BIEM is giving me very large error for numerical functions.
I ...
2
votes
0
answers
50
views
Best way to constrain a complex number to being within the unit circle?
What is the best way of implementing the following function,
$$f(x) = \frac{x}{\max(1, |x|)},$$
where $x$ is complex, using a Cartesian representation of $x$ with IEEE 754 floating point ...
1
vote
1
answer
86
views
Algorithm to calculate lower incomplete gamma function
I'm trying to understand the implementation of the algoritm here. Please see GammaLowerRegularized(a, x) function.
I understand 1st part of the function for ...
1
vote
1
answer
86
views
What does it mean unambiguously that a number is value 0 up to numerical precision?
I was reading that a quantity $x$ is $0$ upt to numerical precision. What does this statement formally mean -- especially in the context of numerical methods or real computers.
I looked up in google ...
0
votes
2
answers
69
views
(Numerical Analysis) What is the largest double float represented for the gamma function and $n!$
Consider that
\begin{align}
\Gamma(n+1) = n!
\end{align}
for any integers. I then got the following two questions:
What is the largest value of $n$ for which $Γ(n+1)$ and $n!$ can be exactly ...
4
votes
2
answers
131
views
Precise algorithm for finding higher order derivatives
I'm trying to make an algorithm that finds the first 10 or so terms of a function's Taylor series, which requires finding the nth derivative of the function for the nth term. It's easy to implement ...
1
vote
0
answers
58
views
Finding points of local maximum error in Remez algorithm
So the Remez algorithm is an algorithm for finding optimal polynomial approximations or at the very least for converging towards them. To find an approximation of $f$ by an $N$th degree polynomial the ...
2
votes
1
answer
167
views
Why aren't Grobner bases more common?
I have only heard of / seen Grobner bases in passing, but my understanding is that they are much like vector bases but for polynomials instead of linear systems. I know polynomials are used in CAD and ...
1
vote
1
answer
422
views
What is the machine epsilon and number of mantissa bits for TI-83?
I am trying to determine how many bits the TI-83 Plus uses to store floating point numbers. I am using the algorithm for approximating the machine epsilon given in "Numerical Mathematics and ...
1
vote
3
answers
142
views
How to determine the set of real numbers corresponding to a given floating point number?
Let's say we consider IEEE 754 double precision floating-point numbers, and we use RNTE - Round To Nearest, Ties to Even - rounding.
I know that the RNTE rounding works this way:
given two consecutive ...
2
votes
1
answer
7k
views
How to represent zero as floating point number?
For the floating-point number, we have the form
$\pm d_0.d_1d_2···d_{P-1}\times\beta^E$
$\pm$ --------------------------- sign
$d_0.d_1d_2···d_{p-1}$ --------- significant
$\beta$ --------------------...
3
votes
2
answers
142
views
How can I compute logarithm when comparison is undecidable?
In Haskell, I have the following datatypes that encodes arbitrary real numbers and arbitrary complex numbers, respectively:
...
1
vote
1
answer
92
views
Cancellation in C++
I am trying to figure out what the problem with the following expression in C++ is:
y=std::log(std::cosh(x));
My first intention was that there might occure a ...
1
vote
1
answer
184
views
$fl(x)=x(1+\delta)$
The floating point representation of a real number $x$ in a machine is given by $fl(x)=x(1+\delta),\: |\delta| = \frac{|x^*-x|}{|x|} \le \epsilon$.
But I do not find this equation very insightful. ...
2
votes
2
answers
77
views
Validity of Algorithm for Testing Two Floating Point Numbers
This question is related to the epsilon- (or delta- if you prefer) test for floating point equality. But my question is not how to do it. Instead I have a related algorithm for testing equality, and I ...
5
votes
5
answers
471
views
fast and stable x * tanh(log1pexp(x)) computation
$$f(x) = x \tanh(\log(1 + e^x))$$
The function (mish activation) can be easily implemented using a stable log1pexp without any significant loss of precision. Unfortunately, this is computationally ...
0
votes
3
answers
174
views
Numerical Approximation in Java
I am trying to solve an equation which I believe cannot be done analytically, but can use a numerical approximation to get a result. The equation is:
$$\frac{2*\sqrt{\pi}*h*s*e^{m^{2}/(2*s^2)}}{\sqrt{...
1
vote
1
answer
188
views
Is the exponent bias $2^{n-1}-1$ or $2^{n-1}$
I'm a bit confused with the exponent bias. The sources I found online claim that it is either $2^{n-1}-1$ or $2^{n-1}$, $n$ is the number of bits used for the exponent. In my book when given examples ...
0
votes
0
answers
46
views
Normalizing the Central Difference Method
How could I normalize the 2nd order central difference method?
The original function is F(A,B,C,D) and only one variable is varied at a time. ie
$F'' = \frac{F(A+\Delta A,B,C,D) - 2\times F(A,B,C,D) +...
3
votes
1
answer
751
views
Robust two lines/segments intersection point in 2D
Given two line segments the problem is to find an intersection point of corresponding lines (assuming that they are not parallel or coincide).
There is a Wikipedia article which gives us exact ...
0
votes
0
answers
54
views
How to solve the following problem by using Gaussian elimination with partial pivoting (A=PLU)?
****The Question is here***** (in the link)
Given a nonsingular matrix A $\in$ $R^*(nxn)$, how would you solve the following problems efficiently using Gaussian elimination with partial pivoting (the ...
1
vote
0
answers
21
views
Are there practical usage of determinants in numerical simulation?
I know the historical importance of the link between linear systems and determinants. I also know that determinants have a beautiful connection with non-singular matrices, i.e., if a matrix is non-...
2
votes
1
answer
330
views
Numerical issues in solving linear systems
There was an exam in the class. The course is "High Performance Scientific Computing". One of the question in the exam is as follows:
Consider the linear system
$$ \begin{bmatrix} a & b ...
0
votes
1
answer
74
views
Computing an Expression
I am writing code to evaluate the following expression:
$$ \frac{(a+b+c)!}{a! b! c!} $$
where $a$, $b$ and $c$ are on the range of $10$ to $500$. The result is going
to be a floating point number. ...
5
votes
4
answers
775
views
Is order of matrix multiplication affecting numerical accuracy of the result?
I have to multiply three matrices of floats: A (100x8000), B (8000x27) and C (27x1).
Is ...
3
votes
2
answers
133
views
How much can we trust mathematical software when working with large numbers, and how much memory it needs to work with these numbers?
For example, I want to evaluate the expression:
$3^{3^{{3}^{3}}}$
so I used wolframalpha.com (it's free, and I don't own any software), which returned the scientific notation of the number above, ...
3
votes
1
answer
475
views
numerically stable log1pexp calculation
What are good approximations for computing log1pexp for single precision and double precision floating point numbers?
Note: ...
3
votes
0
answers
395
views
Stable and fast computation of the squared euclidean distance matrix
Let's say I want to compute the matrix $M$ of the squared euclidean distances between each pair of vectors $(x, y)$ belonging to two sets $X$ and $Y$ respectively. The sets of vectors $X$ and $Y$ have ...
4
votes
2
answers
613
views
Proof that (x-y)(x+y) is more accurate than x²-y²
I was carrying on my reading of What Every Computer Scientist Should Know About Floating-Point Arithmetic but got stuck on the proof of Theorem 2 (page 34).
At some point it says:
\begin{align}
(x \...
3
votes
1
answer
120
views
Proof that a guard digit bound the error of subtraction
I was reading What Every Computer Scientist Should Know About Floating-Point Arithmetic, which is extremely interesting. But I have some troubles understanding the proof of Theorem 9 (page 33).
First ...
3
votes
1
answer
58
views
Rigorous error bounds for eigenvalue solvers
I computed the first four eigenvalues of a quite large ($2^{24}\times 2^{24}$) but very sparse matrix. I used pythons in-build function sparse.linalg.eigsh to compute them.
I need a validation that ...
0
votes
0
answers
36
views
Application of iterative algorithm $(\theta_n,w_n)$ converging to $\{(\theta,\theta):\theta \in \Bbb R\}$
I have a iterative algorithm $(\theta_n,w_n)$ which I am showing converges to $\{(\theta,\theta):\theta \in \Bbb R\}$.
The iterative algorithm is of the form :
$\theta_{n+1} = \theta_n + a(n)[h(\...
0
votes
2
answers
2k
views
How to test for overflow when multiplying floats
I am trying to implement a 3-term recurrence relation:
$$
p_{n+1} = ap_n + bp_{n-1}
$$
This can be implemented as
...
1
vote
1
answer
86
views
Why do I get different results from two calculation methods?
I am wondering what the reason for the following is
We know that ,
exponential has a taylor representation :
$$exp(x)=1+x+\frac{x^{2}}{2!}+\frac{x^{3}}{3!}+...$$
Using the first n terms , in R , ...
1
vote
1
answer
110
views
Real RAM computational mode
Given a real value $M>0$, I want to compute the greatest value of $\epsilon$ strictly smaller than $M$. Given the assumption that the computational model is Real-RAM, how to find a real number ...
1
vote
0
answers
49
views
Accuracy and performance between a division and subtraction for a ratio in decibels
For comparing two images, one can use the Peak Signal-to-Noise Ratio (PSNR) metric, defined as follows:
$\mathrm{PSNR} = 10 \cdot \log_{10}\left(\frac{\mathrm{MAX}^2}{\mathrm{MSE}}\right) = 20 \cdot \...
2
votes
1
answer
58
views
Avoiding overflow in computing the ratio of two large numbers
Is there a trick for computing the expression
$x + (exp(x)-x)/(exp(2*x) + 1)$ while avoiding an overflow?
Currently, computation seems to fail for any $x \geq 710$, presumably because computing $exp(...
1
vote
0
answers
75
views
Sparse Matrix inversion without actual inversion
I want to know what are the efficient way to invert a Sparse Matrix? Are there any algorithm,linear algebra or expansions that make this task easier with out actually inverting the matrix?
Thank you ...
5
votes
2
answers
515
views
Big O notation: removing big O from denominator
In A First Course in the Numerical Analysis of Differential Equations (page 26) Arieh Iserles gives the following derivation:
\begin{equation}
\frac{\rho(w)}{\ln(w)}=\frac{\xi+\xi^2}{\xi-\frac{1}{2}\...
1
vote
0
answers
27
views
Construct unitary $Q$ such that $span\{q_1,q_2\} = span\{v_1,v_2\}$ where $v_1,v_2 \in \mathbb{R}^n$ are given as input
Assume also that $v_1,v_2$ are linearly independent, and $q_i \in \mathbb{R}^n$ denotes the $i$-th column of $Q$. This is what I've got so far. First obtain unit vectors $w_1,w_2$ which are orthogonal ...
3
votes
1
answer
344
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
2
answers
137
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
0
answers
50
views
Computational cost of using dictionary in floating point opertations
I would like to know the computational cost of using/accessing a dictionary.
This should depend on the length of the dictionary. Say a dictionary $D$ has $n$ elements.
What would be the cost of ...
0
votes
0
answers
94
views
Naviers Stokes equation and machine learning
I am looking for a reference explaining how to solve Navier-Stokes numerically using Machine learning algorithms .
Thank you in advance for your help .
1
vote
1
answer
56
views
What is a logical approach to developing an algorithm which can find the optimal parameters for a function which make it best fit a given data set?
Consider the highlighted columns in the following table:
Starting with 100,000 newborns, $l_{x+2}$ denotes the number of individuals in the sample still alive at age $x+2$. If we consider Makeham's ...
6
votes
1
answer
944
views
Reception of numerical infinities
A group of computer scientists associated with numerical analyst Yaroslav Sergeyev have published numerous publications recently on a scheme proposed by Sergeyev that uses terms like Infinity Computer,...
0
votes
0
answers
22
views
Numerical analysis - f(x) = f(y)
I am writing a function that can be split into cases
(1)$f(x) \leq f(y)$ and $f(x) \geq f(y)$
or into cases
(2)$f(x) < f(y), f(x) = f(y), f(x) > f(y)$
If I have f(x) = f(y), it is ...
1
vote
1
answer
100
views
Machine error in computer arithmetic
I'm wondering if if is possible to have a function $f$ such that there exists $x,y$ such that we have $f_t(x) > f_t(y)$ where $f_t$ denotes the true value of $f$ and $f_a(x)<f_a(y)$ where $f_a$ ...