[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Prayer Times from C to Java



Ahmed Talaat writes:
 > By the way, I ran the java, and C code, and I found differences in
 > the results of both programs in the range of 2 to 3 minutes.

These differences seem harmless at first, but at unpredictable
times/locations, they accumulate into tens of minutes. I remember the
old ITL version 0.5 had a problem like this which was caused by over
simplified formulas not counting the small numbers causing a havoc of
unpredictable, well hidden, and wrong results.
 
 > Going through the debugger, I found out that this difference is
 > coming from the accumulation of tiny differences between the
 > results of the trigonometric functions in the C vs Java JVM. This
 > is one more thing that I am not sure what to do about it.
 > 

In the next ITL (ie 0.7) I'm hoping to address part of this issue by
providing a test script with various results and a DEBUG mode to allow
pinpointing bugs within the ITL's future versions, and also to allow
programs/ports to other languages to be as bug free as possible and
compare results. I doubt that this would help in your case, though.
 
 > And finaly, comparing the results of either the C or Java code to
 > the one or two ready made prayer programs on my PC, again they are
 > all different.
 >  
 > I live in Dubai, and in the past few months, I found that all the
 > masjeeds have now installed an electronic clock that shows the 5
 > prayer times, according to which they operate. Again, I compared
 > the values on their clock to any of the current program, and I
 > found that they are different. So, I really do not know which is
 > the most accurate program, or may be there is none at the moment.
 > 

This could mean many things. For example: human error and software
bugs; rounding errors; being biased to a certain Fiqh by default or
results tainted to a certain location; perpetual calendars, or old
calculation theories in the ever changing universe..etc...etc.

Any or all these factors could in fact contribute to producing
different/wrong results. The ITL prayer library does try to overcome
some of these issues at least. This is not the case with the other
tools that I have tested or read about, and some of them even try to
do the opposite.

Salaam,
Thamer Mahmoud