pyccel.ast.mathext module#

Module containing objects from the math module understood by pyccel

class pyccel.ast.mathext.MathAcos(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.acos function.

A class which represents a call to the acos function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'acos'#
class pyccel.ast.mathext.MathAcosh(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.acosh function.

A class which represents a call to the acosh function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'acosh'#
class pyccel.ast.mathext.MathAsin(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.asin function.

A class which represents a call to the asin function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'asin'#
class pyccel.ast.mathext.MathAsinh(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.asinh function.

A class which represents a call to the asinh function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'asinh'#
class pyccel.ast.mathext.MathAtan(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.atan function.

A class which represents a call to the atan function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'atan'#
class pyccel.ast.mathext.MathAtan2(y, x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.atan2 function.

A class which represents a call to the atan2 function from the math library.

Parameters:
  • y (TypedAstNode) – The first expression passed as argument to the function.

  • x (TypedAstNode) – The second expression passed as argument to the function.

name = 'atan2'#
class pyccel.ast.mathext.MathAtanh(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.atanh function.

A class which represents a call to the atanh function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'atanh'#
class pyccel.ast.mathext.MathCeil(x)[source]#

Bases: MathFunctionInt

Class representing a call to the math.ceil function.

A class which represents a call to the ceil function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'ceil'#
class pyccel.ast.mathext.MathCopysign(x, y)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.copysign function.

A class which represents a call to the copysign function from the math library.

Parameters:
  • x (TypedAstNode) – The first expression passed as argument to the function.

  • y (TypedAstNode) – The second expression passed as argument to the function.

name = 'copysign'#
class pyccel.ast.mathext.MathCos(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.cos function.

A class which represents a call to the cos function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'cos'#
class pyccel.ast.mathext.MathCosh(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.cosh function.

A class which represents a call to the cosh function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'cosh'#
class pyccel.ast.mathext.MathDegrees(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.degrees function.

A class which represents a call to the degrees function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'degrees'#
class pyccel.ast.mathext.MathErf(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.erf function.

A class which represents a call to the erf function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'erf'#
class pyccel.ast.mathext.MathErfc(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.erfc function.

A class which represents a call to the erfc function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'erfc'#
class pyccel.ast.mathext.MathExp(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.exp function.

A class which represents a call to the exp function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'exp'#
class pyccel.ast.mathext.MathExpm1(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.expm1 function.

A class which represents a call to the expm1 function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'expm1'#
class pyccel.ast.mathext.MathFabs(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.fabs function.

A class which represents a call to the fabs function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'fabs'#
class pyccel.ast.mathext.MathFactorial(x)[source]#

Bases: MathFunctionInt

Class representing a call to the math.factorial function.

A class which represents a call to the factorial function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'factorial'#
class pyccel.ast.mathext.MathFloor(x)[source]#

Bases: MathFunctionInt

Class representing a call to the math.floor function.

A class which represents a call to the floor function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'floor'#
class pyccel.ast.mathext.MathFmod(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.fmod function.

A class which represents a call to the fmod function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'fmod'#
class pyccel.ast.mathext.MathFrexp(*args)[source]#

Bases: MathFunctionBase

frexp(x)

Return the mantissa and exponent of x, as pair (m, e). m is a float and e is an int, such that x = m * 2.**e. If x is 0, m and e are both 0. Else 0.5 <= abs(m) < 1.0.

name = 'frexp'#
class pyccel.ast.mathext.MathFsum(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.fsum function.

A class which represents a call to the fsum function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'fsum'#
class pyccel.ast.mathext.MathFunctionBase(*args)[source]#

Bases: PyccelFunction

Abstract base class for the Math Functions.

A super-class from which all functions in the math library should inherit.

Parameters:

*args (tuple of TypedAstNode) – The arguments passed to the function.

class pyccel.ast.mathext.MathFunctionBool(*args)[source]#

Bases: MathFunctionBase

Super-class from which functions returning a boolean inherit.

A super-class from which functions in the math library which return a boolean should inherit.

Parameters:

*args (tuple of TypedAstNode) – The arguments passed to the function.

name = 'bool'#
class pyccel.ast.mathext.MathFunctionFloat(*args)[source]#

Bases: MathFunctionBase

Super-class from which functions returning a float inherit.

A super-class from which functions in the math library which return a float should inherit.

Parameters:

*args (tuple of TypedAstNode) – The arguments passed to the function.

name = 'float'#
class pyccel.ast.mathext.MathFunctionInt(*args)[source]#

Bases: MathFunctionBase

Super-class from which functions returning an integer inherit.

A super-class from which functions in the math library which return an integer should inherit.

Parameters:

*args (tuple of TypedAstNode) – The arguments passed to the function.

name = 'int'#
class pyccel.ast.mathext.MathGamma(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.gamma function.

A class which represents a call to the gamma function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'gamma'#
class pyccel.ast.mathext.MathGcd(*args)[source]#

Bases: MathFunctionInt

Class representing a call to the math.gcd function.

A class which represents a call to the gcd function from the math library.

Parameters:

*args (tuple of TypedAstNode) – The arguments passed to the function.

name = 'gcd'#
class pyccel.ast.mathext.MathHypot(*args)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.hypot function.

A class which represents a call to the hypot function from the math library.

Parameters:

*args (TypedAstNode) – The arguments passed to the function.

name = 'hypot'#
class pyccel.ast.mathext.MathIsclose(a, b)[source]#

Bases: MathFunctionBool

Class representing a call to the math.isclose function.

A class which represents a call to the isclose function from the math library.

Parameters:
  • a (TypedAstNode) – The first expression passed as argument to the function.

  • b (TypedAstNode) – The second expression passed as argument to the function.

name = 'isclose'#
class pyccel.ast.mathext.MathIsfinite(x)[source]#

Bases: MathFunctionBool

Class representing a call to the math.isfinite function.

A class which represents a call to the isfinite function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'isfinite'#
class pyccel.ast.mathext.MathIsinf(x)[source]#

Bases: MathFunctionBool

Class representing a call to the math.isinf function.

A class which represents a call to the isinf function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'isinf'#
class pyccel.ast.mathext.MathIsnan(x)[source]#

Bases: MathFunctionBool

Class representing a call to the math.isnan function.

A class which represents a call to the isnan function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'isnan'#
class pyccel.ast.mathext.MathLcm(*args)[source]#

Bases: MathFunctionInt

Class representing a call to the math.lcm function.

A class which represents a call to the lcm function from the math library.

Parameters:

*args (tuple of TypedAstNode) – The arguments passed to the function.

name = 'lcm'#
class pyccel.ast.mathext.MathLdexp(x, i)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.ldexp function.

A class which represents a call to the ldexp function from the math library.

Parameters:
  • x (TypedAstNode) – The first expression passed as argument to the function.

  • i (TypedAstNode) – The second expression passed as argument to the function.

name = 'ldexp'#
class pyccel.ast.mathext.MathLgamma(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.lgamma function.

A class which represents a call to the lgamma function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'lgamma'#
class pyccel.ast.mathext.MathLog(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.log function.

A class which represents a call to the log function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'log'#
class pyccel.ast.mathext.MathLog10(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.log10 function.

A class which represents a call to the log10 function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'log10'#
class pyccel.ast.mathext.MathLog1p(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.log1p function.

A class which represents a call to the log1p function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'log1p'#
class pyccel.ast.mathext.MathLog2(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.log2 function.

A class which represents a call to the log2 function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'log2'#
class pyccel.ast.mathext.MathModf(*args)[source]#

Bases: MathFunctionBase

modf(x)

Return the fractional and integer parts of x. Both results carry the sign of x and are floats.

name = 'modf'#
class pyccel.ast.mathext.MathPow(x, y)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.pow function.

A class which represents a call to the pow function from the math library.

Parameters:
  • x (TypedAstNode) – The first expression passed as argument to the function.

  • y (TypedAstNode) – The second expression passed as argument to the function.

name = 'pow'#
class pyccel.ast.mathext.MathRadians(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.radians function.

A class which represents a call to the radians function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'radians'#
class pyccel.ast.mathext.MathRemainder(x, y)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.remainder function.

A class which represents a call to the remainder function from the math library.

Parameters:
  • x (TypedAstNode) – The first expression passed as argument to the function.

  • y (TypedAstNode) – The second expression passed as argument to the function.

name = 'remainder'#
class pyccel.ast.mathext.MathSin(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.sin function.

A class which represents a call to the sin function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'sin'#
class pyccel.ast.mathext.MathSinh(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.sinh function.

A class which represents a call to the sinh function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'sinh'#
class pyccel.ast.mathext.MathSqrt(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.sqrt function.

A class which represents a call to the sqrt function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'sqrt'#
class pyccel.ast.mathext.MathTan(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.tan function.

A class which represents a call to the tan function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'tan'#
class pyccel.ast.mathext.MathTanh(x)[source]#

Bases: MathFunctionFloat

Class representing a call to the math.tanh function.

A class which represents a call to the tanh function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'tanh'#
class pyccel.ast.mathext.MathTrunc(x)[source]#

Bases: MathFunctionInt

Class representing a call to the math.trunc function.

A class which represents a call to the trunc function from the math library.

Parameters:

x (TypedAstNode) – The expression passed as argument to the function.

name = 'trunc'#