From: Vladimir V. Kisil Date: Sat, 9 Apr 2011 10:40:38 +0000 (+0200) Subject: Add conjugate() methods to functions cosh, sinh, tanh. X-Git-Tag: release_1-6-0~15 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=e7d59ed49503cfe73fdb6038c2c69c87cbde7c24;ds=inline Add conjugate() methods to functions cosh, sinh, tanh. --- diff --git a/ginac/inifcns_trans.cpp b/ginac/inifcns_trans.cpp index 0db69e84..da8b3b0a 100644 --- a/ginac/inifcns_trans.cpp +++ b/ginac/inifcns_trans.cpp @@ -1059,11 +1059,18 @@ static ex sinh_imag_part(const ex & x) return cosh(GiNaC::real_part(x))*sin(GiNaC::imag_part(x)); } +static ex sinh_conjugate(const ex & x) +{ + // conjugate(sinh(x))==sinh(conjugate(x)) + return sinh(x.conjugate()); +} + REGISTER_FUNCTION(sinh, eval_func(sinh_eval). evalf_func(sinh_evalf). derivative_func(sinh_deriv). real_part_func(sinh_real_part). imag_part_func(sinh_imag_part). + conjugate_func(sinh_conjugate). latex_name("\\sinh")); ////////// @@ -1136,11 +1143,18 @@ static ex cosh_imag_part(const ex & x) return sinh(GiNaC::real_part(x))*sin(GiNaC::imag_part(x)); } +static ex cosh_conjugate(const ex & x) +{ + // conjugate(cosh(x))==cosh(conjugate(x)) + return cosh(x.conjugate()); +} + REGISTER_FUNCTION(cosh, eval_func(cosh_eval). evalf_func(cosh_evalf). derivative_func(cosh_deriv). real_part_func(cosh_real_part). imag_part_func(cosh_imag_part). + conjugate_func(cosh_conjugate). latex_name("\\cosh")); ////////// @@ -1233,12 +1247,19 @@ static ex tanh_imag_part(const ex & x) return tan(b)/(1+power(tanh(a),2)*power(tan(b),2)); } +static ex tanh_conjugate(const ex & x) +{ + // conjugate(tan(x))==tan(conjugate(x)) + return tanh(x.conjugate()); +} + REGISTER_FUNCTION(tanh, eval_func(tanh_eval). evalf_func(tanh_evalf). derivative_func(tanh_deriv). series_func(tanh_series). real_part_func(tanh_real_part). imag_part_func(tanh_imag_part). + conjugate_func(tanh_conjugate). latex_name("\\tanh")); //////////