Probability Value Library Peter N. Yianilos and Eric Sven Ristad The pr_t package provides an abstraction for probability values. The principal benefit of using this abstraction is to avoid underflow in time series modeling. This package provides a direct and elegant solution to this problem. All work necessary to support a sufficiently large exponent range is swept into the routines associated with the pr_t data type. This software was first described in a 1994 Princeton University Computer Science Technical Report. Description of Files: Makefile If you have gcc installed, you should be able to simply type make. Otherwise you will need to edit this file. If you run into problems running pr_test.c below, consider removing "-DNDEBUG". This will enable many asserts() which may help locate the problem, but slow things down by a a factor of 2-3. pr.c The source code for all pr_t functions. pr.h Defines the interface to pr_t. pr_bench.c Run this program "pr_bench" to benchmark the pr_t functions on your system in comparison with other approaches. We provide runbench.csh described below to perform a complete series. pr_test.c Run this after making the software. You should get 13 or more digits of precision for all tests. pr_t.3 A man page which may installed in section 3. runbench.csh Run this shell file to measure pr_t performance -- and for comparison that of plain double operations, and logarithmic operations as well. Five times are reported, all for addition operations: 1) Standard double addition 2) pr_t (macro form). This is not actually part of the pr_t library, but represents what one might expect from inline implementation. 3) pr_t (pointer form). Here the pr_t routines are passed pointers to their arguments. 4) pr_t (functional form). These routines lead to cleaner code at the cost of performance. 5) Logarithmic computation: Here, exp() and log() are used to emulate a system which represents probabilities using logs, and uses the standard math functions to convert back and forth. Using table lookup techniques one could certainly improve on these times. The most important comparisons are between (1) and (3),(4).