diff --git a/src/unitvector.hh b/src/unitvector.hh
index 6ca22338587a0aa5f80e0526f82d851ddd1828f3..c6c1d7578e228fa2b8604f512d6cd18e4846e6b6 100644
--- a/src/unitvector.hh
+++ b/src/unitvector.hh
@@ -64,6 +64,8 @@ public:
 
         if (x > 1-eps) {  // regular expression is unstable, use the series expansion instead
             result *= -2 + 2*(x-1)/3 - 4/15*(x-1)*(x-1) + 4/35*(x-1)*(x-1)*(x-1);
+        } else if (x < -1+eps) {  // a and b are conjugate.  The function is not differentiable
+            DUNE_THROW(Dune::Exception, "Distance is not differentiable for conjugate points!");
         } else {
             result *= -2*std::acos(x) / std::sqrt(1-x*x);
         }