public static double computeError(double training, double output) {
    if (training == 1.0) {
      if (output > 0.9) {
        return (0.0);
      }
    }
    else if (training == 0.0) {
      if (output < 0.1) {
        return (0.0);
      }
    }
    else {
    }
    return (training - output);
  }