# Questions tagged [precision-and-accuracy]

The tag has no usage guidance.

571 questions
Filter by
Sorted by
Tagged with
278 views

### IntegerPart - is this a known bug?

I'm working in Mathematica 13.0 and I type a=0.00001; IntegerPart[a/a] and well, the output is 0. Try with almost any other value of ...
1 vote
32 views

### Discrepancies in NDSolve Solution Between 4D and its Reduced 3D Counterpart

I have two systems, a 4D system and a 3D system. The 3D system is a reduction of the 4D system in such a way that: ...
101 views

### Mathematica ignores precision requirement when evaluating a Legendre function

Bug persisting through 13.1.0 [CASE:4953269] When attempting to calculate a certain associated Legendre polynomial within a given precision, Mathematica seems to ignore it if the argument is ...
53 views

### How to improve the accuracy of integration with Bessel function without significant drop in performance?

Consider the following function and integral: ...
130 views

### Adding numbers with defined precision produces incorrect result

I've tracked a bug in my code down to the problem of adding two numbers together, with the left argument having machine precision, e.g by 3 . The issue is, if ...
31 views

### What does standard deviation mean when using Predict[]?

I am using the Machine Learning function Predict[data, Method -> "DecisionTree"], and I am trying to get the most accurate measurement of its accuracy. ...
172 views

### Why this integral gives zero?

I would like to compute this integral for a =100, ... ,1500 $$\int_1^\infty \dfrac{\left(x^2-1\right)^{3/2}}{x} \,e^{-ax}\, dx$$ ...
1 vote
51 views

### Controlling accuracy for code

So I have a lot of trouble controlling precision and or accuracy with Mathematica. I have tried reading up for it but in the end I get even more confused. Here is my code, it is a little long but it ...
239 views

### NIntegrate fails to converge to desired accuracy

I am calculating an integral with Mathematica. This is the code I am using: ...
22 views

### Issues with ConvexOptimization and SetPrecision

I am completely new to Mathematica (second day), so do not expect things to look polished. I am trying to perform a ConvexOptimization over a List/Array (dimensionality ...
1 vote
78 views

### Plotting high precision high degree polynomial

When I plot a high degree polynomial such as (available as CloudObject since it is too big to explicitly include): ...
1 vote
82 views

### Divide by zero warning: Actual division by zero or spurious?

I have the following code that calculates the gain of an amplifier ...
267 views

### Error "is too small to represent as a normalized machine number; precision \ may be lost " for small values in Plot

I'm trying to plot two curves but I'm having issues with the lower end of the range: ...
62 views

### What's the best method to use when NIntegrating a sinx + cosx type function?

I'm having some problems when trying to NIntegrate a sinx + cosx type function. I have already tryed several combinations of ...
69 views

When I evaluate x = 1.0000000000000000001 (* Precision of 20 digits *) Mathematica returns ...
90 views

### long division acurate answer on dividing long numbers [closed]

ok but first of all if i have the huge number to be divided what will i have to use for the division to be accurate long division or some other formula square root or 2 this is to calculate music ...
341 views

### Real number equality (==) not working: what's the least-overcomplicated solution?

I'm running a program that evaluates equalities after I substitute all symbols for numbers. The equalities on floats are giving me trouble. My program is reaching a point where something like the ...
39 views

### How do change precision in coefficients in matrices

I alway have this kind of matrices... obviously I would like to have 0s instead of 10^-15. I've tried with N[] function but doesn't work. Does anybody know how to proceed in this case?
1 vote
117 views

### Is the result given by NSolve sufficiently reliable to claim that there is such a solution for the equation?

I use this code for ContourPlot ...
35 views

### How to obtain the most accurate maximum value of the given equation? Changing WorkingPrecision gives different results

I have two functions $f(x,y)$ and $g(x,y)$ over the domains $1.56 <x< 1.6$ and $3<y<\pi$. ...
32 views

1 vote
94 views

### NSolve and FindRoot give a value which is not correct; how can I obtain the exact solution of the given equation? [closed]

I have two functions $f(x,y)$ and $g(x,y)$, I use this code ...
73 views

### Crashing mathematica 12.3 with a simple ODE

I'm trying to solve an ODE using the following code: ...
85 views

### RegionMember command alternative that can check members exactly?

My problem is as follows: I have an exact rational polygon created using ConvexHullMesh and given a rational point I need Mathematica to decide exactly if it is ...
99 views

Matlab: ...
1 vote
54 views

### Accuracy issue in computing a Markov Transition Matrix

this question is based on a previous post of mine. I am simulating a one-dimensional Markov process on a linear graph. Transition probabilities are different than zero only for nearest neighbours of ...
1 vote
98 views

### Exponential fit precision lost

I have a data: ...
45 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 (...
1 vote
93 views

### How to make Mathematica work only with 10 digits? [duplicate]

I have a quite frustrating problem. In my code, I need Mathematica to ignore everything after 10 digits. For example I need it to treat: 25.26011447795545 as ...
1 vote
51 views

### How to use ContourPlot and illustrate the domain of its separate lines over one axis as continuous lines on the top?

I am using this code ...
85 views

### Rational numbers in NDSolve

Is it possible to use NDSolve with Rational numbers instead of Real? I use all rational ...
65 views

### Which one is more accurate Solve or NSolve? How can I get the same result as Solve using NSolve in the given code?

I am using this code to calculate the quantity $sol$. Using Solve, I get the result $9.8598$ ...
674 views

### How to force Mathematica to do infinite-precision calculations?

Consider the following calculation: 1234*5678*90.12 The result is: 6.31439*10^8 However, I want to get a precise result. Of ...
36 views

### Precision Issue in LinearOptimization - dual solution is not feasible

Trying to solve a linear program with high precision requirements and am interested in both the primal and the dual solution. Prefer solving the primal problem for convenience and solving the dual ...
71 views

### Avoid Extrapolation When Using NMaximize on Interpolating Functions

I want to use NMaximize to find the maximum value given by one interpolation function with respect to a constraint given by a second interpolation function. The main problem is that NMaximize produces ...
1 vote
24 views

### Mathematica 12.1: Evaluation result does not show decimals [duplicate]

It surprises me that Mathematica does not show decimals after evaluating the following calculations: 500000+5.05 Result: 500005. Expecting: 500005.05 ...
1 vote
109 views

### Nonlinear model fit gaussian precision

I wanted to fit double gaussian but it doesn't work, it doesn't fit gaussian. The error I get: Data:data Here is code ...
1 vote
45 views

### KernelMixtureDistribution error message about precision

I want to use KernelMixtureDistribution to deal with a large amount of data points. For example, the following codes shows how I use it: ...
42 views

### Why is the N` function giving me the wrong result when using WolframScript? [duplicate]

I am using wolframscript.exe to learn mathematica and I would expect the following code to return 0.7071: ...
52 views

### Why it remains only one digit after point in this numerical computation?

Why? And why N doesn't help? How to change and/or make it permanent?
59 views

1 vote
74 views

### Wrong limit appears [closed]

Consider the following limit $$\lim_{x\to-\infty}x-\sqrt{x^2+7x}$$ Going through some algebra leads to \begin{align} \lim_{x\to-\infty}x-\sqrt{x^2+7x}&=\lim_{x\to-\infty}\frac{(x-\sqrt{x^2+7x})...
1 vote
46 views

### Mathematica returns zero for small rational number to 1/133 power but not zero [closed]

This small number raised to the 1/133 root is not zero but Mathematica is underflowing with the computation. I assume Mathematica is first computing the quotient numerically, then taking the root: <...
65 views

### Minimizing a quadratic form: Failed to converge to the requested accuracy or precision within 100 \ iterations

I'm trying to minimize this type of quadratic form: ...
1 vote
91 views

### How to calculate precise higher derivatives of ParametricNDSolve solution

Higher Derivatives of NDSolve don't match the results from DSolve solution, can I somehow increase the accuracy of numerical method to match arbitrarily high derivatives? Equation I am using ...
59 views

### Issues with Nintegrate - different methods yielding different values (both giving warnings)

I am integrating the following function \begin{equation} \frac{1}{2d^{2}}\times\frac{\sqrt{\omega_{c}\left|t_1-t_2\right|}-\sqrt{\pi}e^{\frac{1}{\omega_{c}\left|t_1-t_2\right|}}\text{erfc}\left(\frac{...
I am plotting the following function $\frac{\sqrt{t \text{$\omega_c $}}-\sqrt{\pi } e^{\frac{1}{t \text{$\omega_c $}}} \text{erfc}\left(\frac{1}{\sqrt{t \text{$\omega_c$}}}\right)}{(t \text{$\omega_c\$}...