/* 
  This file was generated automatically with /nfs/data-012/marques/software/source/libxc/svn/scripts/maple2c.pl.
  Do not edit this file directly as it can be overwritten!!

  This Source Code Form is subject to the terms of the Mozilla Public
  License, v. 2.0. If a copy of the MPL was not distributed with this
  file, You can obtain one at http://mozilla.org/MPL/2.0/.

  Maple version     : Maple 2016 (X86 64 LINUX)
  Maple source      : ../maple/gga_k_pearson.mpl
  Type of functional: work_gga_x
*/

void xc_gga_k_pearson_enhance
  (const xc_func_type *p,  xc_gga_work_x_t *r)
{
  double t1, t2, t3, t4, t6, t7, t8, t9;
  double t10, t11, t14, t15, t22, t24, t25, t36;
  double t39, t41, t42, t56, t58;


  t1 = M_CBRT6;
  t2 = 0.31415926535897932385e1 * 0.31415926535897932385e1;
  t3 = cbrt(t2);
  t4 = t3 * t3;
  t6 = t1 / t4;
  t7 = r->x * r->x;
  t8 = t2 * t2;
  t9 = 0.1e1 / t8;
  t10 = t7 * t7;
  t11 = t10 * t7;
  t14 = 0.1e1 + t9 * t11 / 0.2304e4;
  t15 = 0.1e1 / t14;
  r->f = 0.1e1 + 0.5e1 / 0.648e3 * t6 * t7 * t15;

  if(r->order < 1) return;

  t22 = t7 * r->x;
  t24 = t14 * t14;
  t25 = 0.1e1 / t24;
  r->dfdx = 0.5e1 / 0.324e3 * t6 * r->x * t15 - 0.5e1 / 0.248832e6 * t6 * t10 * t22 * t25 * t9;

  if(r->order < 2) return;

  t36 = t10 * t10;
  t39 = 0.1e1 / t24 / t14;
  t41 = t8 * t8;
  t42 = 0.1e1 / t41;
  r->d2fdx2 = 0.5e1 / 0.324e3 * t6 * t15 - 0.5e1 / 0.27648e5 * t6 * t11 * t25 * t9 + 0.5e1 / 0.47775744e8 * t6 * t36 * t10 * t39 * t42;

  if(r->order < 3) return;

  t56 = t36 * t36;
  t58 = t24 * t24;
  r->d3fdx3 = -0.35e2 / 0.31104e5 * t6 * t25 * t9 * t10 * r->x + 0.35e2 / 0.15925248e8 * t6 * t36 * t22 * t39 * t42 - 0.5e1 / 0.6115295232e10 * t6 * t56 * r->x / t58 / t41 / t8;

  if(r->order < 4) return;


}

#define maple2c_order 3
#define maple2c_func  xc_gga_k_pearson_enhance
