# Questions tagged [precision-and-accuracy]

The tag has no usage guidance.

612 questions
Filter by
Sorted by
Tagged with
40 views

### Evaluation gives different results before and after simplifying expression

I am trying to evaluate $h(z)=\frac{f(z)}{g(z)}$ at points $z$ close to 0. Here I have taken an example value of $z=\texttt{z1}=10^{-7}$ for demonstration. I notice that evaluating the fraction before ...
92 views

### Generating sequence from a number with Precision

This question was from the End-Semester question paper of the previous year of my Course on Wolfram Mathematica - Apparently when I try to code it, something is going wrong with respect to Precision - ...
1 vote
59 views

### Appying Function To All Elements Of A Long List vs Over List's First Element Gives Different Results

So, I have two lists, and a function. If I apply my function to both lists in a "listable" manner, I have one result, but if I apply it to lists' elements one-by-one, in a "map" ...
110 views

### Precision error in ND package

Based on the helpful answers to this question, I wrote the code below to compute zeros of the derivative of the Riemann zeta function, high in the critical strip ...
31 views

### How to treat small numbers in order to gain efficiency and precision in neural network algorithm?

Unfortunately I won't be able to provide a MWE, as it would be too big and complex, and this question will be based on pure semantics, basically (and I understand if this is impossible to answer in ...
54 views

### NMinimze cant find points that satisfy constraints

NMinimize cant find solutions for a function which clearly has one. Setting a working precision resulted in some output, however with error messages about tolerance and precision. Heres my code. The ...
62 views

### Orthonormal Wavelet functions

The wavelet function "WaveletPsi" is supposed to create an orthonormal basis of some space. Now consider e.g. the following wavelet function: ...
49 views

### Spurious solutions when using NSolve on a simplified equation

I am solving an equation that should have only one solution in $[0,1]$, and as shown below, equ2 is a simplified version of equ1 ...
78 views

### Accuracy or precision issues with this code

I'm experiencing issues with the code below (this working code solves the Tolman-Oppenheimer-Volkoff (TOV) equations in general relativity, for the hydrostatic equilibrium of a spherical star). ...
106 views

### Exp[-690255.2204176334] is too small to represent as a normalized machine number; precision may be lost [closed]

I'm trying to visualize the relationship of maximum temperature $(T_{m})$ with the heating rate with Randall-Wilkins theory for an energy depth of 0.85 eV. The Randall-Wilkins expression used is ...
1 vote
84 views

### How to improve the accuracy of FindRoot or NDSolveValue at extreme conditions in my equation system?

This is a follow up question to my earlier one. I have posted a question related to a DAE system. Here is my earlier question and the equation system now I am asking for an answer is ...
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 ...
104 views

### How to modify the given codes (NIntegrate of Boole) to get the most accurate result possible?

I have five conditions con1 to con5 over the two-dimensional domain $t,u\in[o,2\pi]$. I want to compute this area $(con1 \cap con2 )\cup(con3 \cap con4 \cap con5)$ numerically. I try the two codes ...
1 vote
52 views

### How to modify NIntegrate code below so that it gives the most accurate/reliable numerical result?

Imagine that I have two conditions con1 and con2 over the two-dimensional domain $x,y\in[-2,2]$. I want to compute the area of the union of these two conditions i.e. the region $(con1 )\cup(con2)$. I ...
1 vote
105 views

I'm currently working with the HeunB function, and am finding that its numerical precision is not sufficient at large arguments - in particular I have the function $\text{HeunB}\left[-k^2,1-\beta ,\... 3 votes 4 answers 469 views ### Why is precision so low despite setting working precision to 25? I am currently generating some Gauss-Jacobi quadrature rules. Along the way, I have to find zeroes of Jacobi polynomials. In particular, I have this piece of code: ... 3 votes 2 answers 105 views ### RegionFunction is imprecise I've managed to print clipping a figure inside another. That's impossible out of controlling directly their coordinates (x, y[, z]), and then it's impossible to do a graphic clipping over an already ... 0 votes 0 answers 43 views ### Random precision in the digits I am running Mathematica 12.3.1.0 under Windows 11 64-bit. Everything was running perfectly under Windows 10, until I updated to Windows 11. Now, I type, for example, k = 1.3807 10^-23 m = 1.3804 10^-... 0 votes 2 answers 152 views ### WhenEvent in NDSolve -management of accuracy I am bouncing a particle off various surfaces and using WhenEvent to determine when I hit the surface. Here are some very simple examples for when things go ... 1 vote 1 answer 110 views ### How to solve the problem with the error in FindRoot for non-linear equation? Whoever is reading this have to be patient as the code is slightly long and I have explain each section in order to explain the problem. So I want to solve the set of non-linear algebraic equation ... 0 votes 0 answers 36 views ### How to increase precision close to a irregular singular point of a numerical solution? Using for example an ODE like ode = t^3 y''[t] + t y'[t] + y[t] with the following boundary conditions ... 2 votes 2 answers 137 views ### How to get correct numerical result without lots of digit precisions? I am wondering if it is possible to get the correct numerical result without computing with a lot of precisions in expressions. as a simple example suppose in the middle of some of my numerical code ... 1 vote 1 answer 101 views ### How to improve accuracy of the integration in the following case? Consider the following function dsPrimakovdtnucleus: ... 0 votes 0 answers 35 views ### FindRoot::nlnum and InterpolatingFunction::dprec problem ... 5 votes 1 answer 137 views ### Incorrect answer zero where correct answer is very large (precision issue) Define a function F as follows: F[α_, x_] = N[Exp[x/2] Abs[Gamma[α/2 + I x /(2 Pi)]]^2, 10]; It is a product of two terms. ... 0 votes 0 answers 64 views ### Answer changes slightly when re-run I am trying to resolve why I get slightly different answers when I re-run my notebook. Here is my full code: ... 6 votes 2 answers 224 views ### How to ensure for a solution of NDSolve to be positive? I'am trying to solve kinetic equation for test particles in the Maxwellian plasma. It is Vlasov equation appended with Landau integral of collisions. It is proven that solution of such an equation is ... 2 votes 1 answer 125 views ### Increase precision of matrix multiplication [closed] I am computing U.U......U.x, where x is a vector, U a square matrix and the product involves N times U, i.e., (U^N).x if you like. One way to do this is ... 0 votes 0 answers 42 views ### Numerical integration converging too slowly with Tanhyberbolic function ... 2 votes 3 answers 153 views ### Accuracy and precision control for a simple calculation [closed] Consider a very simple calculation:$231 \times (2.54) ^ 3$, which is the number of cubic cm in a US gallon. On my phone app calculator I got the exact answer, which is$3785.411784$. On Mathematica, ... 1 vote 1 answer 125 views ### How do I speed up this numerical integration with Bessel functions? (Tried changing Working Precision and Integration Strategies) I need to compute the function P[b] given as follows: ... 1 vote 1 answer 56 views ### LinearOptimization and Accuracy Surprised to encounter the following issue in handling Accuracy with LinearOptimization: ... 0 votes 1 answer 98 views ### Is there any alternative for conditional plot that gives a more precise result in a shorter time? I have the given function$Func$and want to have a plot of those domains where$-3\leq Func\leq 3$in precise details. I am using ... 1 vote 0 answers 73 views ### How to handle "too small to represent as a normalized machine number" when plotting a figure [duplicate] I am trying to plot a figure by the following codes: Plot[(27 2^((-2 + a)/(-1 + a)) 5^(a/(-1 + a)) 7^(1/(1 - a)) a^2)/((-1 + a) (4 + 9 a)), {a, 1.001, 3}] ... 3 votes 3 answers 334 views ### Equality of almost equal lists Can you help me with this common problem I have? Given two lists: a={339.66666666666697, -287.4444444444446, 0.} and ... 1 vote 1 answer 47 views ### Interval Arithmetic when calculating eigenvectors Consider the following matrix with entries being intervals ... 2 votes 2 answers 253 views ### How to prevent Mathematica from rounding some PDF values to 0? Dear Mathematica community, I'm having a problem with the PDF function for the hypoexponential distribution. Specifically, Mathematica returns 0 as soon as the value is very small. Below is an example:... 1 vote 1 answer 67 views ### Using FindRoot and having problems with$MaxExtraPrecision

I'm trying to find the roots of the function radial, written below. And to make this, I'm using the function \[Omega]ini to ...
1 vote
101 views

### Kahan Compensated Summation

Is there an example/library that implements Kahan summation in Mathematica for matrix-matrix/vector-matrix multiplication? Having some trouble adapting something like this Compilation of Total with ...
1 vote
22 views

### FindShortestPath failing with All even when GraphDistanceMatrix succeeds

Shortest Path routines are commonly used within more complex optimization methods that work to ensure there are no negative cycles even when there are negative weight edges. Often there are 0 weight ...
1 vote
85 views

### Am I losing precision in manually entered equations?

I am using the following code to calculate the two solutions of a quadratic equation in the variable t. ...
192 views

### Floating point precision and speed [closed]

I am attempting to understand how to speed up the evaluation of numerical expression. Specifically, following the first point of this blog, Mathematica is much quicker dealing with floating-point ...
342 views

### Solution gets worse as I increase Precision and Accuracy goals

I am numerically solving the following ODE below. If I set AccuracyGoal and PrecisionGoal both to 10 I get a solution that makes sense: constant and then damped oscillation. However, all things equal, ...
315 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
39 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: ...
115 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 ...
88 views

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

Consider the following function and integral: ...
164 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 ...
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$$ ...