#2681 solve_rec wrong result

solve_rec (1)

solve_rec returns the wrong result in this example:

S: solve_rec(x[i] = x[i-1] + x[i-2] + a^i/b^i, x[i], x[0] = 0, x[1] = 1);
is(equal(0 + 1 + a^i/b^i,x[i])), i=2, S;

while using a slightly different formulation it determines the correct result:

S: solve_rec(x[i] = x[i-1] + x[i-2] + (a/b)^i, x[i], x[0] = 0, x[1] = 1);
is(equal(0 + 1 + a^i/b^i,x[i])), i=2, S;

build_info(version="5.31.1",timestamp="2013-10-16 05:58:10",host="x86_64-suse-linux-gnu",lisp_name="CLISP",lisp_version="2.49 (2010-07-07) (built on build84 [])")


  • Rupert Swarbrick

    • status: open --> closed
  • Rupert Swarbrick

    This should be fixed in a patch I've just pushed to master. Thank you for the excellent bug report - it made it very easy to work out what was going wrong. (Less easy was working out what was supposed to happen deep inside the solve_rec code, but that's hardly your fault!)

    I've definitely fixed this bug, but I'm not completely convinced that I haven't broken some unrelated functionality. The solve_rec and simplify_sum testsuites haven't gained any errors, but it'd be great if you could try out the new version and report any more wrinkles you find.

    To do so, you can just grab the new version of solve_rec.mac from https://sourceforge.net/p/maxima/code/ci/master/tree/share/solve_rec/ and stick it in your share/solve_rec directory.

  • snipergang

    snipergang - 2014-01-27

    I'll try it, if I find the time. If I find any more bugs I'll write a new bug report and let you know.


Log in to post a comment.