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 [precision-and-accuracy]

2
votes
1answer
389 views

Why does the PoissonDistribution not plot around its mean for moderate large numbers?

I plotted the Poisson Distribution for various mean values (plot label and vertical line). The plots does not peak around the mean as the mean increase. Any advice to get the right plot, or at least ...
1
vote
0answers
43 views

NDSove vs ParametricNDSolve

ParametricNDSolve is very practical when one has to execute NDSolve again and again. However is it equally accurate? I have not ...
1
vote
2answers
143 views

NMaximize not always returning solution

This question is related to a previous question and answer here: NMinimize or NMaximize for a dynamic problem but tackles a different problem. I am trying to solve a simple linear quadratic ...
0
votes
0answers
58 views

Numerical calculation Mathematica 11.2 / 11.3 / 12 [duplicate]

Please I do not understand why Mathematica 11.2 version evaluates numerically the value below Exp[-800]//N (* 3.667874584178*10^-348 *) while 11.3 and 12 ...
1
vote
1answer
98 views

How to make these operations occur faster?

How can I get this section of the code to solve this integration faster. I have rather large values but I don't need it to be too specific. However if I lower the precision it says the integration is ...
0
votes
0answers
36 views
0
votes
2answers
48 views

Precision, accuracy and very large/small exponents with Reduce

Numerical precision/accuracy question here. I am currently working on solving nonlinear equations with Reduce. Oftentimes, ...
0
votes
0answers
24 views

NumberForm giving incorrect result [duplicate]

The definition of the NumberForm function is the following: "NumberForm[expr,n] prints with approximate real numbers in expr given to n-digit precision." However ...
3
votes
2answers
72 views

Solution to eigenvalue BVP using NDEigensystem to high precision

I'm trying to solve linear (non-self-adjoint) boundary-value problems to as high precision as possible (optimally 1e-15). For example, the below code solves for the first 5 eigenvalues of the harmonic ...
1
vote
0answers
24 views

Getting values of EllipticK with arguments that are very near 1

I need to evaluate EllipticK[m] very close to 1. However, when I get too close to 1 the function defaults to the exact solution for 1 , which is ...
1
vote
0answers
57 views

Confusion matrix using data from two matrices

I have a problem. Any help will be appreciated. In order to calculate the accuracy, sensitivity, sensibility and F1 score between diseases and their symptoms, I have two matrices with a different ...
4
votes
2answers
130 views

How can I get high precision circle drawing in Graphics, across ten orders of magnitude

I need to visualize some fractal circle arrangements where tangent circles can vary by ten orders of magnitude. In such cases the circles are not being drawn as tangent. Example: The red and blue ...
0
votes
0answers
45 views

Why doesn't SetPrecision give me the precision I ask for? [duplicate]

I'm dealing with a problem requires a precision of 50 digitals after the decimal point. However, I got the following value when doing so: I don't know what's going on here, ain't it 0.09 with other ...
1
vote
1answer
68 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
1answer
111 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
1answer
177 views

How to increase the accuracy of a plot

I have the following code below: ...
3
votes
0answers
61 views

Slight loss of precision when parsing JSON

Exporting to JSON is working well for me under 11.3. The issue present in previous versions seem to be solved: ...
4
votes
2answers
394 views

Using LinearSolve instead of Inverse does not give a good enough precision

If I want to calculate $B^{-1}A$, then instead of using Inverse, I should in theory just be able to use LinearSolve[B,A]. Now ...
0
votes
1answer
52 views

ContourPlot fails in a simple equation

I'm very new with Mathematica, and I'm struggling with a very simple problem. I want to plot this ...
0
votes
1answer
60 views

ContourPlot showing breaks in contours

I'm trying find graphically the solutions of the intersection of the following functions. ...
2
votes
2answers
112 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
50 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...
8
votes
7answers
1k views

How to display very small numbers in Mathematica?

I am trying to evaluate the function: $$f(x) = \cos(x) - \mathrm{e}^{-2.7 x}$$ at $x = 1.7 \times 10^{-25}$ and Mathematica keeps returning '0.' How do I evaluate the expression in a better way?
3
votes
1answer
94 views

Problem with the Inverse CDF of Non-central F Ratio Distribution

In[3]:= n = 5; n1 = 4; n2 = 6; γ = 0.05; α = 1/370; InverseCDF[NoncentralFRatioDistribution[1, n1 - 1, n1/γ^2], 1 - α - (n - n1)/n2] During evaluation of In[3]...
6
votes
2answers
181 views

Catastrophic loss of accuracy in Orthogonalize

Context In connection to this question I am interested in orthogonalizing known matrices. As a test case, let us consider the definite positive $15 \times 15$ matrix ...
0
votes
1answer
93 views

Good practice about numerical precision

In one of my calculations, I get -1.11022*10^-16 as one of my eigenvalues for a matrix. It's essentially zero and I suppose I could use SetPrecision to make it zero but I wonder what's a good practice ...
0
votes
1answer
60 views

Increasing MaxExtraPrecision arbitrarily changes numerical result

I am trying to confirm that a function $f$ satisfies a particular differential equation of the type $D f=0$, for some differential operator $D$. I set $Df$ as Diffeq...
0
votes
0answers
34 views

Return the precision of the first non zero digit in a number for measurement error representation function

I'd like to return the precision of the first non zero digit in a number. The motivation is so that I can quickly construct my error notation which is the bracketed notation, e.g. $x = 1.234$ with ...
1
vote
2answers
131 views

How to avoid this type of change of digits in computed numbers?

Is there a way to avoid the digits being changed? ...
0
votes
1answer
38 views

Inaccuracy in Plot3D

This problem might be well-known - in this case, I would appreciate a link, because I could not find anything. My problem: A certain function (super long and nasty expression) needs to be plotted. ...
6
votes
1answer
92 views

Loss of accuracy in orthogonalisation of polynomials using Orthogonalize

Context As a mean to understand the growth of structure in the universe, I am interested in characterising the curvature of random fields such as this one: For this purpose I start with a PDF of the ...
0
votes
0answers
40 views

NIntegrate weird behaviour inside a function

I wrote this little function ...
1
vote
0answers
39 views

DensityPlot, ScalingFunctions, and small values

Edit: I figured out I can use Rescale to retrieve the plot as well as get the correct plot legend. I still can't figure out how to rescale the axes from 10^-9 to 1 ...
1
vote
2answers
91 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 ...
1
vote
1answer
49 views

Accuracy of function past 10^(-17)

I am trying to integrate an analytic function: ...
0
votes
1answer
49 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]]: ...
0
votes
0answers
31 views

Speed and precision with Inverse Laplace transform

I have a problem with an inverse Laplace transform that to me looks like a precision problem when computing with large/small numbers. Scientific background: I would like to compute how photons from a ...
1
vote
1answer
53 views

Performing a FindRoot from Numerical integration

I am trying to evaluate: FindRoot[Xfnew[γ, w, Hi, mx]*92*10^23*γ^(4/(1 + w)) == 1198/10000, {Hi, hs}, MaxIterations -> 10000] for some starting value hs,...
0
votes
3answers
32 views

Low precision from function returning matrix

Got a function depending on single parameter "t" defined below which returns a 2 by 2 matrix ...
0
votes
2answers
78 views

How to deal with the loss of significant digits in this expression with Fresnel integrals?

I needed to solve this integral: $$\int_1^\infty \frac{dx}{\sqrt{x}} \cos \left(a x-\frac{\pi}{4} \right) \cos \left(b x-\frac{\pi}{4} \right) \cos \left(c x-\frac{\pi}{4} \right)$$ Coming from ...
2
votes
2answers
88 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
41 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....
2
votes
1answer
75 views

Inaccurate zero eigenvalues for 7*7 matrix [closed]

I have symbolic entries for all the elements of a 7*7 matrix. At the symbolic level Eigenvalues gives two zeroes and five others that are extremely complicated. At ...
3
votes
1answer
56 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
39 views

Solving a system of linear equations in Mathematica regarding the errors of different methods

I have a system of equations, i.e. 0.62243x + 0.51824y = 0.70524 0.71497x + 0.59496y = 0.80996 I have 3 ways to solve this system (there are more but I am ...
0
votes
1answer
80 views

Problem with solving differential equation using NDSolve

I am trying to solve differential equations subject to condition z[0] == 0 and z[tmax] == 10 Pi. ...
0
votes
2answers
61 views

Formatting a list of values and dependent formatting of corresponding errors list

I am making a table of data that I wish to output using TeXForm. Rather than manipulate the values in LaTeX (e.g. using the ...