Bug intoduced in (8.0?) persisting through version 13.2

If we use TimeValue to look at the PV of an Annuity with initial payment:

TimeValue[ Annuity[{ 1, { p, 0 } }, 2], r ] // Apart

$p + \frac{1}{(1+r)^2} + \frac{1}{1+r}$

The initial payment p is taken to be at time 0. However if we take the Cashflow of the same Annuity and look at the PV of that Cashflow:

TimeValue[ Cashflow @ Annuity[{ 1, { p, 0 } }, 2], r ] // Apart

$\frac{1}{(1+r)^2} + \frac{1+p}{1+r}$

Suddenly p is now taken to be at time 1 instead of 0. Is this a bug?

  • 3
    $\begingroup$ Looks like a bug. Mathematica is quite clearly adding the initial payment to the first period rather than at t=0. Output Out[18] above should be Cashflow[{{0, p}, {1, 1}, {2, 1}}] $\endgroup$ Commented Mar 17, 2015 at 5:35
  • 5
    $\begingroup$ Looks like nobody at WRI cares to fix this rather simple bug. Sad. :) $\endgroup$
    – gwr
    Commented Feb 27, 2017 at 12:35
  • 3
    $\begingroup$ I just noticed this in version 12.3. When I went to post about it I found this earlier post. This bug will result in a wrong result in a financial calculation. Why hasn't it been fixed? $\endgroup$ Commented Sep 4, 2021 at 23:30
  • 3
    $\begingroup$ It is ridiculous this bug has persisted for 7+ years now. If it is of any use, the case number was CASE:2800989 in whatever issue tracking system Wolfram Research was using back then. $\endgroup$
    – asterix314
    Commented Oct 12, 2022 at 6:43
  • 3
    $\begingroup$ @asterix314 it is possible that the person who wrote this initially has left WRI and no one there understands the code fully to fix it without introducing new bug. May be if it is complex code. This happens all the time at large software companies. May be this is why it has not been fixed yet?. Just guessing ofcourse. $\endgroup$
    – Nasser
    Commented Oct 12, 2022 at 8:41

1 Answer 1


WRI replied, finally:

We believe that the issue has been resolved in the current 13.2.1 release of Mathematica.

I don't have the newest version installed so I cannot verify. But I think we can take their word and consider the issue closed.

  • 4
    $\begingroup$ I can confirm that TimeValue[Annuity[{1, {p, 0}}, 2], r] // Apart and TimeValue[Cashflow@Annuity[{1, {p, 0}}, 2], r] // Apart both yield (p + 1/(1 + r)^2 + 1/(1 + r)) at v.13.2.1 $\endgroup$
    – alex
    Commented Apr 28, 2023 at 10:10
  • $\begingroup$ What's that? 13 years later? I got an email from them 5 years after I reported a bug, telling me it had been fixed. I wonder what their mean bug-fix time is... $\endgroup$ Commented Apr 28, 2023 at 17:12
  • $\begingroup$ Better later than never - you are welcome :) $\endgroup$
    – Gosia
    Commented May 23, 2023 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.