Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.maple > #297 > unrolled thread

number of digits in Maple

Started bypluton <plutonesque@gmail.com>
First post2012-01-08 14:17 -0800
Last post2012-01-16 20:45 -0800
Articles 9 — 5 participants

Back to article view | Back to comp.soft-sys.math.maple


Contents

  number of digits in Maple pluton <plutonesque@gmail.com> - 2012-01-08 14:17 -0800
    Re: number of digits in Maple "Thomas D. Dean" <tomdean@speakeasy.org> - 2012-01-08 21:01 -0800
      Re: number of digits in Maple "G. A. Edgar" <edgar@math.ohio-state.edu.invalid> - 2012-01-09 07:00 -0700
        Re: number of digits in Maple pluton <plutonesque@gmail.com> - 2012-01-09 07:31 -0800
          Re: number of digits in Maple "Thomas D. Dean" <tomdean@speakeasy.org> - 2012-01-09 08:32 -0800
            Re: number of digits in Maple pluton <plutonesque@gmail.com> - 2012-01-09 12:30 -0800
    Re: number of digits in Maple Axel Vogt <&noreply@axelvogt.de> - 2012-01-09 22:44 +0100
    Re: number of digits in Maple acer <maple@rogers.com> - 2012-01-09 20:43 -0800
      Re: number of digits in Maple pluton <plutonesque@gmail.com> - 2012-01-16 20:45 -0800

#297 — number of digits in Maple

Frompluton <plutonesque@gmail.com>
Date2012-01-08 14:17 -0800
Subjectnumber of digits in Maple
Message-ID<6007336.1918.1326061067180.JavaMail.geo-discussion-forums@vbw20>
Hi,

If I understood well current computer can numerically handle 16 digits in floating points numbers. In Maple, the number of Digits can be controlled with th command Digits but looks like there is no difference between Numerical and Symbolic calculations. If I use kernelopts(maxdigits); my computer says 268435448 and I understand that Maple will use this number of digits for symbolic calculations but what about numerical calculations ?

Thank you

[toc] | [next] | [standalone]


#298

From"Thomas D. Dean" <tomdean@speakeasy.org>
Date2012-01-08 21:01 -0800
Message-ID<ZL2dnfHe9_8P6ZfSnZ2dnUVZ_q6dnZ2d@megapath.net>
In reply to#297
pluton wrote:
> Hi,
>
> If I understood well current computer can numerically handle 16 digits in floating points numbers. In Maple, the number of Digits can be controlled with th command Digits but looks like there is no difference between Numerical and Symbolic calculations. If I use kernelopts(maxdigits); my computer says 268435448 and I understand that Maple will use this number of digits for symbolic calculations but what about numerical calculations ?
>
> Thank you
Look at ? Digits
         ? evalf/details

Try evalf(Pi,100);

Tom Dean

[toc] | [prev] | [next] | [standalone]


#299

From"G. A. Edgar" <edgar@math.ohio-state.edu.invalid>
Date2012-01-09 07:00 -0700
Message-ID<090120120700093310%edgar@math.ohio-state.edu.invalid>
In reply to#298
In article <ZL2dnfHe9_8P6ZfSnZ2dnUVZ_q6dnZ2d@megapath.net>, Thomas D.
Dean <tomdean@speakeasy.org> wrote:

> pluton wrote:
> > Hi,
> >
> > If I understood well current computer can numerically handle 16 digits in
> > floating points numbers. In Maple, the number of Digits can be controlled
> > with th command Digits but looks like there is no difference between
> > Numerical and Symbolic calculations. If I use kernelopts(maxdigits); my
> > computer says 268435448 and I understand that Maple will use this number of
> > digits for symbolic calculations but what about numerical calculations ?
> >
> > Thank you
> Look at ? Digits
>          ? evalf/details
> 
> Try evalf(Pi,100);
> 
> Tom Dean

Also try this:

restart;
A := evalf(sqrt(2));
Digits := 50;
B := evalf(sqrt(2));
B-A;

-- 
G. A. Edgar                              http://www.math.ohio-state.edu/~edgar/

[toc] | [prev] | [next] | [standalone]


#300

Frompluton <plutonesque@gmail.com>
Date2012-01-09 07:31 -0800
Message-ID<18239699.1083.1326123119619.JavaMail.geo-discussion-forums@vbyc2>
In reply to#299
but what about the so-called floating point arithmetic? I thought a computer could not store more the 16 digits on average?

[toc] | [prev] | [next] | [standalone]


#301

From"Thomas D. Dean" <tomdean@speakeasy.org>
Date2012-01-09 08:32 -0800
Message-ID<5MCdnQ8dIvngi5bSnZ2dnUVZ_jidnZ2d@megapath.net>
In reply to#300
pluton wrote:
> but what about the so-called floating point arithmetic? I thought a computer could not store more the 16 digits on average?
? Digits talks about software floating point.  This is not limited to 16 
digits.

True, hardware floating point is limited to something like 16 digits on 
a 32-bit CPU.

I believe Maple uses hardware floating point for some things like plot.

Tom Dean

[toc] | [prev] | [next] | [standalone]


#302

Frompluton <plutonesque@gmail.com>
Date2012-01-09 12:30 -0800
Message-ID<6812333.18.1326141045724.JavaMail.geo-discussion-forums@yqdj19>
In reply to#301
ok, it sounds like what I am talking about is the format float64 but as you said, computers are not limited to it.

[toc] | [prev] | [next] | [standalone]


#303

FromAxel Vogt <&noreply@axelvogt.de>
Date2012-01-09 22:44 +0100
Message-ID<9n15e7F947U1@mid.individual.net>
In reply to#297
On 08.01.2012 23:17, pluton wrote:
> Hi,
>
> If I understood well current computer can numerically handle 16 digits in floating points numbers. In Maple, the number of Digits can be controlled with th command Digits but looks like there is no difference between Numerical and Symbolic calculations. If I use kernelopts(maxdigits); my computer says 268435448 and I understand that Maple will use this number of digits for symbolic calculations but what about numerical calculations ?
>
> Thank you

As G A Edgar says/shows: you can choose what you want.

The system will find a way. Roughly: many digits are like
n-tuples of bytes, just as float64 is a n-tuple of ...

Holds for any CAS (if it allows it), not only Maple.

[toc] | [prev] | [next] | [standalone]


#304

Fromacer <maple@rogers.com>
Date2012-01-09 20:43 -0800
Message-ID<442d1095-e166-4f81-bf18-ee47cd8ee2a7@z1g2000vbx.googlegroups.com>
In reply to#297
On Jan 8, 5:17 pm, pluton <plutones...@gmail.com> wrote:
> Hi,
>
> If I understood well current computer can numerically handle 16 digits in floating points numbers. In Maple, the number of Digits can be controlled with th command Digits but looks like there is no difference between Numerical and Symbolic calculations. If I use kernelopts(maxdigits); my computer says 268435448 and I understand that Maple will use this number of digits for symbolic calculations but what about numerical calculations ?
>
> Thank you

As others have explained, by itself "floating point" does not
necessarily mean 64bit double precision hardware floating-point. Maple
can do software floating-point computation, at Digits working
precision. The GnuMP library is used for some parts of software
floating-point computations. (See http://gmplib.org/ for more on
that.)

So, perhaps you are wondering whether Maple will always do numeric
computations only using software floating-point. The answer, in large
part, is no. Quite often it will use hardware double floating-point,
if Digits<=15, for numeric problems where the input is all numeric and
wholly (or sometimes partially) floating-point. Here below are some
places where that is the case,

compiled C (various dynamic libs in Maple's bin.xxxx folders):
  - sin, exp, sinh, etc, only where necessary to attain accuracy not
always available by OS runtime
  - LinearAlgebra (also including modular LA)
  - Statistics
  - Optimization (LP, QP, LS, entirely double precision)
  - dsolve/numeric
  - pdsolve/numeric
  - DiscreteTransforms
  - CurveFitting
  - etc, that I forget

alternative interpreter that is double precision, named evalhf:
  - evalhf'able procedures run wrapped with evalhf()

compiled procedures, using `Compiler` routine:
  - behind the scenes this takes a maple language user-written proc,
generates C source,
    compiles it, links it into a dynamic lib, dlsym opens that
function in that dy-lib,
    and provides an entry point that looks acts just like the original
user-written proc.

floating-point arithmetic, etc, inside regular proc's which have
`option hfloat`

arithmetic and special functions of scalar floating-point numbers,
whether that happen to be
scalar HFloat or scalar SFloat (latter requires intermediate
conversion).

Now, someone else here mentioned `plot`. What the plotting routines do
is (if Digits<=15) attempt to
run the procedure, or evaluate the expressions, under the above-
mentioned evalhf double-precision
alternative interpreter. If for some reason that fails (the evalhf
interpreter is more limited in the
scope of its functionality) then the plotting routines fall back to
software floating-point.

The reason for all of this, of course, is primarily the speed benefit.
Careful timings can reveal quite
a step increase in computation time, as these kinds of computation go
over the Digits=15 threshhold.
Also, software floats are stored as DAGs and memory managed, while
most of the above double-
precision operations do not require that (HFloats being an exception).
So additional memory management
is another cost that begins to accrue, with higher software floating-
point. It's an interesting question:
whether it would be worthwhile to replicate some of the double-
precision functionality listed above using
an efficient compiled quadruple-precision scheme, so as to mitigate
the penalty of the sharp rise in timing
as the Digits setting increased above 15 in value.

Hope that helps,
acer

[toc] | [prev] | [next] | [standalone]


#315

Frompluton <plutonesque@gmail.com>
Date2012-01-16 20:45 -0800
Message-ID<8605102.2570.1326775518143.JavaMail.geo-discussion-forums@vbzs10>
In reply to#304
ok, clarified. Thanks a lot to all of you.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.maple


csiph-web