Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tabulate an expression in arbitrary precision

2 views
Skip to first unread message

Leslaw Bieniasz

unread,
Nov 29, 2008, 4:32:55 AM11/29/08
to
Hi,
I am new to MATHEMATICA, and I am looking for advice.
I have access to MATHEMATICA 6.0.
I need to tabulate values of a certain expression involving error function Erf[x], for a number of x values.
The problem is that I need to do these calculations in
arbitrary precision (that is I want to be able to control
the number N of significant digits). Can anybody show me some examples of how this might be done? I stress I know
nothing about MATHEMATICA. I want the results to be displayed and saved in the form of a table having two columns, where the first column contains x values, and
the second column contains the corresponding values of the expression, with all N significant digits.

Leslaw

Bob Hanlon

unread,
Nov 30, 2008, 6:58:19 AM11/30/08
to
If machine precision is good enough:

Grid[Prepend[Table[{
NumberForm[x, {2, 1}],
NumberForm[Erf[x], {11, 10}, DigitBlock -> 5]},
{x, 0, 1, 0.1}],
TraditionalForm /@ {x, Erf[x]}],
Frame -> All]

For greater precision:

n = 25;
Grid[Prepend[Table[{
NumberForm[N[x], {2, 1}],
NumberForm[N[Erf[x], 2 n], {n + 1, n}, DigitBlock -> 5]},
{x, 0, 1, 1/10}],
TraditionalForm /@ {x, Erf[x]}],
Frame -> All]


Bob Hanlon

---- Leslaw Bieniasz <nbbi...@cyf-kr.edu.pl> wrote:

=============

Leslaw


--

Bob Hanlon


Raffy

unread,
Dec 1, 2008, 7:00:27 AM12/1/08
to
On Nov 29, 4:32 am, Leslaw Bieniasz <nbbie...@cyf-kr.edu.pl> wrote:
> Hi,
> I am new to MATHEMATICA, and I am looking for advice.
> I have access to MATHEMATICA 6.0.
> I need to tabulate values of a certain expression involving error functio=

n Erf[x], for a number of x values.
> The problem is that I need to do these calculations in
> arbitrary precision (that is I want to be able to control
> the number N of significant digits). Can anybody show me some examples of=

how this might be done? I stress I know
> nothing about MATHEMATICA. I want the results to be displayed and saved i=
n the form of a table having two columns, where the first column contains x=
values, and
> the second column contains the corresponding values of the expression, wi=

th all N significant digits.
>
> Leslaw

Table[{N[x], N[Erf[x], 32]}, {x, -3, 3, 1/5}] // TableForm

0 new messages