Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-07 10:15:10

0001 /*
0002     Copyright (C) 2021 Fredrik Johansson
0003 
0004     This file is part of FLINT.
0005 
0006     FLINT is free software: you can redistribute it and/or modify it under
0007     the terms of the GNU Lesser General Public License (LGPL) as published
0008     by the Free Software Foundation; either version 3 of the License, or
0009     (at your option) any later version.  See <https://www.gnu.org/licenses/>.
0010 */
0011 
0012 #ifndef FEXPR_BUILTIN_H
0013 #define FEXPR_BUILTIN_H
0014 
0015 #ifdef FEXPR_BUILTIN_INLINES_C
0016 #define FEXPR_BUILTIN_INLINE
0017 #else
0018 #define FEXPR_BUILTIN_INLINE static inline
0019 #endif
0020 
0021 #include "fexpr.h"
0022 
0023 #ifdef __cplusplus
0024 extern "C" {
0025 #endif
0026 
0027 /* Builtin symbols */
0028 
0029 /* Must be listed in alphabetical order with corresponding entry
0030    in fexpr_builtin_table (the alphabetical order is just so that
0031    we can do binary search on the strings). */
0032 typedef enum
0033 {
0034     FEXPR_AGM,
0035     FEXPR_AGMSequence,
0036     FEXPR_Abs,
0037     FEXPR_Acos,
0038     FEXPR_Acosh,
0039     FEXPR_Acot,
0040     FEXPR_Acoth,
0041     FEXPR_Acsc,
0042     FEXPR_Acsch,
0043     FEXPR_Add,
0044     FEXPR_AiryAi,
0045     FEXPR_AiryAiZero,
0046     FEXPR_AiryBi,
0047     FEXPR_AiryBiZero,
0048     FEXPR_AlgebraicNumberSerialized,
0049     FEXPR_AlgebraicNumbers,
0050     FEXPR_All,
0051     FEXPR_AnalyticContinuation,
0052     FEXPR_And,
0053     FEXPR_AngleBrackets,
0054     FEXPR_Approximation,
0055     FEXPR_Arg,
0056     FEXPR_ArgMax,
0057     FEXPR_ArgMaxUnique,
0058     FEXPR_ArgMin,
0059     FEXPR_ArgMinUnique,
0060     FEXPR_Asec,
0061     FEXPR_Asech,
0062     FEXPR_Asin,
0063     FEXPR_Asinh,
0064     FEXPR_AsymptoticTo,
0065     FEXPR_Atan,
0066     FEXPR_Atan2,
0067     FEXPR_Atanh,
0068     FEXPR_BarnesG,
0069     FEXPR_BellNumber,
0070     FEXPR_BernoulliB,
0071     FEXPR_BernoulliPolynomial,
0072     FEXPR_BernsteinEllipse,
0073     FEXPR_BesselI,
0074     FEXPR_BesselJ,
0075     FEXPR_BesselJZero,
0076     FEXPR_BesselK,
0077     FEXPR_BesselY,
0078     FEXPR_BesselYZero,
0079     FEXPR_BetaFunction,
0080     FEXPR_Binomial,
0081     FEXPR_Braces,
0082     FEXPR_Brackets,
0083     FEXPR_CC,
0084     FEXPR_Call,
0085     FEXPR_CallIndeterminate,
0086     FEXPR_Cardinality,
0087     FEXPR_CarlsonHypergeometricR,
0088     FEXPR_CarlsonHypergeometricT,
0089     FEXPR_CarlsonRC,
0090     FEXPR_CarlsonRD,
0091     FEXPR_CarlsonRF,
0092     FEXPR_CarlsonRG,
0093     FEXPR_CarlsonRJ,
0094     FEXPR_CartesianPower,
0095     FEXPR_CartesianProduct,
0096     FEXPR_Case,
0097     FEXPR_Cases,
0098     FEXPR_CatalanConstant,
0099     FEXPR_Ceil,
0100     FEXPR_Characteristic,
0101     FEXPR_ChebyshevT,
0102     FEXPR_ChebyshevU,
0103     FEXPR_ClosedComplexDisk,
0104     FEXPR_ClosedOpenInterval,
0105     FEXPR_Coefficient,
0106     FEXPR_Column,
0107     FEXPR_ColumnMatrix,
0108     FEXPR_CommutativeRings,
0109     FEXPR_ComplexBranchDerivative,
0110     FEXPR_ComplexDerivative,
0111     FEXPR_ComplexInfinities,
0112     FEXPR_ComplexLimit,
0113     FEXPR_ComplexSignedInfinities,
0114     FEXPR_ComplexSingularityClosure,
0115     FEXPR_ComplexZeroMultiplicity,
0116     FEXPR_Concatenation,
0117     FEXPR_CongruentMod,
0118     FEXPR_Conjugate,
0119     FEXPR_ConreyGenerator,
0120     FEXPR_Cos,
0121     FEXPR_CosIntegral,
0122     FEXPR_Cosh,
0123     FEXPR_CoshIntegral,
0124     FEXPR_Cot,
0125     FEXPR_Coth,
0126     FEXPR_CoulombC,
0127     FEXPR_CoulombF,
0128     FEXPR_CoulombG,
0129     FEXPR_CoulombH,
0130     FEXPR_CoulombSigma,
0131     FEXPR_Csc,
0132     FEXPR_Csch,
0133     FEXPR_Csgn,
0134     FEXPR_CurvePath,
0135     FEXPR_Cyclotomic,
0136     FEXPR_Decimal,
0137     FEXPR_DedekindEta,
0138     FEXPR_DedekindEtaEpsilon,
0139     FEXPR_DedekindSum,
0140     FEXPR_Def,
0141     FEXPR_Delta,
0142     FEXPR_Delta_,
0143     FEXPR_Derivative,
0144     FEXPR_Det,
0145     FEXPR_DiagonalMatrix,
0146     FEXPR_DigammaFunction,
0147     FEXPR_DigammaFunctionZero,
0148     FEXPR_DirichletCharacter,
0149     FEXPR_DirichletGroup,
0150     FEXPR_DirichletL,
0151     FEXPR_DirichletLZero,
0152     FEXPR_DirichletLambda,
0153     FEXPR_DiscreteLog,
0154     FEXPR_Div,
0155     FEXPR_Divides,
0156     FEXPR_DivisorProduct,
0157     FEXPR_DivisorSigma,
0158     FEXPR_DivisorSum,
0159     FEXPR_DoubleFactorial,
0160     FEXPR_EisensteinE,
0161     FEXPR_EisensteinG,
0162     FEXPR_Element,
0163     FEXPR_Ellipsis,
0164     FEXPR_EllipticE,
0165     FEXPR_EllipticK,
0166     FEXPR_EllipticPi,
0167     FEXPR_EllipticRootE,
0168     FEXPR_Enclosure,
0169     FEXPR_Equal,
0170     FEXPR_EqualAndElement,
0171     FEXPR_EqualNearestDecimal,
0172     FEXPR_EqualQSeriesEllipsis,
0173     FEXPR_Equivalent,
0174     FEXPR_Erf,
0175     FEXPR_Erfc,
0176     FEXPR_Erfi,
0177     FEXPR_Euler,
0178     FEXPR_EulerE,
0179     FEXPR_EulerPhi,
0180     FEXPR_EulerPolynomial,
0181     FEXPR_EulerQSeries,
0182     FEXPR_Exists,
0183     FEXPR_Exp,
0184     FEXPR_ExpIntegralE,
0185     FEXPR_ExpIntegralEi,
0186     FEXPR_ExtendedRealNumbers,
0187     FEXPR_Factorial,
0188     FEXPR_FallingFactorial,
0189     FEXPR_False,
0190     FEXPR_Fibonacci,
0191     FEXPR_Fields,
0192     FEXPR_FiniteField,
0193     FEXPR_Floor,
0194     FEXPR_For,
0195     FEXPR_FormalLaurentSeries,
0196     FEXPR_FormalPowerSeries,
0197     FEXPR_FormalPuiseuxSeries,
0198     FEXPR_FresnelC,
0199     FEXPR_FresnelS,
0200     FEXPR_Fun,
0201     FEXPR_GCD,
0202     FEXPR_Gamma,
0203     FEXPR_GaussLegendreWeight,
0204     FEXPR_GaussSum,
0205     FEXPR_GegenbauerC,
0206     FEXPR_GeneralLinearGroup,
0207     FEXPR_GeneralizedBernoulliB,
0208     FEXPR_GeneralizedRiemannHypothesis,
0209     FEXPR_GlaisherConstant,
0210     FEXPR_GoldenRatio,
0211     FEXPR_Greater,
0212     FEXPR_GreaterEqual,
0213     FEXPR_GreekGamma,
0214     FEXPR_GreekGamma_,
0215     FEXPR_GreekPi,
0216     FEXPR_GreekPi_,
0217     FEXPR_Guess,
0218     FEXPR_HankelH1,
0219     FEXPR_HankelH2,
0220     FEXPR_HarmonicNumber,
0221     FEXPR_HermiteH,
0222     FEXPR_HilbertClassPolynomial,
0223     FEXPR_HilbertMatrix,
0224     FEXPR_HurwitzZeta,
0225     FEXPR_Hypergeometric0F1,
0226     FEXPR_Hypergeometric0F1Regularized,
0227     FEXPR_Hypergeometric1F1,
0228     FEXPR_Hypergeometric1F1Regularized,
0229     FEXPR_Hypergeometric1F2,
0230     FEXPR_Hypergeometric1F2Regularized,
0231     FEXPR_Hypergeometric2F0,
0232     FEXPR_Hypergeometric2F1,
0233     FEXPR_Hypergeometric2F1Regularized,
0234     FEXPR_Hypergeometric2F2,
0235     FEXPR_Hypergeometric2F2Regularized,
0236     FEXPR_Hypergeometric3F2,
0237     FEXPR_Hypergeometric3F2Regularized,
0238     FEXPR_HypergeometricU,
0239     FEXPR_HypergeometricUStar,
0240     FEXPR_HypergeometricUStarRemainder,
0241     FEXPR_IdentityMatrix,
0242     FEXPR_Im,
0243     FEXPR_Implies,
0244     FEXPR_IncompleteBeta,
0245     FEXPR_IncompleteBetaRegularized,
0246     FEXPR_IncompleteEllipticE,
0247     FEXPR_IncompleteEllipticF,
0248     FEXPR_IncompleteEllipticPi,
0249     FEXPR_IndefiniteIntegralEqual,
0250     FEXPR_Infimum,
0251     FEXPR_Infinity,
0252     FEXPR_IntegersGreaterEqual,
0253     FEXPR_IntegersLessEqual,
0254     FEXPR_Integral,
0255     FEXPR_Intersection,
0256     FEXPR_Interval,
0257     FEXPR_IsEven,
0258     FEXPR_IsHolomorphicOn,
0259     FEXPR_IsMeromorphicOn,
0260     FEXPR_IsOdd,
0261     FEXPR_IsPrime,
0262     FEXPR_Item,
0263     FEXPR_JacobiP,
0264     FEXPR_JacobiSymbol,
0265     FEXPR_JacobiTheta,
0266     FEXPR_JacobiThetaEpsilon,
0267     FEXPR_JacobiThetaPermutation,
0268     FEXPR_JacobiThetaQ,
0269     FEXPR_KeiperLiLambda,
0270     FEXPR_KhinchinConstant,
0271     FEXPR_KroneckerDelta,
0272     FEXPR_KroneckerSymbol,
0273     FEXPR_LCM,
0274     FEXPR_LaguerreL,
0275     FEXPR_LambertW,
0276     FEXPR_Lamda,
0277     FEXPR_Lamda_,
0278     FEXPR_LandauG,
0279     FEXPR_Lattice,
0280     FEXPR_LeftLimit,
0281     FEXPR_LegendreP,
0282     FEXPR_LegendrePolynomialZero,
0283     FEXPR_LegendreSymbol,
0284     FEXPR_Length,
0285     FEXPR_LerchPhi,
0286     FEXPR_Less,
0287     FEXPR_LessEqual,
0288     FEXPR_Limit,
0289     FEXPR_LiouvilleLambda,
0290     FEXPR_List,
0291     FEXPR_Log,
0292     FEXPR_LogBarnesG,
0293     FEXPR_LogBarnesGRemainder,
0294     FEXPR_LogGamma,
0295     FEXPR_LogIntegral,
0296     FEXPR_Logic,
0297     FEXPR_LowerGamma,
0298     FEXPR_Matrices,
0299     FEXPR_Matrix,
0300     FEXPR_Matrix2x2,
0301     FEXPR_Max,
0302     FEXPR_Maximum,
0303     FEXPR_MeromorphicDerivative,
0304     FEXPR_MeromorphicLimit,
0305     FEXPR_Min,
0306     FEXPR_Minimum,
0307     FEXPR_Mod,
0308     FEXPR_ModularGroupAction,
0309     FEXPR_ModularGroupFundamentalDomain,
0310     FEXPR_ModularJ,
0311     FEXPR_ModularLambda,
0312     FEXPR_ModularLambdaFundamentalDomain,
0313     FEXPR_MoebiusMu,
0314     FEXPR_Mul,
0315     FEXPR_MultiZetaValue,
0316     FEXPR_NN,
0317     FEXPR_Neg,
0318     FEXPR_Not,
0319     FEXPR_NotElement,
0320     FEXPR_NotEqual,
0321     FEXPR_NumberE,
0322     FEXPR_NumberI,
0323     FEXPR_Omega,
0324     FEXPR_Omega_,
0325     FEXPR_One,
0326     FEXPR_OpenClosedInterval,
0327     FEXPR_OpenComplexDisk,
0328     FEXPR_OpenInterval,
0329     FEXPR_OpenRealBall,
0330     FEXPR_Or,
0331     FEXPR_Otherwise,
0332     FEXPR_PSL2Z,
0333     FEXPR_Parentheses,
0334     FEXPR_PartitionsP,
0335     FEXPR_Path,
0336     FEXPR_Phi,
0337     FEXPR_Phi_,
0338     FEXPR_Pi,
0339     FEXPR_Pol,
0340     FEXPR_Poles,
0341     FEXPR_PolyLog,
0342     FEXPR_Polynomial,
0343     FEXPR_PolynomialDegree,
0344     FEXPR_PolynomialFractions,
0345     FEXPR_PolynomialRootIndexed,
0346     FEXPR_PolynomialRootNearest,
0347     FEXPR_Polynomials,
0348     FEXPR_Pos,
0349     FEXPR_Pow,
0350     FEXPR_Prime,
0351     FEXPR_PrimePi,
0352     FEXPR_PrimeProduct,
0353     FEXPR_PrimeSum,
0354     FEXPR_Primes,
0355     FEXPR_PrimitiveDirichletCharacters,
0356     FEXPR_PrimitiveReducedPositiveIntegralBinaryQuadraticForms,
0357     FEXPR_Product,
0358     FEXPR_ProjectiveComplexNumbers,
0359     FEXPR_ProjectiveRealNumbers,
0360     FEXPR_Psi,
0361     FEXPR_Psi_,
0362     FEXPR_QQ,
0363     FEXPR_QSeriesCoefficient,
0364     FEXPR_QuotientRing,
0365     FEXPR_RR,
0366     FEXPR_Range,
0367     FEXPR_Re,
0368     FEXPR_RealAbs,
0369     FEXPR_RealAlgebraicNumbers,
0370     FEXPR_RealBall,
0371     FEXPR_RealDerivative,
0372     FEXPR_RealInfinities,
0373     FEXPR_RealLimit,
0374     FEXPR_RealSignedInfinities,
0375     FEXPR_RealSingularityClosure,
0376     FEXPR_Repeat,
0377     FEXPR_Residue,
0378     FEXPR_RiemannHypothesis,
0379     FEXPR_RiemannXi,
0380     FEXPR_RiemannZeta,
0381     FEXPR_RiemannZetaZero,
0382     FEXPR_RightLimit,
0383     FEXPR_Rings,
0384     FEXPR_RisingFactorial,
0385     FEXPR_Root,
0386     FEXPR_RootOfUnity,
0387     FEXPR_Row,
0388     FEXPR_RowMatrix,
0389     FEXPR_SL2Z,
0390     FEXPR_Same,
0391     FEXPR_Sec,
0392     FEXPR_Sech,
0393     FEXPR_SequenceLimit,
0394     FEXPR_SequenceLimitInferior,
0395     FEXPR_SequenceLimitSuperior,
0396     FEXPR_Ser,
0397     FEXPR_Set,
0398     FEXPR_SetMinus,
0399     FEXPR_Sets,
0400     FEXPR_ShowExpandedNormalForm,
0401     FEXPR_Sigma,
0402     FEXPR_Sigma_,
0403     FEXPR_Sign,
0404     FEXPR_SignExtendedComplexNumbers,
0405     FEXPR_Sin,
0406     FEXPR_SinIntegral,
0407     FEXPR_Sinc,
0408     FEXPR_SingularValues,
0409     FEXPR_Sinh,
0410     FEXPR_SinhIntegral,
0411     FEXPR_SloaneA,
0412     FEXPR_Solutions,
0413     FEXPR_SpecialLinearGroup,
0414     FEXPR_Spectrum,
0415     FEXPR_SphericalHarmonicY,
0416     FEXPR_Sqrt,
0417     FEXPR_SquaresR,
0418     FEXPR_Step,
0419     FEXPR_StieltjesGamma,
0420     FEXPR_StirlingCycle,
0421     FEXPR_StirlingS1,
0422     FEXPR_StirlingS2,
0423     FEXPR_StirlingSeriesRemainder,
0424     FEXPR_Sub,
0425     FEXPR_Subscript,
0426     FEXPR_Subset,
0427     FEXPR_SubsetEqual,
0428     FEXPR_Subsets,
0429     FEXPR_Sum,
0430     FEXPR_Supremum,
0431     FEXPR_SymmetricPolynomial,
0432     FEXPR_Tan,
0433     FEXPR_Tanh,
0434     FEXPR_Theta,
0435     FEXPR_Theta_,
0436     FEXPR_True,
0437     FEXPR_Tuple,
0438     FEXPR_Tuples,
0439     FEXPR_Undefined,
0440     FEXPR_Union,
0441     FEXPR_UniqueSolution,
0442     FEXPR_UniqueZero,
0443     FEXPR_UnitCircle,
0444     FEXPR_Unknown,
0445     FEXPR_UnsignedInfinity,
0446     FEXPR_UpperGamma,
0447     FEXPR_UpperHalfPlane,
0448     FEXPR_WeierstrassP,
0449     FEXPR_WeierstrassSigma,
0450     FEXPR_WeierstrassZeta,
0451     FEXPR_Where,
0452     FEXPR_XGCD,
0453     FEXPR_XX,
0454     FEXPR_Xi,
0455     FEXPR_Xi_,
0456     FEXPR_ZZ,
0457     FEXPR_Zero,
0458     FEXPR_ZeroMatrix,
0459     FEXPR_Zeros,
0460     FEXPR_alpha,
0461     FEXPR_alpha_,
0462     FEXPR_beta,
0463     FEXPR_beta_,
0464     FEXPR_chi,
0465     FEXPR_chi_,
0466     FEXPR_delta,
0467     FEXPR_delta_,
0468     FEXPR_ell,
0469     FEXPR_ell_,
0470     FEXPR_epsilon,
0471     FEXPR_epsilon_,
0472     FEXPR_eta,
0473     FEXPR_eta_,
0474     FEXPR_gamma,
0475     FEXPR_gamma_,
0476     FEXPR_iota,
0477     FEXPR_iota_,
0478     FEXPR_kappa,
0479     FEXPR_kappa_,
0480     FEXPR_lamda,
0481     FEXPR_lamda_,
0482     FEXPR_mu,
0483     FEXPR_mu_,
0484     FEXPR_nu,
0485     FEXPR_nu_,
0486     FEXPR_omega,
0487     FEXPR_omega_,
0488     FEXPR_phi,
0489     FEXPR_phi_,
0490     FEXPR_pi,
0491     FEXPR_pi_,
0492     FEXPR_rho,
0493     FEXPR_rho_,
0494     FEXPR_sigma,
0495     FEXPR_sigma_,
0496     FEXPR_tau,
0497     FEXPR_tau_,
0498     FEXPR_theta,
0499     FEXPR_theta_,
0500     FEXPR_varphi,
0501     FEXPR_varphi_,
0502     FEXPR_vartheta,
0503     FEXPR_vartheta_,
0504     FEXPR_xi,
0505     FEXPR_xi_,
0506     FEXPR_zeta,
0507     FEXPR_zeta_,
0508     FEXPR_BUILTIN_LENGTH
0509 }
0510 fexpr_builtin_symbol;
0511 
0512 typedef void (*_fexpr_latex_writer)(calcium_stream_t, const fexpr_t, ulong);
0513 
0514 typedef struct
0515 {
0516     fexpr_builtin_symbol symbol;
0517     const char * string;
0518     const char * latex_string;
0519     _fexpr_latex_writer latex_writer;
0520 }
0521 fexpr_symbol_info;
0522 
0523 FLINT_DLL extern const fexpr_symbol_info fexpr_builtin_table[FEXPR_BUILTIN_LENGTH];
0524 
0525 #define FEXPR_SYMBOL_Pos  (FEXPR_TYPE_SMALL_SYMBOL | (FEXPR_Pos << 16))
0526 #define FEXPR_SYMBOL_Neg  (FEXPR_TYPE_SMALL_SYMBOL | (FEXPR_Neg << 16))
0527 #define FEXPR_SYMBOL_Add  (FEXPR_TYPE_SMALL_SYMBOL | (FEXPR_Add << 16))
0528 #define FEXPR_SYMBOL_Sub  (FEXPR_TYPE_SMALL_SYMBOL | (FEXPR_Sub << 16))
0529 #define FEXPR_SYMBOL_Mul  (FEXPR_TYPE_SMALL_SYMBOL | (FEXPR_Mul << 16))
0530 #define FEXPR_SYMBOL_Div  (FEXPR_TYPE_SMALL_SYMBOL | (FEXPR_Div << 16))
0531 #define FEXPR_SYMBOL_Pow  (FEXPR_TYPE_SMALL_SYMBOL | (FEXPR_Pow << 16))
0532 
0533 slong fexpr_builtin_lookup(const char * s);
0534 
0535 FEXPR_BUILTIN_INLINE
0536 const char * fexpr_builtin_name(slong n)
0537 {
0538     return fexpr_builtin_table[n].string;
0539 }
0540 
0541 FEXPR_BUILTIN_INLINE slong fexpr_builtin_length(void)
0542 {
0543     return FEXPR_BUILTIN_LENGTH;
0544 }
0545 
0546 #ifdef __cplusplus
0547 }
0548 #endif
0549 
0550 #endif