   
   // @_transparent // @_inlineable
   public static func * (lhs: Rational, rhs: Rational) -> Rational {
-    if lhs.isNaN || rhs.isNaN { return .nan }
-    if lhs.isInfinite {
-      if rhs.isZero { return .nan }
-      return lhs.sign != rhs.sign
-        ? lhs.numerator < 0 ? lhs : -lhs
-        : lhs.numerator < 0 ? -lhs : lhs
-    }
-    if rhs.isInfinite {
-      if lhs.isZero { return .nan }
-      return lhs.sign != rhs.sign
-        ? rhs.numerator < 0 ? rhs : -rhs
-        : rhs.numerator < 0 ? -rhs : rhs
+    if lhs.denominator == 0 {
+      if rhs.numerator == 0 { return .nan }
+      return rhs.sign == .minus ? -lhs : lhs
+    }
+    if rhs.denominator == 0 {
+      if lhs.numerator == 0 { return .nan }
+      return lhs.sign == .minus ? -rhs : rhs
     }
     
     let lnm = lhs.numerator.magnitude, ldm = lhs.denominator.magnitude

    // a `T`. This is why the following arithmetic is performed with values of
    // type `T.Magnitude`.
    let a = T.Magnitude.gcd(lnm, rdm)
    guard a != 0 else { return .nan }
    let b = T.Magnitude.gcd(rnm, ldm)
    guard b != 0 else { return .nan }
    let n = lhs.sign == rhs.sign
      ? T(lnm / a * (rnm / b)) : -T(lnm / a * (rnm / b))
    let d = T(ldm / b * (rdm / a))


  // @_transparent // @_inlineable
  public static func + (lhs: Rational, rhs: Rational) -> Rational {
    if lhs.denominator == 0 {
      if rhs.denominator != 0 || lhs.numerator == 0 { return lhs }
      if lhs.numerator > 0 { return rhs.numerator < 0 ? .nan : rhs }
      return rhs.numerator > 0 ? .nan : rhs
    }
    if rhs.denominator == 0 { return rhs }

    let ldm = lhs.denominator.magnitude
    let rdm = rhs.denominator.magnitude
