Name:

canonical brings all polynomial subexpressions of an expression to canonical form or activates, deactivates or checks canonical form printing

Library names:

void sollya_lib_set_canonical_and_print(sollya_obj_t) void sollya_lib_set_canonical(sollya_obj_t) sollya_obj_t sollya_lib_canonical(sollya_obj_t) sollya_obj_t sollya_lib_get_canonical()

Usage:

canonical(function) : function -> function canonical = activation value : on|off -> void canonical = activation value ! : on|off -> void

Parameters:

Description:

Example 1:

   > print(canonical(1 + x * (x + 3 * x^2)));
   1 + x^2 + 3 * x^3
   > print(canonical((x + 1)^7));
   1 + 7 * x + 21 * x^2 + 35 * x^3 + 35 * x^4 + 21 * x^5 + 7 * x^6 + x^7

Example 2:

   > print(canonical(exp((x + 1)^5) - log(asin(((x + 2) + x)^4 * (x + 1)) + x)));
   exp(1 + 5 * x + 10 * x^2 + 10 * x^3 + 5 * x^4 + x^5) - log(asin(16 + 80 * x + 160 * x^2 + 160 * x^3 + 80 * x^4 + 16 * x^5) + x)

Example 3:

   > canonical;
   off
   > (x + 2)^9;
   512 + x * (2304 + x * (4608 + x * (5376 + x * (4032 + x * (2016 + x * (672 + x * (144 + x * (18 + x))))))))
   > canonical = on;
   Canonical automatic printing output has been activated.
   > (x + 2)^9;
   512 + 2304 * x + 4608 * x^2 + 5376 * x^3 + 4032 * x^4 + 2016 * x^5 + 672 * x^6 + 144 * x^7 + 18 * x^8 + x^9
   > canonical;
   on
   > canonical = off!;
   > (x + 2)^9;
   512 + x * (2304 + x * (4608 + x * (5376 + x * (4032 + x * (2016 + x * (672 + x * (144 + x * (18 + x))))))))
See also: horner, print, autosimplify
Go back to the list of commands