Subject: CGAL users discussion list
List archive
- From: Stefan Schirra <>
- To:
- Subject: Re: [cgal-discuss] error in comparing CORE Expr values
- Date: Thu, 19 Sep 2019 16:17:22 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:vlEy1x3ID9ptINC1smDT+DRfVm0co7zxezQtwd8ZseIUKvad9pjvdHbS+e9qxAeQG9mCsLQe06GJ7uigATVGvc/b9ihaMdRlbFwssY0uhQsuAcqIWwXQDcXBSGgEJvlET0Jv5HqhMEJYS47UblzWpWCuv3ZJQk2sfQV6Kf7oFYHMks+5y/69+4HJYwVPmTGxfa5+IA+5oAnMuMQam5VuJro+xhbLonZDZuBayX91KV6JkBvw+9m88IR//yhMvv4q6tJNX7j9c6kkV7JTES4oM3oy5M3ltBnDSRWA634BWWgIkRRGHhbI4gjiUpj+riX1uOx92DKHPcLtVrA7RS6i76ZwRxD2jioMKiM0/3vWisx0i6JbvQ6hqhliyIPafI2ZKPxzdb7bcNgHR2ROQ9xRWjRcDI2iYYsBD+kPM+hWoIbypVQBsRSwCBKwBO7s0DJEmmP60KM43uknDArI3BYgH9ULsHnMsdv1KLkdUe6vw6nO0D7Ncu9Z2Tf86IjSaBAuu+yHULVrccrN0kkgCwPFjlSKqYz/JD6V1/8Ns2eB4+V8TuKjkXMnqwdwojS2w8cjkIbJiZ8LxV/f6CV52ok1KcelR0FleNOpFoZbuSKCN4ZuX88vTHxktDw1x7AJo5K3YiYHxI46yxPZdveJaZKH4gj5W+aUOTp4hGxqeLa4hxuq9Uig1+L9WdOo0FZNtCpJiMXDtmsX2xzO7MiHS+Jx/kK71jaAyg/c9PpLIV0ularUMZIu36A/moISsUTFACD2hF37gLKZe0k54OSl5Ovqbq/4qpKSLYN4lxnyMqE0lcy+BeQ4PBIOX2+e+emkz73j4Vb5T6lKjv03iKnZqovXJcUApq62GQNazp0j5wyiDzeg0dQUhHwHI0hKeB2akYfmIEzOIOr3Dfulnlujji9nx+raMb35HpXNMn/Dna/9crZy8UFczBM/ws1e55JPFr4BPenzWlTqudzDDh45NhS0zPz9BNV80IMeQ2OPDbWDPKPcq1/brt4oduKDbYtQtDfmIOU+/Nbvi2U4kBkTZ/qHx5wSPUukE/pvJQ2ianrtmM0IWTMRohE1TO3wknWDSjEVbG30QqQ9ozQyB46rB5rZScahjerSj2+AApRKazUeWRi3GnDyetDcAqpeWGepOsZk1wc8e/2hRosmj0D8sBLqwqZgNKzf4WsFs5Om0dF66+DZiAs9szB5XZzEgjO9Clpsl2ZNfAcYmaV2oEhz0FCGi/UqgudXU9dIoe5PU0I/PJHQwuZnEd+0Vg+TJ47VGmbjec2vBHQKdvx028UHORsvGs6tyBvYmTesAvoQnrOHCZYp6K2a03Wjf8s=
Hi,
On 19.09.2019 11:27, Stefan Schirra wrote:
If we set the error to infińity in operator/ for FPF in CORE/Filter.h
filteredFp operator/ (const filteredFp& x) const {
if (x.fpVal == 0.0)
core_error("possible zero divisor!", __FILE__, __LINE__, false);
double xxx = core_abs(x.fpVal) / x.maxAbs - (x.ind+1)*CORE_EPS + DBL_MIN;
if (xxx > 0) {
double val = fpVal / x.fpVal;
double maxVal = ( core_abs(val) + maxAbs / x.maxAbs) / xxx + DBL_MIN;
return filteredFp(val, maxVal, 1 + core_max(ind, x.ind + 1));
} else
// return filteredFp(getDoubleInfty(), 0.0, 0);
return filteredFp(getDoubleInfty(), getDoubleInfty(), 1); // NEW
}
it works.
In Stefan Funke's Diplomarbeit the recommendation is to return
[NaN, infty, ...] if xxx is not positive. There is no way to get rid of the NaN anymore, so no derived interval will be OK later on.
However, you can get rid of the inf later on and this happens in the sample code, causing the bug. Again in a division operation, the new approximation is computed as
double val = fpVal / x.fpVal;
with fpVal positive finite and x.fpVal = infinity, resulting in value 0 in accordance with IEEE 754. The resulting interval is considered OK, because the value is finite, although it does not contain the actual value.
Probably one should use something like
return filteredFp( ::sqrt(-1.0), getDoubleInfty(), 1);
or some default NaN, if there is something like that in CORE already.
Best regards
Stefan
- [cgal-discuss] error in comparing CORE Expr values, Peter Palfrader, 09/18/2019
- Re: [cgal-discuss] error in comparing CORE Expr values, Stefan Schirra, 09/19/2019
- Re: [cgal-discuss] error in comparing CORE Expr values, Stefan Schirra, 09/19/2019
- Re: [cgal-discuss] error in comparing CORE Expr values, Stefan Schirra, 09/19/2019
Archive powered by MHonArc 2.6.18.