/* 
  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_x_b86.mpl
  Type of functional: work_gga_x
*/

void xc_gga_x_b86_enhance
  (const xc_func_type *p,  xc_gga_work_x_t *r)
{
  double t1, t4, t5, t6, t7, t12, t14, t15;
  double t18, t22, t24, t25, t26, t28, t29, t30;
  double t34, t48, t50, t53;

  gga_x_b86_params *params;
 
  assert(p->params != NULL);
  params = (gga_x_b86_params * )(p->params);

  t1 = r->x * r->x;
  t4 = params->gamma * t1 + 0.1e1;
  t5 = pow(t4, params->omega);
  t6 = 0.1e1 / t5;
  t7 = params->beta * t1 * t6;
  r->f = 0.1e1 + t7;

  if(r->order < 1) return;

  t12 = params->beta * t1 * r->x * t6;
  t14 = 0.1e1 / t4;
  t15 = params->omega * params->gamma * t14;
  r->dfdx = 0.2e1 * params->beta * r->x * t6 - 0.2e1 * t12 * t15;

  if(r->order < 2) return;

  t18 = params->beta * t6;
  t22 = t1 * t1;
  t24 = params->beta * t22 * t6;
  t25 = params->omega * params->omega;
  t26 = params->gamma * params->gamma;
  t28 = t4 * t4;
  t29 = 0.1e1 / t28;
  t30 = t25 * t26 * t29;
  t34 = params->omega * t26 * t29;
  r->d2fdx2 = -0.10e2 * t7 * t15 + 0.4e1 * t24 * t30 + 0.4e1 * t24 * t34 + 0.2e1 * t18;

  if(r->order < 3) return;

  t48 = params->beta * t22 * r->x * t6;
  t50 = t26 * params->gamma;
  t53 = 0.1e1 / t28 / t4;
  r->d3fdx3 = -0.24e2 * t18 * params->omega * r->x * params->gamma * t14 - 0.8e1 * t48 * t25 * params->omega * t50 * t53 - 0.24e2 * t48 * t25 * t50 * t53 - 0.16e2 * t48 * params->omega * t50 * t53 + 0.36e2 * t12 * t30 + 0.36e2 * t12 * t34;

  if(r->order < 4) return;


}

#define maple2c_order 3
#define maple2c_func  xc_gga_x_b86_enhance
