diff --git a/dune/gfe/spaces/unitvector.hh b/dune/gfe/spaces/unitvector.hh
index a7cb4d9478261db7777138f6d9d8bddaba70d331..31bd401e5c8e53a7abf0a5220b8ff212f3b9d819 100644
--- a/dune/gfe/spaces/unitvector.hh
+++ b/dune/gfe/spaces/unitvector.hh
@@ -258,8 +258,8 @@ public:
     adouble x = a.data_ * b.data_ / (a.data_.two_norm()*b.data_.two_norm());
 
     // paranoia:  if the argument is just eps larger than 1 acos returns NaN
-    using std::min;
-    x = min(x,1.0);
+    using std::fmin;
+    x = fmin(x,1.0);
 
     // Special implementation that remains AD-differentiable near x==1
     return arcCosSquared(x);