Bug#888733: hyantesite: test failures on most architectures
Rebecca N. Palmer
rebecca_palmer at zoho.com
Sun May 5 20:02:02 BST 2019
Control: tags -1 upstream
(probably - I haven't actually tried)
The missing centre points (0 instead of max at distance=0) are probably
due to rounding error in the great circle distance
(src/hyantes_run.c:80): equal coordinates should give tmp=acos(1)=0, but
rounding error might make it acos(just over 1)=NaN, causing this point
to be skipped by if(tmp<range). The other points are then scaled up in
the normalization step.
However, the "obvious" fix
--- a/src/hyantes_run.c
+++ b/src/hyantes_run.c
@@ -76,8 +76,10 @@ static void DO_RUN (data_t lonMin, data_t latMin,
data_t lonStep, data_t latStep
for(size_t i=imin;i<imax;i++) {
for(size_t j=jmin;j<jmax;j++) {
+ data_t tmp0 =
+
COS(latMin+latStep*i)*COS( t[k].lat ) * (
COS(lonMin+lonStep*j)*COS(t[k].lon)+SIN(lonMin+lonStep*j)*SIN(t[k].lon))
+ SIN(latMin+latStep*i)*SIN(t[k].lat);
data_t tmp =
- 6368.*
ACOS(COS(latMin+latStep*i)*COS( t[k].lat ) * (
COS(lonMin+lonStep*j)*COS(t[k].lon)+SIN(lonMin+lonStep*j)*SIN(t[k].lon))
+ SIN(latMin+latStep*i)*SIN(t[k].lat));
+ (tmp0 >= 1.) ? 0. :
(6368.* ACOS(tmp0));
/* if distance from town is within range, set
contribution */
if( tmp < range ) {
/* The next line will be replace by cpp to
match the wanted smoothing function*/
seems to break ra_pareto, for unknown reasons. (It also still doesn't
pass family, but that appears to be a bug in the test suite: there are
some missing centre points *in the family.out reference*, which are
probably also why this bug isn't visible on amd64.)
More information about the debian-science-maintainers
mailing list