Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
53 views

ContourPlot showing breaks in contours

I'm trying find graphically the solutions of the intersection of the following functions. ...
2
votes
2answers
94 views

Why is 0 vs 0.0 causing a precision problem?

I wasn't sure what to title this Question. I tried calculating different forms of a continued fraction, and I found that I get a correct result when I set d to 0 but a wrong result (in the final two ...
5
votes
0answers
38 views

Small positive machine number calculation in Mathematica 11.3

In Mathematica version < 11.3, any positive Machine‐Precision Numbers exceeding the range [$MinMachineNumber,$MaxMachineNumber...
5
votes
1answer
83 views

Extracting binary digits of machine precision numbers

Currently, I am developing an octree data structure. And I need it to be fast. To this end, I would like to have a fast way to extract the $m$ binary digits "after the dot" of each entry in a matrix ...
1
vote
2answers
45 views

Truncate a number in mathematica

I want to truncate a simple number to n decimal digits. For example, 2/3. I used f[x_, n_] := N[IntegerPart[x 10^n]/10^n] but I get ...
0
votes
1answer
48 views

How to get the correct result in a simple operation in Mathematica

I have the following values for x[[i]], y[[i]] and A[[i,j]]: ...
2
votes
2answers
83 views

What's the smallest positive real allowed in mathematica?

This question may be a bit strange, but in this question, one of the answers suggests substituting some negatives values in a matrix by the smallest positive real number allowed. So, I was wondering ...
0
votes
1answer
40 views

Simple division with high precision in Mathematica [closed]

I want to do a simple division i.e. 0.70524/0.51824 . What I want is to find the result of the roundation of this division for precision from 1 to 19 decimal digits....
3
votes
1answer
47 views

Numerical precision problem

I have this simple code: ep = 1 - 80000000000 (-(199999/200000) + 1/E^(1/200000)) ep // N -8.27404*10^-8 ...
0
votes
0answers
76 views

Plot a function with very small values, close to zero

I want to plot a function with very small values, close to zero, but even though the limit is -3/2 as x->0, I can't get any ...
1
vote
1answer
72 views

Copy-paste with annoying trailing 0s

When one copies an output containing machine-precision numbers to a input, many trailing 0s appears. For example : Evaluate the following expression : ...
0
votes
2answers
64 views

equal expressions give different numerical result

I have two expressions, and they are really equal: ...
2
votes
1answer
37 views

Working Precision warnings for ParametricPlot

I wish to plot a series of parametric curves for the following function called poly that has five parameters (Γ, ...
1
vote
1answer
36 views

How to choose elements of a matrix with internally generated variables and rank them with real coefficients

I have a Code (a long one), part of it is below. The following piece basically multiplies an adjacency matrix with a vector of equilibrium values. Then tries to pick non-zero elements to be used in ...
14
votes
4answers
290 views

Terrible accuracy of DawsonF

DawsonF[30.] returns 0. The correct value is 0.016676... At least it prints a warning message, ...
5
votes
2answers
124 views

Integrating a bivariate distribution over a region bounded by a straight line

Summary of problem: I'm using Mathematica version 8 to try to integrate the bivariate distribution over a region bounded by a straight line. The two random variables are uncorrelated. When I use ...
5
votes
2answers
333 views

Why does N not upgrade precision? [duplicate]

Precision[N[1.0, 20]] Precision[N[1, 20]] MachinePrecision 20. It would be so much more intuitive and less error prone, if <...
7
votes
1answer
112 views

Plot3D discrepancy between MMA 10 and 11.3 - possible small numbers issue

I'm having some troubles with the following code I wrote in MMA 10 some time ago: ...
3
votes
1answer
60 views

Machine Epsilon is not equal to $MachineEpsilon

I try to wrap my head around machine precision calculations in Mathematica (11.2, Linux). I do not understand the following behavior: ...
0
votes
2answers
49 views

NIntegrate numerical accuracy and errors

I have the following 3x3 matrix M = {{-I*ω + Γ/2, I*g1, 0}, {I*g1, -I*ω + κ1/2, I*g2}, {0, I*g2, -I*ω + κ2/2}}; Finding the eigenvalues and eigenvectors ...
1
vote
1answer
91 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 ...
0
votes
0answers
43 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?
5
votes
1answer
68 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 ...
3
votes
1answer
116 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 ...
2
votes
0answers
85 views

Is it possible to get the original number from DecimalForm?

I'm trying to implement an efficient TSV exporter based on the code from this answer. It works sufficiently quickly but the problem is that OutputForm shows about 6 ...
14
votes
2answers
513 views

New General::munfl error and loss of precision

The latest version 11.3.0.0 of Mathematica returns Indeterminate when evaluating Log[Exp[-800.]]. I believe this was not ...
6
votes
1answer
231 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 ...
1
vote
1answer
49 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:". ...
6
votes
2answers
149 views

how to get single, and quad Precision out of Mathematica which match Fortran result

by default, if a number has decimal . after it, then Mathematica will do computation using machine Precision, which on my PC (intel hardware) running windows 7 64 ...
3
votes
1answer
114 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 & ...
29
votes
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 ...
1
vote
0answers
102 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 ...
9
votes
1answer
489 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]: ...
6
votes
4answers
208 views

How do I convert an inexact number smaller than $MinMachineNumber to machine-precision?

I was trying to convert some arbitrary-precision numbers to machine-precision numbers using N[myNumber,MachinePrecision]. But, although my test number did lose some ...
3
votes
1answer
56 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 ...
1
vote
2answers
110 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 ...
0
votes
0answers
57 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 ...
1
vote
0answers
149 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 ...
6
votes
1answer
544 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 ...
0
votes
2answers
342 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....
0
votes
0answers
39 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, ...
3
votes
1answer
182 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: ...
12
votes
1answer
672 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 ...
0
votes
1answer
107 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}$? ...
1
vote
0answers
140 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 ...
1
vote
0answers
106 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 ...
8
votes
1answer
108 views

Unexpected behavior from CoordinateBoundingBoxArray with Into[1] and 0.41

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

Bug in floating-point number comparisons near $MachineEpsilon?

I stumbled over the following weird behavior when comparing floating-point numbers close to 1.0: qq = 1.0 + 60.0 $MachineEpsilon; and then ...
3
votes
1answer
105 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[7], 2] BaseForm[InputForm[7/2 // N], 2] It gives: 2^^111 and 2^...
4
votes
1answer
357 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? ...