
(*********************************************************************

        Adapted from
        Roman E. Maeder: Programming in Mathematica,
        Second Edition, Addison-Wesley, 1991.

 *********************************************************************)

OddEvenRules = {
	(f_Symbol?OddQ)[n_?Negative x_.] :> -f[-n x],
	(f_Symbol?OddQ)[n_?Negative x_. + y__] :> -f[-n x - Plus[y]] /; OrderedQ[{n x, y}],
	(f_Symbol?EvenQ)[n_?Negative x_.] :> f[-n x],
	(f_Symbol?EvenQ)[n_?Negative x_. + y__] :> f[-n x - Plus[y]] /; OrderedQ[{n x, y}]
}
(*********************************************************************

        Adapted from
        Roman E. Maeder: Programming in Mathematica,
        Second Edition, Addison-Wesley, 1991.

 *********************************************************************)

OddEvenRules = {
	(f_Symbol?OddQ)[n_?Negative x_.] :> -f[-n x],
	(f_Symbol?OddQ)[n_?Negative x_. + y__] :> -f[-n x - Plus[y]] /; OrderedQ[{n x, y}],
	(f_Symbol?EvenQ)[n_?Negative x_.] :> f[-n x],
	(f_Symbol?EvenQ)[n_?Negative x_. + y__] :> f[-n x - Plus[y]] /; OrderedQ[{n x, y}]
}
