1
vote
1answer
56 views

Computing a solution of the Laplace-Eigenvalueproblem with Neumann-b.c.

Good day! I was considering the Laplace-Eigenvalueproblem with Neumann b.c., i.e. find $u \in H^1(\Omega) \setminus \{0\}$ and $\lambda \in \mathbb{R}$, such that: \begin{eqnarray} -\Delta u \ ...
0
votes
0answers
19 views
10
votes
1answer
293 views

Fast inverse square root trick

I found what appears to be an intriguing method for calculating $$\frac{1}{\sqrt x}$$ extremely fast on this website, with more explanation here. However, the computer-science lingo and ...
0
votes
1answer
72 views

Floating Point Number System

I really have no idea of how to do these questions - in fact I have no idea of how to do any question in the paper - but I have tried to figure out what's going on in the course called Computational ...
0
votes
0answers
66 views

What is the result of the calculation: $8.375 - 0.375-0.875$?

Given the base $\beta=2$ (binary) and $t=4$ digits to represent the number in computer with hidden bit representation and symmetric rounding, what is the result of the calculation in floating point ...
0
votes
1answer
58 views

$a + b = a$ in machine precision [closed]

I have the following statement: "If $a + b = a$, then $b = 0$" may not true with the floating point operations. Actually, if $|y| ‎< (\varepsilon / B) |x|$, then $fl(x+y) = x$, where ...
1
vote
2answers
41 views

Solving system of linear eqaution in special cases

I have to solve for $Ax=B$. Here the diagonal elements of $A$ are $-1$ and all other elements are $1$. $A$ is $n \times n$ matrix . In this special case can we solve for $x$ quickly? EDIT: quick is ...
5
votes
2answers
922 views

Fast Matlab Code for hypergeometric function $_2F_1$

I am looking for a good numerical algorithm to evaluate the hypergeometric function $_2F_1$ in Matlab (hypergeom in Matlab is very slow). I looked across the ...
2
votes
1answer
98 views

Algorithm analysis

Consider a recursive Mergesort implementation that calls Insertion Sort on sublists smaller than some threshold. If there are n calls to Mergesort, how many calls will there be to Insertion Sort? ...
1
vote
1answer
557 views

How to fit non-linear matlab data?

I'm working on a problem in scientific computing namely fitting data to this equation $c(z) = 4800 + p_1 + p_2 \cdot z/1000 + p_3 \cdot e^{ -p4 \cdot z/1000}$ The data is in a background question ...
1
vote
0answers
140 views

How to Diagonalize an Extremely Large Sparse Matrix in SLEPc/PETSc

Dear Friends, Recently I have started with learning SLEPc/PETSc, but I didn't find a way to solve my problem. I have to solve a big sparse matrix which is a two dimensional quantum ...
0
votes
1answer
128 views

A an nxn matrix. P a permutation matrix that permutes columns of A. How many operations does P*A involve?

Essentially, I am supposed to count how many operations a particular computational algorithm involves, and I've gotten stuck on this one part. My understanding is that for two nxn matrices, matrix ...
0
votes
1answer
29 views

Flop computation clarification

Can someone clarify this for me? Suppose I wanted to use MATLAB to compute a polynomial, i.e., $(x-3)^{5}$. Would this count as 5 subtractions and 4 multiplications, or does the computer only subtract ...
1
vote
1answer
39 views

Specify conditions for $\alpha$ so that the iteration $x_{n+1} = x_n - \alpha f(x_n)$ converges to root of f.

Specify conditions on $\alpha$ so that the iterative process $x_{n+1} = x_n - \alpha f(x_n)$ converges to root of f if started with $x_0$ close to the root. It is suggested that the proof should ...
0
votes
1answer
691 views

Proving the relative error of division.

The problem says to show that the relative error for division on a computer is $$Rel(\frac{x_{A}}{y_{A}})=\frac{Rel(x_{A})-Rel(y_{A})}{1-Rel(y_{A})}$$ $$\approx Rel(x_{A})-Rel(y_{A})$$ provided ...
0
votes
1answer
244 views

machine numbers in IEEE single precision

Is the following numbers machines numbers on the IEEE single precision system? $10^{304}$ $2^4+2^{27}.$ What do I have to do to know whether they are machine numbers on IEEE single precision?
1
vote
1answer
132 views

Floating point arithmetic

How can I prove that : a real number has a finite representation in the binary system if and only if it is of the form $$\pm \frac{m}{2^n}$$ where n and m are positive integers.
1
vote
1answer
63 views

Confidence in the first $k$ decimal places of a product after multiplying $N$ irrational numbers together

If I multiply $N$ irrational numbers together to generate a product $P$, where the irrational number are specified to a working precision of $m$ decimal digits, how many decimal digits, $k$, should I ...
5
votes
1answer
258 views

Explain this code to compute $\log(1+x)$

It's well known that you need to take care when writing a function to compute $\log(1+x)$ when $x$ is small. Because of floating point roundoff, $1+x$ may have less precision than $x$, which can ...
2
votes
0answers
86 views

Need little hint to prove a theorem .

I have an iterative method \begin{eqnarray} X_{k+1}=(1+\beta)X_k-\beta X_k A X_k~~~~~~~~~~~~~~~~~ k = 0,1,\ldots \end{eqnarray} with initial approximation $X_0 = \beta A^*$ ($\beta$ is scalar ...
2
votes
1answer
262 views

Properties of shortest addition chains for small numbers (e.g. up to 600)

Up to which values of $n$ do the following properties hold for strictly monotonically increasing, shortest addition chains (sac) $a=a_1,\dots,a_k$ (definitions below)? a) There exists a sac for $n$ ...
0
votes
2answers
187 views

Random and Pseudo-random number generation

I heard that computation results can be very sensitive to choice of random number generator. I wonder whether it is relevant to program own Mersenne-Twister or other pseudo-random routines to get a ...
2
votes
0answers
127 views

1/3+2/3 in double precision

When I add 1/3 and 2/3 in double precision, I ended up with $1.\boxed{111\ldots1}1\times2^{-1}$, where the boxed part is the 52-bit mantissa. By the rounding to even rule, I should round it up, right? ...
1
vote
1answer
841 views

How many numbers are in a floating point number system, given these 4 parameters.

I'm trying to make floating point number systems a bit more intuitive for myself. There are a few things I am confused about, and I think the best way to clear up my confusions would be for someone to ...
8
votes
3answers
3k views

fast algorithm for solving system of linear equations

I have a system of linear equations, $Ax=b$, with $N$ equations and $N$ unknowns ($N$ large) If I am interested in the solution for only one of the unknowns, what are the best approaches? for ...
8
votes
1answer
505 views

Incremental calculation of inverse of a matrix

Does there exist a fast way to calculate the inverse of an $N \times N$ matrix, if we know the inverse of the $(N-1) \times (N-1)$ sub-matrix? For example, if $A$ is a $1000 \times 1000$ invertible ...
3
votes
2answers
10k views

Implement a program in Matlab for LU decomposition with pivoting

I need to write a program to solve matrix equations Ax=b where A is an nxn matrix, and b is a vector with n entries using LU decomposition. Unfortunately I'm not allowed to use any prewritten codes in ...
3
votes
2answers
304 views

'(Pseudo)-random functions' by seeding of PRNGs?

I have an application that wants controllable random functions from $\mathbb{Z}^2$ and $\mathbb{Z}^3$ to $2^{32}$ , where by controllable I basically mean seedable by some parameters (say, on the ...