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.

Filter by
Sorted by
Tagged with
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 ...
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: ...
3 votes
1 answer
57 views

Avoid MachinePrecision numbers in Message

Can I change the output of Message to not show MachinePrecision numbers? E.g. ...
1 vote
4 answers
216 views

Can I change the default behavior so that "0.1" is interpreted as "1/10" automatically?

Consider the function f[a_] := NIntegrate[Sqrt[a + Log[x]], {x, 1, 10}, WorkingPrecision -> 30]. With this definition, I cannot call ...
1 vote
1 answer
110 views

Machine-precision numbers cause loss of precision

I am trying to use the Mod function as follows. Table[ Nest[Mod[2 #, 1] &, FractionalPart[Pi], n], {n, 100}] // N ...
3 votes
3 answers
763 views

How can I compute Erf of large numbers to more precision?

I would like to compute Erf[80/3] to enough precision to know the order of magnitude of 1 - Erf[80/3] How can I do that? I ...
3 votes
1 answer
162 views

Why does precision decrease after increasing PrecisionGoal and WorkingPrecision on this integral?

I am trying to calculate a messy double-integral to many digits of precision. As shown below, the precision seems to increase reliably as WorkingPrecision goes from ...
0 votes
1 answer
252 views

How to improve working precision?

I'm trying to fit the array data as follow: NonlinearModelFit[ data, s*t^r + (A/(w*(Pi/2)^0.5))*Exp[-2*((t - u)/w)^2], {s, r, A, w, u}, t]; But when ...
1 vote
1 answer
72 views

How to get the output for the following code involving differentiation and integration?

I need to evaluate the following Mathematica code to get a numerical value as my output. But during compilation I get the error message NumericalMath`FixedPrecisionEvaluate::precbd: Requested ...
9 votes
1 answer
770 views

Machine Epsilon

I'm trying to evaluate the machine epsilon of my computer (see below). I wrote this: ...
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 ...
6 votes
1 answer
163 views

Issues with $MachineEpsilon

I'm attempting to add $MachineEpsilon to numbers I am pulling from the domains of 3 interpolating functions. I pulled 3 numbers, and for one of these numbers adding ...
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 ...
0 votes
0 answers
352 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 ...
1 vote
1 answer
702 views

How can I suppress the warning "precision may be lost"?

When I import data from a .dat file, V11.3 emits the message: is too small to represent as a normalized machine number; precision may be lost. How can I close the ...
5 votes
1 answer
353 views

Equality for floats

Suppose I have two floats (e.g. {x,y} = RandomReal[{0,1},2]). Might there be a situation where all three comparisons evaluate to ...
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 ...
3 votes
1 answer
122 views

DeleteCases with a case as float?

Might the DeleteCases have issues in matching when the list is of floats (machine precision numbers)? E.g. in this code it might fail to match correctly because ...
1 vote
1 answer
95 views

Number definition and approximation

I run these lines: a = 0.833 SetPrecision[a, 20] and this is the output: 0.833 0.83299999999999996270 I expected to ...
2 votes
0 answers
54 views

Set Underflow precision in Mathematica 12 same as version 11.x [duplicate]

It seems like Mathematica version 12 sets arbitrary underflow precision depending on the function, but I would like the underflow precision to be same as what was for previous version of Mathematica ...
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 ...
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 ...
9 votes
2 answers
442 views

How to detect underflow/overflow (post 11.3)?

This old trick used to work before 11.3: SetSystemOptions["CheckMachineUnderflow" -> True] But no longer... so how can we explicitly check for this in v12+?? ...
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 ...
0 votes
1 answer
88 views

Allow Mathematica to solve the differential equations with larger than 16 digits parameters

Consider the system of differential equations ...
3 votes
2 answers
926 views

Why is Mathematica's default precision only 16 digits? [closed]

I was performing some basic computations when I noticed that NumberForm[N[Zeta[3]], {100, 100}] yields ...
7 votes
2 answers
958 views

Accurately evaluating the hypergeometric function

As part of another problem, I am working to evaluate hypergeometric functions such as Hypergeometric2F1[1, 1, n, -1] for large $n$. I am hoping to obtain at ...
1 vote
1 answer
64 views

why some parts of my curve are removed or wiped

When I try to draw the next code I get a curve with missing parts, as shown in the picture. I do not know if it is an precision problem in the Mathematica program or is some data not calculated. Or is ...
0 votes
1 answer
141 views

Preventing Mathematica from considering small values to be equal to zero [duplicate]

In my calculations I have a variable (say z) which can be an argument of Log, say, z Log[z]. ...
0 votes
1 answer
99 views

Why this very simple problem turns to "Indeterminate"?

Why the following calculation gives Indeterminate value? ...
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. ...
3 votes
1 answer
240 views

Setting precision and machine underflow

As is well known, Mathematica changed how it handles numbers smaller than $MinMachineNumber in recent versions. I'm running Mathematica 12 on a Mac, and I cannot figure out why it's treating these ...
19 votes
5 answers
4k views

Numerical underflow for a scaled error function

I calculate a scaled error function defined as f[x_] := Erfc[x]*Exp[x^2] but it can not calculate f[30000.]. ...
2 votes
1 answer
453 views

Why would Evaluate[] in Plot give me warning about precision?

I have a code:- Plot[Evaluate@PDF[NormalDistribution[1.6, 0.2], x], {x, -6, 6}] And then I got the warning: ...
5 votes
2 answers
867 views

Underflow error General::munfl from E^x instead of Exp[x]

In contrast to earlier versions, Mathematica 11.3 and 12.0 generate lots of underflow errors from my code, e.g. ...
2 votes
1 answer
171 views

Correct syntax for working precision in functions version 12

I just recently updated from version 11.2 -> 12...there apparently are quite a few changes since 11.2. $\unicode{952}\unicode{960}$ One being how version >11.3 deal with numbers that approach zero. ...
8 votes
2 answers
590 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 ...
1 vote
3 answers
136 views

When should one write integer numbers with a decimal?

I often see different solutions where users have taken advantage of how Mathematica handles numbers differently. I.e. when is it appropriate to use a decimal point in a calculation? Can someone ...
1 vote
1 answer
96 views

Drawing from InverseWishartMatrixDistribution. A machine precision error?

I'm drawing from the Inverse-Wishart Distribution, but I got the following error message: ...
4 votes
1 answer
233 views

Inexact numbers as keys in Association?

Can someone explain me how Mathematica's Associations behave with inexact numbers as keys: <| 0.22499999999999964` -> a |> [0.22499999999999965`] and <...
2 votes
1 answer
180 views

Efficient Round edition with different rounding direction

As pointed out in this post, Mathematica has a special version of Round that Round rounds numbers of the form x.5 toward the nearest even integer. A comment by ...
2 votes
1 answer
140 views

How to prevent Mathematica from giving inexact answers

Upon doing a simple subtraction 13.725 - 13.5 both Mathematica 11.3 and 12.0 beta version are giving me 0.22499999999999964 ...
3 votes
1 answer
139 views

Forcing divisions to be a machine-precision floating point divisions instead of multiplication by inverse

I want to imitate machine-precision, de facto IEEE division on Mathematica. On my quick trials I find this surprisingly hard to accomplish, since Mma rewrites a / b ...
0 votes
1 answer
77 views

ContourPlot showing breaks in contours

I'm trying find graphically the solutions of the intersection of the following functions. ...
6 votes
1 answer
159 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 ...
6 votes
2 answers
178 views

How can I make 1+$MachineEpsilon not look like 1?

I undarstand that 1+$MachineEpsilon is actually not equal 1. However, it persists to look like it was equal ...
2 votes
2 answers
495 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
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...
2 votes
2 answers
2k 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
1 answer
62 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]]: ...