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]

1
vote
0answers
22 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 ...
0
votes
0answers
20 views

Confusion matrics to estimate the accurancy of classification using Diseases associated to their symptoms [closed]

Hi guys does anybody have a suggestion to create a logarithm for the confusion matrices , the propose for this confusion is to estimate the accuracy of ranked model as you see in title I have matrics ...
1
vote
0answers
42 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
121 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
39 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
66 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
102 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
163 views

How to increase the accuracy of a plot

I have the following code below: ...
3
votes
0answers
56 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
374 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
58 views

ContourPlot showing breaks in contours

I'm trying find graphically the solutions of the intersection of the following functions. ...
2
votes
2answers
103 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
47 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
90 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
178 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
67 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
57 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
33 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
129 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
37 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
89 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
39 views

NIntegrate weird behaviour inside a function

I wrote this little function ...
0
votes
0answers
31 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
62 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
48 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
30 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
52 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
73 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
87 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
69 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
53 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
79 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
1answer
46 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 ...
3
votes
1answer
64 views

NumberForm and Precision

With MachinePrecision this construction works as expected ...
0
votes
2answers
66 views

equal expressions give different numerical result

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

NIntegrate fails to converge

I am trying to compute this integral for different a with 0.0001<a<0.5, ...
7
votes
1answer
237 views

How does Mathematica determine when to use scientific notation?

I have code that takes an initial guess for a set of parameters to use in a function that I want to minimize, calculates the function, prints the value, recalculates new parameters via the gradient ...
7
votes
3answers
122 views

How to create an Interval object with specific end points?

When creating an Interval object, the end points are automatically widened when an end point is an inexact number. For instance: ...
14
votes
4answers
323 views

Terrible accuracy of DawsonF

DawsonF[30.] returns 0. The correct value is 0.016676... At least it prints a warning message, ...
1
vote
2answers
44 views

Diagnosing the numerical stability of a function

I have programmed a function f[x] that seems to be very unstable numerically. More precisely, I noticed that for certain arguments in arbitrary precision, the ...