# Questions tagged [machine-precision]

For questions on the use of machine-precision real numbers (also known as floats), the numbers that can be directly manipulated through the underlying numerical capabilities of your computer system.

165 questions
Filter by
Sorted by
Tagged with
102 views

### Performance Tuning - How can I make Mathematica to use less than certain digits number?

I would like to know if there is a way to make Mathematica to use at most certain digit number. For example, Suppose I want to calculate 2*Pi. x=N[Pi] y=2*x ...
70 views

### Getting max precision limit overflow for a very simple calculation

I've never seen this error on such a simple calculation. Does anybody know how to fix this annoying error?
71 views

### Precision-related error in Audio

Bug introduced in 11.3 or earlier CASE:4075745 I have been experimenting with using Audio and associated functions for data acquisition using an external sound ...
132 views

### The algorithm behind InputForm for machine numbers

There are several questions on this site about implementing fast CSV/TSV export for machine numbers without loss of precision. Recently I discovered that Export ...
105 views

116 views

For machine-precision numbers, Mathematica uses a tolerance for comparisons, so that 1.-$MachineEpsilon==1. However, Floor does ... 1answer 109 views ### Showing what happens with a number beyond machineprecision I want to play around a bit in Mathematica to understand how floating-point precision, rounding and truncation actually works. I understand that Machineprecision is$2^{-52}$. First of all I would ... 1answer 424 views ### What is wrong with importing Real32 or Real64? Those who visit the chat might have seen the question of varkor. I'm posting it here in the hope that I have missed something. Assume you have a real number ... 1answer 51 views ### Precision Issue with Log I have the following codes. Naturally, I expect to get zero. I thought it is due to some possible issues stated as "Machine-precision inputs can give numerically wrong answers on branch cuts:". ... 2answers 4k views ### Why does Mathematica results differ from C++ results within machine precision? I am trying to wrap my head around floating-point precision. Performing the following numeric operation: 275./6.*1.03692775514337 in Mathematica and C++ and ... 1answer 143 views ### Is Mathematica, while operating within$MachinePrecision IEEE 754 compliant?

I was looking in Mathematicas documentation and could not find to which point Mathematica includes the IEEE 754 standard? It is mention it in its documentation MachinePrecision under Background & ...
143 views

### Machine Learning Predict Precision

I have this code p = Predict[{1 -> 123456789123456789, 3 -> 987654321987654321}] values are big, more than 15 digits (standard machine precision). when I ...
494 views

### How to use Working Precision to get good result and plot?

I have a function f(x) which I would like to see going up for very low values of x: from an asymptotic study, I expect it to go to Infinity for low x; however, I can see an elbow and many oscillations....
513 views

### What explains the inaccuracies in machine-precision 'integers' with trigonometry or powers?

This Mathematica tutorial notes some strange behaviour with calculations such as Sin[10^50]: ...
65 views

### Precision improvement for solution of the simplest low-pass filter

I solved the most basic low-pass filter using NDSolve in Mathematica and LTSpice. The solution provided by Mathematica seems to lack precision. I tried to deal with WorkingPrecision but I didn't ...
117 views

### Unexpected behavior from CoordinateBoundingBoxArray with Into and 0.41

I want to get the four corners of a Cuboid. This usually works: CoordinateBoundingBoxArray[{-{1., 1.}, {1., 1.}}, Into@1] gives ...
1k views

### Elegant high precision log1p?

Sometimes it is hard to understand how numerical expressions are evaluated. I remember reading claims by Wolfram on how smart the Kernel is to evaluate expressions trees numerically by recognizing ...
192 views

### Printing Precision of Machine Numbers

Is Mathematica making the print precision rounding judgment more stringent based on whether or not the number is above or below the rounding target? If so, why? In my real case, I have many numbers ...
116 views

### MemberQ[{0.01, 0.05}, (0.01*9*2)/9/2] returns False

Multiplying and dividing by the same stuff seems to alter the value. Quite curiously, if the value you start from is large enough (greater than 0.05 in my case) you do not see the problem. Any idea ...
59 views

### ListLinePlot gives the correct values but N doesn't

I have solved a set of 6 differential equations with DSolve. When I use the table command and produce the results of one of the equations given by DSolve, the ListLinePlot command gives me the correct ...
613 views

### Really understanding precision

I've been reading the documentation in Mathematica about precision, namely: Exact and Approximate Results Arbitrary-Precision Numbers Arbitrary-Precision Calculations Machine-Precision Numbers ...
40 views

### Unpredictable behavior of numerical error

A comparison of float calculation and exact expression for NumberForm[0.3^2 - (3/10)^2, 18] gives an exact zero for $0.3$. However, ...
206 views

### Precision of integers vs. Precision of floating numbers

It seems that Mathematica can handle very big integers accurately, but cannot do the same for floating numbers. See the following code: ...
118 views

### How to use a higher precision?

Below is my code. If I set W to $10^{55}$, it breaks down and the result is wrong. What do I need to do to use W as large as $10^{200}$? ...
758 views

### Does Mathematica have an equivalent of Python's float.as_integer_ratio?

The Python programming language has a float.as_integer_ratio(x) function which exactly converts an IEEE 754 floating-point number into a numerator/denominator pair ...
1k views

### Is there a difference between Divide[a,b] and a/b?

In this comment it was asserted that Divide[a,b] and a/b are different, though the documentation indicates that they are the ...
570 views

### 'eps' equivalent in Mathematica

In MATLAB, there is a function named eps. eps Spacing of floating point numbers. D = eps(X), is the positive distance from ABS(X) to the next larger in ...
700 views

### Why does 1 - Exp[-10.0^12] cause an out-of-memory error?

I would like to understand why evaluation of the expression 1 - Exp[-10.0^12] causes an out-of-memory error and how can I prevent such errors when calculating ...
196 views

### Treating a bad conditioned covariance matrix

I am trying to detect outliers in a big dataset using the Mahalanobys distance method. To calculate the Mahalanobys distance for a given vector $x$ from a mean vector $\mu$ you have to compute the ...
142 views

### Chop intermediate results of NDSolve after each step [closed]

Using NDSolve for a set of three ordinary differential equations, I ran into the problem that intermediate results quickly develop negligible imaginary parts. I get ...
2k views

### Why is this Mandelbrot set's implementation infeasible: takes a massive amount of time to do?

The Mandelbrot set is defined by complex numbers such as $z=z^2+c$ where $z_0=0$ for the initial point and $c\in\mathbb C$. The numbers grow very fast in the iteration. ...
240 views

### Precision problem with numerical solution of a differential equation

I want solve $$2\sqrt{|\gamma|}x = \int_{1}^{t} dy \sqrt{\frac{1+2|\gamma_2|y}{y^2(1-y)}}$$ where $0<t\leq$1. I'm using a for cycle to evaluate t, calculate the integral and the assign the $x$. ...
109 views

### Why does this rounding happen at machine precision?

Clearly, dividing by two in a binary number shifts the decimal point like this: BaseForm[InputForm, 2] BaseForm[InputForm[7/2 // N], 2] It gives: 2^^111 and 2^...
359 views

### What happens at the end of MachinePrecision? Is the remainder discarded or rounded?

What happens at the end of MachinePrecision? Is the remainder discarded or rounded? This code suggests it is discarded; is that conclusion correct? Why is it not rounded? ...
86 views

### problem in matching two sets of particles

I have been trying to simulate a simple system in which there are two set of particles. One kind of particles are localized on the boundary of a circle (shown in purple below), whereas the second kind ...
180 views

523 views

### Export numeric data with preset decimal places

I have a table of pairs of numbers, each with 300 decimal places, which are all important. If saved using Export["data.dat", data] and then imported back via Import["data.dat"] - then the 300 decimal ...
2k views

### Making a calculation with high precision

I would like to make the following calculation: 1/Sqrt[1 - (150^2 10^(-4))/(9 10^16.)] - 1 Mathematica 8 returns 0. The result is obviously not 0, but my ...
501 views

### Machine Epsilon

I'm trying to evaluate the machine epsilon of my computer (see below). I wrote this: ...
73 views

### A simple syntax does not work

The code below does not work. Can anyone tell me why? Thanks! ...
191 views

### ConvexHullMesh fails with small numbers

When I try to get the ConvexHullMesh of a List of points that are "small scale", I get errors: ...
560 views

### Machine-Precision and Arbitrary Precision [closed]

What is meant by a machine number in the Mathematica documentation? What is the difference between machine-precision and fixed-point precision? What is arbitrary precision?
387 views

### Does Mathematica have an equivalent of C's nextafter?

In C (and many other programming languages), there is a function double nextafter(double x, double y) which takes two (IEEE 754) floating-point numbers and ...