[CppAD] Bug in optimize()?

Brad Bell bradbell at seanet.com
Fri Aug 12 07:20:14 EDT 2011


This bug has been fixed; see the heading 08-08 on
     http://www.coin-or.org/CppAD/Doc/whats_new_11.htm

On 7/25/2011 8:44 AM, Oliver Ruepp wrote:
> Hi all,
>
> I recently ran into a problem using the optimize() method of a CppADFun
> object. The problem occurs when evaluating a sequence of additions and
> subtractions. As soon as the method is called, the program aborts with
> the following message:
>
> Error during check of f.optimize().
> Error detected by false result for
>      check[i] == y[i]
> at line 1729 in the file
>      /usr/local/include/cppad/local/optimize.hpp
> cppad_sum_test: /usr/local/include/cppad/error_handler.hpp:198: static
> void CppAD::ErrorHandler::Default(bool, int, const char*, const char*,
> const char*): Assertion `false' failed.
>
> This is basically due to CppAD realizing that the optimized computation
> does not yield the same result as the original one.
> I tried to get to the root of the problem, but couldn't quite figure out
> how the 'optimize' method works.
> Could it be that it rearranges the sequence of additions/subtractions? I
> was thinking that this could be the problem, since floating-point
> addition is not always commutative due to rounding.
>
> I was able to reproduce the problem with a very simple example, which is
> available here:
> <http://www6.in.tum.de/~ruepp/cppad_sum_test.cpp>
> I am using cppad-20110701 with g++ 4.5.2 under Linux.
>
>
> Regards
> Oliver Ruepp
>
> _______________________________________________
> CppAD mailing list
> CppAD at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cppad
>



More information about the CppAD mailing list