fixed small typo from before, im[k] = 1e-9! Both sin and cos are at 1e-6 = |f| if I set D exactly and let c = 0, im[k] = 1e-9, but above threshold it doesn't converge. It doesn't blow up either, so there's probably something harmless that I need to fix with the Jacobian