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
AI Thread Summary
The discussion centers on the potential for amateur research in numerical analysis, particularly in relation to programming and handling large numbers. The participant expresses a keen interest in numerical methods and has experience with programming in Pascal and C++. They inquire about the feasibility of approximating mathematical constants like pi and e to 1000 decimal places, highlighting challenges faced with large number arithmetic, such as buffer overflows. Key recommendations include exploring arbitrary precision arithmetic, which is essential for performing calculations with a high degree of accuracy. Resources such as the Apfloat library for C++ and GMP (GNU Multiple Precision Arithmetic Library) are suggested for those interested in high-performance calculations. Additionally, the use of tools like Mathcad for symbolic processing and specific algorithms like the spigot algorithm for generating digits of pi are mentioned as useful for handling large numerical computations. Overall, the thread emphasizes the importance of understanding advanced programming techniques and mathematical concepts to achieve ambitious numerical analysis goals.
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: 489
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top