 
   @_alwaysEmitIntoClient
   public func clamped(lowerBound: Self, upperBound: Self) -> Self {
-    return Swift.min(upperBound, Swift.max(lowerBound, self))
-  }
-  */
+    return pointwiseMin(upperBound, pointwiseMax(lowerBound, self))
+  }
 }
 
 extension SIMD where Scalar: FixedWidthInteger {

  @_alwaysEmitIntoClient
  public static var one: Self {
    return Self(repeating: 1)
  }
}


/// Each element of the result is the maximum of the corresponding elements
/// of the inputs.
@_alwaysEmitIntoClient
public func pointwiseMax<T>(_ a: T, _ b: T) -> T
where T: SIMD, T.Scalar: FloatingPoint {
  var result = T()
  for i in result.indices {
    result[i] = T.Scalar.maximum(a[i], b[i])
  }
  return result
}
