public double get(double x) {
      if (x <= 0.0) {
        return 0;
      }
      if (x >= 1.0) {
        return 1.0;
      }
      double t = 0.5;
      double range = 0.5;
      while (range > error) {
        double tx = getX(t);
        range *= 0.5;
        if (tx < x) {
          t += range;
        } else {
          t -= range;
        }
      }

      double x1 = getX(t - range);
      double x2 = getX(t + range);
      double y1 = getY(t - range);
      double y2 = getY(t + range);

      return (y2 - y1) * (x - x1) / (x2 - x1) + y1;
    }
binary search for the region and linear interpolate the answer
ConstraintLayoutExamples/CycleEditor/src/com/google/androidstudio/motionlayoutcycles/Easing.java