Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Commit

Permalink
gegenbauer derivative wrt x; see Sage #21639
Browse files Browse the repository at this point in the history
  • Loading branch information
rwst committed Oct 5, 2016
1 parent ddfa002 commit 6587fdc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ginac/inifcns_orthopoly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,19 @@ static ex gegenb_eval(const ex& n, const ex &a, const ex& x)
return sum / overall_denom;
}

static ex gegenb_deriv(const ex& n, const ex & a, const ex & x, unsigned deriv_param)
{
if (deriv_param == 0)
throw std::runtime_error("derivative w.r.t. to the index is not supported yet");
if (deriv_param == 1)
throw std::runtime_error("derivative w.r.t. to the second index is not supported yet");

return _ex2 * a * gegenbauer(n-1, a+1, x).hold();
}

REGISTER_FUNCTION(gegenbauer, eval_func(gegenb_eval).
evalf_func(gegenb_evalf).
derivative_func(gegenb_deriv).
latex_name("C"));

} // namespace GiNaC

0 comments on commit 6587fdc

Please sign in to comment.