Questions tagged [arbitrary-precision]

Questions on the arbitrary precision capabilities of Mathematica.

Filter by
Sorted by
Tagged with
0 votes
2 answers
100 views

Is there a way to convert a high precision value to its digits?

Is there a way to convert a number like 2.5326384172870370602159219766864657866396178797`20.124930050805514*^-12 to a high precision integer? Mathematica gives me only 20 digits with ...
levitymaster's user avatar
3 votes
4 answers
189 views

Calculating the angle between vectors returns small complex number instead of zero

I am calculating the angle between vectors $$cos(\theta{_a}{_b}) = \frac{a^T b}{||a|| ||b||}$$ In mathematica I am coding ...
Manuel Hernandez's user avatar
2 votes
2 answers
138 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 ...
ghadir jafari's user avatar
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:...
user88652's user avatar
0 votes
1 answer
55 views

ToString[SetPrecision[x,1.2]] doesn't work as expected

2nd Code Block demonstrates failure in comment of output ...
Phillip D. Neumiller's user avatar
0 votes
0 answers
30 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 ...
Dan Doe's user avatar
  • 113
0 votes
1 answer
76 views

Confusion about precision [duplicate]

When I evaluate x = 1.0000000000000000001 (* Precision of 20 digits *) Mathematica returns ...
Gert's user avatar
  • 1,470
-3 votes
1 answer
107 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 ...
NARI MILANI's user avatar
1 vote
0 answers
56 views

Finding the position of maximal value when dealing with precision numbers [closed]

In for example this answer a solution is given to find the position of a maximal value. However, this solutions seems to run into trouble when dealing with precision numbers. Take the following ...
Kvothe's user avatar
  • 4,197
2 votes
0 answers
109 views

Rational numbers in NDSolve

Is it possible to use NDSolve with Rational numbers instead of Real? I use all rational ...
amzon-ex's user avatar
  • 141
6 votes
2 answers
1k 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 ...
Wolf's user avatar
  • 145
3 votes
1 answer
78 views

Precision in Graph methods

It appears that GraphDistance, GraphDistanceMatrix, FindShortestPath, etc. all work with ...
user46831's user avatar
  • 633
0 votes
0 answers
145 views

How to use Equal for close arbitrary precision numbers to be considered the same?

I am trying to add a comparator function in a larger piece of code which can equate two arbitrary precision numbers and yields True if they are approximately close. ...
Ali Hashmi's user avatar
  • 8,900
1 vote
1 answer
154 views

General:munfl error problem

I have the following function, that is the result of The integration between x and some upper limit of a positive function, thus should be positive $f(x,vE) = \frac{e^{-1140.09 x} \left(e^{67945.5 \...
Giorgio Busoni's user avatar
3 votes
0 answers
258 views

How to deal with too small numbers

When dealing with a code that produces too small numbers (in a complicated way) like 0.33691 4.015757066049965*10^-330 I get the following warning General::munfl: ...
S. Euler's user avatar
  • 317
1 vote
1 answer
102 views

InverseFunction: Precision problem

I define a function SS[t] as an inverse function: ...
Job Stancil's user avatar
2 votes
2 answers
181 views

Most efficient strategy for integrating over removable poles?

I am finding many situations where I have to numerically integrate some function $f(x)$ of the form: $$f(x)=f_{s}(x)-ax^{-n},$$ where $f_s$ is a special function with a finite-order pole that is ...
WillG's user avatar
  • 854
2 votes
1 answer
152 views

Shouldn't NIntegrate return a number whose Precision is PrecisionGoal, not WorkingPrecision?

I know that Mathematica has great built-in precision tracking, so when you do calculations with arbitrary-precision numbers, Mathematica keeps track of the precision on the result. Given this careful ...
WillG's user avatar
  • 854
0 votes
0 answers
56 views

Use Check in a While loop without wasting the calculation

I am trying to generate and solve a matrix that tends towards being singular using variable arbitrary precision to ensure accuracy. Consider, for example, a matrix with tunable singularity: ...
Eli Lansey's user avatar
  • 7,429
0 votes
1 answer
89 views

Solving linear systems efficiently

In certain calculation I encountered a system of linear equations in 144 variables, and it takes hours to compute. Most probably the reason is that coefficients are really huge integers (about $10^{50}...
მამუკა ჯიბლაძე's user avatar
2 votes
1 answer
157 views

Difficulty when trying to find roots to high accuracy

I'm working with the logistic map $f(x,\lambda)=4\lambda x(1-x)$, and iterations of the logistic map $f^{(2^n)}(x,\lambda)=f^{(2^{n-1})}(f^{(2^{n-1})}(x,\lambda),\lambda)$. There are some special ...
David's user avatar
  • 270
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 ...
WillG's user avatar
  • 854
0 votes
0 answers
61 views

Increase precision of ConvexHullMesh

I want to generate a set of equations for all planes in the convex hull as specified in this question. The problem is that the generated set of equations don't correctly cover all the points. I run a ...
Samvid Mistry's user avatar
1 vote
0 answers
168 views

FindMaximum does not use requested WorkingPrecision

I think that there is a bug in the way FindMaximum handles WorkingPrecision for constrained problems. Has anyone encountered a similar problem before? Is there a work around? Here is an example in ...
Uri Z's user avatar
  • 31
2 votes
0 answers
180 views

`LinearSolve` in arbitrary precision has a sudden change in performance as the size of a problem is gradually increased

It is expected that calculations in arbitrary precision are much slower than in machine precision. However, LinearSolve has an unexpected behavior: there is a ...
renphysics's user avatar
  • 1,550
1 vote
2 answers
155 views

Does SetPrecision[x, Infinity] expose the internal exact number in the approximated number?

What I already know (maybe) : My theory about Mathematica's way of implementing approximated number An number approX with arbitrary precision ...
Murphy Ng's user avatar
  • 177
0 votes
1 answer
60 views

How to initialize arbitrary precision?

How do I calculate $$\frac{1}{{\frac{1}{7 \times 10^7}- \frac{8\times10^{17}\times 3.1\times 10^7}{6.7 \times 10^{-11}\times \left(1.9 \times 10^{27}\right)^2} }}\tag{1}$$ To arbitrary precision? I ...
BLAZE's user avatar
  • 127
0 votes
0 answers
85 views

Creating an interpolation matrix efficiently

I would like to know if there is a fast way to create the following matrix (note that the matrix is defined with arbitrary precision): ...
user12588's user avatar
  • 585
2 votes
1 answer
96 views

Dealing with zero at high precision

I am using mathematica to deal with rational functions, $p(x)/q(x)$, where the polynomials, $p,q$ have a high degree and coefficients with high order of precision, e.g: ...
Bulkilol's user avatar
  • 289
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 ...
Indeterminate's user avatar
0 votes
0 answers
47 views

What is the limit of digits to show in the conversion of an exact number to an Arbitrary Precision Number?

By executing something like N[π, c] what is the maximum positive integer value c can have until the output is compromised by ...
FRANCESCO's user avatar
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 ...
FRANCESCO's user avatar
5 votes
1 answer
187 views

Linear Algebra in Arbitrary Precision - SLOW

I am trying to implement an arbitrary precision algorithm, but I am not very familiar with Mathematica or arbitrary precision arithmetic. I was able to implement it but surprised by how much slower it ...
Maya's user avatar
  • 71
1 vote
0 answers
58 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 ...
1010011010's user avatar
0 votes
1 answer
99 views

Why this very simple problem turns to "Indeterminate"?

Why the following calculation gives Indeterminate value? ...
Bekaso's user avatar
  • 629
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]. ...
Bekaso's user avatar
  • 629
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 ...
user63612's user avatar
  • 103
5 votes
0 answers
65 views

DumpSave and precision of interpolation data

Consider the following prec = 32; x = N[Range[0, 1, 1/10], prec]; f = Interpolation[Transpose@{x, x}]; Then ...
mmal's user avatar
  • 3,498
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 ...
XinBae's user avatar
  • 617
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 ...
Alex's user avatar
  • 45
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]]: ...
Alex's user avatar
  • 45
0 votes
1 answer
109 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....
Alex's user avatar
  • 45
10 votes
1 answer
282 views

Arbitrary Precision, Nearly-Singular Matrices, and LinearSolve

I have been trying to solve a nonlinear eigenvalue problem, $\mathbf{M}(\lambda) \mathbf{v} = 0$, in Mathematica using Newton's method. The core of the algorithm relies upon an inverse iteration, ...
john's user avatar
  • 101
5 votes
2 answers
584 views

Why does N not upgrade precision? [duplicate]

Precision[N[1.0, 20]] Precision[N[1, 20]] MachinePrecision 20. It would be so much more intuitive and less error prone, if <...
Johu's user avatar
  • 4,876
9 votes
1 answer
249 views

Plot3D discrepancy between MMA 10 and 11.3 - possible small numbers issue

I'm having some troubles with the following code I wrote in MMA 10 some time ago: ...
Fraccalo's user avatar
  • 5,997
5 votes
2 answers
223 views

Early vs. late application of arbitrary precision

The following arbitrary-precision computations, in which arbitrary precision is applied early (to the inputs), both work as expected: ...
theorist's user avatar
  • 3,603
8 votes
1 answer
990 views

What is wrong with importing Real32 or Real64?

Those who visit the chat might have seen the question of varkor. I'm posting it here in the hope that I have missed something. Assume you have a real number ...
halirutan's user avatar
  • 112k
6 votes
1 answer
339 views

Mathematica precision common problems

When I do something a little bit more complicated than standard documentation examples, I often hit precision problem. Or I accidentally disprove Riemann hypothesis Like this ...
Zlelik's user avatar
  • 531
1 vote
1 answer
268 views

Interpolation function precision in multi dimentional case

I have this interpolation example ...
Zlelik's user avatar
  • 531
4 votes
1 answer
333 views

Can NDEigensystem use arbitrary precision arithmetic?

Consider the following computation of an eigenfunction of 1D Laplacian on the interval of $[0,\pi]$: ...
Ruslan's user avatar
  • 7,122