Could you find good numerical approximations to math. problem with a PC?

  • Thread starter Thread starter Arian.D
  • Start date Start date
  • Tags Tags
    Numerical pc
Click For Summary
SUMMARY

This discussion centers on the pursuit of numerical analysis using programming languages like C++ and Pascal. The user seeks to explore arbitrary precision arithmetic to perform calculations involving large numbers, specifically aiming to approximate constants like pi and e to 1000 decimal places. Recommendations include using the Apfloat library for C++ and exploring the GMP library for arbitrary precision arithmetic. The conversation highlights the importance of understanding algorithms such as the spigot algorithm for generating large numbers.

PREREQUISITES
  • Basic knowledge of C++ programming
  • Understanding of numerical integration methods (trapezoidal method, Simpson's rule, midpoint rule, Gaussian quadrature)
  • Familiarity with arbitrary precision arithmetic concepts
  • Experience with mathematical software tools like Mathcad
NEXT STEPS
  • Research the Apfloat library for implementing arbitrary precision arithmetic in C++
  • Explore the GMP library for additional arbitrary precision capabilities
  • Study the spigot algorithm for efficient digit generation of pi
  • Learn about symbolic processors in mathematical software like Mathcad, Maple, or MuPad
USEFUL FOR

Amateur researchers in numerical analysis, programmers interested in high-precision calculations, and anyone looking to deepen their understanding of arbitrary precision arithmetic.

Arian.D
Messages
101
Reaction score
0
I've recently taken a basic numerical analysis course in university and the subject intrigues me so much. I know Pascal and C++ fairly well, not very good like a professional programmer, but just to tell you how good I am, I've coded several programs for numerical integration using trapezoidal method, Simpson's rule, midpoint rule and Gaussian quadrature rule.
So my main question is, how far I could go forward doing amateur research in numerical analysis? I've seen that when I try to do arithmetic on large numbers things go wrong and with my limited knowledge of CS I guess a buffer overflow happens. So I guess I need to know some professional programming to be able to get some fascinating results. For example can I approximate pi up to 1000 decimals on a PC? Can I approximate e up to 1000 decimals? Things like that.

I feel I have very little information about the subject, that's why I can't explain myself very well, but I think I've somehow tried my best to tell you what my intention is, I leave the rest up to the reader that helps me what I should do. My goal is to do amateur research in numerical methods of computing math. operators by computer. What things do I need to know? What limits will I face? etc. Thanks in advance.
 
Technology news on Phys.org
Arbitrary Precision Arithmetic is what you need. Here you have a package for C++ since you know how to program on C++. http://www.apfloat.org/apfloat/

you can do more research on your own, the term is "arbitrary precision arithmetic". That's what Mathematica and other programs use I guess.

Here's a citation of what the website says:
ApFloat said:
Apfloat is a high performance arbitrary precision package. That means you can do calculations involving millions of digits with it.

EDIT: Perhaps you would like this one too: http://gmplib.org/
 
Last edited:
Have a look at the Wiki entry for Arbitrary Precision Arithmetic http://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic

I use Mathcad as a general purpose mathematical tool and make use of its symbolic processor (either Maple or MuPad based, depending upon version) for large numbers.

There are also some interesting algorithms for generating large numbers, such as the spigot algorithm for pi. In the image below, I show one such implemented in Mathcad. It calculates each digit of pi and stores them in a vector. I then reduce the vector to a string for more convenient display (if you'd be so good as to ignore the missing decimal point between the first '3' and '1', I'd be grateful).
 

Attachments

  • phys - 12 06 14 arbitrary precision arithmetic 01.jpg
    phys - 12 06 14 arbitrary precision arithmetic 01.jpg
    31.8 KB · Views: 512

Similar threads

  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
4
Views
2K
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 62 ·
3
Replies
62
Views
8K
  • · Replies 1 ·
Replies
1
Views
3K