[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #57715] Discontinuity time - event missed - oops?
From: |
anonymous |
Subject: |
[bug #57715] Discontinuity time - event missed - oops? |
Date: |
Fri, 31 Jan 2020 16:03:07 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0 |
URL:
<https://savannah.gnu.org/bugs/?57715>
Summary: Discontinuity time - event missed - oops?
Project: MCSim simulation sofware
Submitted by: None
Submitted on: Fri 31 Jan 2020 09:03:06 PM UTC
Category: Sim
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
Frédéric,
This concerns modelu.c, line 286. A model that we're working on, and that
makes use of events, produces the diagnostic:
UpdateSpikes: Discontinuity was passed over...
I upgraded the diagnostic output to be more informative:
UpdateSpikes: Discontinuity was passed over:
sim time = 1.90000000000000010
event time = 1.89999999999999990
So, the issue of an event being passed over seems to be caused by comparing
two double precision numbers for equality, a perennial source of software
bugs. Your "Oops" comment in the source code suggests you thought this was an
accident waiting to happen.
I have not tried our model on Linux. We are building MCSim on Windows using
mingw. The cc switches are just -O3, and we're linking with GSL.
C99 gives us nextafter() and nextforward(). Using nextafter() seems to offer a
fix. See attached, lines 293-308. This corrects the issue for our model but I
think a more robust solution is required here.
Alex
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Fri 31 Jan 2020 09:03:06 PM UTC Name: modelu.c Size: 24KiB By: None
<http://savannah.gnu.org/bugs/download.php?file_id=48318>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?57715>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug #57715] Discontinuity time - event missed - oops?,
anonymous <=