A method of representing numbers by a fixed number of significant digits, and the exponent of some base number. They are characterized in the form ${(significant digits)}*base^{exponent}$. Typically, numbers are represented with respect to base = 2 (binary).

learn more… | top users | synonyms

2
votes
1answer
56 views

What are the tradeoffs of using statically allocated arrays vs. pointers and dynamic allocation? [on hold]

I am learning Monte Carlo simulation by C++. I begin with reading codes (from the internet and text books) of the 2D Ising model and the XY model. I find some people define spins simply by a two ...
5
votes
1answer
69 views

Additional cost associated with quad (or higher) precision

In going from double precision to quad (or higher) precision, roughly how much of a performance hit is taken on various architectures and frameworks. Do floating point operations take twice as much ...
2
votes
1answer
67 views

On the cardinality of the set of numbers representable by a floating point system

I am new to numerical methods and I cannot think of a way to start solving the following problem. I know the mantissa, base and the boundaries are related when defining a number but I cannot really ...
3
votes
2answers
83 views

Difference between rounding modes in computational science?

Are there any instances of scientific numerical problems where the choice of rounding mode matters? There are usually a number of different rounding modes available: to $0$, away from $0$, to ...
6
votes
1answer
171 views

Why should I renormalize physical variables?

I am working with legacy physical codes and I develop new ones based on the output of them. They all use their own internal normalization of variables (for example all distances are divided by the ...
11
votes
1answer
835 views

How to avoid catastrophic cancellation in python function?

I am having trouble implementing a function numerically. It suffers from the fact that at large input values the result is a very large number times a very small number. I am not sure if catastrophic ...
0
votes
0answers
93 views

What is the smallest positive integer that is not exactly representable as a floating point number in this system?

I have difficulties answering Exercise 3.10 from the book Overton M. Numerical computing with IEEE floating point arithmetic, 2nd edition. What is the smallest positive integer that is not exactly ...
0
votes
0answers
17 views

Compute hypergeometric function ratio: $\frac{_{2}F_{1}(a+1,b;c;x)}{_{2}F_{1}(a,b;c;x)}$, for large positive $a,b,c$? [duplicate]

I need a numerically stable way to compute the following ratio: $$\frac{_{2}F_{1}(a+1,b;c;x)}{_{2}F_{1}(a,b;c;x)}$$ All the parameters are real positive numbers, with $0 < a,b,c$ and $0 < x ...
2
votes
2answers
95 views

Choosing epsilons

Most numerical algorithms require an epsilon to be chosen in order to be robust and provide meaningful results. Choosing machine epsilon is usually too aggressive. Barring any special knowledge ...
3
votes
1answer
96 views

Compute hypergeometric function ratio: $\frac{_{2}F_{1}(a+1,b;c;x)}{_{2}F_{1}(a,b;c;x)}$?

I need a numerically stable way to compute the following ratio: $$\frac{_{2}F_{1}(a+1,b;c;x)}{_{2}F_{1}(a,b;c;x)}$$ All the parameters are real numbers, with $a< 0$,$\ $ $b,c > 0$ and ...
3
votes
0answers
35 views

What disables Gradual Overflow?

After studying the process of Gradual Underflow, I'm left a little curious as to why machines don't implement Gradual Overflow; where numbers exceeding the overflow level would be stored as ...
0
votes
1answer
98 views

Overcoming floating point issues when Inverse does not exist but determinant provides nonzero result

I have an expression (let's say determinant of matrix A) expressed in symbolic form in terms of 2 decision variables x1, x2 and 2 parameters q1 and q2. I'm minimizing this using fmincon for different ...
5
votes
1answer
72 views

Accurate Polynomial Evaluation in Floating Point

What are the most accurate algorithms for evaluating a polynomial using floating point arithmetic? The internet seems to suggest that Horner's method is commonly used. In particular I have a cubic ...
6
votes
3answers
916 views

How to determine the amount of FLOPs my computer is capable of

I would like to determine the theoretical number of FLOPs (Floating Point Operations) that my computer can do. Can someone please help me with this. (I would like to compare my computer to some ...
12
votes
8answers
2k views

Which algorithm is more accurate for computing the sum of a sorted array of numbers?

Given is an increasing finite sequence of positive numbers $z_{1} ,z_{2},.....z_{n}$. Which of the following two algorithms is better for computing the sum of the numbers? ...
2
votes
2answers
77 views

Re-scaling array of floats so that all items are approximately integer

I have an array of floating point values $F$. I want to input my array into an algorithm that only takes integer values. How can I efficiently determine the smallest multiplier $m$ such that all ...
5
votes
3answers
154 views

Machine epsilon does not limit relative rounding error for denormals. Is this a problem?

As we know, machine epsilon limits relative rounding error in the range of normalized floating point numbers. But it is easy to check that this is not true for denormalized numbers. My question is ...
2
votes
1answer
686 views

range of positive mantissa in given floating-point number representation

I am a student and I came to this question while solving problems regarding the float-points. ...
3
votes
1answer
2k views

Machine epsilon (eps)

The wiki for machine epsilon says: "Machine epsilon gives an upper bound on the relative error due to rounding in floating point arithmetic" If machine epsilon is the upper bound on the relative ...
1
vote
2answers
401 views

How to handle floating point operations in HLSL?

I'm trying to write a perona malik anisotropic diffusion filter for the GPU. I'm basing my shader off a matlab implementation of the filter. I'm running into trouble because of what I suspect is ...
13
votes
4answers
3k views

Do currently available GPUs support double precision floating point arithmetic?

I have run the molecular dynamics (MD) code GROMACS on a Ubuntu Linux cluster consisting of nodes containing 24 Intel Xeon CPUs. My particular point of interest turns out to be somewhat sensitive to ...
7
votes
4answers
279 views

Relevance of fixed-point and arbitrary precision computations

I see very few non-floating point computing libraries/packages around. Given the various inaccuracies of floating point representation, the question arises why there aren't at least some fields where ...
5
votes
1answer
213 views

cancellation problem in float-point numbers

In http://en.wikipedia.org/wiki/Floating_point#Addition_and_subtraction, it gives an example about cancellation problem in float-point numbers, see I don't understand why it is written : ...
10
votes
1answer
189 views

Are there Improved ways of computing $p \log(p)$?

Most math libraries have a number of versions of logarithm functions. Most of the time we assume them to be perfect, but actually quite a lot of them just offer a certain number of digits of ...
3
votes
2answers
460 views

Need for quad precision in scientific computing?

Even if quad precision is not directly supported by most CPUs, many Compilers (GNU, Intel) support them. Also some software packages allow to compile with quad precision, e.g. PETSc. But is there ...
4
votes
2answers
131 views

Krylov subspace iterative methods in floating point arithmetic

Is there any work that considers Krylov subspace iterative methods in floating point arithmetic? I'm especially interested in how rounding errors influence the convergence and the accuracy of the ...
11
votes
1answer
187 views

Catastrophic cancellation in logsum

I'm trying to implement the following function in double-precision floating point with low relative error: $$\mathrm{logsum}(x,y) = \log(\exp(x) + \exp(y))$$ This is used extensively in statistical ...
10
votes
3answers
320 views

Relative comparison of floating point numbers

I have a numerical function f(x, y) returning a double floating point number that implements some formula and I want to check that it is correct against analytic ...
6
votes
2answers
275 views

transitive floating point comparison with (absolute) tolerance

I want to compare two floating point numbers for equality relative to a known absolute tolerance. However, this is inside an algorithm I wrote quite some time ago, and I believe the logic of that ...
13
votes
4answers
317 views

In floating point arithmetic, why does numerical imprecision result from adding a small term to a difference of large terms?

I have been reading the book Computer Simulation of Liquids by Allen and Tildesley. Starting on page 71, the authors discuss the various algorithms that are used to integrate Newton's equations of ...
7
votes
5answers
316 views

What algorithm for solving a set of stiff ODEs would be easiest to port to high precision floating point arithmetic?

I want to solve a relatively small system of stiff ODEs (< 10 first-order equations) using high precision floating point arithmetic (using MPFR or alike). What would be the easiest algorithm to ...
16
votes
3answers
2k views

How to add large exponential terms reliably without overflow errors?

A very common problem in Markov Chain Monte Carlo involves computing probabilities that are sum of large exponential terms, $ e^{a_1} + e^{a_2} + ... $ where the components of $a$ can range from ...
7
votes
1answer
329 views

What's the right way to compare vectors in floating-point?

I know that I should use a tolerance for comparing floating point numbers. But for comparing vectors, I can think of 3 possible solutions corresponding to different distance metrics: Compare the ...
15
votes
5answers
579 views

Analyzing Numerical Error in C++ Function

Suppose that I have a function that takes as input several floating-point values (single or double), does some computation, and produces output floating-point values (also single or double). I am ...
10
votes
4answers
2k views

FLOP counting for library functions

When evaluating the number of FLOPs in a simple function, one can often just go down the expression tallying basic arithmetic operators. However, in the case of mathematical statements involving even ...
5
votes
2answers
4k views

How to set double precision values in Fortran

Recently, I've encountered a bizarre problem with FORTRAN95. I initialized variables X and Y as follows: X=1.0 Y=0.1 Later I add them together and print the ...
2
votes
2answers
303 views

Is there a Moore's law for floating-point precision, and what would it imply?

Moore's law states that the number of transistors on an integrated circuit grow exponentially, roughly doubling at a period of 20 months. This affects the amount of memory available and the speed of ...
19
votes
5answers
522 views

Is there software that can autogenerate numerically-accurate floating point C routines from symbolic formulae?

Given a real function of real variables, is there software available that can automatically generate numerically-accurate code to calculate the function over all inputs on a machine equipped with IEEE ...
3
votes
2answers
166 views

Looking for a mathematical proof of stability in floating point arithmetic of CG - any reference?

I am looking for a reference - paper, book, discussion, anything that has a mathematical proof for stability of the conjugate gradient method in floating point arithmetic. Something similar for ...
5
votes
3answers
325 views

Does there exist an arbitrary-precision convex optimization solver?

I have a relatively simple convex optimization problem that involves less than 100 variables but contains a terribly ill-conditioned matrix. I have tried CVX and CPLEX; even though both can typically ...