docs: private static double CUBIC_MINIMIZER(double cm, double u, double fu, double du, double v, double fv, double dv) {
          double a, d, gamma, theta, p, q, r, s;
          d = (v) - (u);
          theta = ((fu) - (fv)) * 3 / d + (du) + (dv);
          p = Math.abs(theta);
          q = Math.abs(du);
          r = Math.abs(dv);
          s = max3(p, q, r);
          /* gamma = s*sqrt((theta/s)**2 - (du/s) * (dv/s)) */
          a = theta / s;
          gamma = s * Math.sqrt(a * a - ((du) / s) * ((dv) / s));
          if ((v) < (u)) gamma = -gamma;
          p = gamma - (du) + theta;
          q = gamma - (du) + gamma + (dv);
          r = p / q;
          (cm) = (u) + r * d;
          return cm;
      }