Questions tagged [numerical-analysis]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Frameworks for numerically solving this specific form of PDE?

are there some packages in any programming language which make it convenient to solve this specific type of PDE? $f_t + \left(1 + \xi \frac{\kappa_t - a}{T-t}\right) f_a + \frac{\sigma^2}{2} f_{aa} + ...
Johannes's user avatar
2 votes
1 answer
119 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: ...
Erel Segal-Halevi's user avatar
0 votes
0 answers
11 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 ...
lefouflou's user avatar
0 votes
0 answers
14 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 ...
Maoshen Tang's user avatar
2 votes
0 answers
52 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 ...
sircolinton's user avatar
1 vote
1 answer
133 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 ...
Denis's user avatar
  • 131
1 vote
1 answer
118 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 ...
Charlie Parker's user avatar
0 votes
2 answers
76 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 ...
Jens Kramer's user avatar
4 votes
2 answers
186 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 ...
Natrium's user avatar
  • 75
1 vote
0 answers
60 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 ...
Jake's user avatar
  • 3,800
2 votes
1 answer
182 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 ...
user37344's user avatar
  • 125
1 vote
1 answer
532 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 ...
irowe's user avatar
  • 113
1 vote
3 answers
145 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 ...
Fabio Nardelli's user avatar
2 votes
1 answer
9k 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$ --------------------...
user8314628's user avatar
3 votes
2 answers
143 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: ...
Dannyu NDos's user avatar
1 vote
1 answer
103 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 ...
Pepsilon7's user avatar
1 vote
1 answer
279 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. ...
Xenusi's user avatar
  • 124
2 votes
2 answers
89 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 ...
Jack Straub's user avatar
5 votes
5 answers
523 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 ...
Yashas's user avatar
  • 275
0 votes
3 answers
201 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{...
JJJJJJJJJJJJJJJJ's user avatar
1 vote
1 answer
245 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 ...
SlimJim's user avatar
  • 13
0 votes
0 answers
49 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) +...
John Allen's user avatar
3 votes
1 answer
887 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 ...
Azat Ibrakov's user avatar
0 votes
0 answers
58 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 ...
Brad's user avatar
  • 1
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-...
DanielTheRocketMan's user avatar
2 votes
1 answer
340 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 ...
tahasozgen's user avatar
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. ...
Bob's user avatar
  • 359
5 votes
4 answers
853 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 ...
abukaj's user avatar
  • 151
3 votes
2 answers
137 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, ...
Pinteco's user avatar
  • 151
3 votes
1 answer
606 views

numerically stable log1pexp calculation

What are good approximations for computing log1pexp for single precision and double precision floating point numbers? Note: ...
Yashas's user avatar
  • 275
3 votes
0 answers
437 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 ...
Celelibi's user avatar
  • 443
4 votes
2 answers
653 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 \...
Celelibi's user avatar
  • 443
3 votes
1 answer
127 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 ...
Celelibi's user avatar
  • 443
3 votes
1 answer
59 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 ...
BGJ's user avatar
  • 131
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(\...
applied_math's user avatar
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 ...
vibe's user avatar
  • 208
1 vote
1 answer
99 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 , ...
Quality's user avatar
  • 113
1 vote
1 answer
134 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 ...
Armin Mir's user avatar
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 \...
benlaug's user avatar
  • 111
2 votes
1 answer
59 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(...
Pavel's user avatar
  • 123
1 vote
0 answers
76 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 ...
Saswati's user avatar
  • 11
5 votes
2 answers
570 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}\...
Simon Dirckx's user avatar
1 vote
0 answers
28 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 ...
TylerMasthay's user avatar
3 votes
1 answer
392 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: ...
winnie99's user avatar
  • 155
1 vote
2 answers
145 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 ...
Pedro Pereira's user avatar
0 votes
0 answers
55 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 ...
Abby's user avatar
  • 1
0 votes
0 answers
96 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 .
ABRAICH Ayoub's user avatar
1 vote
1 answer
62 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 ...
M Smith's user avatar
  • 467
6 votes
1 answer
979 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,...
Mikhail Katz's user avatar
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 ...
Robert S's user avatar
  • 121