The function ln() does not verify whether the input represents a nonnegative number. Mathematically, \(\ln(x)\) is undefined for \(x \le 0\).  
At the outset of ln(), ensure x > 0. If Float128 offers a signchecking method, use it, e.g.:
In a production scenario, its generally correct to revert on \(\ln(0)\) or \(\ln(\text{negative})\).
