If you `Rationalize`

your real numbers you will be able to use *Mathematica's* arbitrary precision engine:

```
poly2 = Rationalize[poly[z], 0];
Plot[poly2, {z, 0, 1}, WorkingPrecision -> 50]
```

## Arbitrary and machine precision

*Mathematica* has two kinds of numeric calculations: machine precision, and arbitrary precision. Machine precision is fast but is limited to 53 binary (≈16 decimal) digits^{(1)(2)} and may lose precision during a calculation. *Mathematica* also does not track the precision of a result.

Numbers entered as `1.234`

or `1234``

are taken to be machine precision.

Arbitrary precision is slower, but *Mathematica* will track the precision of calculations, often using more calculations as necessary to preserve precision, and print the precision of the result.

Exact values such as `1234`

and `1/2`

can be used in arbitrary precision calculations. Numbers can also be entered with e.g. `1.234`20`

specifying 20 digits of precision, and these will automatically use arbitrary precision if *all other values* are either exact or arbitrary.

Precision can be checked with the function `Precision`

:

```
Precision /@ {1.234, 1234`, 1.234`20, 7}
```

```
{MachinePrecision, MachinePrecision, 20., ∞ }
```

Precision can only be preserved if all values in a calculation have at least that precision. Also, arbitrary precision arithmetic may be used with numbers having a precision less than `MachinePrecision`

-- *Mathematica* will show the true precision of the result.

```
Precision[1.234 + 7]
Precision[1.234`20 + 1.234`12]
```

```
MachinePrecision
12.301
```

Precision can be set with `SetPrecision`

. It is probably better to use this rather than `Rationalize`

to put numbers into a form that the arbitrary precision engine will use, because the latter will be manufacturing false precision.

Applying this to your problem:

```
poly3 = SetPrecision[poly[z], 15];
Plot[Evaluate[poly3], {z, 0, 1}, WorkingPrecision -> 50]
```

During evaluation of In[91]:= Plot::precw: The precision of the
argument function <<>> is less than WorkingPrecision (50.`). >>

This is an important warning because it lets you know that your results may not be valid.

See this tutorial for more information about precision. Take time to understand the difference between *Mathematica's* meanings of `Accuracy`

and `Precision`

.

Recommended reading, a more recent answer from Szabolcs regarding arbitrary precision:

Michael's answer shows the folly of simply doing a `Rationalize`

as I did at the start of this answer. Since questions like this come up often it would be good to have a general solution that is easily applied. I propose this rule using his formula:

```
machineToInterval =
c_Real?MachineNumberQ :>
Interval[ {1 - 2^-54, 1 + 2^-54} SetPrecision[c, ∞] ];
```

This converts any machine numbers into explicit `Interval`

form.

To extract an ordered pair of values from a numeric `Interval`

we merely need `First`

.

```
poly3 = poly[z] /. machineToInterval;
Plot[{First @ poly3, poly[z]}, {z, 0, 1}
, WorkingPrecision -> 50
, PlotStyle -> {{Thick, Red}, ColorData[97][1]}
]
```

6Have you considered that you're working with a 29th degree polynomial with insanely huge coefficients? It's not surprising to me that you get a plot like that. It may seem "nice" early on, but that's because z^29 (and other high-order terms) is very small near 0. Near approximately 0.85, it rapidly approaches 1. – Mike Bailey – 2012-03-18T02:14:15.607

6@Mithc, I will have to disagree with you. Just because the terms of the ploynomial get large as z goes to 1 does not mean you should expect this type of erratic behaviour. Indeed the polynomial can have no more than 29 real roots! So why you expect a plot like this is beyond me. You should not have voted the question down. I suspect a numerical issue here and was hoping somebody could help me pin it down. – None – 2012-03-18T03:09:17.130

8It's cancellation error. Per advice in the response, use higher precision and/or rationalize the coefficients. And be sure you know what you are doing in terms of what might comprise an "expected" outcome, because the result might not mean much if the actual coefficients really have error intervals associated with them. – Daniel Lichtblau – 2012-03-19T01:16:31.160