function value = sag_df ( x )

%*****************************************************************************80
%
%% sag_df evaluates the derivative of the sag() function.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    02 October 2019
%
%  Input:
%
%    real x: the argument.
%
%  Output:
%
%    real value: the derivative value.
%
  value = 2.0 * x .* cos ( ( x + 3.0 * pi ) / 4.0 ) ...
    - x.^2 .* sin ( ( x + 3.0 * pi ) / 4.0 ) / 4.0;

  return
end
