求f(x1,x2)=(x1-2)的四次方加上(x1-2x2)的平方。大家帮帮忙。

解决方案 »

  1.   

    求f(x1,x2)=(x1-2)的四次方加上(x1-2x2)的平方。大家帮帮忙。x1,x2为变量
      

  2.   

    double result(double x1,double x2)
    {
       double result;
       result = pow( x1 - 2, 4) ;
       result += pow( x1 - 2 * x2, 2);
       return result;
    }
      

  3.   

    f( x1, x2 )=(( x1 - 2 ) ^4) * ((x1 - 2 * x2)^2)
      

  4.   

    不就是 pow(x1 - 2 , 4) + pow(x1 - 2 * x2 , 2) 吗?
      

  5.   

    #include "math.h"

    double calc(double x1, double x2)
    {
           double dRes;
           dRes = pow( x1 - 2, 4) + pow( x1 - 2 * x2, 2);
           return dRes;
    }