Worst case, you can always extract the needed code from commons-math and adapt it for BigDecimal. It doesnt seem to be too hard to understand and should not be too hard to adapt.