final double cachedPrice = prices[bondIndex];
final double price = faceAmount*bond.dirtyPrice(yield.rate(),
yield.dayCounter(),
yield.compounding(),
yield.frequency(),
today)/100;
if (Math.abs(price-cachedPrice) > tolerance) {
fail("failed to reproduce cached price:\n"
+ " calculated: " + price + "\n"
+ " expected: " + cachedPrice + "\n"