Hi Arpan,
> I am using PRISM for some sort of reliability analysis. My input
> probabilities (each of type /const double/) are extremely small values.
> Unfortunately, I am getting a syntax error when representing the
> following value:
>
> const double prob = 2867940088951973/288230376151711744;
>
> and similar other values. It seems if the number of digits in the
> numerator and the denominator is small, the error goes away.
>
> Any suggestions on how to supply such small probabilities (e.g., 10^-15)
> as constants?
The issue is that the parser treats the numerator and denominator as
integer literals and those are stored as Java ints (range of around ~2^31).
If you use
const double prob = 2867940088951973.0/288230376151711744.0
both numerator and denominator are parsed as double values and you get a
constant with the corresponding double (IEEE floating-point) result.
You can also specify a value using the normal floating point scientific
notation, e.g., 1E-15 would correspond to 1 * 10^15.
If you have very small probabilities, there's a chance that you may run
into other issues with precision that you may want to keep in mind:
- In the standard computations, the values are processed using
floating-point arithmetic with the possibility of rounding-errors etc
- If you are using one of the engines making use of MTBDD-based
techniques (mtbdd, hybrid, sparse), some of the floating point values
can be truncated, adding further imprecision. You can tweak the
truncation point via the -cuddepsilon setting.
- There might be issues with convergence of the iterative solution
methods, you may want to try the interval iteration option to compare
the results.
- If your model is not that large you can try to use the exact engine,
which uses an arbitrary precision representation (biginteger for
numerator and denominator) for the values. Currently, however, you would
run into the same parsing issue as now; we are working on some
refactoring there.
Cheers,
Joachim