ANTAREX API

Clava API

LARA API

LARA Common Language API

(.js)
laraImport("lara.MathExtra");

(.lara)
import lara.MathExtra;

MathExtra

MathExtra

MathExtra

Static Members

convertToC

convertToC(expression)

Attempts to convert a mathematical expression to valid C code (e.g., converts ^ to a call to pow()).

Parameters

expression: string|$jp - The expression to simplify.

Returns

string - simplified expression as C code

simplify

simplify(expression, constants)

Attempts to simplify a mathematical expression.

Parameters

expression: string|$jp - The expression to simplify.
constants: object - An object that maps variable names to constants.

Returns

string - simplified expression

simplifyToC

simplifyToC(expression, constants)

Attempts to simplify a mathematical expression, returning a string that represents C code.

Parameters

expression: string|$jp - The expression to simplify.
constants: object - An object that maps variable names to constants.

Returns

string - simplified expression as C code