|  |  | last edited 8 years ago by Bill Page | 
| 1 2 3 4 5 | ||
| Editor: Bill Page Time: 2017/04/07 19:31:07 GMT+0 | ||
| Note: | ||
changed: -\begin{axiom} - -binomial(5,2)-binomial(5,5-2) -binomial(a,b)-binomial(a,a-b) - -\end{axiom} - Ah well no joy in Mudville I guess I need a special function of some sort, - any comments? - Moved to: SandBoxCombfuncDiscussion
Add conjugate
(1) -> )library BOP BOP1
BasicOperator is now explicitly exposed in frame initial BasicOperator will be automatically loaded when needed from /var/aw/var/LatexWiki/BOP.NRLIB/BOP BasicOperatorFunctions1 is now explicitly exposed in frame initial BasicOperatorFunctions1 will be automatically loaded when needed from /var/aw/var/LatexWiki/BOP1.NRLIB/BOP1
)abbrev category COMBOPC CombinatorialOpsCategory
++ Category for summations and products
++ Author: Manuel Bronstein
++ Date Created: ???
++ Date Last Updated: 22 February 1993 (JHD/BMT)
++ Description:
++   CombinatorialOpsCategory is the category obtaining by adjoining
++   summations and products to the usual combinatorial operations;
CombinatorialOpsCategory() : Category ==
  CombinatorialFunctionCategory with
    factorials : % -> %
      ++ factorials(f) rewrites the permutations and binomials in f
      ++ in terms of factorials;
    factorials : (%,
)abbrev package COMBF CombinatorialFunction
++ Provides the usual combinatorial functions
++ Author: Manuel Bronstein,
CombinatorialFunction(R,
  OP  ==> BasicOperator
  K   ==> Kernel F
  SE  ==> Symbol
  O   ==> OutputForm
  SMP ==> SparseMultivariatePolynomial(R,
  POWER        ==> '%power
  OPEXP        ==> 'exp
  SPECIALDIFF  ==> '%specialDiff
  SPECIALDISP  ==> '%specialDisp
  SPECIALEQUAL ==> '%specialEqual
  Exports ==> with
    belong?    : OP -> Boolean
      ++ belong?(op) is true if op is a combinatorial operator;
    operator   : OP -> OP
      ++ operator(op) returns a copy of op with the domain-dependent
      ++ properties appropriate for F;
      ++ error if op is not a combinatorial operator;
    "^"       : (F,
  Implementation ==> add
    COMB := 'comb
    ifact     : F -> F
    iiipow    : List F -> F
    iperm     : List F -> F
    ibinom    : List F -> F
    isum      : List F -> F
    idsum     : List F -> F
    iprod     : List F -> F
    idprod    : List F -> F
    dsum      : List F -> O
    ddsum     : List F -> O
    dprod     : List F -> O
    ddprod    : List F -> O
    equalsumprod  : (K,
    -- Must be a macro to produce fresh symbol for each use
    dummy ==> new()$SE :: F
    opfact  := operator('factorial)$CommonOperators
    opperm  := operator('permutation)$CommonOperators
    opbinom := operator('binomial)$CommonOperators
    opsum   := operator('summation)$CommonOperators
    opdsum  := operator('%defsum)$CommonOperators
    opprod  := operator('product)$CommonOperators
    opdprod := operator('%defprod)$CommonOperators
    oppow   := operator(POWER::Symbol)$CommonOperators
    factorial x          == opfact x
    binomial(x,
    import from F
    import from Kernel F
    number?(x : F) : Boolean ==
      if R has RetractableTo(Z) then
        ground?(x) or
         ((retractIfCan(x)@Union(Fraction(Z),
    x ^ y               ==
      -- Do some basic simplifications
      is?(x,
    belong? op           == has?(op,
    product(x : F,
    summation(x : F,
    dvsum(l,
    dvdsum(l,
    dvprod(l,
      opsum [differentiate(first l,
    dvdprod(l,
    dprod l ==
      prod(summand(l)::O,
    ddprod l ==
      prod(summand(l)::O,
    dsum l ==
      sum(summand(l)::O,
    ddsum l ==
      sum(summand(l)::O,
    equalsumprod(s1,
      (eval(first l1,
    equaldsumprod(s1,
      ((third rest l1 = third rest l2) and
       (third rest rest l1 = third rest rest l2) and
       (eval(first l1,
    product(x : F,
    summation(x : F,
    smpfact(p,
    K2fact(k,
    operator op ==
      is?(op,
    iprod l ==
      zero? first l => 0
--      one? first l => 1
      (first l = 1) => 1
      kernel(opprod,
    isum l ==
      zero? first l => 0
      kernel(opsum,
    idprod l ==
      member?(retract(second l)@SE,
    idsum l ==
      member?(retract(second l)@SE,
    ifact x ==
--      zero? x or one? x => 1
      zero? x or (x = 1) => 1
      kernel(opfact,
    ibinom l ==
      n := first l
      ((p := second l) = 0) or (p = n) => 1
--      one? p or (p = n - 1) => n
      (p = 1) or (p = n - 1) => n
      kernel(opbinom,
    iperm l ==
      zero? second l => 1
      kernel(opperm,
    if R has RetractableTo Z then
      iidsum l ==
        (r1 := retractIfCan(fourth l)@Union(Z,
      iidprod l ==
        (r1 := retractIfCan(fourth l)@Union(Z,
      iiipow l ==
          (u := isExpt(x := first l,
      if F has RadicalCategory then
        ipow l ==
          (r := retractIfCan(second l)@Union(Fraction Z,
    else
      ipow l ==
        zero?(x := first l) =>
          zero? second l => error "0 ^ 0"
          0
--        one? x or zero?(n := second l) => 1
        (x = 1) or zero?(n : F := second l) => 1
--        one? n => x
        (n = 1) => x
        (u := isExpt(x,
    if R has CombinatorialFunctionCategory then
      iifact x ==
        (r := retractIfCan(x)@Union(R,
      iiperm l ==
        (r1 := retractIfCan(first l)@Union(R,
      if R has RetractableTo(Z) and F has Algebra(Fraction(Z)) then
         -- Try to explicitly evaluete binomial coefficient
         -- We currently simplify binomial coefficients for non-negative
         -- integral second argument,
    else
      iifact x  == ifact x
      iibinom l == ibinom l
      iiperm l  == iperm l
    if R has ElementaryFunctionCategory then
      iipow l ==
        (r1 := retractIfCan(first l)@Union(R,
    if F has ElementaryFunctionCategory then
      dvpow2 l == if zero?(first l) then
                    0
                  else
                    log(first l) * first(l) ^ second(l)
    evaluate(opfact,
    setProperty(opsum,
)abbrev package FSPECF FunctionalSpecialFunction
)boot $tryRecompileArguments := nil
++ Provides the special functions
++ Author: Manuel Bronstein
++ Date Created: 18 Apr 1989
++ Description: Provides some special functions over an integral domain.
++ Keywords: special,
  OP  ==> BasicOperator
  K   ==> Kernel F
  SE  ==> Symbol
  SPECIALDIFF  ==> '%specialDiff
  Exports ==> with
    belong? : OP -> Boolean
      ++ belong?(op) is true if op is a special function operator;
    operator : OP -> OP
      ++ operator(op) returns a copy of op with the domain-dependent
      ++ properties appropriate for F;
      ++ error if op is not a special function operator
    abs     : F -> F
      ++ abs(f) returns the absolute value operator applied to f
    conjugate: F -> F
      ++ conjugate(f) returns the conjugate operator applied to f
    Gamma   : F -> F
      ++ Gamma(f) returns the formal Gamma function applied to f
    Gamma   : (F,
  Implementation ==> add
    SPECIAL := 'special
    INP ==> InputForm
    SPECIALINPUT ==> '%specialInput
    iabs      : F -> F
    iGamma    : F -> F
    iBeta     : (F,
    iWeierstrassP : (F,
    iiWeierstrassP : List F -> F
    iiWeierstrassPPrime : List F -> F
    iiWeierstrassSigma : List F -> F
    iiWeierstrassZeta : List F -> F
    iiMeijerG : List F -> F
    opabs       := operator('abs)$CommonOperators
    opconjugate := operator('conjugate)$CommonOperators
    opsqrt      := operator('sqrt)$CommonOperators
    opGamma     := operator('Gamma)$CommonOperators
    opGamma2    := operator('Gamma2)$CommonOperators
    opBeta      := operator('Beta)$CommonOperators
    opdigamma   := operator('digamma)$CommonOperators
    oppolygamma := operator('polygamma)$CommonOperators
    opBesselJ   := operator('besselJ)$CommonOperators
    opBesselY   := operator('besselY)$CommonOperators
    opBesselI   := operator('besselI)$CommonOperators
    opBesselK   := operator('besselK)$CommonOperators
    opAiryAi    := operator('airyAi)$CommonOperators
    opAiryAiPrime := operator('airyAiPrime)$CommonOperators
    opAiryBi    := operator('airyBi)$CommonOperators
    opAiryBiPrime := operator('airyBiPrime)$CommonOperators
    opLambertW := operator('lambertW)$CommonOperators
    opPolylog := operator('polylog)$CommonOperators
    opWeierstrassP := operator('weierstrassP)$CommonOperators
    opWeierstrassPPrime := operator('weierstrassPPrime)$CommonOperators
    opWeierstrassSigma := operator('weierstrassSigma)$CommonOperators
    opWeierstrassZeta := operator('weierstrassZeta)$CommonOperators
    opHypergeometricF := operator('hypergeometricF)$CommonOperators
    opMeijerG := operator('meijerG)$CommonOperators
    opCharlierC := operator('charlierC)$CommonOperators
    opHermiteH := operator('hermiteH)$CommonOperators
    opJacobiP := operator('jacobiP)$CommonOperators
    opLaguerreL := operator('laguerreL)$CommonOperators
    opMeixnerM := operator('meixnerM)$CommonOperators
    op_log_gamma := operator('%logGamma)$CommonOperators
    op_eis := operator('%eis)$CommonOperators
    op_erfs := operator('%erfs)$CommonOperators
    op_erfis := operator('%erfis)$CommonOperators
    abs x         == opabs x
    conjugate x   == opconjugate x
    Gamma(x)      == opGamma(x)
    Gamma(a,
        meijerG(a,
    import from List Kernel(F)
    opdiff := operator(operator('%diff)$CommonOperators)$F
    dummy ==> new()$SE :: F
    ahalf : F := recip(2::F)::F
    athird : F    := recip(3::F)::F
    afourth : F   := recip(4::F)::F
    asixth : F := recip(6::F)::F
    twothirds : F := 2*athird
    threehalfs : F := 3*ahalf
    -- Helpers for partially defined derivatives
    grad2(l : List F,
    grad3(l : List F,
    grad4(l : List F,
    -- handle WeierstrassPInverse
)if false
    opWeierstrassPInverse := operator('weierstrassPInverse)$CommonOperators
    weierstrassPInverse(g2,
    eWeierstrassPInverse(g2 : F,
    elWeierstrassPInverse(l : List F) : F == eWeierstrassPInverse(l(1),
    if F has RadicalCategory then
        eWeierstrassPInverseGrad_g2(l : List F) : F ==
            g2 := l(1)
            g3 := l(2)
            z := l(3)
            error "unimplemented"
        eWeierstrassPInverseGrad_g3(l : List F) : F ==
            g2 := l(1)
            g3 := l(2)
            z := l(3)
            error "unimplemented"
        eWeierstrassPInverseGrad_z(l : List F) : F ==
            g2 := l(1)
            g3 := l(2)
            z := l(3)
            1/sqrt(4*z^3 - g2*z - g3)
        derivative(opWeierstrassPInverse,
)endif
    -- handle WhittakerM
    opWhittakerM := operator('whittakerM)$CommonOperators
    whittakerM(k,
    eWhittakerM(k : F,
    elWhittakerM(l : List F) : F == eWhittakerM(l(1),
    eWhittakerMGrad_z(k : F,
    dWhittakerM(l : List F,
    setProperty(opWhittakerM,
    -- handle WhittakerW
    opWhittakerW := operator('whittakerW)$CommonOperators
    whittakerW(k,
    eWhittakerW(k : F,
    elWhittakerW(l : List F) : F == eWhittakerW(l(1),
    eWhittakerWGrad_z(k : F,
    dWhittakerW(l : List F,
    setProperty(opWhittakerW,
    -- handle AngerJ
    opAngerJ := operator('angerJ)$CommonOperators
    angerJ(v,
    if F has TranscendentalFunctionCategory then
        eAngerJ(v : F,
        elAngerJ(l : List F) : F == eAngerJ(l(1),
        eAngerJGrad_z(v : F,
        dAngerJ(l : List F,
        setProperty(opAngerJ,
    else
        eeAngerJ(l : List F) : F == kernel(opAngerJ,
    -- handle WeberE
    opWeberE := operator('weberE)$CommonOperators
    weberE(v,
    if F has TranscendentalFunctionCategory then
        eWeberE(v : F,
        elWeberE(l : List F) : F == eWeberE(l(1),
        eWeberEGrad_z(v : F,
        dWeberE(l : List F,
        setProperty(opWeberE,
    else
        eeWeberE(l :  List F) : F == kernel(opWeberE,
    -- handle StruveH
    opStruveH := operator('struveH)$CommonOperators
    struveH(v,
    eStruveH(v : F,
    elStruveH(l : List F) : F == eStruveH(l(1),
    if F has TranscendentalFunctionCategory
       and F has RadicalCategory then
        eStruveHGrad_z(v : F,
        dStruveH(l : List F,
        setProperty(opStruveH,
    -- handle StruveL
    opStruveL := operator('struveL)$CommonOperators
    struveL(v,
    eStruveL(v : F,
    elStruveL(l : List F) : F == eStruveL(l(1),
    if F has TranscendentalFunctionCategory
       and F has RadicalCategory then
        eStruveLGrad_z(v : F,
        dStruveL(l : List F,
        setProperty(opStruveL,
    -- handle HankelH1
    opHankelH1 := operator('hankelH1)$CommonOperators
    hankelH1(v,
    eHankelH1(v : F,
    elHankelH1(l : List F) : F == eHankelH1(l(1),
    eHankelH1Grad_z(v : F,
    dHankelH1(l : List F,
    setProperty(opHankelH1,
    -- handle HankelH2
    opHankelH2 := operator('hankelH2)$CommonOperators
    hankelH2(v,
    eHankelH2(v : F,
    elHankelH2(l : List F) : F == eHankelH2(l(1),
    eHankelH2Grad_z(v : F,
    dHankelH2(l : List F,
    setProperty(opHankelH2,
    -- handle LommelS1
    opLommelS1 := operator('lommelS1)$CommonOperators
    lommelS1(m,
    eLommelS1(m : F,
    elLommelS1(l : List F) : F == eLommelS1(l(1),
    eLommelS1Grad_z(m : F,
    dLommelS1(l : List F,
    setProperty(opLommelS1,
    -- handle LommelS2
    opLommelS2 := operator('lommelS2)$CommonOperators
    lommelS2(mu,
    eLommelS2(mu : F,
    elLommelS2(l : List F) : F == eLommelS2(l(1),
    eLommelS2Grad_z(m : F,
    dLommelS2(l : List F,
    setProperty(opLommelS2,
    -- handle KummerM
    opKummerM := operator('kummerM)$CommonOperators
    kummerM(mu,
    eKummerM(a : F,
    elKummerM(l : List F) : F == eKummerM(l(1),
    eKummerMGrad_z(a : F,
    dKummerM(l : List F,
    setProperty(opKummerM,
    -- handle KummerU
    opKummerU := operator('kummerU)$CommonOperators
    kummerU(a,
    eKummerU(a : F,
    elKummerU(l : List F) : F == eKummerU(l(1),
    eKummerUGrad_z(a : F,
    dKummerU(l : List F,
    setProperty(opKummerU,
    -- handle LegendreP
    opLegendreP := operator('legendreP)$CommonOperators
    legendreP(nu,
    eLegendreP(nu : F,
    elLegendreP(l : List F) : F == eLegendreP(l(1),
    eLegendrePGrad_z(nu : F,
    dLegendreP(l : List F,
    setProperty(opLegendreP,
    -- handle LegendreQ
    opLegendreQ := operator('legendreQ)$CommonOperators
    legendreQ(nu,
    eLegendreQ(nu : F,
    elLegendreQ(l : List F) : F == eLegendreQ(l(1),
    eLegendreQGrad_z(nu : F,
    dLegendreQ(l : List F,
    setProperty(opLegendreQ,
    -- handle KelvinBei
    opKelvinBei := operator('kelvinBei)$CommonOperators
    kelvinBei(v,
    eKelvinBei(v : F,
    elKelvinBei(l : List F) : F == eKelvinBei(l(1),
    if F has RadicalCategory then
        eKelvinBeiGrad_z(v : F,
        dKelvinBei(l : List F,
        setProperty(opKelvinBei,
    -- handle KelvinBer
    opKelvinBer := operator('kelvinBer)$CommonOperators
    kelvinBer(v,
    eKelvinBer(v : F,
    elKelvinBer(l : List F) : F == eKelvinBer(l(1),
    if F has RadicalCategory then
        eKelvinBerGrad_z(v : F,
        dKelvinBer(l : List F,
        setProperty(opKelvinBer,
    -- handle KelvinKei
    opKelvinKei := operator('kelvinKei)$CommonOperators
    kelvinKei(v,
    eKelvinKei(v : F,
    elKelvinKei(l : List F) : F == eKelvinKei(l(1),
    if F has RadicalCategory then
        eKelvinKeiGrad_z(v : F,
        dKelvinKei(l : List F,
        setProperty(opKelvinKei,
    -- handle KelvinKer
    opKelvinKer := operator('kelvinKer)$CommonOperators
    kelvinKer(v,
    eKelvinKer(v : F,
    elKelvinKer(l : List F) : F == eKelvinKer(l(1),
    if F has RadicalCategory then
        eKelvinKerGrad_z(v : F,
        dKelvinKer(l : List F,
        setProperty(opKelvinKer,
    -- handle EllipticK
    opEllipticK := operator('ellipticK)$CommonOperators
    ellipticK(m) == opEllipticK(m)
    eEllipticK(m : F) : F ==
        kernel(opEllipticK,
    elEllipticK(l : List F) : F == eEllipticK(l(1))
    evaluate(opEllipticK,
    dEllipticK(m : F) : F ==
        ahalf*(ellipticE(m) - (1 - m)*ellipticK(m))/(m*(1 - m))
    derivative(opEllipticK,
    -- handle one argument EllipticE
    opEllipticE := operator('ellipticE)$CommonOperators
    ellipticE(m) == opEllipticE(m)
    eEllipticE(m : F) : F ==
        kernel(opEllipticE,
    elEllipticE(l : List F) : F == eEllipticE(l(1))
    evaluate(opEllipticE,
    dEllipticE(m : F) : F ==
        ahalf*(ellipticE(m) - ellipticK(m))/m
    derivative(opEllipticE,
    -- handle two argument EllipticE
    opEllipticE2 := operator('ellipticE2)$CommonOperators
    ellipticE(z,
    eEllipticE2(z : F,
    elEllipticE2(l : List F) : F == eEllipticE2(l(1),
    if F has RadicalCategory then
        eEllipticE2Grad_z(l : List F) : F ==
            z := l(1)
            m := l(2)
            sqrt(1 - m*z^2)/sqrt(1 - z^2)
        eEllipticE2Grad_m(l : List F) : F ==
            z := l(1)
            m := l(2)
            ahalf*(ellipticE(z,
        derivative(opEllipticE2,
    inEllipticE2(li : List INP) : INP ==
        convert cons(convert('ellipticE),
    input(opEllipticE2,
    -- handle EllipticF
    opEllipticF := operator('ellipticF)$CommonOperators
    ellipticF(z,
    eEllipticF(z : F,
    elEllipticF(l : List F) : F == eEllipticF(l(1),
    if F has RadicalCategory then
        eEllipticFGrad_z(l : List F) : F ==
            z := l(1)
            m := l(2)
            1/(sqrt(1 - m*z^2)*sqrt(1 - z^2))
        eEllipticFGrad_m(l : List F) : F ==
            z := l(1)
            m := l(2)
            ahalf*((ellipticE(z,
        derivative(opEllipticF,
    -- handle EllipticPi
    opEllipticPi := operator('ellipticPi)$CommonOperators
    ellipticPi(z,
    eEllipticPi(z : F,
    elEllipticPi(l : List F) : F == eEllipticPi(l(1),
    if F has RadicalCategory then
        eEllipticPiGrad_z(l : List F) : F ==
            z := l(1)
            n := l(2)
            m := l(3)
            1/((1 - n*z^2)*sqrt(1 - m*z^2)*sqrt(1 - z^2))
        eEllipticPiGrad_n(l : List F) : F ==
            z := l(1)
            n := l(2)
            m := l(3)
            t1 := -(n^2 - m)*ellipticPi(z,
        eEllipticPiGrad_m(l : List F) : F ==
            z := l(1)
            n := l(2)
            m := l(3)
            t1 := m*z*sqrt(1 - z^2)/sqrt(1 - m*z^2)
            t2 := (-ellipticE(z,
        derivative(opEllipticPi,
    -- handle JacobiSn
    opJacobiSn := operator('jacobiSn)$CommonOperators
    jacobiSn(z,
    eJacobiSn(z : F,
    elJacobiSn : List F -> F
    elJacobiSn(l : List F) : F == eJacobiSn(l(1),
    jacobiGradHelper(z : F,
    eJacobiSnGrad_z(l : List F) : F ==
        z := l(1)
        m := l(2)
        jacobiCn(z,
    eJacobiSnGrad_m(l : List F) : F ==
        z := l(1)
        m := l(2)
        ahalf*(eJacobiSnGrad_z(l)*jacobiGradHelper(z,
    derivative(opJacobiSn,
    -- handle JacobiCn
    opJacobiCn := operator('jacobiCn)$CommonOperators
    jacobiCn(z,
    eJacobiCn(z : F,
    elJacobiCn(l : List F) : F == eJacobiCn(l(1),
    eJacobiCnGrad_z(l : List F) : F ==
        z := l(1)
        m := l(2)
        -jacobiSn(z,
    eJacobiCnGrad_m(l : List F) : F ==
        z := l(1)
        m := l(2)
        ahalf*(eJacobiCnGrad_z(l)*jacobiGradHelper(z,
    derivative(opJacobiCn,
    -- handle JacobiDn
    opJacobiDn := operator('jacobiDn)$CommonOperators
    jacobiDn(z,
    eJacobiDn(z : F,
    elJacobiDn(l : List F) : F == eJacobiDn(l(1),
    eJacobiDnGrad_z(l : List F) : F ==
        z := l(1)
        m := l(2)
        -m*jacobiSn(z,
    eJacobiDnGrad_m(l : List F) : F ==
        z := l(1)
        m := l(2)
        ahalf*(eJacobiDnGrad_z(l)*jacobiGradHelper(z,
    derivative(opJacobiDn,
    -- handle JacobiZeta
    opJacobiZeta := operator('jacobiZeta)$CommonOperators
    jacobiZeta(z,
    eJacobiZeta(z : F,
    elJacobiZeta(l : List F) : F == eJacobiZeta(l(1),
    eJacobiZetaGrad_z(l : List F) : F ==
        z := l(1)
        m := l(2)
        dn := jacobiDn(z,
    eJacobiZetaGrad_m(l : List F) : F ==
        z := l(1)
        m := l(2)
        ek := ellipticK(m)
        ee := ellipticE(m)
        er := ee/ek
        dn := jacobiDn(z,
    derivative(opJacobiZeta,
    -- handle JacobiTheta
    opJacobiTheta := operator('jacobiTheta)$CommonOperators
    jacobiTheta(q,
    eJacobiTheta(q : F,
    elJacobiTheta(l : List F) : F == eJacobiTheta(l(1),
    -- handle LerchPhi
    opLerchPhi := operator('lerchPhi)$CommonOperators
    lerchPhi(z,
    eLerchPhi(z : F,
    elLerchPhi(l : List F) : F == eLerchPhi(l(1),
    dLerchPhi(l : List F,
    setProperty(opLerchPhi,
    -- handle RiemannZeta
    opRiemannZeta := operator('riemannZeta)$CommonOperators
    riemannZeta(z) == opRiemannZeta(z)
    eRiemannZeta(z : F) : F ==
        kernel(opRiemannZeta,
    elRiemannZeta(l : List F) : F == eRiemannZeta(l(1))
    evaluate(opRiemannZeta,
    -- orthogonal polynomials
    charlierC(n : F,
    eCharlierC(n : F,
    elCharlierC(l : List F) : F == eCharlierC(l(1),
    evaluate(opCharlierC,
    hermiteH(n : F,
    eHermiteH(n : F,
    elHermiteH(l : List F) : F == eHermiteH(l(1),
    evaluate(opHermiteH,
    eHermiteHGrad_z(n : F,
    dHermiteH(l : List F,
    setProperty(opHermiteH,
    jacobiP(n : F,
    eJacobiP(n : F,
    elJacobiP(l : List F) : F == eJacobiP(l(1),
    evaluate(opJacobiP,
    eJacobiPGrad_z(n : F,
    dJacobiP(l : List F,
    setProperty(opJacobiP,
    laguerreL(n : F,
    eLaguerreL(n : F,
    elLaguerreL(l : List F) : F == eLaguerreL(l(1),
    evaluate(opLaguerreL,
    eLaguerreLGrad_z(n : F,
    dLaguerreL(l : List F,
    setProperty(opLaguerreL,
    meixnerM(n : F,
    eMeixnerM(n : F,
    elMeixnerM(l : List F) : F == eMeixnerM(l(1),
    evaluate(opMeixnerM,
    --
    belong? op == has?(op,
    operator op ==
      is?(op,
      error "Not a special operator"
    -- Could put more unconditional special rules for other functions here
    iGamma x ==
--      one? x => x
      (x = 1) => x
      kernel(opGamma,
    iabs x ==
      zero? x => 0
      one? x => 1
      is?(x,
    if R has abs : R -> R then
      import from Polynomial R
      iiabs x ==
        (r := retractIfCan(x)@Union(Fraction Polynomial R,
    iconjugate(k:K):F ==
      --output("in: ",
    iiconjugate(x:F):F ==
      --output("iin: ",
    iBeta(x,
    import from Fraction(Integer)
    if F has ElementaryFunctionCategory then
        iAiryAi x ==
            zero?(x) => 1::F/((3::F)^twothirds*Gamma(twothirds))
            kernel(opAiryAi,
    if F has ElementaryFunctionCategory then
        iLambertW(x) ==
            zero?(x) => 0
            x = exp(1$F) => 1$F
            x = -exp(-1$F) => -1$F
            kernel(opLambertW,
    if F has ElementaryFunctionCategory then
        if F has LiouvillianFunctionCategory then
            iiPolylog(s,
    iPolylog(l) == iiPolylog(first l,
    iWeierstrassP(g2,
    iWeierstrassSigma(g2,
    iWeierstrassZeta(g2,
    -- Could put more conditional special rules for other functions here
    if R has SpecialFunctionCategory then
      iiGamma x ==
        (r := retractIfCan(x)@Union(R,
      iiBeta l ==
        (r := retractIfCan(first l)@Union(R,
      iidigamma x ==
        (r := retractIfCan(x)@Union(R,
      iipolygamma l ==
        (s := retractIfCan(first l)@Union(R,
      iiBesselJ l ==
        (r := retractIfCan(first l)@Union(R,
      iiBesselY l ==
        (r := retractIfCan(first l)@Union(R,
      iiBesselI l ==
        (r := retractIfCan(first l)@Union(R,
      iiBesselK l ==
        (r := retractIfCan(first l)@Union(R,
      iiAiryAi x ==
        (r := retractIfCan(x)@Union(R,
      iiAiryAiPrime x ==
        (r := retractIfCan(x)@Union(R,
      iiAiryBi x ==
        (r := retractIfCan(x)@Union(R,
      iiAiryBi x ==
        (r := retractIfCan(x)@Union(R,
    else
      if R has RetractableTo Integer then
        iiGamma x ==
          (r := retractIfCan(x)@Union(Integer,
      iiBeta l == iBeta(first l,
    iiWeierstrassP l == iWeierstrassP(first l,
    -- Default behaviour is to build a kernel
    evaluate(opGamma,
    diff1(op : OP,
    iBesselJ(l : List F,
    iBesselY(l : List F,
    iBesselI(l : List F,
    iBesselK(l : List F,
    dPolylog(l : List F,
    ipolygamma(l : List F,
    if F has ElementaryFunctionCategory then
      iGamma2(l : List F,
    inGamma2(li : List INP) : INP ==
        convert cons(convert('Gamma),
    input(opGamma2,
    dLambertW(x : F) : F ==
        lw := lambertW(x)
        lw/(x*(1+lw))
    iWeierstrassPGrad1(l : List F) : F ==
        g2 := first l
        g3 := second l
        x := third l
        delta := g2^3 - 27*g3^2
        wp := weierstrassP(g2,
    iWeierstrassPGrad2(l : List F) : F ==
        g2 := first l
        g3 := second l
        x := third l
        delta := g2^3 - 27*g3^2
        wp := weierstrassP(g2,
    iWeierstrassPGrad3(l : List F) : F ==
        weierstrassPPrime(first l,
    iWeierstrassPPrimeGrad1(l : List F) : F ==
        g2 := first l
        g3 := second l
        x := third l
        delta := g2^3 - 27*g3^2
        wp := weierstrassP(g2,
    iWeierstrassPPrimeGrad2(l : List F) : F ==
        g2 := first l
        g3 := second l
        x := third l
        delta := g2^3 - 27*g3^2
        wp := weierstrassP(g2,
    iWeierstrassPPrimeGrad3(l : List F) : F ==
        g2 := first l
        6*weierstrassP(g2,
    iWeierstrassSigmaGrad1(l : List F) : F ==
        g2 := first l
        g3 := second l
        x := third l
        delta := g2^3 - 27*g3^2
        ws := weierstrassSigma(g2,
    iWeierstrassSigmaGrad2(l : List F) : F ==
        g2 := first l
        g3 := second l
        x := third l
        delta := g2^3 - 27*g3^2
        ws := weierstrassSigma(g2,
    iWeierstrassSigmaGrad3(l : List F) : F ==
        g2 := first l
        g3 := second l
        x := third l
        weierstrassZeta(g2,
    iWeierstrassZetaGrad1(l : List F) : F ==
        g2 := first l
        g3 := second l
        x := third l
        delta := g2^3 - 27*g3^2
        wp := weierstrassP(g2,
    iWeierstrassZetaGrad2(l : List F) : F ==
        g2 := first l
        g3 := second l
        x := third l
        delta := g2^3 - 27*g3^2
        wp := weierstrassP(g2,
    iWeierstrassZetaGrad3(l : List F) : F ==
        -weierstrassP(first l,
    OF ==> OutputForm
    SEX ==> SExpression
    NNI ==> NonNegativeInteger
    dconjugate(lo : List OF) : OF == overbar lo.1
    display(opconjugate,
    if F has RetractableTo(Integer) then
        get_int_listf : List F -> List Integer
        get_int_listo : (Integer,
        get_int_listf(lf : List F) : List Integer ==
            map(z +-> retract(z)@Integer,
        replace_i(lp : List F,
        iiHypergeometricF(l) ==
            n := #l
            z := l(n-2)
            if z = 0 then
                nn := (n - 2)::NNI
                pq := rest(l,
        idvsum(op : BasicOperator,
        dvhypergeom(l : List F,
        add_pairs_to_list(lp : List List F,
        dvmeijer(l : List F,
        get_if_list(n : Integer,
        get_if_lists(ln : List Integer,
        get_int_listi(n : Integer,
        get_of_list(n : Integer,
        get_of_lists(ln : List Integer,
        get_int_listo(n : Integer,
        dhyper0(op : OF,
        dhyper(lo : List OF) : OF ==
            dhyper0("hypergeometricF"::Symbol::OF,
        ddhyper(lo : List OF) : OF ==
            dhyper0(first lo,
        dmeijer0(op : OF,
        dmeijer(lo : List OF) : OF ==
            dmeijer0('meijerG::OF,
        ddmeijer(lo : List OF) : OF ==
            dmeijer0(first lo,
        setProperty(opHypergeometricF,
        inhyper(lf : List INP) : INP ==
            pqi := get_int_listi(2,
        input(opHypergeometricF,
        inmeijer(lf : List INP) : INP ==
            pqi := get_int_listi(4,
        input(opMeijerG,
    else
        iiHypergeometricF(l) == kernel(opHypergeometricF,
    iiMeijerG(l) == kernel(opMeijerG,
    d_eis(x : F) : F == -kernel(op_eis,
    if F has TranscendentalFunctionCategory
       and F has RadicalCategory then
        d_erfs(x : F) : F == 2*x*kernel(op_erfs,
        d_erfis(x : F) : F == -2*x*kernel(op_erfis,
        derivative(op_erfs,
    -- differentiate(abs(g(z)),
    -- Wirtinger derivate of non-holomorphic functions
    derivative(opconjugate,
    setProperty(oppolygamma,
)abbrev package SUMFS FunctionSpaceSum
++ Top-level sum function
++ Author: Manuel Bronstein
++ Date Created: ???
++ Date Last Updated: 19 April 1991
++ Description: computes sums of top-level expressions;
FunctionSpaceSum(R,
  SE  ==> Symbol
  K   ==> Kernel F
  Exports ==> with
    sum : (F,
  Implementation ==> add
    import from ElementaryFunctionStructurePackage(R,
    innersum : (F,
    newk() == kernel(new()$SE)
    sum(x : F,
    sum(x : F,
    notRF?(f,
    innersum(x,
--Copyright (c) 1991-2002,
-- SPAD files for the functional world should be compiled in the
-- following order:
--
--   op  kl  function  funcpkgs  manip  algfunc
--   elemntry  constant  funceval  COMBFUNC  fe
   Compiling FriCAS source code from file 
      /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/554697800083835704-25px002.spad
      using old system compiler.
   COMBOPC abbreviates category CombinatorialOpsCategory 
------------------------------------------------------------------------
   initializing NRLIB COMBOPC for CombinatorialOpsCategory 
   compiling into NRLIB COMBOPC 
;;;     ***       |CombinatorialOpsCategory| REDEFINED
Time: 0 SEC.
   finalizing NRLIB COMBOPC 
   Processing CombinatorialOpsCategory for Browser database:
--------constructor---------
--------(factorials (% %))---------
--------(factorials (% % (Symbol)))---------
--------(summation (% % (Symbol)))---------
--------(summation (% % (SegmentBinding %)))---------
--------(product (% % (Symbol)))---------
--------(product (% % (SegmentBinding %)))---------
; compiling file "/var/aw/var/LatexWiki/COMBOPC.NRLIB/COMBOPC.lsp" (written 15 FEB 2025 07:07:21 PM):
; wrote /var/aw/var/LatexWiki/COMBOPC.NRLIB/COMBOPC.fasl
; compilation finished in 0:00:00.004
------------------------------------------------------------------------
   CombinatorialOpsCategory is now explicitly exposed in frame initial 
   CombinatorialOpsCategory will be automatically loaded when needed 
      from /var/aw/var/LatexWiki/COMBOPC.NRLIB/COMBOPC
   COMBF abbreviates package CombinatorialFunction 
------------------------------------------------------------------------
   initializing NRLIB COMBF for CombinatorialFunction 
   compiling into NRLIB COMBF 
****** Domain: R already in scope
   processing macro definition dummy ==> ::((Sel (Symbol) new),
   compiling exported binomial : (F,
   compiling exported permutation : (F,
   importing F
   importing Kernel F
   compiling local number? : F -> Boolean
****** Domain: R already in scope
augmenting R: (RetractableTo (Integer))
Time: 0 SEC.
   compiling exported ^ : (F,
   compiling exported belong? : BasicOperator -> Boolean
****** comp fails at level 2 with expression: ******
error in function belong? 
(|has?| | << op >> | COMB)
****** level 2  ******
$x:= op
$m:= $
$f:=
((((|op| # #) (|number?| #)) ((|number?| #) (|/\\| #) (< #) (<= #) ...)))
   >> Apparent user error:
   Cannot coerce op 
      of mode (BasicOperator) 
      to mode $