public static double calculateCaseMatch(Stella_Object x, Stella_Object y) {
    { Surrogate testValue000 = Stella_Object.safePrimaryType(x);

      if (Surrogate.subtypeOfFloatP(testValue000)) {
        { FloatWrapper x000 = ((FloatWrapper)(x));

          return (Stella.float_abs(((FloatWrapper)(x000)).wrapperValue - ((FloatWrapper)(y)).wrapperValue));
        }
      }
      else if (Surrogate.subtypeOfIntegerP(testValue000)) {
        { IntegerWrapper x000 = ((IntegerWrapper)(x));

          return (((double)(Stella.integer_abs(((IntegerWrapper)(x000)).wrapperValue - ((IntegerWrapper)(y)).wrapperValue))));
        }
      }
      else if (Surrogate.subtypeOfSymbolP(testValue000)) {
        { Symbol x000 = ((Symbol)(x));

          if (x000 == y) {
            return (1.0);
          }
          else {
            return (0.0);
          }
        }
      }
      else {
        return (((double)(0)));
      }
    }
  }