Presentation is loading. Please wait.

Presentation is loading. Please wait.

High Precision Calculation of the Digamma Function Mohammad I Rafiq School of Computer Science, Carnegie Mellon University Research Advisor : Dr. Victor.

Similar presentations


Presentation on theme: "High Precision Calculation of the Digamma Function Mohammad I Rafiq School of Computer Science, Carnegie Mellon University Research Advisor : Dr. Victor."— Presentation transcript:

1 High Precision Calculation of the Digamma Function Mohammad I Rafiq School of Computer Science, Carnegie Mellon University Research Advisor : Dr. Victor Adamchik Research Advisor : Dr. Victor Adamchik

2 Goal of the Project The main goal of this research project is to be able to compute the digamma and other related special functions, to an arbitrary precision. This has been implemented using NASA's ARPREC package. The other important aspects of this project are to deal with dynamically controlled precision, self correcting error codes and fixed precision calculations. The main goal of this research project is to be able to compute the digamma and other related special functions, to an arbitrary precision. This has been implemented using NASA's ARPREC package. The other important aspects of this project are to deal with dynamically controlled precision, self correcting error codes and fixed precision calculations.

3 Formulas for computation of the Digamma function

4 Results X-(110/213)-5-110/213110/213 110/213 + 5 Precision1000100010001000 Our time (sec) 3.693.312.153.32 Mathematica time (sec) 2.292.202.242.20 Accuracy1000100010001000

5 Results(contd) X-(110/213)-5-110/213110/213 110/213 + 5 Precision2000200020002000 Our time (sec) 32.3633.2332.0131.93 Mathematica time (sec) 23.0523.4523.023.29 Accuracy2000200020002000

6 Problem: Problem: Accuracy decreases as precision and x is increased e.g. Accuracy decreases as precision and x is increased e.g. 1) digamma(110/213 + 500) when calculated at a precision of 500 gives an accuracy of 362. 1) digamma(110/213 + 500) when calculated at a precision of 500 gives an accuracy of 362. 2) digamma(110/213 + 50) when calculated at a precision of 1000 gives an accuracy of 781. 2) digamma(110/213 + 50) when calculated at a precision of 1000 gives an accuracy of 781. Solution: Solution: To use an adaptive precision system rather than a fixed precision system. An adaptive precision system is a floating point system based on significance arithmetic which dynamically adjusts the number of digits used in computations. This is also known as self correcting error codes. To use an adaptive precision system rather than a fixed precision system. An adaptive precision system is a floating point system based on significance arithmetic which dynamically adjusts the number of digits used in computations. This is also known as self correcting error codes.

7 Future Additions To add a two layer caching mechanism in order to improve the calculation times. To add a two layer caching mechanism in order to improve the calculation times.

8 Splay Tree A stores the result corresponding to each input x for a particular precision. If the function is called multiple times for the same input x, but with a different precision then only the result of the higher precision is stored. Splay Tree A stores the result corresponding to each input x for a particular precision. If the function is called multiple times for the same input x, but with a different precision then only the result of the higher precision is stored. Splay Tree B stores the coefficients Ci in the struct k_st, corresponding to each iteration i for each precision. Splay Tree B stores the coefficients Ci in the struct k_st, corresponding to each iteration i for each precision. Each time the function digamma(x,prec) is called, we first search through A for x. If we find x and the precision stored is equal or less than our prec then we truncate the stored result and output it. If we do not find x or our prec is greater than the stored precision, then we search through B for our prec. If we find our prec in the tree, we use the stored coefficients to calculate our result and also update Tree A with the result. If we do not find our prec in B, we calculate both the coefficients and the result and update both Trees A and B. Each time the function digamma(x,prec) is called, we first search through A for x. If we find x and the precision stored is equal or less than our prec then we truncate the stored result and output it. If we do not find x or our prec is greater than the stored precision, then we search through B for our prec. If we find our prec in the tree, we use the stored coefficients to calculate our result and also update Tree A with the result. If we do not find our prec in B, we calculate both the coefficients and the result and update both Trees A and B.


Download ppt "High Precision Calculation of the Digamma Function Mohammad I Rafiq School of Computer Science, Carnegie Mellon University Research Advisor : Dr. Victor."

Similar presentations


Ads by Google