code: public double f(double[] x) {
  
      double sum = 0.0;
  
      for (int i = 0; i < mDimension; i++) {
        m_B[i] = 0.0;
        for (int j = 0; j < mDimension; j++) {
          m_B[i] += (m_a[i][j] * Math.sin(x[j]) + m_b[i][j] * Math.cos(x[j]));
        }
  
        double temp = m_A[i] - m_B[i];
        sum += (temp * temp);
      }
  
      return (sum + mBias);
    }
docs: Function body