simple-squiggle

A restricted subset of Squiggle
Log | Files | Refs | README

simplifyCore.md (1058B)


      1 <!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
      2 
      3 # Function simplifyCore
      4 
      5 simplifyCore() performs single pass simplification suitable for
      6 applications requiring ultimate performance. In contrast, simplify()
      7 extends simplifyCore() with additional passes to provide deeper
      8 simplification.
      9 
     10 
     11 ## Syntax
     12 
     13 ```js
     14 simplifyCore(expr)
     15 ```
     16 
     17 ### Parameters
     18 
     19 Parameter | Type | Description
     20 --------- | ---- | -----------
     21 `node` | Node |  The expression to be simplified
     22 `options` | Object |  Simplification options, as per simplify()
     23 
     24 ### Returns
     25 
     26 Type | Description
     27 ---- | -----------
     28 Node | Returns expression with basic simplifications applied
     29 
     30 
     31 ### Throws
     32 
     33 Type | Description
     34 ---- | -----------
     35 
     36 
     37 ## Examples
     38 
     39 ```js
     40 const f = math.parse('2 * 1 * x ^ (2 - 1)')
     41 math.simpifyCore(f)                          // Node {2 * x}
     42 math.simplify('2 * 1 * x ^ (2 - 1)', [math.simplifyCore]) // Node {2 * x}
     43 ```
     44 
     45 
     46 ## See also
     47 
     48 [simplify](simplify.md),
     49 [resolve](resolve.md),
     50 [derivative](derivative.md)