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.

38 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
97 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...
Lingyuan Ji's user avatar
4 votes
0 answers
130 views

How does Mathematica evaluate N[π, 30] == π?

I want to know how N[π, 30] == π works. The result is True. I wonder whether the exact number ...
FRANCESCO's user avatar
4 votes
0 answers
176 views

Is it possible to get the original number from DecimalForm?

Bug introduced in 5.2 or earlier and persisting through 13.1.0 [CASE:4315787] Wrong behavior of NumberForm (DecimalForm outputs ...
Alexey Popkov's user avatar
4 votes
0 answers
244 views

Classification problem using SVM methods

I am running SVM on mathematica and I a used this code with classes: ...
BetterEnglish's user avatar
3 votes
0 answers
259 views

How to deal with too small numbers

When dealing with a code that produces too small numbers (in a complicated way) like 0.33691 4.015757066049965*10^-330 I get the following warning General::munfl: ...
S. Euler's user avatar
  • 317
3 votes
0 answers
2k views

Set Global Maximum Precision

I'm sure this has been asked before, but I've looked around and can't figure it out: How do I set a global maximum precision for a notebook (or in general, globally)? I have a large notebook in ...
smörkex's user avatar
  • 625
2 votes
0 answers
33 views

Working Precision Slowing Down Numerical Integration Computation

...
Smithy's user avatar
  • 31
2 votes
0 answers
116 views

Generalizing technique to handle General::munfl error?

In contrast to earlier versions of Mathematica, in versions 11.3 and later Mathematica no longer switches to arbitrary precision when it detects a MachineNumber underflow. While this behavior is ...
Lauren Pearce's user avatar
2 votes
0 answers
1k views

General:: Exp[-717.401] is too small to represent as a normalized machine number; precision may be lost

I am solving pde. For the post processing bvp, there is solution given in output which is the solution from mathematica version 10.0.1. Output from above in mathematica 10.0.1 is, But when the similar ...
user75507's user avatar
2 votes
0 answers
301 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 ...
Chris Chiasson's user avatar
2 votes
0 answers
161 views

Enforcing WorkingPrecision in NIntegrate

I have a very complicated 2D integral that I need to calculate repeatedly, and I'm trying to speed it up a bit, since at the moment it's taking a couple of days to complete. One thing I've noticed is ...
Widjet's user avatar
  • 199
1 vote
0 answers
71 views

Issue with some floating-point errors and not others

Not looking for a solution necessarily, but just trying to understand why this issue occurrs. I have a 'Do' loop which iterates some algorithm over values of a parameter 'x' with range {x,0,1,0.1} and ...
Ssdmitten's user avatar
  • 185
1 vote
0 answers
65 views

How does WorkingPrecision in NDSolve handle MachinePrecision?

I'm wondering why the following code NDSolve[{y''[t] + y[t] == 0, y[0] == 1., y'[0] == 0}, y, {t, 0, 10}, WorkingPrecision -> 6] throws the error/warning, that ...
freddy90's user avatar
  • 851
1 vote
0 answers
43 views

ContourPlot3D with small domain produces glitchy mess

I'm able to plot some graphs over small domains, but not others. For example, this works just fine: ...
ppm's user avatar
  • 61
1 vote
0 answers
74 views

Numerical precision - simulating an unstable equilibrium

I was playing around with NDSolve and the following ODE s = NDSolve[{y''[x] == -Sin[y[x]], y[0] == \[Pi], y'[0] == 0 }, y, {x, 0, 120}] The equation and the ...
Smerdjakov's user avatar
1 vote
0 answers
68 views

FindRoot giving error in Mathematica version 12

I was using the same code in previous version of Mathematica but unfortunately I had to update Mathematica to version 12 because I upgraded MacOS to Catalina. Now when I run my code, I get this error ...
Indeterminate's user avatar
1 vote
0 answers
59 views

Changing machine precision notebook-wide leads to peculiarities

For a project of mine it is preferrable to set notebook precision globally. I have done so by using the answer in Global precision setting. The idea is to dynamically create a ...
1010011010's user avatar
1 vote
0 answers
205 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 ...
Zlelik's user avatar
  • 531
1 vote
0 answers
293 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 ...
John's user avatar
  • 660
1 vote
0 answers
65 views

Which operations preserve digit precision?

Imagine I had to use numbers with a 600 precision digits. Do all mathematical operations, like +,-,...
An old man in the sea.'s user avatar
0 votes
0 answers
85 views

How to set the precision for the entire notebook

I want to do various computations conditional on a given precision for the entire notebook. I use the following code: ...
Tugrul Temel's user avatar
  • 5,508
0 votes
0 answers
54 views

Overflow + Underflow Problems with Code

I am trying to use Mathematica to verify simulation results with an analytic result. The analytic results are performance measures of the M/D/1 queue, which unfortunately uses the factorial function ...
PiE's user avatar
  • 427
0 votes
0 answers
59 views

How to set up precision by default?

I have a table computing many numbers with large precision. Because of this, probably, Mathematica consumes a lot of RAM. Is it possible to restrict the precision in any calculations by default (...
John Taylor's user avatar
  • 4,691
0 votes
0 answers
63 views

Mathematica accuracy errors when creating data

I created training data for a neural network and below are two errors I got The only code that uses "FindRoot" command is the following ...
Gabi23's user avatar
  • 295
0 votes
0 answers
41 views

General::munfl - Precision lost in LinearModelFit

I am new to mathematica so I am confused regarding the loss of precision in LinearModelFit. In building a linear model with uora (1 or 2) and encodeSeverity (1,2 or 3) ...
Stuart Mackintosh's user avatar
0 votes
0 answers
52 views

Solving a determinant to get non-zero roots in a heat transfer problem

I am trying to solve a mathematical model of a heat transfer problem. As an intermediate step there is a characteristic equation in the form of a determinant, which needs to be solved for variable <...
Avrana's user avatar
  • 297
0 votes
0 answers
92 views

How to change Machine Precision digits to meet the tolerances

I am trying to solve for Tcm and Mag by solving nonlinear equations using FindRoot command using following code: ...
Tiku's user avatar
  • 51
0 votes
0 answers
71 views

Problem with the Rank of a matrix after a FindRoot

I am solving a boundary problem defined by a set of four-component vectorial functions. Without going into many details, I have two functions on the left and two on the right of an interface. The ...
Dario Bercioux's user avatar
0 votes
0 answers
101 views

How to copy and paste numbers with "`" mark and use them in calculations, without using N or setting precision every time

Suppose we have run a calculation and get a number like 2.758952615889003` If we then copy-paste this number and do a calculation like ...
user106860's user avatar
0 votes
0 answers
28 views

Different sensitivies from LinearSolve and Eigenvalues. How to conciliate them?

I use the following functions to receive a matrix, and make it symmetric positive definite: ...
An old man in the sea.'s user avatar
0 votes
0 answers
95 views

Understanding Working Precision - two example equations

I am trying to understand how WorkingPrecision works, and in general how very small/large numbers are to be handled. Let me preface I probably do not have ...
Smerdjakov's user avatar
0 votes
0 answers
20 views

Conflicting output provided by `N[...]`

I am trying to evaluate an expression : (-((I (k2 - k1) (-1 + E^(2 I (k2 - k1) \[Pi])))/(-1 + (k2 - k1)^2))) /. {k1 -> 2, k2 -> 7} This gives ...
Nitin's user avatar
  • 431
0 votes
0 answers
353 views

Dealing with General::munfl errors

Edit: So, while trying to figure out a minimal exmaple, I found out that my main problem was actually unrelated to this and it just happened to be that giant pile of warnings and error messages coming ...
user70153's user avatar
0 votes
0 answers
72 views

How to resolve underflow occurrences?

I am solving a second order differential equation described by odey below. For the asymptotics, I have the following code which will be used as initial conditions for NDSolve. ...
user583893's user avatar
0 votes
0 answers
332 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 ...
wmora2's user avatar
  • 569
0 votes
0 answers
104 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?
user avatar
0 votes
0 answers
64 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 ...
KratosMath's user avatar
  • 1,243
0 votes
0 answers
44 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, ...
pawel_winzig's user avatar
  • 1,567