+ "\n expected: " + cachedPrice2b
+ "\n tolerance: " + tolerance
+ "\n error: " + (price-cachedPrice2b));
}
yield = bond2.yield(marketPrice2, bondDayCount, Compounding.Compounded, freq);
if (Math.abs(yield-cachedYield2a) > tolerance) {
fail("failed to reproduce cached compounded yield:"
+ "\n calculated: " + yield
+ "\n expected: " + cachedYield2a
+ "\n tolerance: " + tolerance