SICx. Simple JIT Compiler
Version 6.2.2 • 24.06.2023

Flat License
History
Algorithm
Structures
Export functions
Native functions
  •  Assembler instructions
  •  FPU functions
  •  Variable declaration
  •  System functions
  •  Return functions
  •  Copy functions
  •  Swap functions
  •  Argument count functions
  •  Argument filter functions
  •  Compound assignment functions
  •  Bitwise functions
  •  Byte functions
  •  Boolean functions
  •  Approximate boolean functions
  •  Conditional functions
  •  Case functions
  •  GOTO functions
  •  CALL functions
  •  Matrix and array functions
  •  Base functions
  •  Exponential functions
  •  Power functions
  •  Trigonometric functions
  •  Hyperbolic functions
  •  Complex number functions
  •  Complex number arithmetic functions
  •  Complex number boolean functions
  •  Complex number exponential functions
  •  Complex number power functions
  •  Complex number trigonometric functions
  •  Complex number hyperbolic functions
  •  Special functions
  •  Statistical functions
  •  Variable number of arguments
  •  Percent functions
  •  Angle conversion functions
  •  Temperature conversion functions
  •  Units functions
  •  Data modifier functions
  •  Approximate exponential functions
  •  Approximate power functions
  •  Approximate trigonometric functions
  •  Approximate hyperbolic functions
List of Export Functions
List of Native Functions
Function Symbols
Compiler configuration flags
Compiler options
Error codes
Constants
Labels
Postfix notation
Compile-time calculations
Examples
Notes
Contacts




Flat License
Top

© Andrey A. Meshkov "AL-CHEMIST", 2000-3000.
All rights reserved.

Free for any use.
No warranty of any kind.




Algorithm
Top

#1 Convert input string to rpn array
#2 Convert rpn array to executable code


operation priority

 00  (  
 01  )  
 02  ,  
 03   
 04  assign operator = := *:= =: =:* :=:  
 04  assign operator [=] {=} <=>  
 04  assign operator [:=] {:=} <:=>  
 04  assign operator [=:] {=:} <=:>  
 04  assign operator [:=:] {:=:} <:=:>  
 04  += -= ~-=  
 04  *= /= ~/=  
 04  \= ~\= %= ~%=  
 04  ~=  
 04  ^= ~^=  
 04  |= ~|= |~= ~|~=  
 04  |-= ~|-= -|= -|~=  
 04  &= ~&= &~= ~&~=  
 04  |0|= |1|=  
 04  >>= <<= >>>= <<<= >><= <<>=  
 05  == <> != > >= !< < <= !>  
 05  ==~ <>~ !=~ >~ >=~ !<~ <~ <=~ !>~  
 06  || ^^ !&  
 07  && !| !^  
 08  + -  
 09  * /  
 10  \  
 11  %
 12  ++ +-  
 12  -+ -- ~- ~-+ ~--  
 12  *+ *-  
 12  /+ /- ~/ ~/+ ~/-  
 12  \+ \- ~\ ~\+ ~\-  
 12  %+ %- ~% ~%+ ~%-
 12  \% %\
 13  [+] {+} <+>  
 13  [-] {-} <-> [~-] {~-} <~->  
 13  [*] {*} <*>  
 13  [/] {/} </> [~/] {~/} <~/>  
 13  [\] {\} <\> [~\] {~\} <~\>  
 13  [%] {%} <%> [~%] {~%} <~%>
 13  |A| |+| |G| |*| |H| |/| |C| |\| |Q| |h| |c|  
 14  *% /% ~/% +% ~+% -% ~-%
 15  ?< ?> ?<> ?><  
 15  <==> >==<  
 15  <==>~ >==<~  
 16   
 17  ^ ** ~^ ~** */ ~*/  
 17  bitwise ^ ~^  
 18  bitwise | ~| |~ ~|~  
 19  bitwise |- ~|- -| -|~  
 20  bitwise & ~& &~ ~&~  
 21  bitwise |0| |1|  
 22  >> << >>> <<< >>< <<>  
 23  >?< >?~< >?-< >?+<  
 24  -> ~> *-> *~> ->> ~>>  
 25  &-> &~> *&-> *&~>  
 27  postfix = :=  
 27  postfix ! !! ° °°  
 27  postfix ++ --  
 27  postfix ^ ^^  
 27  postfix ==. <>. !=. >. >=. !<. <. <=. !>.  
 27  postfix ==.~ <>.~ !=.~ >.~ >=.~ !<.~ <.~ <=.~ !>.~  
 28  prefix + - ++ --  
 28  prefix / ~ ?  
 28  prefix <<? >>?  
 28  prefix !. ~!.  
 28  prefix ! ° °°  
 32   
 33  :: (=) ==  
 33  function  
 33  argument filter  
 34  postfix function  
 34  data mofifier  
 34  postfix `  
 42  prefix * **  
 42  prefix & &&  





Structures
Top

 

SIC config structure

struct T_sic64_config
  cflags        dd ?            ; compiler flags
  memory        dq ?            ; memory block size

  cpu_flags     dd ?            ; CPU flags

  section_code  dd ?            ; size of .code section
  section_data  dd ?            ; size of .data section
  section_idata dd ?            ; size of .idata section
  section_edata dd ?            ; size of .edata section
  section_rsrc  dd ?            ; size of .rsrc section
  section_reloc dd ?            ; size of .reloc section

  fcode_size    dd ?            ; size of built-in functions

  fdata_size    dq ?            ; function data segment size
  fdata_count   dd ?            ; maximum function count
  cdata_size    dq ?            ; constant data segment size
  cdata_count   dd ?            ; maximum constant count
  vdata_size    dq ?            ; variable data segment size
  vdata_count   dd ?            ; maximum variable count
  rdata_size    dq ?            ; runtime data segment size
  rdata_count   dd ?            ; maximum runtime count
  stack_size    dq ?            ; stack array size
  stack_count   dd ?            ; maximum token count
  rpn_size      dq ?            ; rpn array size
  rpn_count     dd ?            ; maximum rpn item count
  code_size     dq ?            ; code segment size

  fitem_nsize   dd ?            ; maximum length of function name
  citem_nsize   dd ?            ; maximum length of constant name
  vitem_nsize   dd ?            ; maximum length of variable name

  uddata_scount dd ?            ; maximum section count in user-defined data files (SIC.UDF, SIC.UDV)
ends

struct T_sic32_config
  cflags        dd ?            ; compiler flags
  memory        dd ?            ; memory block size

  cpu_flags     dd ?            ; CPU flags

  section_code  dd ?            ; size of .code section
  section_data  dd ?            ; size of .data section
  section_idata dd ?            ; size of .idata section
  section_edata dd ?            ; size of .edata section
  section_rsrc  dd ?            ; size of .rsrc section
  section_reloc dd ?            ; size of .reloc section

  fcode_size    dd ?            ; size of built-in functions

  fdata_size    dd ?            ; function data segment size
  fdata_count   dd ?            ; maximum function count
  cdata_size    dd ?            ; constant data segment size
  cdata_count   dd ?            ; maximum constant count
  vdata_size    dd ?            ; variable data segment size
  vdata_count   dd ?            ; maximum variable count
  rdata_size    dd ?            ; runtime data segment size
  rdata_count   dd ?            ; maximum runtime count
  stack_size    dd ?            ; stack array size
  stack_count   dd ?            ; maximum token count
  rpn_size      dd ?            ; rpn array size
  rpn_count     dd ?            ; maximum rpn item count
  code_size     dd ?            ; code segment size

  fitem_nsize   dd ?            ; maximum length of function name
  citem_nsize   dd ?            ; maximum length of constant name
  vitem_nsize   dd ?            ; maximum length of variable name

  uddata_scount dd ?            ; maximum section count in user-defined data files (SIC.UDF, SIC.UDV)
ends

 

SIC data structure

struct T_sic64_data
  fdata   dq ?                  ; function data segment offset
  cdata   dq ?                  ; constant data segment offset
  vdata   dq ?                  ; variable data segment offset
  rdata   dq ?                  ; runtime data segment offset
  code    dq ?                  ; code segment offset
  data    dq ?                  ; data segment offset
  heap    dq ?                  ; heap segment offset
  entry   dq ?                  ; entry point
  size    dd ?                  ; code size
  cspace  dd ?                  ; code space
  calign  dd ?                  ; code align
  dsize   dd ?                  ; data size
  dspace  dd ?                  ; data space
  dalign  dd ?                  ; data align
  hsize   dd ?                  ; heap size
  hspace  dd ?                  ; heap space
  halign  dd ?                  ; heap align
  coops   dd ?                  ; compiler options
  tokens  dd ?                  ; scanned tokens count
  rpn     dd ?                  ; rpn array item count
  fcount  dd ?                  ; functions count
  ccount  dd ?                  ; constants count
  vcount  dd ?                  ; variables count
  rcount  dd ?                  ; runtimes count
  ccurs   dd ?                  ; current string cursor
  pcurs   dd ?                  ; previous string cursor
  gdata   dq ?                  ; global data
  gcode   dd ?                  ; global code
  ecode   dd ?                  ; error code
  rcode   dd ?                  ; return code
  value   dq ?                  ; return value
ends

struct T_sic32_data
  fdata   dd ?                  ; function data segment offset
  cdata   dd ?                  ; constant data segment offset
  vdata   dd ?                  ; variable data segment offset
  rdata   dd ?                  ; runtime data segment offset
  code    dd ?                  ; code segment offset
  data    dd ?                  ; data segment offset
  heap    dd ?                  ; heap segment offset
  entry   dd ?                  ; entry point
  param   dd ?                  ; parameter
  size    dd ?                  ; code size
  cspace  dd ?                  ; code space
  calign  dd ?                  ; code align
  dsize   dd ?                  ; data size
  dspace  dd ?                  ; data space
  dalign  dd ?                  ; data align
  hsize   dd ?                  ; heap size
  hspace  dd ?                  ; heap space
  halign  dd ?                  ; heap align
  coops   dd ?                  ; compiler options
  tokens  dd ?                  ; scanned tokens count
  rpn     dd ?                  ; rpn array item count
  fcount  dd ?                  ; functions count
  ccount  dd ?                  ; constants count
  vcount  dd ?                  ; variables count
  rcount  dd ?                  ; runtimes count
  ccurs   dd ?                  ; current string cursor
  pcurs   dd ?                  ; previous string cursor
  gdata   dd ?                  ; global data
  gcode   dd ?                  ; global code
  ecode   dd ?                  ; error code
  rcode   dd ?                  ; return code
  value   dq ?                  ; return value
ends

 

common table header

struct table.header
  icount dd ?                   ; item count
  mcount dd ?                   ; item max count
  tisize dd ?                   ; table item size
  tnsize dd ?                   ; table item name size
  titype dd ?                   ; table item type
                                ; = 1 - functions
                                ; = 2 - constants
                                ; = 3 - variables
  oooooo dd ?                   ; padding
ends

 

function table item

fitem.nsize = 50                ; max length of function name buffer

struct fitem64
  name   rb fitem.nsize         ; function name (zero terminated)
  retype dw ?                   ; function return type (INT16)
  acount dw ?                   ; function argument count (INT16)
  cosize dw ?                   ; function code size or flags (INT16)
  offset dq ?                   ; function offset
ends

struct fitem32
  name   rb fitem.nsize         ; function name (zero terminated)
  retype dw ?                   ; function return type (INT16)
  acount dw ?                   ; function argument count (INT16)
  cosize dw ?                   ; function code size or flags (INT16)
  offset dd ?                   ; function offset
         dd ?
ends

 

constant table item

citem.nsize = 44                ; max length of constant name buffer

struct citem64
  name   rb citem.nsize         ; constant name (zero terminated)
  codata dq ?                   ; constant data
  cotype dw ?                   ; constant type
  datype dw ?                   ; constant data type
 union
  value  dq ?                   ; constant value
  offset dq ?
 ends
ends

struct citem32
  name   rb citem.nsize         ; constant name (zero terminated)
  codata dq ?                   ; constant data
  cotype dw ?                   ; constant type
  datype dw ?                   ; constant data type
 union
  value  dq ?                   ; constant value
  offset dd ?
 ends
ends

 

variable table item

vitem.nsize = 44                ; max length of variable name buffer

struct vitem64
  name   rb vitem.nsize         ; variable name (zero terminated)
  vadata dq ?                   ; variable data
  vatype dw ?                   ; variable type
  datype dw ?                   ; variable data type
  offset dq ?                   ; variable offset
ends

struct vitem32
  name   rb vitem.nsize         ; variable name (zero terminated)
  vadata dq ?                   ; variable data
  vatype dw ?                   ; variable type
  datype dw ?                   ; variable data type
  offset dd ?                   ; variable offset
         dd ?
ends

 

complex number

struct T_complex
  re dq ?                       ; real part
  im dq ?                       ; imaginary part
ends

 

IDA data

struct T_ida_data
  instr_size    db ?
  flags         dd ?
  prefix_size   db ?
  rex           db ?
  prex_size     db ? ; VEX/EVEX prefix size
  prex_0        db ? ; VEX.2:C5H VEX.3:C4H EVEX:62H
  prex_1        db ?
  prex_2        db ?
  prex_3        db ?
  modrm         db ?
  sib           db ?
  opcode_offset db ?
  opcode_size   db ?
  disp_offset   db ?
  disp_size     db ?
  imm_offset    db ?
  imm_size      db ?
ends





Export functions
Top
List

 

DWORD sic_version ( VOID )

compiler version

⇐ eax : compiler version
         F0V2V1V0
         V0 - version L0
         V1 - version L1
         V2 - version L2
         F0 - flags
              0 : SICx*
              1 : SICs*

 

BOOL sic_cpu_support ( VOID )

compiler support for the CPU

⇐ eax
1 - CPU supported
0 - CPU not supported

 

VOID sic_setup ( LPVOID config )

setup compiler

⇔ config : T_sic_config structure offset

⇒ config.cflags : compiler configuration flags
                   SIC_CFG_FLAG_CASE_SENSITIVE
                   SIC_CFG_FLAG_NO_UDF
                   SIC_CFG_FLAG_NO_UDC
                   SIC_CFG_FLAG_NO_UDV
⇒ config.memory : memory block size
                   default = 64K
                   maximum = 0x00100000 (1024K)
                   code space = 4 * memory block size

config.cflags = 0
config.memory = 0
  case insensitive compiler
  memory block size = 64K (default)

config.cflags = 0
config.memory = 0x00100000
  case insensitive compiler
  memory block size = 1024K

config.cflags = SIC_CFG_FLAG_CASE_SENSITIVE
config.memory = 0
  case sensitive compiler
  memory block size = 64K (default)

 

VOID sic_cretab ( VOID )

create global tables

 

VOID sic_fretab

destroy global tables

 

DWORD sic_funtac ( VOID )

create global function table
assign table header and add built-in functions

⇐ eax : function table item count or zero on error

 

VOID sic_funtaf ( VOID )

destroy global function table

 

DWORD sic_funloa ( VOID )

load external user defined functions

⇐ eax : external function item count

 

VOID sic_funulo ( VOID )

unload external user defined functions

 

DWORD sic_contac ( VOID )

create global constant table
assign table header and add predefined constants

⇐ eax : constant table item count or zero on error

 

VOID sic_contaf ( VOID )

destroy global constant table

 

DWORD sic_conloa ( VOID )

load external user defined constants

⇐ eax : external constant item count

 

VOID sic_conulo ( VOID )

unload external user defined constants

 

DWORD sic_vartac ( VOID )

create global variable table
assign table header and add predefined variables

⇐ eax : variable table item count or zero on error

 

VOID sic_vartaf ( VOID )

destroy global variable table

 

DWORD sic_varloa ( VOID )

load external user defined variables

⇐ eax : external variable item count

 

VOID sic_varulo ( VOID )

unload external user defined variables

 

DWORD sic_runtac ( VOID )

create global runtime table

⇐ eax : runtime table item count

 

VOID sic_runtaf ( VOID )

destroy global runtime table

⇐ eax : runtime table item count or zero on error

 

VOID sic_init ( LPVOID sic )

allocate memory for sic data segments
assign table headers

⇒ sic : T_sic_data structure offset

 

VOID sic_done ( LPVOID sic )

free memory previously allocated for sic data and code segments

⇒ sic : T_sic_data structure offset

 

INT sic_afun ( LPVOID sic, LPCSTR fun, LPVOID fuo, INT16 fac, UINT16 fuf )

add|set user defined global or local function ( fun ) and assign data ( fuo, fac, fuf )
deal with global table if sic = null or sic.fdata = null

⇒ sic : T_sic_data structure offset
⇒ fun : function name
⇒ fuo : function offset
⇒ fac : function argument count
         fac < 0 - variable number of arguments
                   ABS(fac) = minimum argument count
         fac = 0x8000 - any variable number of arguments
⇒ fuf : function flags
         LO.BYTE = fuf AND 0x00FF
         HI.BYTE = fuf SHR 8
         x32 : LO.BYTE
               cdecl   : count of 4-byte arguments
               stdcall : 0xFF
         x64 : LO.BYTE
               4-bit mask for integer and pointer arguments
               ex.: 0010 - second argument is integer or pointer
                    0101 - first and third arguments are integer or pointer
         x** : HI.BYTE AND (00001111B) - function return type
               0x01 (00000001B) - 1-byte integer
               0x02 (00000010B) - 2-byte integer
               0x04 (00000100B) - 4-byte integer
               0x08 (00001000B) - 8-byte integer
               0x09 (00001001B) - 2 double values (*)
               0x0A (00001010B) - 3 double values (*)
               0x0C (00001100B) - 4 double values (*)
               0x0F (00001111B) - void, no result
               double otherwise
         x** : HI.BYTE AND (00100000B) - dynamic function flag
               dynamic functions are not calculated at compile time
(*) multiple-result functions must return double values 
    on the FPU register stack (SICx*) or in SSE registers (SICs*) 
    both on x32 and x64 systems
♦
⇐ eax : function index or negative value on error

 

INT sic_refun ( LPVOID sic, LPCSTR fun, LPCSTR fuo, BOOL fui )

rename global or local function
deal with global table if sic = null or sic.fdata = null

⇒ sic : T_sic_data structure offset
⇒ fun : function new name
⇒ fuo : function original name
⇒ fui : invalidate original function if TRUE
♦
⇐ eax : function index or negative value on error

 

INT sic_dufun ( LPVOID sic, LPCSTR fun, LPCSTR fuo )

duplicate global or local function
deal with global table if sic = null or sic.fdata = null

⇒ sic : T_sic_data structure offset
⇒ fun : function dup name
⇒ fuo : function original name
♦
⇐ eax : function index or negative value on error

 

INT sic_exfun ( LPVOID sic, LPCSTR fun, LPCSTR fum )

exchange global or local functions
deal with global table if sic = null or sic.fdata = null

⇒ sic : T_sic_data structure offset
⇒ fun : function name
⇒ fum : function name
♦
⇐ eax : function index or negative value on error

 

INT sic_aconf ( LPVOID sic, LPCSTR con, DOUBLE cov )

add|set user defined global or local float constant ( con ) and assign data ( cov )
deal with global table if sic = null or sic.cdata = null

⇒ sic : T_sic_data structure offset
⇒ con : constant name
⇒ cov : constant value offset
♦
⇐ eax : constant index or negative value on error

 

INT sic_aconi ( LPVOID sic, LPCSTR con, INT_PTR cov )

add|set user defined global or local integer constant ( con ) and assign data ( cov )
deal with global table if sic = null or sic.cdata = null

⇒ sic : T_sic_data structure offset
⇒ con : constant name
⇒ cov : constant value
♦
⇐ eax : constant index or negative value on error

 

INT sic_acons ( LPVOID sic, LPCSTR con, LPCSTR cov )

add|set user defined global or local string constant ( con ) and assign data ( cov )
deal with global table if sic = null or sic.cdata = null

⇒ sic : T_sic_data structure offset
⇒ con : constant name
⇒ cov : constant value
♦
⇐ eax : constant index or negative value on error

 

INT sic_acono ( LPVOID sic, LPCSTR con, LPVOID cov )

add|set user defined global or local offset constant ( con ) and assign data ( cov )
deal with global table if sic = null or sic.cdata = null

⇒ sic : T_sic_data structure offset
⇒ con : constant name
⇒ cov : constant value
♦
⇐ eax : constant index or negative value on error

 

INT sic_aconp ( LPVOID sic, LPCSTR con, LPVOID cov )

add|set user defined global or local pointer constant ( con ) and assign data ( cov )
deal with global table if sic = null or sic.cdata = null

⇒ sic : T_sic_data structure offset
⇒ con : constant name
⇒ cov : constant value
♦
⇐ eax : constant index or negative value on error

 

INT sic_recon ( LPVOID sic, LPCSTR con, LPCSTR coo, BOOL coi )

rename global or local constant
deal with global table if sic = null or sic.cdata = null

⇒ sic : T_sic_data structure offset
⇒ con : constant new name
⇒ coo : constant original name
⇒ coi : invalidate original constant if TRUE
♦
⇐ eax : constant index or negative value on error

 

INT sic_ducon ( LPVOID sic, LPCSTR con, LPCSTR coo )

duplicate global or local constant
deal with global table if sic = null or sic.cdata = null

⇒ sic : T_sic_data structure offset
⇒ con : constant dup name
⇒ coo : constant original name
♦
⇐ eax : constant index or negative value on error

 

INT sic_excon ( LPVOID sic, LPCSTR con, LPCSTR com )

exchange global or local constants
deal with global table if sic = null or sic.cdata = null

⇒ sic : T_sic_data structure offset
⇒ con : constant name
⇒ com : constant name
♦
⇐ eax : constant index or negative value on error

 

INT sic_avarf ( LPVOID sic, LPCSTR van, LPVOID vao )

add|set user defined global or local float variable ( van ) and assign data ( vao )
deal with global table if sic = null or sic.vdata = null

⇒ sic : T_sic_data structure offset
⇒ van : variable name
⇒ vao : variable offset
♦
⇐ eax : variable index or negative value on error

 

INT sic_avari ( LPVOID sic, LPCSTR van, LPVOID vao )

add|set user defined global or local integer variable ( van ) and assign data ( vao )
deal with global table if sic = null or sic.vdata = null

⇒ sic : T_sic_data structure offset
⇒ van : variable name
⇒ vao : variable offset
♦
⇐ eax : variable index or negative value on error

 

INT sic_avars ( LPVOID sic, LPCSTR van, LPVOID vao )

add|set user defined global or local string variable ( van ) and assign data ( vao )
deal with global table if sic = null or sic.vdata = null

⇒ sic : T_sic_data structure offset
⇒ van : variable name
⇒ vao : variable offset
♦
⇐ eax : variable index or negative value on error

 

INT sic_avaro ( LPVOID sic, LPCSTR van, LPVOID vao )

add|set user defined global or local offset variable ( van ) and assign data ( vao )
deal with global table if sic = null or sic.vdata = null

⇒ sic : T_sic_data structure offset
⇒ van : variable name
⇒ vao : variable offset
♦
⇐ eax : variable index or negative value on error

 

INT sic_avarp ( LPVOID sic, LPCSTR van, LPVOID vao )

add|set user defined global or local pointer variable ( van ) and assign data ( vao )
deal with global table if sic = null or sic.vdata = null

⇒ sic : T_sic_data structure offset
⇒ van : variable name
⇒ vao : variable offset
♦
⇐ eax : variable index or negative value on error

 

INT sic_revar ( LPVOID sic, LPCSTR van, LPCSTR vao, BOOL vai )

rename global or local variable
deal with global table if sic = null or sic.vdata = null

⇒ sic : T_sic_data structure offset
⇒ van : variable new name
⇒ vao : variable original name
⇒ vai : invalidate original variable if TRUE
♦
⇐ eax : variable index or negative value on error

 

INT sic_duvar ( LPVOID sic, LPCSTR van, LPCSTR vao )

duplicate global or local variable
deal with global table if sic = null or sic.vdata = null

⇒ sic : T_sic_data structure offset
⇒ van : variable dup name
⇒ vao : variable original name
♦
⇐ eax : variable index or negative value on error

 

INT sic_exvar ( LPVOID sic, LPCSTR van, LPCSTR vam )

exchange global or local variables
deal with global table if sic = null or sic.vdata = null

⇒ sic : T_sic_data structure offset
⇒ van : variable name
⇒ vam : variable name
♦
⇐ eax : variable index or negative value on error

 

INT sic_invaf ( LPVOID sic, LPCSTR fun )

invalidate global or local function ( fun )
deal with global table if sic = null or sic.fdata = null

⇒ sic : T_sic_data structure offset
⇒ fun : function name
♦
⇐ eax : function index or negative value on error

 

INT sic_invac ( LPVOID sic, LPCSTR con )

invalidate global or local constant ( con )
deal with global table if sic = null or sic.cdata = null

⇒ sic : T_sic_data structure offset
⇒ con : constant name
♦
⇐ eax : constant index or negative value on error

 

INT sic_invav ( LPVOID sic, LPCSTR van )

invalidate global or local variable ( van )
deal with global table if sic = null or sic.vdata = null

⇒ sic : T_sic_data structure offset
⇒ van : variable name
♦
⇐ eax : variable index or negative value on error

 

VOID sic_patab ( LPVOID sic )

pack global or local tables ( remove invalid items, decrease and fix table size )
deal with global tables if sic = null or sic.?data = null
!!! you can`t add any item to the packed table

 

DWORD sic_pafut ( LPVOID sic )

pack global or local function table ( remove invalid items, decrease and fix table size )
deal with global table if sic = null or sic.fdata = null
!!! you can`t add any item to the packed table

⇒ sic : T_sic_data structure offset
♦
⇐ eax : table item count or zero on error

 

DWORD sic_pacot ( LPVOID sic )

pack global or local constant table ( remove invalid items, decrease and fix table size )
deal with global table if sic = null or sic.cdata = null
!!! you can`t add any item to the packed table

⇒ sic : T_sic_data structure offset
♦
⇐ eax : table item count or zero on error

 

DWORD sic_pavat ( LPVOID sic )

pack global or local variable table ( remove invalid items, decrease and fix table size )
deal with global table if sic = null or sic.vdata = null
!!! you can`t add any item to the packed table

⇒ sic : T_sic_data structure offset
♦
⇐ eax : table item count or zero on error

 

LPVOID sic_gefut ( LPVOID sic )

get global or local function table offset
deal with global table if sic = null or sic.fdata = null

⇒ sic : T_sic_data structure offset
♦
⇐ eax : function table offset

 

DWORD sic_gefuc ( LPVOID sic )

get global or local function item count
deal with global table if sic = null or sic.fdata = nil

⇒ sic : T_sic_data structure offset
♦
⇐ eax : function item count

 

INT sic_gefui ( LPVOID sic, INT fin, LPVOID fui )

get global or local function item
deal with global table if sic = null or sic.fdata = nil

⇒ sic : T_sic_data structure offset
⇒ fin : function index
♦
⇐ fui : function item
⇐ eax : function index or negative value on error

 

INT sic_gefun ( LPVOID sic, LPCSTR fun )

get global or local item ( fun ) index in function table
deal with global table if sic = null or sic.fdata = nil

⇒ sic : T_sic_data structure offset
⇒ fun : function name
♦
⇐ eax : function index or negative value on error

 

LPVOID sic_gecot ( LPVOID sic )

get global or local constant table offset
deal with global table if sic = null or sic.cdata = nil

⇒ sic : T_sic_data structure offset
♦
⇐ eax : constant table offset

 

DWORD sic_gecoc ( LPVOID sic )

get global or local constant item count
deal with global table if sic = null or sic.cdata = null

⇒ sic : T_sic_data structure offset
♦
⇐ eax : constant item count

 

INT sic_gecoi ( LPVOID sic, INT cin, LPVOID coi )

get global or local constant item
deal with global table if sic = null or sic.cdata = null

⇒ sic : T_sic_data structure offset
⇒ cin : constant index
♦
⇐ coi : constant item
⇐ eax : constant index or negative value on error

 

INT sic_gecon ( LPVOID sic, LPCSTR con )

get global or local item ( con ) index in constant table
deal with global table if sic = null or sic.cdata = null

⇒ sic : T_sic_data structure offset
⇒ con : constant name
♦
⇐ eax : constant index or negative value on error

 

LPVOID sic_gevat ( LPVOID sic )

get global or local variable table offset
deal with global table if sic = null or sic.vdata = nil

⇒ sic : T_sic_data structure offset
♦
⇐ eax : variable table offset

 

DWORD sic_gevac ( LPVOID sic )

get global or local variable item count
deal with global table if sic = null or sic.vdata = null

⇒ sic : T_sic_data structure offset
♦
⇐ eax : variable item count

 

INT sic_gevai ( LPVOID sic, INT vin, LPVOID vai )

get global or local variable item
deal with global table if sic = null or sic.vdata = null

⇒ sic : T_sic_data structure offset
⇒ vin : variable index
♦
⇐ vai : variable item
⇐ eax : variable index or negative value on error

 

INT sic_gevar ( LPVOID sic, LPCSTR van )

get global or local item ( van ) index in variable table
deal with global table if sic = null or sic.vdata = null

⇒ sic : T_sic_data structure offset
⇒ van : variable name
♦
⇐ eax : variable index or negative value on error

 

LPVOID sic_gerut ( LPVOID sic )

get global or local runtime table offset
deal with global table if sic = null or sic.rdata = nil

⇒ sic : T_sic_data structure offset
♦
⇐ eax : runtime table offset

 

DWORD sic_geruc ( LPVOID sic )

get global or local runtime item count
deal with global table if sic = null or sic.rdata = null

⇒ sic : T_sic_data structure offset
♦
⇐ eax : runtime item count

 

INT sic_gerui ( LPVOID sic, INT rin, LPVOID rui )

get global or local runtime item
deal with global table if sic = null or sic.rdata = null

⇒ sic : T_sic_data structure offset
⇒ rin : runtime index
♦
⇐ rui : runtime item
⇐ eax : runtime index or negative value on error

 

INT sic_gerun ( LPVOID sic, LPCSTR run )

get global or local item ( run ) index in runtime table
deal with global table if sic = null or sic.rdata = null

⇒ sic : T_sic_data structure offset
⇒ run : runtime name
♦
⇐ eax : runtime index or negative value on error

 

DWORD sic_compile ( LPVOID sic, LPCSTR s, DWORD sop )

allocate memory for sic code segment and compile string ( s )

⇒ sic : T_sic_data structure offset
⇒ s   : string to compile
⇒ sop : sic compiler options
♦
⇐ eax        : generated code size or zero on error
⇐ sic.coops  : actual compiler options
⇐ sic.tokens : scanned tokens count
⇐ sic.ccurs  : current string cursor
⇐ sic.pcurs  : previous string cursor

 

DWORD sic_build ( LPVOID sic, LPCSTR s, DWORD sop )

allocate memory for sic code segment and compile string ( s )
<s> can be multi-line expression with ';' as delimiter

⇒ sic : T_sic_data structure offset
⇒ s   : string to compile
⇒ sop : sic compiler options
♦
⇐ eax        : generated code size or zero on error
⇐ sic.coops  : actual compiler options
⇐ sic.tokens : scanned tokens count
⇐ sic.ccurs  : current string cursor
⇐ sic.pcurs  : previous string cursor

 

DOUBLE sic_exec ( LPVOID sic, LPDWORD err )

execute code

⇒ sic : T_sic_data structure offset
♦
⇐ st0 : result or zero on error
⇐ err : error code or zero on success
         err = 0x00010000 -> null T_sic_data structure offset
         err = 0x00020000 -> null code segment offset
         err = 0x00040000 -> invalid code size

         if compiler option SIC_OPT_FLAG_FP_FRAME is enabled
         err and 0x00000008 = OE flag
         err and 0x00000004 = ZE flag
         err and 0x00000001 = IE flag

 

VOID sic_call ( LPVOID sic )

execute code

⇒ sic       : T_sic_data structure offset
♦
⇐ sic.value : result

 

DOUBLE sic_cexec ( LPVOID sic, LPCSTR s, LPDWORD sop, LPDWORD err )

compile & execute string

⇒ sic : T_sic_data structure offset
⇒ s   : string to compile
⇒ sop : sic compiler options offset
♦
⇐ st0 : result or zero on error
⇐ sop : actual compiler options
⇐ err : error code or zero on success
         err = 0x00000100 -> compiler error

         if compiler option SIC_OPT_FLAG_FP_FRAME is enabled
         err and 0x00000008 = OE flag
         err and 0x00000004 = ZE flag
         err and 0x00000001 = IE flag

 

DOUBLE sic_bexec ( LPVOID sic, LPCSTR s, LPDWORD sop, LPDWORD err )

compile & execute string
<s> can be multi-line expression with ';' as delimiter

⇒ sic : T_sic_data structure offset
⇒ s   : string to compile
⇒ sop : sic compiler options offset
♦
⇐ st0 : result or zero on error
⇐ sop : actual compiler options
⇐ err : error code or zero on success
         err = 0x00000100 -> compiler error

         if compiler option SIC_OPT_FLAG_FP_FRAME is enabled
         err and 0x00000008 = OE flag
         err and 0x00000004 = ZE flag
         err and 0x00000001 = IE flag

 

DOUBLE sic_scexec ( LPCSTR s, LPDWORD sop, LPDWORD err )

compile & execute string

⇒ s   : string to compile
⇒ sop : sic compiler options offset
♦
⇐ st0 : result or zero on error
⇐ sop : actual compiler options
⇐ err : error code or zero on success
         err = 0x00000100 -> compiler error

         if compiler option SIC_OPT_FLAG_FP_FRAME is enabled
         err and 0x00000008 = OE flag
         err and 0x00000004 = ZE flag
         err and 0x00000001 = IE flag

 

DOUBLE sic_sbexec ( LPCSTR s, LPDWORD sop, LPDWORD err )

compile & execute string
<s> can be multi-line expression with ';' as delimiter

⇒ s   : string to compile
⇒ sop : sic compiler options offset
♦
⇐ st0 : result or zero on error
⇐ sop : actual compiler options
⇐ err : error code or zero on success
         err = 0x00000100 -> compiler error

         if compiler option SIC_OPT_FLAG_FP_FRAME is enabled
         err and 0x00000008 = OE flag
         err and 0x00000004 = ZE flag
         err and 0x00000001 = IE flag

 

INT sic_va_count ( VOID )

variable argument count

⇐ eax : variable argument count

 

INT sic_inda ( LPVOID code, LPVOID data, BYTE x64 )

instruction disassembler

⇒ code : pointer to the code
⇒ data : pointer to T_ida_data structure
⇒ x64  : x64=0 for 32-bit, x64!=0 for 64-bit code
♦
⇐ eax : instruction size
⇐ edx : instruction flags

 

UINT_PTR cpuseed ( VOID )

CPU random generator

⇐ random uint number
  x64 : ⇐ rax [0, 264-1]-interval
  x32 : ⇐ eax [0, 232-1]-interval

 

UINT64 cpuseed64 ( VOID )

CPU random generator

⇐ random uint number
  [0, 264-1]-interval
  x64 : ⇐ rax
  x32 : ⇐ eax:edx

 

UINT32 cpuseed32 ( VOID )

CPU random generator

⇐ random uint number
  [0, 232-1]-interval
  ⇐ eax

 

UINT16 cpuseed16 ( VOID )

CPU random generator

⇐ random uint number
  [0, 216-1]-interval
  ⇐ ax

 

UINT_PTR cpurand ( VOID )

CPU random generator

⇐ random uint number
  x64 : ⇐ rax [0, 264-1]-interval
  x32 : ⇐ eax [0, 232-1]-interval

 

UINT64 cpurand64 ( VOID )

CPU random generator

⇐ random uint number
  [0, 264-1]-interval
  x64 : ⇐ rax
  x32 : ⇐ eax:edx

 

UINT32 cpurand32 ( VOID )

CPU random generator

⇐ random uint number
  [0, 232-1]-interval
  ⇐ eax

 

UINT16 cpurand16 ( VOID )

CPU random generator

⇐ random uint number
  [0, 216-1]-interval
  ⇐ ax

 

DOUBLE cpurandf ( VOID )

CPU random generator

⇐ random float number
  [0,1)-interval (53-bit resolution)

 

DOUBLE cpurandf2pi ( VOID )

CPU random generator

⇐ random float number
  [0,2•pi)-interval (53-bit resolution)

 

UINT_PTR mt19937_igen ( VOID )

Mersenne Twister random generator

⇐ random uint number
  x64 : ⇐ rax [0, 264-1]-interval
  x32 : ⇐ eax [0, 232-1]-interval

 

DOUBLE mt19937_fgen ( VOID )

Mersenne Twister random generator

⇐ random float number
  [0,1)-interval (53-bit resolution)

 

DOUBLE mt19937_fgen2pi ( VOID )

Mersenne Twister random generator

⇐ random float number
  [0,2•pi)-interval (53-bit resolution)

 

VOID mt19937_seed ( UINT_PTR ASeed )

Mersenne Twister seed by value

⇒ ASeed : seed value

 

VOID mt19937_seeds ( PUINT_PTR ASeeds, UINT_PTR ACount )

Mersenne Twister seed by array

⇒ ASeeds : pointer to seed values array
⇒ ACount : seeds count

 

DOUBLE sic_erf ( DOUBLE A )

Error function

 

DOUBLE sic_erfc ( DOUBLE A )

Complementary error function

 

DOUBLE sic_cdfnorm ( DOUBLE A )

Normal distribution function

 

DOUBLE sic_erfinv ( DOUBLE A )

Inverse error function

 

DOUBLE sic_erfcinv ( DOUBLE A )

Inverse complementary error function

 

DOUBLE sic_cdfnorminv ( DOUBLE A )

Inverse of normal distribution function

 

DOUBLE sic_lgamma ( DOUBLE A )

Natural logarithm of the absolute value of gamma function

 

DOUBLE sic_lgammas ( DOUBLE A, LPDWORD S )

Natural logarithm of the absolute value and the sign of gamma function
⇐ S - gamma function sign flag
  0 : positive
  1 : negative

 

DOUBLE sic_tgamma ( DOUBLE A )

Gamma function

 

DOUBLE sic_rgamma ( DOUBLE A )

Reciprocal gamma function

 

DOUBLE sic_rtgamma ( DOUBLE A )

Reciprocal gamma function

 

DOUBLE sic_beta ( DOUBLE A, DOUBLE B )

Beta function





List of Export Functions
Top
Details
  1.  sic_aconf
  2.  sic_aconi
  3.  sic_acono
  4.  sic_aconp
  5.  sic_aconpf
  6.  sic_aconpi
  7.  sic_aconps
  8.  sic_acons
  9.  sic_afun
  10.  sic_avarf
  11.  sic_avari
  12.  sic_avaro
  13.  sic_avarp
  14.  sic_avarpf
  15.  sic_avarpi
  16.  sic_avarps
  17.  sic_avars
  18.  sic_bexec
  19.  sic_build
  20.  sic_cexec
  21.  sic_compile
  22.  sic_conloa
  23.  sic_contac
  24.  sic_contaf
  25.  sic_conulo
  26.  sic_cpu_support
  27.  sic_cretab
  28.  sic_done
  29.  sic_ducon
  30.  sic_dufun
  31.  sic_duvar
  32.  sic_excon
  33.  sic_exec
  34.  sic_exfun
  35.  sic_exvar
  36.  sic_fretab
  37.  sic_funloa
  38.  sic_funtac
  39.  sic_funtaf
  40.  sic_funulo
  41.  sic_gecoc
  42.  sic_gecoi
  43.  sic_gecon
  44.  sic_gecot
  45.  sic_gefuc
  46.  sic_gefui
  47.  sic_gefun
  48.  sic_gefut
  49.  sic_geruc
  50.  sic_gerui
  51.  sic_gerun
  52.  sic_gerut
  53.  sic_gevac
  54.  sic_gevai
  55.  sic_gevar
  56.  sic_gevat
  57.  sic_inda
  58.  sic_init
  59.  sic_invac
  60.  sic_invaf
  61.  sic_invav
  62.  sic_pacot
  63.  sic_pafut
  64.  sic_patab
  65.  sic_pavat
  66.  sic_pcall
  67.  sic_recon
  68.  sic_refun
  69.  sic_revar
  70.  sic_runtac
  71.  sic_runtaf
  72.  sic_sbexec
  73.  sic_scexec
  74.  sic_setup
  75.  sic_va_count
  76.  sic_varloa
  77.  sic_vartac
  78.  sic_vartaf
  79.  sic_varulo
  80.  sic_version

  81.  cpurand
  82.  cpurand16
  83.  cpurand32
  84.  cpurand64
  85.  cpurandf
  86.  cpurandf2pi
  87.  cpuseed
  88.  cpuseed16
  89.  cpuseed32
  90.  cpuseed64

  91.  mt19937_fgen
  92.  mt19937_fgen2pi
  93.  mt19937_igen
  94.  mt19937_seed
  95.  mt19937_seeds

  96.  sic_beta
  97.  sic_cdfnorm
  98.  sic_cdfnorminv
  99.  sic_erf
  100.  sic_erfc
  101.  sic_erfcinv
  102.  sic_erfinv
  103.  sic_lgamma
  104.  sic_lgammas
  105.  sic_rgamma
  106.  sic_rtgamma
  107.  sic_tgamma




Native functions
Top
List
Symbols

Fuchsia-colored functions have an implementation with integer parameters.
For such functions, there are both
double func (double x1, double x2, …, double xn) and
double func (integer x1, integer x2, …, integer xn)

Green-colored functions accept only integer parameters.

Description of the functions that have only the FPU implementation contains the #FPU tag.

Third column = argument count [:result count]
Functions with integer result : ‹result count› = i
Functions with pointer result : ‹result count› = p
Default value of ‹result count› is 1

Functions with a variable number of arguments:
  • argument count < 0
  • ABS (argument count) = minimum argument count

Assembler instructions
int3 0:0 Breakpoint
int3
int.3 0:0 Breakpoint
int 3
finit 0:0 Initialize FPU after checking for pending unmasked floating-point exceptions

SSE
Load default MXCSR value 0x1F80

finit

fninit 0:0 Initialize FPU without checking for pending unmasked floating-point exceptions

SSE
Load default MXCSR value 0x1F80

fninit

fclex 0:0 Clear floating-point exception flags after checking for pending unmasked floating-point exceptions

SSE
Clear MXCSR exception flags

fclex

fnclex 0:0 Clear floating-point exception flags without checking for pending unmasked floating-point exceptions

SSE
Clear MXCSR exception flags

fnclex

 
FPU functions
fstsw
1:0 Store FPU status word to integer variable after checking for pending unmasked floating-point exceptions

SSE
Store MXCSR register to integer variable

fstsw(x)
x - integer variable    

int sw;
fstsw sw;

fnstsw
1:0 Store FPU status word to integer variable without checking for pending unmasked floating-point exceptions

SSE
Store MXCSR register to integer variable

fnstsw(x)
x - integer variable    

int sw;
fnstsw sw;

fstef
1:0 Store FPU exception flags to integer variable after checking for pending unmasked floating-point exceptions

SSE
Store MXCSR exception flags to integer variable

fstef(x)
x - integer variable    

int ef;
fstef ef;

fnstef
1:0 Store FPU exception flags to integer variable without checking for pending unmasked floating-point exceptions

SSE
Store MXCSR exception flags to integer variable

fnstef(x)
x - integer variable    

int ef;
fnstef ef;

fstcw
1:0 Store FPU control word to integer variable after checking for pending unmasked floating-point exceptions

SSE
Store MXCSR register to integer variable

fstcw(x)
x - integer variable    

int cw;
fstcw cw;

fnstcw
1:0 Store FPU control word to integer variable without checking for pending unmasked floating-point exceptions

SSE
Store MXCSR register to integer variable

fnstcw(x)
x - integer variable    

int cw;
fnstcw cw;

fldcw
1:0 Load FPU control word from integer variable or constant

SSE
Load MXCSR register from integer variable or constant

fldcw(x)

int cw_o;
int cw_n;

// save FPU control word
fnstcw cw_o;

// mask all FPU exceptions
cw_n = cw_o | 0b00111111;

// load FPU control word
fldcw cw_n;

// ...

// restore FPU control word
fldcw cw_o;

fmaske
1:0 Mask FPU exceptions after checking for pending unmasked floating-point exceptions

SSE
Mask MXCSR exceptions

fmaske(x)

int cw_o;

// save FPU control word
fnstcw cw_o;

// mask all FPU exceptions
fmaske 0b00111111;

// ...

// restore FPU control word
fldcw cw_o;

fnmaske
1:0 Mask FPU exceptions without checking for pending unmasked floating-point exceptions

SSE
Mask MXCSR exceptions

fnmaske(x)

int cw_o;

// save FPU control word
fnstcw cw_o;

// mask all FPU exceptions
fnmaske 0b00111111;

// ...

// restore FPU control word
fldcw cw_o;

 
Variable declaration
You can use ` (grave accent) prefix symbol while declaring variables.  

var `x=888; // create variable named x in runtime table
To access runtime variable declared as `x use x or `x.

Use # prefix symbol to prefer global variables
Use `` prefix symbols to prefer local variables

var
float 
double 
      Double variable declaration.
64-bit float

var dd00 = 222.123;
float dd01 = sin(2:pi);
double dd02 = 888.123;
double dd03 = sin(a) / 0.1;

dd00;

var vv, v1=sin(a), v2=cos(a);
vv = v1^2 + v2^2;

var x0=(x1=10)+(x2=20);
x0 + x1 + x2;

var `x = 22, `y = 99;
  x = 88; // assign runtime variable x
 `y = 55; // assign runtime variable y
``x = 11; // assign local or global variable x
``y = 66; // assign local or global variable y
 #x = 33; // assign global or local variable x
 #y = 44; // assign global or local variable y

cvar
complex 
      Complex variable declaration.
2 × 64-bit float

cvar z0;
complex (z1=11,22), (z2=33,44);
var z.re, z.im;
var u.re, u.im;

// z0 = z1 + z2
cmove(z0, cadd(z1,z2));
cmove(z.re,z.im, cadd(z1,z2));
cmove(u.re,u.im, z0);

cvar z0;
cvar z1=(11,22), z2=(33,44);

// z0 = z1 + z2
cmove(z0, cadd(z1,z2));

cvar z0;
cvar z1=11,22, z2=33,44;

// z0 = z1 + z2
cmove(z0, cadd(z1,z2));

int
integer 
Native integer variable declaration.
x32 : 4-byte integer
x64 : 8-byte integer

int ii00 = 222;
integer ii01 = 888;
integer ii02 = a - b;
integer ii03 = #55;
integer ii04 = $A;
integer ii05 = ##1000;

ii00;

int ii, i1=123, i2=321;
ii = i2 - i1;

str
string 
String variable declaration.
Address of an array of single-byte characters


Escape symbols (case sensitive)
\0 ⇒ 0x00 00   Null character (NUL)
\a ⇒ 0x07 07   Bell (BEL)
\b ⇒ 0x08 08   Backspace (BS)
\t ⇒ 0x09 09   Horizontal tab (TAB)
\n ⇒ 0x0A 10   Line feed | New line (LF)
\v ⇒ 0x0B 11   Vertical tab (VT)
\f ⇒ 0x0C 12   Form feed | Page break (FF)
\r ⇒ 0x0D 13   Carriage return (CR)
\e ⇒ 0x1B 27   Escape character (ESC)

Escape hex symbols
\x?? ⇒ 0x??

Escape oct symbols
\??? ⇒ o???
\??  ⇒ o??

Escape unicode symbols
\u???? ⇒ 0x??

ASCII Control Codes (case sensitive)
\c¿
\c@ ⇒ 0x00   NUL
\cA ⇒ 0x01   SOH
\cB ⇒ 0x02   STX
\cC ⇒ 0x03   ETX
...
\c_ ⇒ 0x1F   US
\c? ⇒ 0x7F   DEL
 

str ss00 = "123";
string ss01 = "abc";
string ss02 = "abc\xA7+\xa7";
string ss03 = "abc\x22+\x22";
string ss04 = "abc\"+\"";
string ss05 = "abc\r\n";
string ss06 = 'abc';
string ss07 = “abc”;
string ss08 = „abc”;
string ss09 = ‘abc’;
string ss10 = ‚abc’;
string ss11 = «abc»;
string ss12 = ‹abc›;

ss00;

str ss1="abc", ss2="abcd";
int i1, i2, i3=lstrlen("abcdef");
i1 = lstrlen(ss1);
i2 = lstrlen(ss2);

str ss = "12345678";
ss += 4; // ss = "5678"

absolute
:: Declare a variable that resides at the same address as another variable
x::y    
absolute(x,y)    
x absolute y    

y - variable or pointer constant    
y - integer or string constant    

var z0.re=3, z0.im=4;
complex z0::z0.re;
complex z1 absolute z0.re;
complex absolute(z2,z0);
complex (z3,z0):absolute;
var abs0, abs1, abs2, abs3, abs4;
var arg0, arg1, arg2, arg3, arg4;

abs0 = cabs(z0.re,z0.im);
abs1 = cabs(z0);
abs2 = cabs(z1);
abs3 = cabs(z2);
abs4 = cabs(z3);

arg0 = carg(z0.re,z0.im);
arg1 = carg(z0);
arg2 = carg(z1);
arg3 = carg(z2);
arg4 = carg(z3);

complex z0=3,4;
var z0.re absolute z0;
var z0.im absolute (&z0+8);
var z1.re absolute (&z0+0);
var z1.im absolute (&z0+8);
var abs0, abs1, abs2;
var arg0, arg1, arg2;

abs0 = cabs(z0);
abs1 = cabs(z0.re,z0.im);
abs2 = cabs(z1.re,z1.im);

arg0 = carg(z0);
arg1 = carg(z0.re,z0.im);
arg2 = carg(z1.re,z1.im);

int p0 = &x;
var x0 absolute p0:covalue;

x0 = 888;
// x = 888;

 
System functions
addr
&x 1:p
2:p
Address of the variable
&x    
addr(x)    

int p1;
int p2;

p1 = &x;
p2 = addr(x);

complex z0=11,22;
complex z2;
int p_z0;

p_z0 = &z0;
cmove(z2, p_z0^^);

saddr
&&x 1:p
Address of the string array
&&x    
saddr(x)    

x - string variable or constant    

str s0 = "12345678";
int i0, i1, i2;

assign i0, &&s0;
assign i1, &&v_str8;
assign i2, &&c_str8;

str s0;
int i1, i2, i3;
int i4, i5, i6;

i1 = &s0;
i2 = &&s0;
assign i3, &&s0;

: s0 = "12345678";
i4 = &s0;
i5 = &&s0;
assign i6, &&s0;

assign
-2:0
Assign the address of the variable.
Assign function uses the address of the variable it had at compile time
assign x,y    
assign(x,y)    

x - destination variable    
y - variable or pointer constant    
y - integer or string constant    

var u0;

assign u0, x;
u0 = 111;
// x = 111

assign u0, y;
u0 = 222;
// y = 222

var u0;

assign u0, &x;
u0 = 111;
// x = 111

assign u0, &y;
u0 = 222;
// y = 222

int p0 = &x;
var x0;

assign x0, p0:covalue;
x0 = 888;
// x = 888

str s0, z0;
int i0, j0;

s0 = "12345678";
assign i0, &&s0;
// i0 = null

: z0 = "12345678";
assign j0, &&z0;
// x64: j0 = 4050765991979987505
// x32: j0 = 875770417

reassign
-1:0
Restore initial address of the variable
reassign x    
reassign(x)    

x - variable    

var u0 = 123;
var p0 = 456;

assign u0, p0;
u0 = 222;
// u0 = 222
// p0 = 222

reassign u0;
u0 = 888;
// u0 = 888
// p0 = 222

vfloat
vdouble 
1 Address as double variable vfloat(p)    
vdouble(p)    

p - pointer or integer constant    
p = address of a variable    

var v1=1.1, v2=2.2;
var v3, v4, v5, v6;

v3 = vdouble(&v1);
v4 = (&v2):vdouble;
vdouble(&v5) = v3;
(&v6):vdouble = v4;

var x0 = 888;
int p0 = &x0;

// x0 = 123
(p0:covalue):vdouble = 123;

vcomplex
1 Address as complex variable vcomplex(p)    

p - pointer or integer constant    
p = address of a variable    

complex z1, z2, z3, z4, z5, z6;

cmove(z1, 1.1, 2.2);
cmove(z2, 3.3, 4.4);

cmove(z3, (&z1):vcomplex);
cmove(z4, vcomplex(&z2));
cmove((&z5):vcomplex, z3);
cmove(vcomplex(&z6), z4);

complex z0 = 11,22;
int p0 = &z0;

// z0 = (33,88)
cmove((p0:covalue):vcomplex, 33,88);

vint
vinteger 
1 Address as integer variable vint(p)    
vinteger(p)    

p - pointer or integer constant    
p = address of a variable    

int v1=11, v2=22;
int v3, v4, v5, v6;

v3 = vint(&v1);
v4 = (&v2):vint;
vint(&v5) = v3;
(&v6):vint = v4;

int x0 = 888;
int p0 = &x0;

// x0 = 123
(p0:covalue):vinteger = 123;

vstr
vstring 
1 Address as string variable vstr(p)    
vstring(p)    

p - pointer or integer constant    
p = address of a variable    

str v1="11", v2="22";
str v3, v4, v5, v6;

v3 = vstr(&v1);
v4 = (&v2):vstr;
vstr(&v5) = v3;
(&v6):vstr = v4;

str x0 = "abc";
int p0 = &x0;

// x0 = "xyz"
(p0:covalue):vstring = "xyz";

pfloat
pdouble 
*p
p^
1 Double indirection operator *p    
p^    
pfloat(p)    
pdouble(p)    

p - integer variable or constant    
p - pointer constant    
p = address of double value    

int p_v;
var v1;
var v2;
var v3;
var v4;
var v5;
var v6;

x = 111.222;
p_v = &x;

v1 = *p_v;
v2 = p_v^;
v3 = pfloat(p_v);
v4 = pdouble(p_v);
v5 = p_v:pfloat;
v6 = p_v:pdouble;

pcomplex
**p
p^^
1:2 Complex indirection operator **p    
p^^    
pcomplex(p)    

p - integer variable or constant    
p - pointer constant    
p = address of T_complex structure    

int p_c;
complex z0;
complex z1;
complex z2;
complex z3;
complex z4;

cmove(z0, 22,88);
p_c = &z0;

cmove(z1, **p_c);
cmove(z2, p_c^^);
cmove(z3, pcomplex(p_c));
cmove(z4, p_c:pcomplex);

pint
pinteger 
1:i Native integer indirection operator pint(p)    
pinteger(p)    

p - integer variable or constant    
p - pointer constant    
p = address of int value    

int p_i;
int i0 = 888;
int i1;
int i2;

p_i = &i0;
i1 = pint(p_i);
i2 = p_i:pint;

pstr
pstring 
1:i String indirection operator pstr(p)    
pstring(p)    

p - integer variable or constant    
p - pointer constant    
p = address of string    

int p_s;
str s0 = "888";
str s1;
str s2;

p_s = &s0;
s1 = pstr(p_s);
s2 = p_s:pstr;

pint64
1 Int64 indirection operator pint64(p)    

p - integer variable or constant    
p - pointer constant    
p = address of int64 value    

:float
:double 
 
1 Double type modifier x:float    
x:double    
:int
 
1 Native integer type modifier x:int    
:int64
 
1 Int64 type modifier x:int64    
tcarg
 
1 Complex argument typecast for external procedure

Postfix notation not allowed.

complex ca0=1,2, cb0=12,23;
complex cr00, cr01, cr02;
complex cr10, cr11, cr12;
complex cr20, cr21, cr22;

cr00 = cpow (ca0, cb0);
cr10 = csin (ca0);
cr20 = ccos (ca0);

$+ CPUX64

libm_cpow (&cr01, &ca0, &cb0);
libm_csin (&cr11, &ca0);
libm_ccos (&cr21, &ca0);

$+ CPUX32

libm_cpow (&cr01, ca0, cb0);
libm_csin (&cr11, ca0);
libm_ccos (&cr21, ca0);

$+ CPUX

libm_cpow (&cr02, tcarg(ca0), tcarg(cb0));
libm_csin (&cr12, tcarg(ca0));
libm_ccos (&cr22, tcarg(ca0));

complex ca0=1,2, cb0=12,23;
complex cr00, cr01, cr02;
complex cr10, cr11, cr12;

cr00 = cmul (ca0, cb0);
cr10 = cdiv (ca0, cb0);

$+ CPUX64

gsl_cmul (&cr01, &ca0, &cb0);
gsl_cdiv (&cr11, &ca0, &cb0);

$+ CPUX32

gsl_cmul (&cr01, ca0, cb0);
gsl_cdiv (&cr11, ca0, cb0);

$+ CPUX

gsl_cmul (&cr02, tcarg(ca0), tcarg(cb0));
gsl_cdiv (&cr12, tcarg(ca0), tcarg(cb0));

covalue
x`
1 The value of the variable it had at compile time
covalue(x)    
x`    

double u0; // u0 = 0
double ua;
double ub;

u0 = 888;
ua = u0:covalue; // ua = 0
u0 = 222;
ub = u0:covalue; // ub = 0

double u0 = 777;
double ua;
double ub;

u0 = 888;
ua = u0:covalue; // ua = 777
u0 = 222;
ub = u0:covalue; // ub = 777

double u0; // u0 = 0
double ua;
double ub;

// evaluate at compile time
: u0 = 888+111; // u0 = 999

u0 = 888;
ua = u0:covalue; // ua = 999
u0 = 222;
ub = u0:covalue; // ub = 999

double u0; // u0 = 0
double ua;
double ub;
double uc;
double ud;

// evaluate at compile time
: u0 = 888+111; // u0 = 999

u0 = 888;
ua = u0:covalue; // ua = 999
u0 = 222;
ub = u0:covalue; // ub = 999

// evaluate at compile time
: u0 = 888-111; // u0 = 777

u0 = 888;
uc = u0:covalue; // uc = 777
u0 = 222;
ud = u0:covalue; // ud = 777

restore
1 Copy covalue to the variable
Return new value of the variable
restore(x)    
x - variable    

var d1 = 111.222;
var d2, d3;

d1 = 333.444;     // d1 = 333.444
d2 = d1;          // d1 = 333.444
d3 = restore(d1); // d1 = 111.222

int i1 = 111;
int i2, i3;

i1 = 333;         // i1 = 333
i2 = i1;          // i1 = 333
i3 = restore(i1); // i1 = 111

str s1 = "aaa";
str s2, s3;

s1 = "bbb";       // s1 = "bbb"
s2 = s1;          // s1 = "bbb"
s3 = restore(s1); // s1 = "aaa"

reset
1:0 Copy covalue to the variable
Return void
reset(x)    
x - variable    

var d1 = 111.222;
var d2;

d1 = 333.444; // d1 = 333.444
d2 = d1;      // d1 = 333.444
reset(d1);    // d1 = 111.222

int i1 = 111;
int i2;

i1 = 333;  // i1 = 333
i2 = i1;   // i1 = 333
reset(i1); // i1 = 111

str s1 = "aaa";
str s2;

s1 = "bbb"; // s1 = "bbb"
s2 = s1;    // s1 = "bbb"
reset(s1);  // s1 = "aaa"

is.x32
0:i Is x32 DLL?
returns:
1 ⇐ DLL is x32
0 ⇐ DLL is not x32
is.n32
0:i Is not x32 DLL?
returns:
1 ⇐ DLL is not x32
0 ⇐ DLL is x32
is.x64
0:i Is x64 DLL?
returns:
1 ⇐ DLL is x64
0 ⇐ DLL is not x64
is.n64
0:i Is not x64 DLL?
returns:
1 ⇐ DLL is not x64
0 ⇐ DLL is x64
dll.bits
0:i DLL bitness
returns:
32 ⇐ DLL is x32
64 ⇐ DLL is x64
sizeof
1:i Size of object in bytes
sizeof(x)

x - constant, variable or
data type keyword

var vv;
int ii;
str ss;

int vv.size;
int ii.size;
int ss.size;

int double.size;
int complex.size;
int integer.size;
int string.size;
int pointer.size;

vv.size = sizeof(vv);
// = 8

ii.size = sizeof(ii);
// = 8 (x64) | 4 (x32)

ss.size = sizeof(ss);
// = 8 (x64) | 4 (x32)

double.size = sizeof(double);
// = 8

complex.size = sizeof(complex);
// = 16

integer.size = sizeof(integer);
// = 8 (x64) | 4 (x32)

string.size = sizeof(string);
// = 8 (x64) | 4 (x32)

pointer.size = sizeof(pointer);
// = 8 (x64) | 4 (x32)

is.nan
1:i Returns whether x is a NaN (Not-A-Number) value
is.nan(x)  
♦ 1 ⇐ x is a NaN value
♦ 0 ⇐ otherwise
is.inf
1:i Returns whether x is an infinity value (either positive infinity or negative infinity)
is.inf(x)  
♦ 1 ⇐ x is an infinity value
♦ 0 ⇐ otherwise
is.valid
1:i Returns whether x is a valid value.
A valid value is any floating-point value that is neither infinite nor NaN (Not-A-Number)
is.valid(x)  
♦ 1 ⇐ x is a valid value
♦ 0 ⇐ otherwise
is.invalid
1:i Returns whether x is an invalid value.
An invalid value is any floating-point value that is either infinite or NaN (Not-A-Number)
is.invalid(x)  
♦ 1 ⇐ x is an invalid value
♦ 0 ⇐ otherwise
 
Return functions
result.set
=x
:=x
1
Assign the default result value.

Required active compiler options:
SIC_OPT_FLAG_STACK_FRAME
SIC_OPT_FLAG_LOCALS

result.set(x)  
=x  
:=x  

$+ STACK_FRAME
$+ LOCALS

result.set(888);

a = x;
b = y;

exit;

c = z;

$+ STACK_FRAME
$+ LOCALS

= 888; // result = 888

a = x;
b = y;

exit;

c = z;

$+ STACK_FRAME
$+ LOCALS

:= 888; // result = 888

a = x;
b = y;

exit;

c = z;

result.get
(=)
== 
0
Get the default result value.

Required active compiler options:
SIC_OPT_FLAG_STACK_FRAME
SIC_OPT_FLAG_LOCALS

result.get  

$+ STACK_FRAME
$+ LOCALS

result.set(888);

a = x;
b = y;
c = result.get;

$+ STACK_FRAME
$+ LOCALS

= 888; // result = 888

a = x;
b = y;
c = 12 + (=); // c = 12 + result

$+ STACK_FRAME
$+ LOCALS

= 222; // result = 222

a = x;
b = y;
c = 2222 - ==; // c = 2222 - result

co.rcopy
co.rxcopy 
x= 
x:=
1
Copy the default result value to the variable x.

Required active compiler options:
SIC_OPT_FLAG_STACK_FRAME
SIC_OPT_FLAG_LOCALS

co.rcopy(x)  
co.rxcopy(x)  
x=  
x:=  

x - variable    
x = result.get  

$+ STACK_FRAME
$+ LOCALS

= 888; // result = 888

a = x;
b = y;
c = ; // c = 888

$+ STACK_FRAME
$+ LOCALS

:= 888; // result = 888

a = x;
b = y;
c := ; // c = 888

exit
quit 
0:0
Quit the function.

Required active compiler options:
SIC_OPT_FLAG_STACK_FRAME
SIC_OPT_FLAG_LOCALS

exit;  
quit;  

$+ STACK_FRAME
$+ LOCALS

x + y;
exit;

x - y;

$+ STACK_FRAME
$+ LOCALS

x + y;
quit;

x - y;

exit.if
quit.if 
*.if.true 
1:0
Quit the function.

Required active compiler options:
SIC_OPT_FLAG_STACK_FRAME
SIC_OPT_FLAG_LOCALS

exit.if(c);  
quit.if(c);  

exit.if.true(c);  
quit.if.true(c);  

c - integer value

Quit the function if c≠0

$+ STACK_FRAME
$+ LOCALS

a = b * 0;
exit.if (a==0);

a = 888;

$+ STACK_FRAME
$+ LOCALS

a = b * 0;
exit.if.true (a!=0);

a = 888;

exit.if.not
quit.if.not 
*.if.false 
1:0
Quit the function.

Required active compiler options:
SIC_OPT_FLAG_STACK_FRAME
SIC_OPT_FLAG_LOCALS

exit.if.not(c);  
quit.if.not(c);  

exit.if.false(c);  
quit.if.false(c);  

c - integer value

Quit the function if c=0

$+ STACK_FRAME
$+ LOCALS

a = b * 0;
exit.if.not (a==0);

a = 888;

$+ STACK_FRAME
$+ LOCALS

a = b * 0;
exit.if.false (a!=0);

a = 888;

return
0:0
1:0
Assign the result value if defined and quit the function.

Required active compiler options:
SIC_OPT_FLAG_STACK_FRAME
SIC_OPT_FLAG_LOCALS

return;  
return(x);  

$+ STACK_FRAME
$+ LOCALS

x + y;
return;

x - y;

$+ STACK_FRAME
$+ LOCALS

x + y;
return (222);

x - y;

return.if
return.if.true 
1:0
2:0
Assign the result value if defined and quit the function.

Required active compiler options:
SIC_OPT_FLAG_STACK_FRAME
SIC_OPT_FLAG_LOCALS

return.if(c);  
return.if(x,c);  

return.if.true(c);  
return.if.true(x,c);  

c - integer value

Quit the function if c≠0

$+ STACK_FRAME
$+ LOCALS

a = b * 0;
return.if (a==0);

a = 888;

$+ STACK_FRAME
$+ LOCALS

a = b * 0;
return.if.true (a==0);

a = 888;

$+ STACK_FRAME
$+ LOCALS

a = b * 0;
return.if (222, a==0);

a = 888;

$+ STACK_FRAME
$+ LOCALS

a = b * 0;
return.if.true (222, a==0);

a = 888;

return.if.not
return.if.false 
1:0
2:0
Assign the result value if defined and quit the function.

Required active compiler options:
SIC_OPT_FLAG_STACK_FRAME
SIC_OPT_FLAG_LOCALS

return.if.not(c);  
return.if.not(x,c);  

return.if.false(c);  
return.if.false(x,c);  

c - integer value

Quit the function if c=0

$+ STACK_FRAME
$+ LOCALS

a = b * 0;
return.if.not (a!=0);

a = 888;

$+ STACK_FRAME
$+ LOCALS

a = b * 0;
return.if.false (a!=0);

a = 888;

$+ STACK_FRAME
$+ LOCALS

a = b * 0;
return.if.not (222, a!=0);

a = 888;

$+ STACK_FRAME
$+ LOCALS

a = b * 0;
return.if.false (222, a!=0);

a = 888;

 
Copy functions
copy
xcopy 

:= 
2 Copy the value of y to the variable x.
Returns new value of x
copy(*x,y)  
xcopy(*x,y)  
x = y  
x := y  

x - variable
y - value

copy.int
xcopy.int 
[=] 
[:=] 
2 Copy the value of int(y) to the variable x.
Returns new value of x

Accept double or integer values

copy.int(*x,y)  
xcopy.int(*x,y)  
x [=]  y  
x [:=] y  

x - variable
y - value

str ss = "123";
var y1 = 1.1, y2 = 5.5, y3 = 2.2, y4 = 4.4;
int n1 = 222, n2 = 2, n3 = 3;
var x1 = 333, x2 = 333, x3 = 333, x4 = 333;
var x5 = 333, x6 = 333, x7 = 333, x8 = 333;
int u1 = 333, u2 = 333, u3 = 333, u4 = 333;
int u5 = 333, u6 = 333, u7 = 333, u8 = 333;

x1 [:=] (y1+0.5);
x2 [:=] y2;
x3 [:=] 444.777;
x4 [:=] n1;
x5 [:=] 0n123;
x6 [:=] (y3+y4):int;
x7 [:=] (n2 && n3);
x8 [:=] lstrlen(ss);

u1 [:=] (y1+0.5);
u2 [:=] y2;
u3 [:=] 444.777;
u4 [:=] n1;
u5 [:=] 0n123;
u6 [:=] (y3+y4):int;
u7 [:=] (n2 && n3);
u8 [:=] lstrlen(ss);

copy.frac
xcopy.frac 
{=} 
{:=} 
2 Copy the value of frac(y) to the variable x.
Returns new value of x

Accept double or integer values

copy.frac(*x,y)  
xcopy.frac(*x,y)  
x {=}  y  
x {:=} y  

x - variable
y - value

str ss = "123";
var y1 = 1.1, y2 = 5.5, y3 = 2.2, y4 = 4.4;
int n1 = 222, n2 = 2, n3 = 3;
var x1 = 333, x2 = 333, x3 = 333, x4 = 333;
var x5 = 333, x6 = 333, x7 = 333, x8 = 333;
int u1 = 333, u2 = 333, u3 = 333, u4 = 333;
int u5 = 333, u6 = 333, u7 = 333, u8 = 333;

x1 {:=} (y1+0.5);
x2 {:=} y2;
x3 {:=} 444.777;
x4 {:=} n1;
x5 {:=} 0n123;
x6 {:=} (y3+y4):int;
x7 {:=} (n2 && n3);
x8 {:=} lstrlen(ss);

u1 {:=} (y1+0.5);
u2 {:=} y2;
u3 {:=} 444.777;
u4 {:=} n1;
u5 {:=} 0n123;
u6 {:=} (y3+y4):int;
u7 {:=} (n2 && n3);
u8 {:=} lstrlen(ss);

copy.round
xcopy.round 
<=> 
<:=> 
2 Copy the value of round(y) to the variable x.
Returns new value of x

Accept double or integer values

copy.round(*x,y)  
xcopy.round(*x,y)  
x <=>  y  
x <:=> y  

x - variable
y - value

str ss = "123";
var y1 = 1.1, y2 = 5.5, y3 = 2.2, y4 = 4.4;
int n1 = 222, n2 = 2, n3 = 3;
var x1 = 333, x2 = 333, x3 = 333, x4 = 333;
var x5 = 333, x6 = 333, x7 = 333, x8 = 333;
int u1 = 333, u2 = 333, u3 = 333, u4 = 333;
int u5 = 333, u6 = 333, u7 = 333, u8 = 333;

x1 <:=> (y1+0.5);
x2 <:=> y2;
x3 <:=> 444.777;
x4 <:=> n1;
x5 <:=> 0n123;
x6 <:=> (y3+y4):int;
x7 <:=> (n2 && n3);
x8 <:=> lstrlen(ss);

u1 <:=> (y1+0.5);
u2 <:=> y2;
u3 <:=> 444.777;
u4 <:=> n1;
u5 <:=> 0n123;
u6 <:=> (y3+y4):int;
u7 <:=> (n2 && n3);
u8 <:=> lstrlen(ss);

copx
ycopx 
=:
2 Copy x to y.
Returns new value of y
copx(x,*y)  
ycopx(x,*y)  
x =: y  

x - variable or constant
y - variable

copx.int
ycopx.int 
[=:]
2 Copy int(x) to y.
Returns new value of y

Accept double or integer values

copx.int(x,*y)  
ycopx.int(x,*y)  
x [=:] y  

x - variable or constant
y - variable

var z1 = 2.5, z2 = 5.8;
int n1 = 4, n2 = 8;
var x1 = 333, x2 = 333, x3 = 333, x4 = 333;
int u1 = 333, u2 = 333, u3 = 333, u4 = 333;

z1 [=:] x1;
111.222 [=:] x2;
n1 [=:] x3;
0n777 [=:] x4;

z2 [=:] u1;
555.666 [=:] u2;
n2 [=:] u3;
0n999 [=:] u4;

copx.frac
ycopx.frac 
{=:}
2 Copy frac(x) to y.
Returns new value of y

Accept double or integer values

copx.frac(x,*y)  
ycopx.frac(x,*y)  
x {=:} y  

x - variable or constant
y - variable

var z1 = 2.5, z2 = 5.8;
int n1 = 4, n2 = 8;
var x1 = 333, x2 = 333, x3 = 333, x4 = 333;
int u1 = 333, u2 = 333, u3 = 333, u4 = 333;

z1 {=:} x1;
111.222 {=:} x2;
n1 {=:} x3;
0n777 {=:} x4;

z2 {=:} u1;
555.666 {=:} u2;
n2 {=:} u3;
0n999 {=:} u4;

copx.round
ycopx.round 
<=:>
2 Copy round(x) to y.
Returns new value of y

Accept double or integer values

copx.round(x,*y)  
ycopx.round(x,*y)  
x <=:> y  

x - variable or constant
y - variable

var z1 = 2.5, z2 = 5.8;
int n1 = 4, n2 = 8;
var x1 = 333, x2 = 333, x3 = 333, x4 = 333;
int u1 = 333, u2 = 333, u3 = 333, u4 = 333;

z1 <=:> x1;
111.222 <=:> x2;
n1 <=:> x3;
0n777 <=:> x4;

z2 <=:> u1;
555.666 <=:> u2;
n2 <=:> u3;
0n999 <=:> u4;

pcopy
pxcopy 
*:= 
2 Indirect copy function.
Copy the value of y to px.
Returns the value of y
pcopy(*px,y)  
pxcopy(*px,y)  
px *:= y  

px - integer variable
px = destination address

y - value

int DST;
int nn;
var vv;

DST = &nn;
pcopy (DST, (x+y):int);

DST = &vv;
pcopy (DST, x+y);

int DST;
int nn;
var vv;

DST = &nn;
DST *:= (x+y):int;

DST = &vv;
DST *:= x+y;

pcopx
pycopx 
=:* 
2 Indirect copy function.
Copy x to py.
Returns the value of x
pcopx(x,*py)  
pycopx(x,*py)  
x =:* py  

x - variable or constant

py - integer variable
py = destination address

int DST;
int ii;
int nn;
var vv;

DST = &nn;
ii = x;
pcopx (ii, DST);

DST = &vv;
pcopx (x, DST);

int DST;
int ii;
int nn;
var vv;

DST = &nn;
ii = x;
ii =:* DST;

DST = &vv;
x =:* DST;

x2copy
4 Copy the value of the yi to the variable xi
Returns new value of x1

All variables and values must be of the same type.

x2copy(*x1,*x2, y1,y2)

var x1;
var x2;
var y1 = 11.1;
var y2 = 22.2;

x2copy(x1,x2,y1,y2);

int x1;
int x2;
int y1 = 111;
int y2 = 222;

x2copy(x1,x2,y1,y2);

str x1;
str x2;
str y1 = "aaa";
str y2 = "bbb";

x2copy(x1,x2,y1,y2);

x3copy
6 Copy the value of the yi to the variable xi
Returns new value of x1

All variables and values must be of the same type.

x3copy(*x1,*x2,*x3, y1,y2,y3)

var x1;
var x2;
var x3;
var y1 = 11.1;
var y2 = 22.2;
var y3 = 33.3;

x3copy(x1,x2,x3,y1,y2,y3);

int x1;
int x2;
int x3;
int y1 = 111;
int y2 = 222;
int y3 = 333;

x3copy(x1,x2,x3,y1,y2,y3);

str x1;
str x2;
str x3;
str y1 = "aaa";
str y2 = "bbb";
str y3 = "ccc";

x3copy(x1,x2,x3,y1,y2,y3);

x4copy
8 Copy the value of the yi to the variable xi
Returns new value of x1

All variables and values must be of the same type.

x4copy(*x1,*x2,*x3,*x4, y1,y2,y3,y4)

var x1;
var x2;
var x3;
var x4;
var y1 = 11.1;
var y2 = 22.2;
var y3 = 33.3;
var y4 = 44.4;

x4copy(x1,x2,x3,x4,y1,y2,y3,y4);

int x1;
int x2;
int x3;
int x4;
int y1 = 111;
int y2 = 222;
int y3 = 333;
int y4 = 444;

x4copy(x1,x2,x3,x4,y1,y2,y3,y4);

str x1;
str x2;
str x3;
str x4;
str y1 = "aaa";
str y2 = "bbb";
str y3 = "ccc";
str y4 = "ddd";

x4copy(x1,x2,x3,x4,y1,y2,y3,y4);

vcopy
vxcopy 
-2 Copy the value of the variable y to the variables xi

All variables must be of the same type.

Argument filters varg(…) not allowed.

vcopy(*x1,*x2,…,*xn, *y)

vcopy(x1,y) ≡ copy(x1,y)

var x1;
var x2;
var y0 = 888.888;

vcopy(x1,x2,y0);

int x1;
int x2;
int y0 = 888;

vcopy(x1,x2,y0);

str x1;
str x2;
str y0 = "abc";

vcopy(x1,x2,y0);

vcopx
vycopx 
-2 Copy the value of the variable x to the variables yi

All variables must be of the same type.

Argument filters varg(…) not allowed.

vcopx(*x, *y1,*y2,…,*yn)

vcopx(x,y1) ≡ copx(x,y1)

var y1;
var y2;
var x0 = 888.888;

vcopx(x0,y1,y2);

int y1;
int y2;
int x0 = 888;

vcopx(x0,y1,y2);

str y1;
str y2;
str x0 = "abc";

vcopx(x0,y1,y2);

 
Swap functions
swap
:=:
2 Swap the values of the variables x and y.
Returns new value of x
swap(*x,*y)  
x :=: y  

x - variable
y - variable

var vv_1 = 111.111;
var vv_2 = 222.222;

int ii_1 = 111;
int ii_2 = 222;

str ss_1 = "111";
str ss_2 = "222";

vv_1 :=: vv_2;
vv_1 :=: ii_1;

ii_1 :=: ii_2;
ii_1 :=: vv_1;
ii_1 :=: ss_1;

ss_1 :=: ss_2;
ss_2 :=: ii_1;

swap.int
[:=:]
2 Swap the int values of the variables x and y.
Returns new value of x

Accept double or integer values

swap.int(*x,*y)  
x [:=:] y  

x - variable
y - variable

x' = int(x)
y' = int(y)
x  = y'
y  = x'

var a0 = 9.5;  var b0 = 8.4;
var aa = 1.4;  int ii = 555;
int jj = 666;  var bb = 3.7;
int i0 = 777;  int j0 = 888;

a0 [:=:] b0;
aa [:=:] ii;
jj [:=:] bb;
i0 [:=:] j0;

swap.frac
{:=:}
2 Swap the frac values of the variables x and y.
Returns new value of x

Accept double or integer values

swap.frac(*x,*y)  
x {:=:} y  

x - variable
y - variable

x' = frac(x)
y' = frac(y)
x  = y'
y  = x'

var a0 = 9.5;  var b0 = 8.4;
var aa = 1.4;  int ii = 555;
int jj = 666;  var bb = 3.7;
int i0 = 777;  int j0 = 888;

a0 {:=:} b0;
aa {:=:} ii;
jj {:=:} bb;
i0 {:=:} j0;

swap.round
<:=:>
2 Swap the round values of the variables x and y.
Returns new value of x

Accept double or integer values

swap.round(*x,*y)  
x <:=:> y  

x - variable
y - variable

x' = round(x)
y' = round(y)
x  = y'
y  = x'

var a0 = 9.5;  var b0 = 8.4;
var aa = 1.4;  int ii = 555;
int jj = 666;  var bb = 3.7;
int i0 = 777;  int j0 = 888;

a0 <:=:> b0;
aa <:=:> ii;
jj <:=:> bb;
i0 <:=:> j0;

swapr
-2 Swap the values of the variables.
Shift right.
Returns new value of x1

All variables must be of the same type.

Argument filters varg(…) not allowed.

swapr(*x1,*x2,…,*xn)

x1   → x2
x2   → x3
...
xn-1 → xn
xn   → x1

swapr(x1,x2) ≡ swap(x1,x2)

var p1 = 111.111;
var p2 = 222.222;
var p3 = 333.333;

swapr (p1, p2, p3);

int p1 = 111;
int p2 = 222;
int p3 = 333;

swapr (p1, p2, p3);

str p1 = "111";
str p2 = "222";
str p3 = "333";

swapr (p1, p2, p3);

swapl
-2 Swap the values of the variables.
Shift left.
Returns new value of x1

All variables must be of the same type.

Argument filters varg(…) not allowed.

swapl(*x1,*x2,…,*xn)

x1   ← x2
x2   ← x3
...
xn-1 ← xn
xn   ← x1

swapl(x1,x2) ≡ swap(x1,x2)

var p1 = 111.111;
var p2 = 222.222;
var p3 = 333.333;

swapl (p1, p2, p3);

int p1 = 111;
int p2 = 222;
int p3 = 333;

swapl (p1, p2, p3);

str p1 = "111";
str p2 = "222";
str p3 = "333";

swapl (p1, p2, p3);

 
Argument count functions
vcount any accept all xi
vcount(x1,x2,…,xn)

vcount() = 0
vcount(11,22) = 2
vcount(11,22,33) = 3

vcount.z any accept xi = 0
vcount.z(x1,x2,…,xn)

vcount.z(1,1,1,1,0,0,0,-1,-1)
= 3

vcount.nz any accept xi ≠ 0
vcount.nz(x1,x2,…,xn)

vcount.nz(1,1,1,1,0,0,0,-1,-1)
= 6

vcount.az any accept xi > 0
vcount.az(x1,x2,…,xn)

vcount.az(1,1,1,1,0,0,0,-1,-1)
= 4

vcount.aez any accept xi ≥ 0
vcount.aez(x1,x2,…,xn)

vcount.aez(1,1,1,1,0,0,0,-1,-1)
= 7

vcount.bz any accept xi < 0
vcount.bz(x1,x2,…,xn)

vcount.bz(1,1,1,1,0,0,0,-1,-1)
= 2

vcount.bez any accept xi ≤ 0
vcount.bez(x1,x2,…,xn)

vcount.bez(1,1,1,1,0,0,0,-1,-1)
= 5

vcount.e -2 accept xi = a
vcount.e(x1,x2,…,xn,a)

vcount.e(3,3,3,3,1,1,1,2,2, 2)
= 2

vcount.ne -2 accept xi ≠ a
vcount.ne(x1,x2,…,xn,a)

vcount.ne(3,3,3,3,1,1,1,2,2, 2)
= 7

vcount.a -2 accept xi > a
vcount.a(x1,x2,…,xn,a)

vcount.a(3,3,3,3,1,1,1,2,2, 2)
= 4

vcount.ae -2 accept xi ≥ a
vcount.ae(x1,x2,…,xn,a)

vcount.ae(3,3,3,3,1,1,1,2,2, 2)
= 6

vcount.b -2 accept xi < a
vcount.b(x1,x2,…,xn,a)

vcount.b(3,3,3,3,1,1,1,2,2, 2)
= 3

vcount.be -2 accept xi ≤ a
vcount.be(x1,x2,…,xn,a)

vcount.be(3,3,3,3,1,1,1,2,2, 2)
= 5

 
Argument filter functions
varg.z -1 accept xi = 0
func(varg.z(x1,x2,…,xn))

vsum(varg.z(1,1,1,1,0,0,0,-1,-1)) ≡
vsum(0,0,0) = 0

varg.nz -1 accept xi ≠ 0
func(varg.nz(x1,x2,…,xn))

vsum(varg.nz(1,1,1,1,0,0,0,-1,-1)) ≡
vsum(1,1,1,1,-1,-1) = 2

varg.az -1 accept xi > 0
func(varg.az(x1,x2,…,xn))

vsum(varg.az(1,1,1,1,0,0,0,-1,-1)) ≡
vsum(1,1,1,1) = 4

varg.aez -1 accept xi ≥ 0
func(varg.aez(x1,x2,…,xn))

vsum(varg.aez(1,1,1,1,0,0,0,-1,-1)) ≡
vsum(1,1,1,1,0,0,0) = 4

varg.bz -1 accept xi < 0
func(varg.bz(x1,x2,…,xn))

vsum(varg.bz(1,1,1,1,0,0,0,-1,-1)) ≡
vsum(-1,-1) = -2

varg.bez -1 accept xi ≤ 0
func(varg.bez(x1,x2,…,xn))

vsum(varg.bez(1,1,1,1,0,0,0,-1,-1)) ≡
vsum(0,0,0,-1,-1) = -2

varg.e -2 accept xi = a
func(varg.e(x1,x2,…,xn,a))

vsum(varg.e(3,3,3,3,1,1,1,2,2, 2)) ≡
vsum(2,2) = 4

varg.ne -2 accept xi ≠ a
func(varg.ne(x1,x2,…,xn,a))

vsum(varg.ne(3,3,3,3,1,1,1,2,2, 2)) ≡
vsum(3,3,3,3,1,1,1) = 15

varg.a -2 accept xi > a
func(varg.a(x1,x2,…,xn,a))

vsum(varg.a(3,3,3,3,1,1,1,2,2, 2)) ≡
vsum(3,3,3,3) = 12

varg.ae -2 accept xi ≥ a
func(varg.ae(x1,x2,…,xn,a))

vsum(varg.ae(3,3,3,3,1,1,1,2,2, 2)) ≡
vsum(3,3,3,3,2,2) = 16

varg.b -2 accept xi < a
func(varg.b(x1,x2,…,xn,a))

vsum(varg.b(3,3,3,3,1,1,1,2,2, 2)) ≡
vsum(1,1,1) = 3

varg.be -2 accept xi ≤ a
func(varg.be(x1,x2,…,xn,a))

vsum(varg.be(3,3,3,3,1,1,1,2,2, 2)) ≡
vsum(1,1,1,2,2) = 7

 
Compound assignment functions
inc.pre ++x
1 Prefix increment of the variable by 1 ++x  
inc.pre(x)  

x - variable    

var uu = 10;
var ee;

ee = ++uu;
// uu = 11
// ee = 11

inc.post x++
1 Postfix increment of the variable by 1 x++  
inc.post(x)  

x - variable    

var uu = 10;
var ee;

ee = uu++;
// uu = 11
// ee = 10

dec.pre --x
1 Prefix decrement of the variable by 1 --x  
dec.pre(x)  

x - variable    

var uu = 10;
var ee;

ee = --uu;
// uu = 9
// ee = 9

dec.post x--
1 Postfix decrement of the variable by 1 x--  
dec.post(x)  

x - variable    

var uu = 10;
var ee;

ee = uu--;
// uu = 9
// ee = 10

co.chs
-= 1 chs + copy function co.chs(*x)  
x-=  
x = chs(x)  

x - variable    

co.abs
1 abs + copy function co.abs(*x)  
x = abs(x)  

x - variable    

co.nabs
1 nabs + copy function co.nabs(*x)  
x = nabs(x)  

x - variable    

co.add
+=
2 add + copy function co.add(*x,y)  
x += y  
x = (x + y)  
co.sub
-= 2 sub + copy function co.sub(*x,y)  
x -= y  
x = (x - y)  
co.subr
~-= 2 subr + copy function co.subr(*x,y)  
x ~-= y  
x = (y - x)  
co.mul
*=
2 mul + copy function co.mul(*x,y)  
x *= y  
x = (x * y)  
co.div
/= 2 div + copy function co.div(*x,y)  
x /= y  
x = (x / y)  
co.divr
~/= 2 divr + copy function co.divr(*x,y)  
x ~/= y  
x = (y / x)  
co.quo
\=
2 quo + copy function co.quo(*x,y)  
x \= y  
x = (x \ y)  
co.quor
~\=
2 quor + copy function co.quor(*x,y)  
x ~\= y  
x = (y \ x)  
co.mod
%=
2 mod + copy function co.mod(*x,y)  
x %= y  
x = (x % y)  
co.modr
~%=
2 modr + copy function co.modr(*x,y)  
x ~%= y  
x = (y % x)  
co.bnot
~= 1:i bnot + copy function co.bnot(*x)  
~= x    
x = (~x)  
x = (bnot x)  

x - variable    

co.bor
|= 2:i bor + copy function co.bor(*x,y)  
x |= y    
x = (x | y)  
x = (x bor y)  
co.bnor
~|= 2:i bnor + copy function co.bnor(*x,y)  
x ~|= y    
x = (x ~| y)  
x = (x bnor y)  
co.born
|~= 2:i born + copy function co.born(*x,y)  
x |~= y    
x = (x |~ y)  
x = (x born y)  
co.bnorn
~|~= 2:i bnorn + copy function co.bnorn(*x,y)  
x ~|~= y    
x = (x ~|~ y)  
x = (x bnorn y)  
co.borc
|-= 2:i borc + copy function co.borc(*x,y)  
x |-= y    
x = (x |- y)  
x = (x borc y)  
co.bnorc
~|-= 2:i bnorc + copy function co.bnorc(*x,y)  
x ~|-= y    
x = (x ~|- y)  
x = (x bnorc y)  
co.bcor
-|= 2:i bcor + copy function co.bcor(*x,y)  
x -|= y    
x = (x -| y)  
x = (x bcor y)  
co.bcorn
-|~= 2:i bcorn + copy function co.bcorn(*x,y)  
x -|~= y    
x = (x -|~ y)  
x = (x bcorn y)  
co.bxor
^=
2:i bxor + copy function co.bxor(*x,y)  
x ^= y    
x = (x ^ y)  
x = (x bxor y)  
co.bxnor
~^=
2:i bxnor + copy function co.bxnor(*x,y)  
x ~^= y    
x = (x ~^ y)  
x = (x bxnor y)  
co.band
&= 2:i band + copy function co.band(*x,y)  
x &= y    
x = (x & y)  
x = (x band y)  
co.bnand
~&= 2:i bnand + copy function co.bnand(*x,y)  
x ~&= y    
x = (x ~& y)  
x = (x bnand y)  
co.bandn
&~= 2:i bandn + copy function

#BMI1•ANDN

co.bandn(*x,y)  
x &~= y    
x = (x &~ y)  
x = (x bandn y)  
co.bnandn
~&~= 2:i bnandn + copy function

#BMI1•ANDN

co.bnandn(*x,y)  
x ~&~= y    
x = (x ~&~ y)  
x = (x bnandn y)  
co.breset
|0|= 2:i breset + copy function
co.breset(*x,y)  
x |0|= y    
x = (x |0| y)  
x = (x breset y)  
co.bset
|1|= 2:i bset + copy function
co.bset(*x,y)  
x |1|= y    
x = (x |1| y)  
x = (x bset y)  
co.shr
>>= 2:i shr + copy function co.shr(*x,y)  
x >>= y    
x = (x >> y)  
x = (x shr y)  
co.shl
<<= 2:i shl + copy function co.shl(*x,y)  
x <<= y    
x = (x << y)  
x = (x shl y)  
co.sar
>>>= 2:i sar + copy function co.sar(*x,y)  
x >>>= y    
x = (x >>> y)  
x = (x sar y)  
co.sal
<<<= 2:i sal + copy function co.sal(*x,y)  
x <<<= y    
x = (x <<< y)  
x = (x sal y)  
co.ror
>><= 2:i ror + copy function co.ror(*x,y)  
x >><= y    
x = (x >>< y)  
x = (x ror y)  
co.rol
<<>= 2:i rol + copy function co.rol(*x,y)  
x <<>= y    
x = (x <<> y)  
x = (x rol y)  
 
Bitwise functions
bsf
<<?x
1:i Bit scan forward.
Search for the least significant set bit.
bsf(x)  
bsf x  
<<?x  

int ii1;
int ii2;
int ii3;

ii1 = bsf(0b10001000); // = 3
ii2 = <<?(0b10001000); // = 3
ii3 = <<?(0b00000000); // = -1

bsr
>>?x
1:i Bit scan reverse.
Search for the most significant set bit.
bsr(x)  
bsr x  
>>?x  

int ii1;
int ii2;
int ii3;

ii1 = bsr(0b10001000); // = 7
ii2 = >>?(0b10001000); // = 7
ii3 = >>?(0b00000000); // = -1

bt
>?<
2:i Bit test.
Return the destination bit indexed by the y value.
bt(x,y)  
x bt y  
x >?< y  

int pp = 0b11110000; // 240
int uu, nn;

uu = bt(pp,4);
// uu = 1

nn = bt(pp,3);
// nn = 0

btc
>?~<
2:i Bit test and complement.
Return the destination bit indexed by the y value and complement (invert) the destination bit.
btc(x,y)  
x btc y  
x >?~< y  

int pp = 0b11110000; // 240
int uu, nn, oo;

uu = btc(pp,4);
// uu = 1
// pp = 0b11100000 = 224

oo = pp;
nn = btc(oo,3);
// nn = 0
// oo = 0b11101000 = 232

btr
>?-<
2:i Bit test and reset.
Return the destination bit indexed by the y value and clear the destination bit.
btr(x,y)  
x btr y  
x >?-< y  

int pp = 0b11110000; // 240
int uu, nn, oo;

uu = btr(pp,4);
// uu = 1
// pp = 0b11100000 = 224

oo = pp;
nn = btr(oo,5);
// nn = 1
// oo = 0b11000000 = 192

bts
>?+<
2:i Bit test and set.
Return the destination bit indexed by the y value and set in the destination bit.
bts(x,y)  
x bts y  
x >?+< y  

int pp = 0b11110000; // 240
int uu, nn, oo;

uu = bts(pp,3);
// uu = 0
// pp = 0b11111000 = 248

oo = pp;
nn = bts(oo,2);
// nn = 0
// oo = 0b11111100 = 252

hammw
popcount

1:i Hamming weight.
Returns the number of 1 bits in the value of x.

#CPU•POPCNT

hammw(x)  
popcount(x)  

int pp = 0b101110001;
int oo = 0b100010100;
int ppw, oow;

ppw = hammw (pp); // =5
oow = hammw (oo); // =3

hammd

2:i Hamming distance

#CPU•POPCNT

hammd(x,y)  

int pp = 0b101110001;
int oo = 0b100010100;
int hd;

hd = hammd (pp,oo); // =4

bnot
~x 1:i Bitwise not
bnot(x)  
bnot x  
~x  

int xx=999;
int ii1;
int ii2;

ii1 = ~999;     // = -1000
ii2 = bnot(xx); // = -1000

0000reset
0001and
0010andn
0011orc
0100norn
0101cor
0110xor
0111or
1000nor
1001xnor
1010corn
1011orn
1100norc
1101nandn
1110nand
1111set
bor
| 2:i Bitwise or

xyx | y
000
011
101
111

bor(x,y)  
x bor y  
x | y  

int xx=999;
int yy=333;
int ii1;
int ii2;

ii1 = 999 | 333;  // = 1007
ii2 = bor(xx,yy); // = 1007

bnor
~| 2:i Bitwise not or

xyx ~| y
001
010
100
110

bnor(x,y)  
x bnor y  
x ~| y  
~(x | y)  

int xx=999;
int yy=333;
int ii1;
int ii2;

ii1 = 999 ~| 333;  // = -1008
ii2 = bnor(xx,yy); // = -1008

born
|~ 2:i Bitwise or not

xyx |~ y
001
010
101
111

born(x,y)  
x born y  
x |~ y  
x | (~y)  

int xx=999;
int yy=333;
int ii1;
int ii2;

ii1 = 999 |~ 333;  // = -9
ii2 = born(xx,yy); // = -9

bnorn
~|~ 2:i Bitwise not or not

xyx ~|~ y
000
011
100
110

bnorn(x,y)  
x bnorn y  
x ~|~ y  
~(x |~ y)  

int xx=999;
int yy=333;
int ii1;
int ii2;

ii1 = 999 ~|~ 333;  // = 8
ii2 = bnorn(xx,yy); // = 8

borc
|- 2:i Bitwise or clear

xyx |- y
000
010
101
111

borc(x,y)  
x borc y  
x |- y  
x | (y & 0) ≡ x  

int xx=999;
int yy=333;
int ii1;
int ii2;

ii1 = 999 |- 333;  // = 999
ii2 = borc(xx,yy); // = 999

bnorc
~|- 2:i Bitwise not or clear

xyx ~|- y
001
011
100
110

bnorc(x,y)  
x bnorc y  
x ~|- y  
~x | (y & 0) ≡ ~x  

int xx=999;
int yy=333;
int ii1;
int ii2;

ii1 = 999 ~|- 333;  // = -1000
ii2 = bnorc(xx,yy); // = -1000

bcor
-| 2:i Bitwise clear or

xyx -| y
000
011
100
111

bcor(x,y)  
x bcor y  
x -| y  
(x & 0) | y ≡ y  

int xx=999;
int yy=333;
int ii1;
int ii2;

ii1 = 999 -| 333;  // = 333
ii2 = bcor(xx,yy); // = 333

bcorn
-|~ 2:i Bitwise clear or not

xyx -|~ y
001
010
101
110

bcorn(x,y)  
x bcorn y  
x -|~ y  
(x & 0) | ~y ≡ ~y  

int xx=999;
int yy=333;
int ii1;
int ii2;

ii1 = 999 -|~ 333;  // = -334
ii2 = bcorn(xx,yy); // = -334

bxor
^
2:i Bitwise xor

xyx ^ y
000
011
101
110

bxor(x,y)  
x bxor y  
x ^ y  

int xx=999;
int yy=333;
int ii1;
int ii2;

ii1 = 999 ^ 333;   // = 682
ii2 = bxor(xx,yy); // = 682

bxnor
~^
2:i Bitwise not xor

xyx ~^ y
001
010
100
111

bxnor(x,y)  
x bxnor y  
x ~^ y  
~(x ^ y)  

int xx=999;
int yy=333;
int ii1;
int ii2;

ii1 = 999 ~^ 333;   // = -683
ii2 = bxnor(xx,yy); // = -683

band
& 2:i Bitwise and

xyx & y
000
010
100
111

band(x,y)  
x band y  
x & y  

int xx=999;
int yy=333;
int ii1;
int ii2;

ii1 = 999 & 333;   // = 325
ii2 = band(xx,yy); // = 325

bnand
~& 2:i Bitwise not and

xyx ~& y
001
011
101
110

bnand(x,y)  
x bnand y  
x ~& y  
~(x & y)  

int xx=999;
int yy=333;
int ii1;
int ii2;

ii1 = 999 ~& 333;   // = -326
ii2 = bnand(xx,yy); // = -326

bandn
&~ 2:i Bitwise and not

xyx &~ y
000
010
101
110

#BMI1•ANDN

bandn(x,y)  
x bandn y  
x &~ y  
x & (~y)  

int xx=999;
int yy=333;
int ii1;
int ii2;

ii1 = 999 &~ 333;   // = 674
ii2 = bandn(xx,yy); // = 674

bnandn
~&~ 2:i Bitwise not and not

xyx ~&~ y
001
011
100
111

#BMI1•ANDN

bnandn(x,y)  
x bnandn y  
x ~&~ y  
~(x &~ y)  

int xx=999;
int yy=333;
int ii1;
int ii2;

ii1 = 999 ~&~ 333;   // = -675
ii2 = bnandn(xx,yy); // = -675

breset
|0| 2:i Bitwise reset

xyx |0| y
000
010
100
110

breset(x,y)  
x breset y  
x |0| y  
bset
|1| 2:i Bitwise set

xyx |1| y
001
011
101
111

bset(x,y)  
x bset y  
x |1| y  
shr
>>  2:i Bitwise shift right.

Shifts "x" right by "count" bits with zeroes shifted in on the left.

shr(x,count)  
x shr count  
x >> count  

shr(x,-|count|) ≡ shl(x,|count|)

int ii1;
int ii2;
int ii3;

ii1 = 32 >>  2; // = 8
ii2 = 32 >> -1; // = 64
ii3 = 32 <<  1; // = 64

shl
<<  2:i Bitwise shift left.

Shifts "x" left by "count" bits with zeroes shifted in on right.

shl(x,count)  
x shl count  
x << count  

shl(x,-|count|) ≡ shr(x,|count|)

int ii1;
int ii2;
int ii3;

ii1 = 8 <<  2; // = 32
ii2 = 8 << -1; // = 4
ii3 = 8 >>  1; // = 4

sar
>>> 2:i Bitwise shift arithmetic right.

Shifts "x" right by "count" bits with the current sign bit replicated in the leftmost bit.

sar(x,count)  
x sar count  
x >>> count  

sar(x,-|count|) ≡ sal(x,|count|)

int ii1;
int ii2;
int ii3;

ii1 = -999 >>>  1; // = -500
ii2 = -999 >>> -1; // = -1998
ii3 = -999 <<<  1; // = -1998

sal
<<< 2:i Bitwise shift arithmetic left.

Shifts "x" left by "count" bits with zeroes shifted in on right.

sal(x,count)  
x sal count  
x <<< count  

sal(x,-|count|) ≡ sar(x,|count|)

int ii1;
int ii2;
int ii3;

ii1 = -999 <<<  1; // = -1998
ii2 = -999 <<< -1; // = -500
ii3 = -999 >>>  1; // = -500

ror
>>< 2:i Bitwise rotate right.

Rotates the bits in "x" to the right "count" times with all data pushed out the right side re-entering on the left.

ror(x,count)  
x ror count  
x >>< count 

ror(x,-|count|) ≡ rol(x,|count|)

int ii1;
int ii2;
int ii3;
int ii4;
int ii5;
int ii6;

ii1 = 8 ror  1; // = 4
ii2 = 8 ror -1; // = 16
ii3 = 8 rol  1; // = 16

ii4 = 8 >><  1; // = 4
ii5 = 8 >>< -1; // = 16
ii6 = 8 <<>  1; // = 16

rol
<<> 2:i Bitwise rotate left.

Rotates the bits in "x" to the left "count" times with all data pushed out the left side re-entering on the right.

rol(x,count)  
x rol count  
x <<> count  

rol(x,-|count|) ≡ ror(x,|count|)

int ii1;
int ii2;
int ii3;
int ii4;
int ii5;
int ii6;

ii1 = 8 rol  1; // = 16
ii2 = 8 rol -1; // = 4
ii3 = 8 ror  1; // = 4

ii4 = 8 <<>  1; // = 16
ii5 = 8 <<> -1; // = 4
ii6 = 8 >><  1; // = 4

 
Byte functions
bswap
1:i Byte swap.
Reverse the byte order.
bswap(x)  

// x64

int pp, uu;

pp = 0x0122334455667708;

uu = bswap(pp);
// uu = 0x0877665544332201
// 610068790934446593

0;

// x32

int pp, uu;

pp = 0x01223304;

uu = bswap(pp);
// uu = 0x04332201
// 70459905

b4swap
1:i Byte swap.
Reverse the byte order of the first 4 bytes.
Returns 32-bit integer value.
b4swap(x)  

int pp, uu;

pp = 0x01AABB04;

uu = b4swap(pp);
// uu = 0x04BBAA01
// 79407617

b2swap
1:i Byte swap.
Reverse the byte order of the first 2 bytes.
Returns 16-bit integer value.
b2swap(x)  

int pp, uu;

pp = 0x0104;

uu = b2swap(pp);
// uu = 0x0401
// 1025

int pp, uu;

pp = 0xAABB0104;

uu = b2swap(pp);
// uu = 0x0401
// 1025

bitswap
1:i Bit swap.
Reverse the bit order.
bitswap(x)  

// x64

int pp, uu;

pp = 0x8000000000000000;
// pp = 263

uu = bitswap(pp);
// uu = 1

0;

// x32

int pp, uu;

pp = 0x80000000;
// pp = 231

uu = bitswap(pp);
// uu = 1

bit32swap
1:i Bit swap.
Reverse the bit order in the first 4 bytes.
Returns 32-bit integer value.
bit32swap(x)  

int pp, uu;

pp = 0b11111111000000001111111110110110;
// 4 278 255 542

uu = bit32swap(pp);
// uu = 0b01101101111111110000000011111111
// 1 845 428 479

bit16swap
1:i Bit swap.
Reverse the bit order in the first 2 bytes.
Returns 16-bit integer value.
bit16swap(x)  

int pp, uu;

pp = 0b1111000010110110;
// 61 622

uu = bit16swap(pp);
// uu = 0b0110110100001111
// 27 919

bit8swap
1:i Bit swap.
Reverse the bit order in the first byte.
Returns 8-bit integer value.
bit8swap(x)  

int pp, uu;

pp = 0b10110110;
// 182

uu = bit8swap(pp);
// uu = 0b01101101
// 109

 
Boolean functions
ot
bool 
?x
1:i Value as boolean ot(x)  
ot x  
bool(x)  
bool x  
?x  
♦ 1 ⇐ x ≠ 0
♦ 0 ⇐ x = 0
not
!x
1:i Negation not(x)  
not x  
!x  
♦ 1 ⇐ x = 0
♦ 0 ⇐ x ≠ 0
or
||
2:i Disjunction or(x,y)  
x or y  
x || y  
♦ 1 ⇐ x≠0 or y≠0
♦ 0 ⇐ otherwise
nor
!|
2:i Negative disjunction nor(x,y)  
x nor y  
x !| y  
♦ 1 ⇐ x=0 and y=0
♦ 0 ⇐ otherwise
xor
^^
2:i Exclusive disjunction xor(x,y)  
x xor y  
x ^^ y  
♦ 1 ⇐ (x≠0 and y=0) or (x=0 and y≠0)
♦ 0 ⇐ otherwise
xnor
!^
2:i Negative exclusive disjunction xnor(x,y)  
x xnor y  
x !^ y  
♦ 1 ⇐ (x=0 or y≠0) and (x≠0 or y=0)
♦ 0 ⇐ otherwise
and
&&
2:i Conjunction and(x,y)  
x and y  
x && y  
♦ 1 ⇐ x≠0 and y≠0
♦ 0 ⇐ otherwise
nand
!&
2:i Negative conjunction nand(x,y)  
x nand y  
x !& y  
♦ 1 ⇐ x=0 or y=0
♦ 0 ⇐ otherwise
if
if.true 
1:i True
if(x)  
if.true(x)  
♦ 1 ⇐ x ≠ 0
♦ 0 ⇐ x = 0
if.not
if.false 
1:i False
if.not(x)  
if.false(x)  
♦ 1 ⇐ x = 0
♦ 0 ⇐ x ≠ 0
if.z ==.
1:i Zero
if.z(x)  
x==.  
♦ 1 ⇐ x = 0
♦ 0 ⇐ x ≠ 0
if.nz
!=.
<>.
1:i Not zero
if.nz(x)  
x!=.  
x<>.  
♦ 1 ⇐ x ≠ 0
♦ 0 ⇐ x = 0
if.az
>.
1:i Above zero
if.az(x)  
x>.  
♦ 1 ⇐ x > 0
♦ 0 ⇐ x ≤ 0
if.aez
>=.
!<.
1:i Above or equal zero
if.aez(x)  
x>=.  
x!<.  
♦ 1 ⇐ x ≥ 0
♦ 0 ⇐ x < 0
if.bz
<.
1:i Below zero
if.bz(x)  
x<.  
♦ 1 ⇐ x < 0
♦ 0 ⇐ x ≥ 0
if.bez
<=.
!>.
1:i Below or equal zero
if.bez(x)  
x<=.  
x!>.  
♦ 1 ⇐ x ≤ 0
♦ 0 ⇐ x > 0
if.e ==
=
2:i Equal

(•)
The symbol = is equivalent to == when calling *.if.true, *.ie.true, *.if.false or *.ie.false functions

if.e(x,y)  
x == y  
♦ 1 ⇐ x = y
♦ 0 ⇐ x ≠ y

x = 0;

// goto ooo if x = 0
goto.if ooo, x == 0;

x = 2;

ooo:
++x;

x = 0;

// goto ooo if x = 0
goto.if ooo, x = 0;

x = 2;

ooo:
++x;

if.ne
<>
!=
2:i Not equal
Below or above
Less or greater
if.ne(x,y)  
x <> y  
x != y  
♦ 1 ⇐ x ≠ y
♦ 0 ⇐ x = y
if.a
>
2:i Above
Greater
Not below and equal
Not less and equal
if.a(x,y)  
x > y  
♦ 1 ⇐ x > y
♦ 0 ⇐ x ≤ y
if.ae
>=
!<
2:i Above or equal
Greater or equal
Not below
Not less
if.ae(x,y)  
x >= y  
x !< y  
♦ 1 ⇐ x ≥ y
♦ 0 ⇐ x < y
if.b
<
2:i Below
Less
Not above and equal
Not greater and equal
if.b(x,y)  
x < y  
♦ 1 ⇐ x < y
♦ 0 ⇐ x ≥ y
if.be
<=
!>
2:i Below or equal
Less or equal
Not above
Not greater
if.be(x,y)  
x <= y  
x !> y  
♦ 1 ⇐ x ≤ y
♦ 0 ⇐ x > y
if.bea
<==>
2:i Three-way comparison
Below-Equal-Above
if.bea(x,y)  
x <==> y  
♦ -1 ⇐ x < y
♦  0 ⇐ x = y
♦ +1 ⇐ x > y
if.aeb
>==<
2:i Three-way comparison
Above-Equal-Below
if.aeb(x,y)  
x >==< y  
♦ -1 ⇐ x > y
♦  0 ⇐ x = y
♦ +1 ⇐ x < y
if.or
-2:i Multi or function

Argument filters varg(…) not allowed.

if.or (x,Y1,Y2,…,Yn)  
♦ 1 ⇐ (x=Y1) or (x=Y2) … or (x=Yn)
♦ 0 ⇐ othewise
if.nor
-2:i Multi nor function

Argument filters varg(…) not allowed.

if.nor (x,Y1,Y2,…,Yn)  
♦ 1 ⇐ (x≠Y1) and (x≠Y2) … and (x≠Yn)
♦ 0 ⇐ othewise
if.and
-2:i Multi and function

Argument filters varg(…) not allowed.

if.and (x,Y1,Y2,…,Yn)  
♦ 1 ⇐ (x=Y1) and (x=Y2) … and (x=Yn)
♦ 0 ⇐ othewise
if.nand
-2:i Multi nand function

Argument filters varg(…) not allowed.

if.nand (x,Y1,Y2,…,Yn)  
♦ 1 ⇐ (x≠Y1) or (x≠Y2) … or (x≠Yn)
♦ 0 ⇐ othewise
 
Approximate boolean functions
ε  = 2-46 = 1.4210854715202004e-14   
ε' = 2-46+δ   
δ  = max(0,min(x.exponent,y.exponent))   
aif.z ==.~
1:i Approximately zero
aif.z(x)  
x==.~  
♦ 1 ⇐ |x| < ε
♦ 0 ⇐ |x| ≥ ε

aif.z (sin(x) - fsin(x));

var zz=$:0000000000000001;
int uu;

uu = (zz ==.~) // ~0==0 =1

aif.nz
!=.~
<>.~
1:i Approximately not zero
aif.nz(x)  
x!=.~  
x<>.~  
♦ 1 ⇐ |x| ≥ ε
♦ 0 ⇐ |x| < ε

aif.nz (sin(x) - fsin(x));

var zz=$:0000000000000001;
int uu;

uu = (zz !=.~) // ~0!=0 =0

aif.az
>.~
1:i Approximately above zero
aif.az(x)  
x>.~  
♦ 1 ⇐ x ≥ ε
♦ 0 ⇐ x < ε

var zz=$:0000000000000001;
int uu;

uu = (zz >.~) // ~0>0 =0

aif.aez
>=.~
!<.~
1:i Approximately above or equal zero
aif.aez(x)  
x>=.~  
x!<.~  
♦ 1 ⇐ x > -ε
♦ 0 ⇐ x ≤ -ε

var zz=$:0000000000000001;
int uu;

uu = (zz >=.~) // ~0>=0 =1

aif.bz
<.~
1:i Approximately below zero
aif.bz(x)  
x<.~  
♦ 1 ⇐ x ≤ -ε
♦ 0 ⇐ x > -ε

var zz=$:0000000000000001;
int uu;

uu = (zz <.~) // ~0<0 =0

aif.bez
<=.~
!>.~
1:i Approximately below or equal zero
aif.bez(x)  
x<=.~  
x!>.~  
♦ 1 ⇐ x < ε
♦ 0 ⇐ x ≥ ε

var zz=$:0000000000000001;
int uu;

uu = (zz <=.~) // ~0<=0 =1

aif.e ==~
2:i Approximately equal
aif.e(x,y)  
x ==~ y  
♦ 1 ⇐ |x-y| < ε'
♦ 0 ⇐ |x-y| ≥ ε'

aif.e (sin(x), fsin(x));

var aa=$:406BC00000000001; // 222+
var bb=$:406BBFFFFFFFFFFF; // 222-
int uu;

uu = (aa ==~ bb) // =1

aif.ne
!=~
<>~
2:i Approximately not equal
aif.ne(x,y)  
x !=~ y  
x <>~ y  
♦ 1 ⇐ |x-y| ≥ ε'
♦ 0 ⇐ |x-y| < ε'

aif.ne (sin(x), fsin(x));

var aa=$:406BC00000000001; // 222+
var bb=$:406BBFFFFFFFFFFF; // 222-
int uu;

uu = (aa !=~ bb) // =0

aif.a
>~
2:i Approximately above
aif.a(x,y)  
x >~ y  
♦ 1 ⇐ x-y ≥ ε'
♦ 0 ⇐ x-y < ε'

var aa=$:406BC00000000001; // 222+
var bb=$:406BBFFFFFFFFFFF; // 222-
int uu;

uu = (aa >~ bb) // =0

aif.ae
>=~
!<~
2:i Approximately above or equal
aif.ae(x,y)  
x >=~ y  
x !<~ y  
♦ 1 ⇐ x-y > -ε'
♦ 0 ⇐ x-y ≤ -ε'

var aa=$:406BC00000000001; // 222+
var bb=$:406BBFFFFFFFFFFF; // 222-
int uu;

uu = (aa >=~ bb) // =1

aif.b
<~
2:i Approximately below
aif.b(x,y)  
x <~ y  
♦ 1 ⇐ x-y ≤ -ε'
♦ 0 ⇐ x-y > -ε'

var aa=$:406BC00000000001; // 222+
var bb=$:406BBFFFFFFFFFFF; // 222-
int uu;

uu = (aa <~ bb) // =0

aif.be
<=~
!>~
2:i Approximately below or equal
aif.be(x,y)  
x <=~ y  
x !>~ y  
♦ 1 ⇐ x-y < ε'
♦ 0 ⇐ x-y ≥ ε'

var aa=$:406BC00000000001; // 222+
var bb=$:406BBFFFFFFFFFFF; // 222-
int uu;

uu = (aa <=~ bb) // =1

aif.bea
<==>~
2:i Three-way approximate comparison
Below-Equal-Above
aif.bea(x,y)  
x <==>~ y  
♦ -1 ⇐ (x-y) ≤ -ε'
♦  0 ⇐ |x-y| <  ε'
♦ +1 ⇐ (x-y) ≥  ε'

var aa=$:406BC00000000001; // 222+
var bb=$:406BBFFFFFFFFFFF; // 222-
int uu;

uu = (aa <==>~ bb) // =0

aif.aeb
>==<~
2:i Three-way approximate comparison
Above-Equal-Below
aif.aeb(x,y)  
x >==<~ y  
♦ -1 ⇐ (x-y) ≥  ε'
♦  0 ⇐ |x-y| <  ε'
♦ +1 ⇐ (x-y) ≤ -ε'

var aa=$:406BC00000000001; // 222+
var bb=$:406BBFFFFFFFFFFF; // 222-
int uu;

uu = (aa >==<~ bb) // =0

 
Conditional functions
ie
ie.true 
3 Conditional function ie (x,T,F)  
ie.true (x,T,F)  
♦ T ⇐ x ≠ 0
♦ F ⇐ x = 0
ie.not
ie.false 
3 Conditional function ie.not (x,T,F)  
ie.false (x,T,F)  
♦ T ⇐ x = 0
♦ F ⇐ x ≠ 0
ie.z 3 Conditional function ie.z (x,T,F)  
♦ T ⇐ x = 0
♦ F ⇐ x ≠ 0
ie.nz 3 Conditional function ie.nz (x,T,F)  
♦ T ⇐ x ≠ 0
♦ F ⇐ x = 0
ie.az 3 Conditional function ie.az (x,T,F)  
♦ T ⇐ x > 0
♦ F ⇐ x ≤ 0
ie.aez 3 Conditional function ie.aez (x,T,F)  
♦ T ⇐ x ≥ 0
♦ F ⇐ x < 0
ie.bz 3 Conditional function ie.bz (x,T,F)  
♦ T ⇐ x < 0
♦ F ⇐ x ≥ 0
ie.bez 3 Conditional function ie.bez (x,T,F)  
♦ T ⇐ x ≤ 0
♦ F ⇐ x > 0
ie.e 4 Conditional function ie.e (x,y,T,F)  
♦ T ⇐ x = y
♦ F ⇐ x ≠ y
ie.ne 4 Conditional function ie.ne (x,y,T,F)  
♦ T ⇐ x ≠ y
♦ F ⇐ x = y
ie.a 4 Conditional function ie.a (x,y,T,F)  
♦ T ⇐ x > y
♦ F ⇐ x ≤ y
ie.ae 4 Conditional function ie.ae (x,y,T,F)  
♦ T ⇐ x ≥ y
♦ F ⇐ x < y
ie.b 4 Conditional function ie.b (x,y,T,F)  
♦ T ⇐ x < y
♦ F ⇐ x ≥ y
ie.be 4 Conditional function ie.be (x,y,T,F)  
♦ T ⇐ x ≤ y
♦ F ⇐ x > y
ie.bea 5 Conditional function
Below-Equal-Above
ie.bea (x,y,V1,V2,V3)  
♦ V1 ⇐ x < y
♦ V2 ⇐ x = y
♦ V3 ⇐ x > y
ie.aeb 5 Conditional function
Above-Equal-Below
ie.aeb (x,y,V1,V2,V3)  
♦ V1 ⇐ x > y
♦ V2 ⇐ x = y
♦ V3 ⇐ x < y
ie.or
-4 Conditional function

Argument filters varg(…) not allowed.

ie.or (x,Y1,Y2,…,Yn,T,F)  
♦ T ⇐ (x=Y1) or (x=Y2) … or (x=Yn)
♦ F ⇐ othewise
ie.nor
-4 Conditional function

Argument filters varg(…) not allowed.

ie.nor (x,Y1,Y2,…,Yn,T,F)  
♦ T ⇐ (x≠Y1) and (x≠Y2) … and (x≠Yn)
♦ F ⇐ othewise
ie.and
-4 Conditional function

Argument filters varg(…) not allowed.

ie.and (x,Y1,Y2,…,Yn,T,F)  
♦ T ⇐ (x=Y1) and (x=Y2) … and (x=Yn)
♦ F ⇐ othewise
ie.nand
-4 Conditional function

Argument filters varg(…) not allowed.

ie.nand (x,Y1,Y2,…,Yn,T,F)  
♦ T ⇐ (x≠Y1) or (x≠Y2) … or (x≠Yn)
♦ F ⇐ othewise
 
Case functions
case.e
case 
-2 Case switch

Argument filters varg(…) not allowed.

case.e (x,P1,V1,P2,V2,…,Pn,Vn,V)  
case (x,P1,V1,P2,V2,…,Pn,Vn,V)  
♦ Vi ⇐ x=Pi
♦ V  ⇐ no match

case.e (x,P1,V1,P2,V2,…,Pn,Vn)  
case (x,P1,V1,P2,V2,…,Pn,Vn)  
♦ Vi ⇐ x=Pi
♦ x  ⇐ no match

scan from P1 to Pn

case.e (x,V) ≡ case (x,V) ≡ V

rcase.e
rcase 
-2 Reverse case switch

Argument filters varg(…) not allowed.

rcase.e (x,P1,V1,P2,V2,…,Pn,Vn,V)  
rcase (x,P1,V1,P2,V2,…,Pn,Vn,V)  
♦ Vi ⇐ x=Pi
♦ V  ⇐ no match

rcase.e (x,P1,V1,P2,V2,…,Pn,Vn)  
rcase (x,P1,V1,P2,V2,…,Pn,Vn)  
♦ Vi ⇐ x=Pi
♦ x  ⇐ no match

scan from Pn to P1

rcase.e (x,V) ≡ rcase (x,V) ≡ V

case.ne
ncase 
-2 Case switch

Argument filters varg(…) not allowed.

case.ne (x,P1,V1,P2,V2,…,Pn,Vn,V)  
ncase (x,P1,V1,P2,V2,…,Pn,Vn,V)  
♦ Vi ⇐ x≠Pi
♦ V  ⇐ no match

case.ne (x,P1,V1,P2,V2,…,Pn,Vn)  
ncase (x,P1,V1,P2,V2,…,Pn,Vn)  
♦ Vi ⇐ x≠Pi
♦ x  ⇐ no match

scan from P1 to Pn

case.ne (x,V) ≡ ncase (x,V) ≡ V

rcase.ne
rncase 
-2 Reverse case switch

Argument filters varg(…) not allowed.

rcase.ne (x,P1,V1,P2,V2,…,Pn,Vn,V)  
rncase (x,P1,V1,P2,V2,…,Pn,Vn,V)  
♦ Vi ⇐ x≠Pi
♦ V  ⇐ no match

rcase.ne (x,P1,V1,P2,V2,…,Pn,Vn)  
rncase (x,P1,V1,P2,V2,…,Pn,Vn)  
♦ Vi ⇐ x≠Pi
♦ x  ⇐ no match

scan from Pn to P1

rcase.ne (x,V) ≡ rncase (x,V) ≡ V

case.a
-2 Case switch

Argument filters varg(…) not allowed.

case.a (x,P1,V1,P2,V2,…,Pn,Vn,V)  
♦ Vi ⇐ x>Pi
♦ V  ⇐ no match

case.a (x,P1,V1,P2,V2,…,Pn,Vn)  
♦ Vi ⇐ x>Pi
♦ x  ⇐ no match

scan from P1 to Pn

case.a (x,V) ≡ V

rcase.a
-2 Reverse case switch

Argument filters varg(…) not allowed.

rcase.a (x,P1,V1,P2,V2,…,Pn,Vn,V)  
♦ Vi ⇐ x>Pi
♦ V  ⇐ no match

rcase.a (x,P1,V1,P2,V2,…,Pn,Vn)  
♦ Vi ⇐ x>Pi
♦ x  ⇐ no match

scan from Pn to P1

rcase.a (x,V) ≡ V

case.ae
-2 Case switch

Argument filters varg(…) not allowed.

case.ae (x,P1,V1,P2,V2,…,Pn,Vn,V)  
♦ Vi ⇐ x≥Pi
♦ V  ⇐ no match

case.ae (x,P1,V1,P2,V2,…,Pn,Vn)  
♦ Vi ⇐ x≥Pi
♦ x  ⇐ no match

scan from P1 to Pn

case.ae (x,V) ≡ V

rcase.ae
-2 Reverse case switch

Argument filters varg(…) not allowed.

rcase.ae (x,P1,V1,P2,V2,…,Pn,Vn,V)  
♦ Vi ⇐ x≥Pi
♦ V  ⇐ no match

rcase.ae (x,P1,V1,P2,V2,…,Pn,Vn)  
♦ Vi ⇐ x≥Pi
♦ x  ⇐ no match

scan from Pn to P1

rcase.ae (x,V) ≡ V

case.b
-2 Case switch

Argument filters varg(…) not allowed.

case.b (x,P1,V1,P2,V2,…,Pn,Vn,V)  
♦ Vi ⇐ x<Pi
♦ V  ⇐ no match

case.b (x,P1,V1,P2,V2,…,Pn,Vn)  
♦ Vi ⇐ x<Pi
♦ x  ⇐ no match

scan from P1 to Pn

case.b (x,V) ≡ V

rcase.b
-2 Reverse case switch

Argument filters varg(…) not allowed.

rcase.b (x,P1,V1,P2,V2,…,Pn,Vn,V)  
♦ Vi ⇐ x<Pi
♦ V  ⇐ no match

rcase.b (x,P1,V1,P2,V2,…,Pn,Vn)  
♦ Vi ⇐ x<Pi
♦ x  ⇐ no match

scan from Pn to P1

rcase.b (x,V) ≡ V

case.be
-2 Case switch

Argument filters varg(…) not allowed.

case.be (x,P1,V1,P2,V2,…,Pn,Vn,V)  
♦ Vi ⇐ x≤Pi
♦ V  ⇐ no match

case.be (x,P1,V1,P2,V2,…,Pn,Vn)  
♦ Vi ⇐ x≤Pi
♦ x  ⇐ no match

scan from P1 to Pn

case.be (x,V) ≡ V

rcase.be
-2 Reverse case switch

Argument filters varg(…) not allowed.

rcase.be (x,P1,V1,P2,V2,…,Pn,Vn,V)  
♦ Vi ⇐ x≤Pi
♦ V  ⇐ no match

rcase.be (x,P1,V1,P2,V2,…,Pn,Vn)  
♦ Vi ⇐ x≤Pi
♦ x  ⇐ no match

scan from Pn to P1

rcase.be (x,V) ≡ V

case.x32
2 Case switch
case.x32 (x,y)  
♦ x ⇐ DLL is x32
♦ y ⇐ DLL is not x32
case.n32
2 Case switch
case.n32 (x,y)  
♦ x ⇐ DLL is not x32
♦ y ⇐ DLL is x32
case.x64
2 Case switch
case.x64 (x,y)  
♦ x ⇐ DLL is x64
♦ y ⇐ DLL is not x64
case.n64
2 Case switch
case.n64 (x,y)  
♦ x ⇐ DLL is not x64
♦ y ⇐ DLL is x64
 
GOTO functions
goto 1:0 Unconditional jump goto (label)
xgoto -2:0 Jump by index

Argument filters varg(…) not allowed.

xgoto (label0, label1, …, labeln, index)

index - integer value

jump to labelindex if index ∈ [0..n]  
do nothing otherwise  

// xgoto

var aa=2;
var bb=8;

x = 0;
xgoto p0, p1, aa>bb; // aa>bb=0 —> jump to p0

p0:
x -= 22;

p1:
x += 1;

// x=-21

// xgoto

var aa=2;
var bb=8;

x = 0;
xgoto p0, p1, aa<bb; // aa<bb=1 —> jump to p1

p0:
x -= 22;

p1:
x += 1;

// x=1

rxgoto -2:0 Jump by reverse index

Argument filters varg(…) not allowed.

rxgoto (labeln, …, label1, label0, index)

index - integer value

jump to labelindex if index ∈ [0..n]  
do nothing otherwise  

goto.if.x32
1:0 Conditional jump
goto.if.x32 (label)

jump to label if DLL is x32

goto.if.n32
1:0 Conditional jump
goto.if.n32 (label)

jump to label if DLL is not x32

goto.if.x64
1:0 Conditional jump
goto.if.x64 (label)

jump to label if DLL is x64

goto.if.n64
1:0 Conditional jump
goto.if.n64 (label)

jump to label if DLL is not x64

goto.if
goto.if.true 
2:0 Conditional jump goto.if (label, x)  
goto.if.true (label, x)  

jump to label if x ≠ 0

goto.if.not
goto.if.false 
2:0 Conditional jump goto.if.not (label, x)  
goto.if.false (label, x)  

jump to label if x = 0

goto.if.z 2:0 Conditional jump goto.if.z (label, x)

jump to label if x = 0

goto.if.nz 2:0 Conditional jump goto.if.nz (label, x)

jump to label if x ≠ 0

goto.if.az 2:0 Conditional jump goto.if.az (label, x)

jump to label if x > 0

goto.if.aez 2:0 Conditional jump goto.if.aez (label, x)

jump to label if x ≥ 0

goto.if.bz 2:0 Conditional jump goto.if.bz (label, x)

jump to label if x < 0

goto.if.bez 2:0 Conditional jump goto.if.bez (label, x)

jump to label if x ≤ 0

goto.if.or -3:0 Conditional jump

Argument filters varg(…) not allowed.

goto.if.or (label, x,Y1,Y2,…,Yn)

jump to label if
(x=Y1) or (x=Y2) … or (x=Yn)

goto.if.nor -3:0 Conditional jump

Argument filters varg(…) not allowed.

goto.if.nor (label, x,Y1,Y2,…,Yn)

jump to label if
(x≠Y1) and (x≠Y2) … and (x≠Yn)

goto.if.and -3:0 Conditional jump

Argument filters varg(…) not allowed.

goto.if.and (label, x,Y1,Y2,…,Yn)

jump to label if
(x=Y1) and (x=Y2) … and (x=Yn)

goto.if.nand -3:0 Conditional jump

Argument filters varg(…) not allowed.

goto.if.nand (label, x,Y1,Y2,…,Yn)

jump to label if
(x≠Y1) or (x≠Y2) … or (x≠Yn)

 
CALL functions
proc.begin proc.end  0:0 Procedure stack frame functions proc.begin
...
proc.end

$+ STACK_FRAME
$+ LOCALS

call procc;
return z;

| procc: // procedure
| proc.begin
|   x = sin(a);
|   y = cos(a);
|   z = x^2 + y^2;
|   call proco;
| proc.end

| proco: // procedure
| proc.begin
|   z = z + 10;
| proc.end

retn 0:0 Return from procedure retn
call 1:0 Procedure call call (proc)
calls -1:0 Procedure call

Argument filters varg(…) not allowed.

calls (proc1, proc2, …, procn)

call proc1;  
call proc2;  
 
call procn;  

// calls

$+ STACK_FRAME
$+ LOCALS

x = 0; 
calls p1, p2, p3, p4;
return x;

| p1: // procedure 
| x += 1;
| retn;

| p2: // procedure 
| x += 2;
| retn;

| p3: // procedure 
| x += 3;
| retn;

| p4: // procedure 
| x += 4;
| retn;

rcalls -1:0 Reverse procedure call

Argument filters varg(…) not allowed.

rcalls (proc1, proc2, …, procn)

call procn;  
 
call proc2;  
call proc1;  

xcall -2:0 Procedure call by index

Argument filters varg(…) not allowed.

xcall (proc0, proc1, …, procn, index)

index - integer value

call procindex if index ∈ [0..n]  
do nothing otherwise  

// xcall

$+ STACK_FRAME
$+ LOCALS

var aa=2;
var bb=8;

x = 0;
xcall p0, p1, aa>bb; // aa>bb=0 —> call p0
return x; // x=-22

| p0: // procedure 
| x -= 22;
| retn;

| p1: // procedure 
| x += 1;
| retn;

// xcall

$+ STACK_FRAME
$+ LOCALS

var aa=2;
var bb=8;

x = 0;
xcall p0, p1, aa<bb; // aa<bb=1 —> call p1
return x; // x=1

| p0: // procedure 
| x -= 22;
| retn;

| p1: // procedure 
| x += 1;
| retn;

// xcall

$+ STACK_FRAME
$+ LOCALS

int uu;

x = 0;
uu = 3; 
xcall p0, p1, p2, p3, p4, uu;
return x;

| p0: // procedure 
| x -= 22;
| retn;

| p1: // procedure 
| x += 1;
| retn;

| p2: // procedure 
| x += 2;
| retn;

| p3: // procedure 
| x += 3;
| retn;

| p4: // procedure 
| x += 4;
| retn;

rxcall -2:0 Procedure call by reverse index

Argument filters varg(…) not allowed.

rxcall (procn, …, proc1, proc0, index)

index - integer value

call procindex if index ∈ [0..n]  
do nothing otherwise  

call.if.x32
1:0 Conditional call
call.if.x32 (proc)

call proc if DLL is x32

call.if.n32
1:0 Conditional call
call.if.n32 (proc)

call proc if DLL is not x32

call.if.x64
1:0 Conditional call
call.if.x64 (proc)

call proc if DLL is x64

call.if.n64
1:0 Conditional call
call.if.n64 (proc)

call proc if DLL is not x64

call.ie.x32
2:0 Conditional call
call.ie.x32 (if.proc, else.proc)

call if.proc if DLL is x32,
call else.proc otherwise

call.ie.n32
2:0 Conditional call
call.ie.n32 (if.proc, else.proc)

call if.proc if DLL is not x32,
call else.proc otherwise

call.ie.x64
2:0 Conditional call
call.ie.x64 (if.proc, else.proc)

call if.proc if DLL is x64,
call else.proc otherwise

call.ie.n64
2:0 Conditional call
call.ie.n64 (if.proc, else.proc)

call if.proc if DLL is not x64,
call else.proc otherwise

call.if
call.if.true 
2:0 Conditional call call.if (proc, x)  
call.if.true (proc, x)  

call proc if x ≠ 0

call.if.not
call.if.false 
2:0 Conditional call call.if.not (proc, x)  
call.if.false (proc, x)  

call proc if x = 0

call.if.z 2:0 Conditional call call.if.z (proc, x)

call proc if x = 0

call.if.nz 2:0 Conditional call call.if.nz (proc, x)

call proc if x ≠ 0

call.if.az 2:0 Conditional call call.if.az (proc, x)

call proc if x > 0

call.if.aez 2:0 Conditional call call.if.aez (proc, x)

call proc if x ≥ 0

call.if.bz 2:0 Conditional call call.if.bz (proc, x)

call proc if x < 0

call.if.bez 2:0 Conditional call call.if.bez (proc, x)

call proc if x ≤ 0

call.ie
call.ie.true 
3:0 Conditional call call.ie (if.proc, else.proc, x)  
call.ie.true (if.proc, else.proc, x)  

call if.proc if x ≠ 0,
call else.proc otherwise

call.ie.not
call.ie.false 
3:0 Conditional call call.ie.not (if.proc, else.proc, x)  
call.ie.false (if.proc, else.proc, x)  

call if.proc if x = 0,
call else.proc otherwise

call.ie.z 3:0 Conditional call call.ie.z (if.proc, else.proc, x)

call if.proc if x = 0,
call else.proc otherwise

call.ie.nz 3:0 Conditional call call.ie.nz (if.proc, else.proc, x)

call if.proc if x ≠ 0,
call else.proc otherwise

call.ie.az 3:0 Conditional call call.ie.az (if.proc, else.proc, x)

call if.proc if x > 0,
call else.proc otherwise

call.ie.aez 3:0 Conditional call call.ie.aez (if.proc, else.proc, x)

call if.proc if x ≥ 0,
call else.proc otherwise

call.ie.bz 3:0 Conditional call call.ie.bz (if.proc, else.proc, x)

call if.proc if x < 0,
call else.proc otherwise

call.ie.bez 3:0 Conditional call call.ie.bez (if.proc, else.proc, x)

call if.proc if x ≤ 0,
call else.proc otherwise

call.if.or -3:0 Conditional call

Argument filters varg(…) not allowed.

call.if.or (proc, x,Y1,Y2,…,Yn)

call proc if
(x=Y1) or (x=Y2) … or (x=Yn)

call.if.nor -3:0 Conditional call

Argument filters varg(…) not allowed.

call.if.nor (proc, x,Y1,Y2,…,Yn)

call proc if
(x≠Y1) and (x≠Y2) … and (x≠Yn)

call.if.and -3:0 Conditional call

Argument filters varg(…) not allowed.

call.if.and (proc, x,Y1,Y2,…,Yn)

call proc if
(x=Y1) and (x=Y2) … and (x=Yn)

call.if.nand -3:0 Conditional call

Argument filters varg(…) not allowed.

call.if.nand (proc, x,Y1,Y2,…,Yn)

call proc if
(x≠Y1) or (x≠Y2) … or (x≠Yn)

call.ie.or -4:0 Conditional call

Argument filters varg(…) not allowed.

call.ie.or (if.proc, else.proc, x,Y1,Y2,…,Yn)

call if.proc if
(x=Y1) or (x=Y2) … or (x=Yn),
call else.proc otherwise

call.ie.nor -4:0 Conditional call

Argument filters varg(…) not allowed.

call.ie.nor (if.proc, else.proc, x,Y1,Y2,…,Yn)

call if.proc if
(x≠Y1) and (x≠Y2) … and (x≠Yn),
call else.proc otherwise

call.ie.and -4:0 Conditional call

Argument filters varg(…) not allowed.

call.ie.and (if.proc, else.proc, x,Y1,Y2,…,Yn)

call if.proc if
(x=Y1) and (x=Y2) … and (x=Yn),
call else.proc otherwise

call.ie.nand -4:0 Conditional call

Argument filters varg(…) not allowed.

call.ie.nand (if.proc, else.proc, x,Y1,Y2,…,Yn)

call if.proc if
(x≠Y1) or (x≠Y2) … or (x≠Yn),
call else.proc otherwise

 
Matrix and array functions
matrip
-1:i n-dimensional matrix item position.
No range control

Argument filters varg(…) not allowed.

matrip(n1,n2,…[,nn], i1,i2,…,in)

ni - dimension value
ii - item index

ni,ii - constant or variable

nn - optional argument

Returns:
i1+n1*(i2+n2*(…+nn-1*in))

int n = 4;
int m = 5;
int p = 6;

int ip.1.1;
int ip.1.2;
int ip.1.2o;
int ip.2.4;
int ip.2.4o;
int ip.3.6;
int ip.3.6o;

// 1D-matrix
ip.1.1 = matrip(8);
// ip.1.1 = 8

// 1D-matrix
ip.1.2 = matrip(n, 2);
// ip.1.2 = 2

// 1D-matrix
ip.1.2o = matrip(n, 6);
// index out of range
// ip.1.2o = 6

// 2D-matrix
ip.2.4 = matrip((n,m), (2,3));
// ip.2.4 = 14

// 2D-matrix
ip.2.4o = matrip((n,m), (2,6));
// 2nd index out of range
// ip.2.4o = 26

// 3D-matrix
ip.3.6 = matrip((n,m,p), (2,3,4));
// ip.3.6 = 94

// 3D-matrix
ip.3.6o = matrip((n,m,p), (2,6,4));
// 2nd index out of range
// ip.3.6o = 106

matrip.rc
-1:i n-dimensional matrix item position.
Range control

Argument filters varg(…) not allowed.

matrip.rc(n1,n2,…,nn, i1,i2,…,in)

ni - dimension value
ii - item index

ni,ii - constant or variable

Returns:
i1+n1*(i2+n2*(…+nn-1*in))

Returns -1 on error.
Error: argument count is odd or some index is out of range

int n = 4;
int m = 5;
int p = 6;

int ip.e;
int ip.1.1;
int ip.1.2;
int ip.1.2o;
int ip.2.4;
int ip.2.4o;
int ip.3.6;
int ip.3.6o;

// 2D-matrix
ip.e = matrip.rc(n,m, 2);
// argument count is odd
// ip.e = -1

// 1D-matrix
ip.1.1 = matrip.rc(8);
// ip.1.1 = 8

// 1D-matrix
ip.1.2 = matrip.rc(n, 2);
// ip.1.2 = 2

// 1D-matrix
ip.1.2o = matrip.rc(n, 6);
// index out of range
// ip.1.2o = -1

// 2D-matrix
ip.2.4 = matrip.rc((n,m), (2,3));
// ip.2.4 = 14

// 2D-matrix
ip.2.4o = matrip.rc((n,m), (2,6));
// 2nd index out of range
// ip.2.4o = -1

// 3D-matrix
ip.3.6 = matrip.rc((n,m,p), (2,3,4));
// ip.3.6 = 94

// 3D-matrix
ip.3.6o = matrip.rc((n,m,p), (2,6,4));
// 2nd index out of range
// ip.3.6o = -1

farr
->
u[…]
2 Read double array item value.
Forward search
farr(*u,n)  
u -> n  
u[n]  

u - double variable
n - value

a = u->1;
b = u[2];


u[n1,…]  
farr(*u,matrip(n1,…))  

u - double variable
ni - constant or variable

pfarr
*->
u{…}
2 Read double array item value.
Forward search.
Indirect
pfarr(*pu,n)  
pu *-> n  
pu{n}  

pu - integer variable
pu = array address

n - value

$+ STACK_FRAME
$+ LOCALS

int ps; // size of array in bytes
int pu;
var u_0;
var u_1;
var u_2;
var u_3;

// array [0..3] of double
ps = 4*sizeof(double);

// allocate memory
pu = malloc (ps);
return.if(-1,pu==0); // return -1 on error

pu*->0 = 111;
pu*->1 = 222;
pu*->2 = 333;
pu*->3 = 444;

u_0 = pu*->0;
u_1 = pu*->1;
u_2 = pu*->2;
u_3 = pu*->3;

// free memory
free (pu);

$+ STACK_FRAME
$+ LOCALS

int ps; // size of array in bytes
int pu;
var u_0;
var u_1;
var u_2;
var u_3;

// array [0..3] of double
ps = 4*sizeof(double);

// allocate memory
pu = malloc (ps);
return.if(-1,pu==0); // return -1 on error

pu{0} = 111;
pu{1} = 222;
pu{2} = 333;
pu{3} = 444;

u_0 = pu{0};
u_1 = pu{1};
u_2 = pu{2};
u_3 = pu{3};

// free memory
free (pu);


pu{n1,…}  
pfarr(*pu,matrip(n1,…))  

pu - integer variable
pu = array address

ni - constant or variable

$+ STACK_FRAME
$+ LOCALS

int ps; // size of array in bytes
int pu;
var u_0_0;
var u_0_1;
var u_1_0;
var u_1_1;

// array [0..1, 0..1] of double
ps = (2*2)*sizeof(double);

// allocate memory
pu = malloc (ps);
return.if(-1,pu==0); // return -1 on error

pu{2,2, 0,0} = 111;
pu{2,2, 0,1} = 222;
pu{2,2, 1,0} = 333;
pu{2,2, 1,1} = 444;

u_0_0 = pu{2,2, 0,0};
u_0_1 = pu{2,2, 0,1};
u_1_0 = pu{2,2, 1,0};
u_1_1 = pu{2,2, 1,1};

// determinant
a = 
pu{2,2, 0,0} * pu{2,2, 1,1} - 
pu{2,2, 0,1} * pu{2,2, 1,0};

// determinant
b = 
u_0_0 * u_1_1 - u_0_1 * u_1_0;

// free memory
free (pu);

barr
~>
2 Read double array item value.
Backward search
barr(*u,n)  
u ~> n  

u - double variable
n - value

a = u~>1;
b = u~>2;

pbarr
*~>
2 Read double array item value.
Backward search.
Indirect
pbarr(*pu,n)  
pu *~> n  

pu - integer variable
pu = array address

n - value

$+ STACK_FRAME
$+ LOCALS

int ps; // size of array in bytes
int pm;
int pu;
var u_0;
var u_1;
var u_2;
var u_3;

// array [0..3] of double
ps = 4*sizeof(double);

// allocate memory
pm = malloc (ps);
return.if(-1,pm==0); // return -1 on error

// pu = last array item address
pu = pm;
pu += 3*sizeof(double);

pu*~>0 = 111;
pu*~>1 = 222;
pu*~>2 = 333;
pu*~>3 = 444;

u_0 = pu*~>0;
u_1 = pu*~>1;
u_2 = pu*~>2;
u_3 = pu*~>3;

// free memory
free (pm);

farw
3 Write value to double array item.
Forward search
farw(*u,n,x)  
u -> n = x  

u - double variable
n - value
x - value

write x to farr(u,n)

x = u->1;
u->2 = x;

u->3 = u->0;


u[n1,…] = x  
farw(*u,matrip(n1,…),x)  

u - double variable
ni - constant or variable
x - value

x = u[1];
u[2] = x;

u[3] = u[0];

pfarw
3 Write value to double array item.
Forward search.
Indirect
pfarw(*pu,n,x)  
pu *-> n = x  

pu - integer variable
pu = array address

n - value
x - value

write x to pfarr(pu,n)

int pu = &u;

x = pu*->1;
pu*->2 = x;

pu*->3 = pu*->0;


pu{n1,…} = x  
pfarw(*pu,matrip(n1,…),x)  

pu - integer variable
pu = array address

ni - constant or variable
x - value

int pu = &u;

x = pu{1};
pu{2} = x;

pu{3} = pu{0};

barw
3 Write value to double array item.
Backward search
barw(*u,n,x)  
u ~> n = x  

u - double variable
n - value
x - value

write x to barr(u,n)

pbarw
3 Write value to double array item.
Backward search.
Indirect
pbarw(*pu,n,x)  
pu *~> n = x  

pu - integer variable
pu = array address

n - value
x - value

write x to pbarr(pu,n)

fara
&->
2:i
2:p
Get double array item address.
Forward search
fara(*u,n)  
u &-> n  

u - double variable
n - value

if n is constant,
result is pointer constant

int p;

p = u &-> 2;
x = *p;

swap(
  (u&->2):vdouble,
  (u&->3):vdouble
);

pfara
*&->
2:i
Get double array item address.
Forward search.
Indirect
pfara(*pu,n)  
pu *&-> n  

pu - integer variable
pu = array address

n - value

$+ STACK_FRAME
$+ LOCALS

int ps; // size of array in bytes
int pu;
int a_0;
int a_1;
int a_2;
int a_3;
var v_0;
var v_1;
var v_2;
var v_3;

// array [0..3] of double
ps = 4*sizeof(double);

// allocate memory
pu = malloc (ps);
return.if(-1,pu==0); // return -1 on error

// fill the memory with zeros
memset (pu, 0x00, ps);

a_0 = pu *&-> 0;
a_1 = pu *&-> 1;
a_2 = pu *&-> 2;
a_3 = pu *&-> 3;

v_0 = *a_0;
v_1 = *a_1;
v_2 = *a_2;
v_3 = *a_3;

// free memory
free (pu);

bara
&~>
2:i
2:p
Get double array item address.
Backward search
bara(*u,n)  
u &~> n  

u - double variable
n - value

if n is constant,
result is pointer constant

int p;

p = u &~> 2;
x = *p;

swap(
  (u&~>2):vdouble,
  (u&~>3):vdouble
);

pbara
*&~>
2:i
Get double array item address.
Backward search.
Indirect
pbara(*pu,n)  
pu *&~> n  

pu - integer variable
pu = array address

n - value

$+ STACK_FRAME
$+ LOCALS

int ps; // size of array in bytes
int pm;
int pu;
int a_0;
int a_1;
int a_2;
int a_3;
var v_0;
var v_1;
var v_2;
var v_3;

// array [0..3] of double
ps = 4*sizeof(double);

// allocate memory
pm = malloc (ps);
return.if(-1,pm==0); // return -1 on error

// fill the memory with zeros
memset (pm, 0x00, ps);

// pu = last array item address
pu = pm;
pu += 3*sizeof(double);

a_0 = pu *&~> 0;
a_1 = pu *&~> 1;
a_2 = pu *&~> 2;
a_3 = pu *&~> 3;

v_0 = *a_0;
v_1 = *a_1;
v_2 = *a_2;
v_3 = *a_3;

// free memory
free (pm);

farv
->>
2 Double array item as variable.
Forward search
farv(*u,n)  
u ->> n  

u - double variable
n - integer or double constant

farv(u,0) = 888;
farv(u,1) = 555;
swap (farv(u,0), farv(u,1));

u->>0 = 888;
u->>1 = 555;
swap (u->>0, u->>1);

barv
~>>
2 Double array item as variable.
Backward search
barv(*u,n)  
u ~>> n  

u - double variable
n - integer or double constant

barv(u,0) = 888;
barv(u,1) = 555;
swap (barv(u,0), barv(u,1));

u~>>0 = 888;
u->>1 = 555;
swap (u~>>0, u~>>1);

 
Base functions
zero
fldz 
 
0 Load +0.0
fld1
 
0 Load +1.0
fldpi
 
0 Load π
fldl2t
 
0 Load log210
fldl2e
 
0 Load log2e
fldlg2
 
0 Load log102
fldln2
 
0 Load loge2
nan
 
0 Load a NaN (Not-A-Number) value  
0xFFF8000000000000 = 0.0/0.0  
nanu
 
0 Load a NaN (Not-A-Number) value  
0xFFFFFFFFFFFFFFFF  
pinf
 
0 Load a positive infinity value  
0x7FF0000000000000 = +1.0/0.0  
ninf
 
0 Load a negative infinity value  
0xFFF0000000000000 = -1.0/0.0  
peps
 
0 Load a positive epsilon value  
 0x0000000000000001  
+4.9406564584124654e-324 = +2-1074
neps
 
0 Load a negative epsilon value  
 0x8000000000000001  
-4.9406564584124654e-324 = -2-1074
maxd
 
0 Load a maximum double value  
 0x7FEFFFFFFFFFFFFF  
+1.7976931348623157e+308 = +21023 *(2-2-52)
mind
 
0 Load a minimum double value  
 0xFFEFFFFFFFFFFFFF  
-1.7976931348623157e+308 = -21023 *(2-2-52)
f2xm1 1 #FPU 2x-1  
|x| < 1
fyl2x 2 #FPU y * log2(x)  
x > 0
fyl2xp1 2 #FPU y * log2(x+1)  
|x| < (1-a), a = (1/2)*21/2
fprem
2 Partial remainder

#FPU

fprem(x,y) = x - Q * y  
Q = round(x/y) → zero
frprem
2 Reverse partial remainder

#FPU

frprem(x,y) = y - Q * x  
Q = round(y/x) → zero
fprem1
2 IEEE partial remainder

#FPU

fprem1(x,y) = x - Q * y  
Q = round(x/y) → nearest integer
frprem1
2 Reverse IEEE partial remainder

#FPU

frprem1(x,y) = y - Q * x  
Q = round(y/x) → nearest integer
fscale
2 Scale by power of two fscale(x,y) = x * 2y

fscale(1.2056326171875,10) =
1234.5678

frscale
2 Reverse scale by power of two frscale(x,y) = y * 2x

frscale(10,1.2056326171875) =
1234.5678

fxtracts
1 Extract significant

#FPU

1234.5678 = 1.2056326171875 * 210  

fxtracts(1234.5678) =
1.2056326171875

fxtracte
1 Extract exponent

#FPU

1234.5678 = 1.2056326171875 * 210  

fxtracte(1234.5678) =
10

fxtractse
1:2 Extract significant & exponent

#FPU

fxtractse(x) = (s,e)

1234.5678 = 1.2056326171875 * 210  

fxtractse(1234.5678) =
1.2056326171875,10

var vs;
var ve;

x2copy(vs,ve, fxtractse(1234.5678));

co.fxtractse
3 Extract significant & exponent

Returns result in double variables s and e

#FPU

co.fxtractse(*s,*e, x)  

1234.5678 = 1.2056326171875 * 210  

fxtractse(1234.5678) =
1.2056326171875,10

var vs;
var ve;

co.fxtractse(vs,ve, 1234.5678);

fxtractes
1:2 Extract exponent & significant

#FPU

fxtractes(x) = (e,s)

1234.5678 = 1.2056326171875 * 210  

fxtractes(1234.5678) =
10,1.2056326171875

var vs;
var ve;

x2copy(ve,vs, fxtractes(1234.5678));

co.fxtractes
3 Extract exponent & significant

Returns result in double variables e and s

#FPU

co.fxtractes(*e,*s, x)  

1234.5678 = 1.2056326171875 * 210  

fxtractes(1234.5678) =
10,1.2056326171875

var vs;
var ve;

co.fxtractes(ve,vs, 1234.5678);

setz
1 Returns +0.0 setz(x) = 0  
returns 0 for any x
set1
1 Returns +1.0 set1(x) = 1  
returns 1 for any x
uplus +x  1 Unary plus
+x = uplus(x)
chs -x  1 Reverse sign
-x = chs(x)
abs (|x|) 1 Absolute value
abs(x) ≡ (|x|)
nabs (!x!) 1 Negative absolute value
nabs(x) = -abs(x)
nabs(x) ≡ (!x!)
signbit
sgnbit 
1:i Sign bit of a number (0, 1) signbit(x)  
sgnbit(x)  
♦  1 ⇐ sign bit is set
♦  0 ⇐ sign bit is reset

var zerom = $:8000000000000000; // -0.0
var zerop = $:0000000000000000; // +0.0
int sbm, sbp;

sbm = signbit(zerom); // 1
sbp = signbit(zerop); // 0

rsignbit
rsgnbit 
1:i Reversed sign bit of a number (0, 1) rsignbit(x)  
rsgnbit(x)  
♦  1 ⇐ sign bit is reset
♦  0 ⇐ sign bit is set

var zerom = $:8000000000000000; // -0.0
var zerop = $:0000000000000000; // +0.0
int sbm, sbp;

sbm = rsignbit(zerom); // 0
sbp = rsignbit(zerop); // 1

sign
sgn 
1 Sign of a number (-1, 0, 1) sign(x)  
sgn(x)  
♦  1 ⇐ x > 0
♦  0 ⇐ x = 0
♦ -1 ⇐ x < 0

var zerom = $:8000000000000000; // -0.0
var zerop = $:0000000000000000; // +0.0
var szm, szp, spp, snn;

szm = sign(zerom); //  0
szp = sign(zerop); //  0
spp = sign((|a|)); // +1
snn = sign((!a!)); // -1

rsign
rsgn 
1 Reversed sign of a number (-1, 0, 1) rsign(x)  
rsgn(x)  
♦  1 ⇐ x < 0
♦  0 ⇐ x = 0
♦ -1 ⇐ x > 0
nzero
 
!.x
1 Non-zero value nzero(x)  
!.x  
♦ x        ⇐ x != 0
♦ +epsilon ⇐ x = +0
♦ -epsilon ⇐ x = -0

epsilon = 2-1074 = 0x0000000000000001
rnzero
 
~!.x
1 Reversed non-zero value rnzero(x)  
~!.x  
♦ -x       ⇐ x != 0
♦ -epsilon ⇐ x = +0
♦ +epsilon ⇐ x = -0

epsilon = 2-1074 = 0x0000000000000001
pos
ramp 
1 Positive value or zero pos(x)  
ramp(x)  
♦ x ⇐ x > 0
♦ 0 ⇐ otherwise
neg
1 Negative value or zero neg(x)  
♦ x ⇐ x < 0
♦ 0 ⇐ otherwise
inc 1 Increment by 1 inc(x)
dec 1 Decrement by 1 dec(x)
inv
recip 
/x
1 Inversion /x  
inv(x)  
recip(x)  
1/x  

a = 8/+2; // a = 4
b = 8+/2; // b = 8.5

add

2 Addition add(x,y)  
x add y  
(add x,y)  
x + y  

var p1 = 333;
var p2 = 222;
var p3;
int i3;

p3 = p1 + p2;
i3 = p1 + p2;

int p1 = 333;
int p2 = 222;
int p3;
var v3;

p3 = p1 + p2;
v3 = p1 + p2;

add.pos
++
2 Positive addition add.pos(x,y)  
x ++ y  
♦ x + y ⇐ x + y > 0
♦     0 ⇐ otherwise
add.neg
+-
2 Negative addition add.neg(x,y)  
x +- y  
♦ x + y ⇐ x + y < 0
♦     0 ⇐ otherwise
add.int
[+] 2 Int addition add.int(x,y)  
x [+] y  

int(x) + int(y)
add.frac
{+} 2 Frac addition add.frac(x,y)  
x {+} y  

frac(x) + frac(y)
add.round
<+> 2 Round addition add.round(x,y)  
x <+> y  

round(x) + round(y)
sub

2 Subtraction sub(x,y)  
x sub y  
(sub x,y)  
x - y  

var p1 = 333;
var p2 = 222;
var p3;
int i3;

p3 = p1 - p2;
i3 = p1 - p2;

int p1 = 333;
int p2 = 222;
int p3;
var v3;

p3 = p1 - p2;
v3 = p1 - p2;

sub.pos
-+
2 Positive subtraction sub.pos(x,y)  
x -+ y  
♦ x - y ⇐ x - y > 0
♦     0 ⇐ otherwise
sub.neg
--
2 Negative subtraction sub.neg(x,y)  
x -- y  
♦ x - y ⇐ x - y < 0
♦     0 ⇐ otherwise
sub.int
[-] 2 Int subtraction sub.int(x,y)  
x [-] y  

int(x) - int(y)
sub.frac
{-} 2 Frac subtraction sub.frac(x,y)  
x {-} y  

frac(x) - frac(y)
sub.round
<-> 2 Round subtraction sub.round(x,y)  
x <-> y  

round(x) - round(y)
subr
~- 
2 Reverse subtraction subr(x,y)  
x subr y  
(subr x,y)  
x ~- y  
y - x  

var p1 = 333;
var p2 = 222;
var p3;
int i3;

p3 = p1 ~- p2;
i3 = p1 ~- p2;

int p1 = 333;
int p2 = 222;
int p3;
var v3;

p3 = p1 ~- p2;
v3 = p1 ~- p2;

subr.pos
~-+
2 Reverse positive subtraction sub.pos(x,y)  
x ~-+ y  
y -+ x  
♦ y - x ⇐ y - x > 0
♦     0 ⇐ otherwise
subr.neg
~--
2 Reverse negative subtraction sub.neg(x,y)  
x ~-- y  
y -- x  
♦ y - x ⇐ y - x < 0
♦     0 ⇐ otherwise
subr.int
[~-] 2 Reverse int subtraction subr.int(x,y)  
x [~-] y  
y [-] x  

int(y) - int(x)
subr.frac
{~-} 2 Reverse frac subtraction subr.frac(x,y)  
x {~-} y  
y {-} x  

frac(y) - frac(x)
subr.round
<~-> 2 Reverse round subtraction subr.round(x,y)  
x <~-> y  
y <-> x  

round(y) - round(x)
mul

2 Multiplication mul(x,y)  
x mul y  
(mul x,y)  
x * y  

var p1 = 333;
var p2 = 222;
var p3;
int i3;

p3 = p1 * p2;
i3 = p1 * p2;

int p1 = 333;
int p2 = 222;
int p3;
var v3;

p3 = p1 * p2;
v3 = p1 * p2;

mul.pos
*+
2 Positive multiplication mul.pos(x,y)  
x *+ y  
♦ x * y ⇐ x * y > 0
♦     0 ⇐ otherwise
mul.neg
*-
2 Negative multiplication mul.neg(x,y)  
x *- y  
♦ x * y ⇐ x * y < 0
♦     0 ⇐ otherwise
mul.int
[*] 2 Int multiplication mul.int(x,y)  
x [*] y  

int(x) * int(y)
mul.frac
{*} 2 Frac multiplication mul.frac(x,y)  
x {*} y  

frac(x) * frac(y)
mul.round
<*> 2 Round multiplication mul.round(x,y)  
x <*> y  

round(x) * round(y)
div

2 Division div(x,y)  
x div y  
(div x,y)  
x / y  

var p1 = 333;
var p2 = 222;
var p3;
int i3;

p3 = p1 / p2;
i3 = p1 / p2;

int p1 = 333;
int p2 = 222;
int p3;
var v3;

p3 = p1 / p2;
v3 = p1 / p2;

div.pos
/+
2 Positive division div.pos(x,y)  
x /+ y  
♦ x / y ⇐ x / y > 0
♦     0 ⇐ otherwise
div.neg
/-
2 Negative division div.neg(x,y)  
x /- y  
♦ x / y ⇐ x / y < 0
♦     0 ⇐ otherwise
div.int
[/] 2 Int division div.int(x,y)  
x [/] y  

int(x) / int(y)
div.frac
{/} 2 Frac division div.frac(x,y)  
x {/} y  

frac(x) / frac(y)
div.round
</> 2 Round division div.round(x,y)  
x </> y  

round(x) / round(y)
divr
~/ 
2 Reverse division divr(x,y)  
x divr y  
(divr x,y)  
x ~/ y  
y / x  

var p1 = 333;
var p2 = 222;
var p3;
int i3;

p3 = p1 ~/ p2;
i3 = p1 ~/ p2;

int p1 = 333;
int p2 = 222;
int p3;
var v3;

p3 = p1 ~/ p2;
v3 = p1 ~/ p2;

divr.pos
~/+
2 Reverse positive division divr.pos(x,y)  
x ~/+ y  
y /+ x  
♦ y / x ⇐ y / x > 0
♦     0 ⇐ otherwise
divr.neg
~/-
2 Reverse negaitive division divr.neg(x,y)  
x ~/- y  
y /- x  
♦ y / x ⇐ y / x < 0
♦     0 ⇐ otherwise
divr.int
[~/] 2 Reverse int division divr.int(x,y)  
x [~/] y  
y [/] x  

int(y) / int(x)
divr.frac
{~/} 2 Reverse frac division divr.frac(x,y)  
x {~/} y  
y {/} x  

frac(y) / frac(x)
divr.round
<~/> 2 Reverse round division divr.round(x,y)  
x <~/> y  
y </> x  

round(y) / round(x)
quo

2 Quotient quo(x,y)  
x quo y  
(quo x,y)  
x \ y  
int(x/y)  

var p1 = 333;
var p2 = 222;
var p3;
int i3;

p3 = p1 \ p2;
i3 = p1 \ p2;

int p1 = 333;
int p2 = 222;
int p3;
var v3;

p3 = p1 \ p2;
v3 = p1 \ p2;

quo.pos
\+
2 Positive quotient quo.pos(x,y)  
x \+ y  
♦ x \ y ⇐ x \ y > 0
♦     0 ⇐ otherwise
quo.neg
\-
2 Negative quotient quo.neg(x,y)  
x \- y  
♦ x \ y ⇐ x \ y < 0
♦     0 ⇐ otherwise
quo.int
[\]
2 Int quotient quo.int(x,y)  
x [\] y  

int(x) \ int(y)
quo.frac
{\}
2 Frac quotient quo.frac(x,y)  
x {\} y  

frac(x) \ frac(y)
quo.round
<\>
2 Round quotient quo.round(x,y)  
x <\> y  

round(x) \ round(y)
quor
~\ 
2 Reverse quotient quor(x,y)  
x quor y  
(quor x,y)  
x ~\ y  
y \ x  
int(y/x)  

var p1 = 333;
var p2 = 222;
var p3;
int i3;

p3 = p1 ~\ p2;
i3 = p1 ~\ p2;

int p1 = 333;
int p2 = 222;
int p3;
var v3;

p3 = p1 ~\ p2;
v3 = p1 ~\ p2;

quor.pos
~\+
2 Reverse positive quotient quor.pos(x,y)  
x ~\+ y  
y \+ x  
♦ y \ x ⇐ y \ x > 0
♦     0 ⇐ otherwise
quor.neg
~\-
2 Reverse negaitive quotient quor.neg(x,y)  
x ~\- y  
y \- x  
♦ y \ x ⇐ y \ x < 0
♦     0 ⇐ otherwise
quor.int
[~\]
2 Reverse int quotient quor.int(x,y)  
x [~\] y  
y [\] x  

int(y) \ int(x)
quor.frac
{~\}
2 Reverse frac quotient quor.frac(x,y)  
x {~\} y  
y {\} x  

frac(y) \ frac(x)
quor.round
<~\>
2 Reverse round quotient quor.round(x,y)  
x <~\> y  
y <\> x  

round(y) \ round(x)
mod
% 
2 Remainder mod(x,y)  
x mod y  
(mod x,y)  
x % y  

x - Q * y  
Q = int(x/y)    

var p1 = 333;
var p2 = 222;
var p3;
int i3;

p3 = p1 % p2;
i3 = p1 % p2;

int p1 = 333;
int p2 = 222;
int p3;
var v3;

p3 = p1 % p2;
v3 = p1 % p2;

mod.pos
%+
2 Positive remainder mod.pos(x,y)  
x %+ y  
♦ x % y ⇐ x % y > 0
♦      0 ⇐ otherwise
mod.neg
%-
2 Negative remainder mod.neg(x,y)  
x %- y  
♦ x % y ⇐ x % y < 0
♦      0 ⇐ otherwise
mod.int
[%]
2 Int remainder mod.int(x,y)  
x [%] y  

int(x) % int(y)
mod.frac
{%}
2 Frac remainder mod.frac(x,y)  
x {%} y  

frac(x) % frac(y)
mod.round
<%>
2 Round remainder mod.round(x,y)  
x <%> y  

round(x) % round(y)
modr
~% 
2 Reverse remainder modr(x,y)  
x modr y  
(modr x,y)  
x ~% y  
y % x  

y - Q * x  
Q = int(y/x)    

var p1 = 333;
var p2 = 222;
var p3;
int i3;

p3 = p1 ~% p2;
i3 = p1 ~% p2;

int p1 = 333;
int p2 = 222;
int p3;
var v3;

p3 = p1 ~% p2;
v3 = p1 ~% p2;

modr.pos
~%+
2 Reverse positive remainder modr.pos(x,y)  
x ~%+ y  
y %+ x  
♦ y % x ⇐ y % x > 0
♦      0 ⇐ otherwise
modr.neg
~%-
2 Reverse negaitive remainder modr.neg(x,y)  
x ~%- y  
y %- x  
♦ y % x ⇐ y % x < 0
♦      0 ⇐ otherwise
modr.int
[~%]
2 Reverse int remainder modr.int(x,y)  
x [~%] y  
y [%] x  

int(y) % int(x)
modr.frac
{~%}
2 Reverse frac remainder modr.frac(x,y)  
x {~%} y  
y {%} x  

frac(y) % frac(x)
modr.round
<~%>
2 Reverse round remainder modr.round(x,y)  
x <~%> y  
y <%> x  

round(y) % round(x)
quo.mod
\% 
2:2 Quotient and remainder
quo.mod(x,y) = (quo,mod)  
quo = int(x / y)    
mod = x - y * int(x / y)    

var vr;
var vquo, vmod;

x2copy(vquo,vmod, 100\%(pi/4));
vr = vquo*(pi/4) + vmod;

co.quo.mod
4 Quotient and remainder

Returns result in double variables quo and mod

co.quo.mod(*quo,*mod, x,y)  
quo = int(x / y)    
mod = x - y * int(x / y)    

var vr;
var vquo, vmod;

co.quo.mod(vquo,vmod, 100, pi/4);
vr = vquo*(pi/4) + vmod;

mod.quo
%
2:2 Remainder and quotient
mod.quo(x,y) = (mod,quo)  
mod = x - y * int(x / y)    
quo = int(x / y)    

var vr;
var vquo, vmod;

x2copy(vmod,vquo, 100%\(pi/4));
vr = vquo*(pi/4) + vmod;

co.mod.quo
4 Remainder and quotient

Returns result in double variables mod and quo

co.mod.quo(*mod,*quo, x,y)  
mod = x - y * int(x / y)    
quo = int(x / y)    

var vr;
var vquo, vmod;

co.mod.quo(vmod,vquo, 100, pi/4);
vr = vquo*(pi/4) + vmod;

fmadd132
3 Fused multiply-add

#FMA•VFMADD132SD

fmadd132(x,y,z)  
x * z + y
fmadd213
3 Fused multiply-add

#FMA•VFMADD213SD

fmadd213(x,y,z)  
x * y + z
fmadd231
3 Fused multiply-add

#FMA•VFMADD231SD

fmadd231(x,y,z)  
y * z + x
fnmadd132
3 Fused negative multiply-add

#FMA•VFNMADD132SD

fnmadd132(x,y,z)  
-x * z + y
fnmadd213
3 Fused negative multiply-add

#FMA•VFNMADD213SD

fnmadd213(x,y,z)  
-x * y + z
fnmadd231
3 Fused negative multiply-add

#FMA•VFNMADD231SD

fnmadd231(x,y,z)  
-y * z + x
fmsub132
3 Fused multiply-subtract

#FMA•VFMSUB132SD

fmsub132(x,y,z)  
x * z - y
fmsub213
3 Fused multiply-subtract

#FMA•VFMSUB213SD

fmsub213(x,y,z)  
x * y - z
fmsub231
3 Fused multiply-subtract

#FMA•VFMSUB231SD

fmsub231(x,y,z)  
y * z - x
fnmsub132
3 Fused negative multiply-subtract

#FMA•VFNMSUB132SD

fnmsub132(x,y,z)  
-x * z - y
fnmsub213
3 Fused negative multiply-subtract

#FMA•VFNMSUB213SD

fnmsub213(x,y,z)  
-x * y - z
fnmsub231
3 Fused negative multiply-subtract

#FMA•VFNMSUB231SD

fnmsub231(x,y,z)  
-y * z - x
add.mul
3 add & mul add.mul(z,x,y)  
z + x * y
add.div
3 add & div add.div(z,x,y)  
z + x / y
add.divr
3 add & divr add.divr(z,x,y)  
z + y / x
sub.mul
3 sub & mul sub.mul(z,x,y)  
z - x * y
sub.div
3 sub & div sub.div(z,x,y)  
z - x / y
sub.divr
3 sub & divr sub.divr(z,x,y)  
z - y / x
subr.mul
3 subr & mul subr.mul(z,x,y)  
x * y - z
subr.div
3 subr & div subr.div(z,x,y)  
x / y - z
subr.divr
3 subr & divr subr.divr(z,x,y)  
y / x - z
mul.add
3 mul & add mul.add(x,y,z)  
x * y + z
mul.sub
3 mul & sub mul.sub(x,y,z)  
x * y - z
mul.subr
3 mul & subr mul.subr(x,y,z)  
z - x * y
div.add
3 div & add div.add(x,y,z)  
x / y + z
div.sub
3 div & sub div.sub(x,y,z)  
x / y - z
div.subr
3 div & subr div.subr(x,y,z)  
z - x / y
divr.add
3 divr & add divr.add(x,y,z)  
y / x + z
divr.sub
3 divr & sub divr.sub(x,y,z)  
y / x - z
divr.subr
3 divr & subr divr.subr(x,y,z)  
z - y / x
trunc
1:i Integer part of x
integer trunc(x)  

int p1;
int p2;
int p3;
int p4;
int p5;
int p6;

p1 = trunc ( 2.1); // 2
p2 = trunc ( 2.5); // 2
p3 = trunc ( 3.5); // 3
p4 = trunc (-2.1); // -2
p5 = trunc (-2.5); // -2
p6 = trunc (-3.5); // -3

int
[x] 1 Integer part of x int(x)  
[x]  

var p0;
var p1;
var p2;
var p3;
var p4;
var p5;
var p6;

[2.1];
a + [2.1] - b;
p0 = a + [2.1] - b;

p1 = int ( 2.1); // 2
p2 = int ( 2.5); // 2
p3 = int ( 3.5); // 3
p4 = int (-2.1); // -2
p5 = int (-2.5); // -2
p6 = int (-3.5); // -3

intto
[x,n] 2 Trunc x to a specified power of ten
intto(x,n)  
[x,n]  

var p0;
var p1;
var p2;
var p3;
var p4;
var p5;
var p6;

[123456,4];
a + [123456,4] - b;
p0 = a + [123456,4] - b;

p1 = intto (123456, 4); // 120000
p2 = intto (123456, 3); // 123000
p3 = intto (123456, 2); // 123400
p4 = intto (1.234, -2); // 1.23
p5 = intto (1.235, -2); // 1.23
p6 = intto (1.245, -2); // 1.24

deintto
2 intto delta deintto(x,n) = x - intto(x,n)
frac {x} 1 Fractional part of x frac(x)  
{x}  

var p0;
var p1;
var p2;
var p3;
var p4;
var p5;
var p6;

{2.1};
a + {2.1} - b;
p0 = a + {2.1} - b;

p1 = frac ( 2.1); // 0.1
p2 = frac ( 2.5); // 0.5
p3 = frac ( 3.5); // 0.5
p4 = frac (-2.1); // -0.1
p5 = frac (-2.5); // -0.5
p6 = frac (-3.5); // -0.5

fracto
{x,n} 2 Frac x to a specified power of ten
fracto(x,n)  
{x,n}  

var p0;
var p1;
var p2;
var p3;
var p4;
var p5;
var p6;

{12345.6789,4};
a + {12345.6789,4} - b;
p0 = a + {12345.6789,4} - b;

p1 = fracto (12345.6789, 4); // 0.23456789
p2 = fracto (12345.6789, 3); // 0.3456789
p3 = fracto (12345.6789, 2); // 0.456789
p4 = fracto (12345.6789, -1); // 0.789
p5 = fracto (12345.6789, -2); // 0.89
p6 = fracto (12345.6789, -3); // 0.9

defracto
2 fracto delta defracto(x,n) = x - fracto(x,n)
round
<x> 1 Round x to the nearest integer number.
Round half away from zero
round(x)  
<x>  

var p0;
var p1;
var p2;
var p3;
var p4;
var p5;
var p6;
var p7;
var p8;
var p9;
var p10;
var p11;
var p12;
var p13;
var p14;

<2.1>;
a + <2.1> - b;
p0 = a + <2.1> - b;

p1  = round ( 2.1); // 2
p2  = round ( 2.5); // 3
p3  = round ( 2.9); // 3
p4  = round ( 5.1); // 5
p5  = round ( 5.5); // 6
p6  = round ( 5.9); // 6
p7  = round (-2.1); // -2
p8  = round (-2.5); // -3
p9  = round (-2.9); // -3
p10 = round (-5.1); // -5
p11 = round (-5.5); // -6
p12 = round (-5.9); // -6

p13 = round (8728.5); // 8729
p14 = round (87.285*100); // 8728 !!!

deround
1 round delta deround(x) = x - round(x)
roundto
<x,n> 2 Round x to a specified power of ten
roundto(x,n)  
<x,n>  

var p0;
var p1;
var p2;
var p3;
var p4;
var p5;
var p6;
var p7;

<123456,4>;
a + <123456,4> - b;
p0 = a + <123456,4> - b;

p1 = roundto (123456, 4); // 120000
p2 = roundto (123456, 3); // 123000
p3 = roundto (123456, 2); // 123500
p4 = roundto (1.234, -2); // 1.23
p5 = roundto (1.235, -2); // 1.24
p6 = roundto (1.245, -2); // 1.25

p7 = roundto (87.285, -2); // 87.28 !!!

deroundto
2 roundto delta deroundto(x,n) = x - roundto(x,n)
rint
frndint 
1 Round to integer.
Depends on the current FPU rounding mode

#FPU

rint(x)
frndint(x)
rheven
1 Round x to the nearest integer number.
Round half to even

#FPU

rheven(x)

var p1;
var p2;
var p3;
var p4;
var p5;
var p6;
var p7;
var p8;
var p9;
var p10;
var p11;
var p12;

p1  = rheven ( 2.1); // 2
p2  = rheven ( 2.5); // 2
p3  = rheven ( 2.9); // 3
p4  = rheven ( 5.1); // 5
p5  = rheven ( 5.5); // 6
p6  = rheven ( 5.9); // 6
p7  = rheven (-2.1); // -2
p8  = rheven (-2.5); // -2
p9  = rheven (-2.9); // -3
p10 = rheven (-5.1); // -5
p11 = rheven (-5.5); // -6
p12 = rheven (-5.9); // -6

derheven
1 rheven delta

#FPU

derheven(x) = x - rheven(x)
rhodd
1 Round x to the nearest integer number.
Round half to odd

#FPU

rhodd(x)

var p1;
var p2;
var p3;
var p4;
var p5;
var p6;
var p7;
var p8;
var p9;
var p10;
var p11;
var p12;

p1  = rhodd ( 2.1); // 2
p2  = rhodd ( 2.5); // 3
p3  = rhodd ( 2.9); // 3
p4  = rhodd ( 5.1); // 5
p5  = rhodd ( 5.5); // 5
p6  = rhodd ( 5.9); // 6
p7  = rhodd (-2.1); // -2
p8  = rhodd (-2.5); // -3
p9  = rhodd (-2.9); // -3
p10 = rhodd (-5.1); // -5
p11 = rhodd (-5.5); // -5
p12 = rhodd (-5.9); // -6

derhodd
1 rhodd delta

#FPU

derhodd(x) = x - rhodd(x)
rzero
1 Round x toward zero

#FPU

rzero(x)

var p1;
var p2;
var p3;
var p4;
var p5;
var p6;
var p7;
var p8;

p1 = rzero ( 2.1); // 2
p2 = rzero ( 2.5); // 2
p3 = rzero ( 2.9); // 2
p4 = rzero ( 5.1); // 5
p5 = rzero (-2.1); // -2
p6 = rzero (-2.5); // -2
p7 = rzero (-2.9); // -2
p8 = rzero (-5.1); // -5

derzero
1 rzero delta

#FPU

derzero(x) = x - rzero(x)
rinf
1 Round x toward infinity

#FPU

rinf(x)

var p1;
var p2;
var p3;
var p4;
var p5;
var p6;
var p7;
var p8;

p1 = rinf ( 2.1); // 3
p2 = rinf ( 2.5); // 3
p3 = rinf ( 2.9); // 3
p4 = rinf ( 5.1); // 6
p5 = rinf (-2.1); // -3
p6 = rinf (-2.5); // -3
p7 = rinf (-2.9); // -3
p8 = rinf (-5.1); // -6

derinf
1 rinf delta

#FPU

derinf(x) = x - rinf(x)
rpinf
ceil 
1 Round x toward +infinity
Smallest integer ≥ x

#FPU

rpinf(x)
ceil(x)

var p1;
var p2;
var p3;
var p4;
var p5;
var p6;
var p7;
var p8;

p1 = rpinf ( 2.1); // 3
p2 = rpinf ( 2.5); // 3
p3 = rpinf ( 2.9); // 3
p4 = rpinf ( 5.1); // 6
p5 = rpinf (-2.1); // -2
p6 = rpinf (-2.5); // -2
p7 = rpinf (-2.9); // -2
p8 = rpinf (-5.1); // -5

var p1;
var p2;
var p3;
var p4;
var p5;
var p6;

p1 = ceil(2);    //  2
p2 = ceil(2.4);  //  3
p3 = ceil(2.8);  //  3
p4 = ceil(-2.8); // -2
p5 = ceil(-2.4); // -2
p6 = ceil(-2);   // -2

derpinf
deceil 
1 rpinf delta

#FPU

derpinf(x) = x - rpinf(x)
deceil(x) = x - ceil(x)
rninf
floor 
1 Round x toward -infinity
Largest integer ≤ x

#FPU

rninf(x)
floor(x)

var p1;
var p2;
var p3;
var p4;
var p5;
var p6;
var p7;
var p8;

p1 = rninf ( 2.1); // 2
p2 = rninf ( 2.5); // 2
p3 = rninf ( 2.9); // 2
p4 = rninf ( 5.1); // 5
p5 = rninf (-2.1); // -3
p6 = rninf (-2.5); // -3
p7 = rninf (-2.9); // -3
p8 = rninf (-5.1); // -6

var p1;
var p2;
var p3;
var p4;
var p5;
var p6;

p1 = floor(2);    //  2
p2 = floor(2.4);  //  2
p3 = floor(2.8);  //  2
p4 = floor(-2.8); // -3
p5 = floor(-2.4); // -3
p6 = floor(-2);   // -2

derninf
defloor 
1 rninf delta

#FPU

derninf(x) = x - rninf(x)
defloor(x) = x - floor(x)
avg
mean 
|A|
|+|
2 Arithmetic average of two values avg(x,y)  
mean(x,y)  
x |A| y  
x |+| y  

(x + y) / 2
gavg
gmean 
|G|
|*|
2 Geometric average of two values gavg(x,y)  
gmean(x,y)  
x |G| y  
x |*| y  

(x * y)1/2
havg
hmean 
|H|
|/|
2 Harmonic average of two values havg(x,y)  
hmean(x,y)  
x |H| y  
x |/| y  

2 / (1/x + 1/y)
2 * x * y / (x + y)
chavg
chmean 
|C|
|\|
2 Contraharmonic average of two values chavg(x,y)  
chmean(x,y)  
x |C| y  
x |\| y  

(x2 + y2) / (x + y)
qavg
qmean 
|Q|
2 Quadratic average of two values qavg(x,y)  
qmean(x,y)  
x |Q| y  

((x2 + y2) / 2)1/2
heavg
hemean 
|h|
2 Heronian average of two values heavg(x,y)  
hemean(x,y)  
x |h| y  

(1/3) * (x + (x * y)1/2 + y)
ceavg
cemean 
|c|
2 Centroidal average of two values ceavg(x,y)  
cemean(x,y)  
x |c| y  

(2/3) * (x2 + x * y + y2) / (x + y)
min
?<
2 The smaller of two values min(x,y)  
x ?< y  
max
?>
2 The larger of two values max(x,y)  
x ?> y  
minmax
?<>
2:2 The smaller and the larger of two values minmax(x,y)  
x ?<> y  
(min,max)  

var u_min;
var u_max;
var x_min;
var x_max;

x2copy(u_min,u_max, 22?<>11);
x2copy(x_min,x_max, minmax(22,11));

co.minmax
4 The smaller and the larger of two values

Returns result in double variables min and max

co.minmax(*min,*max, x,y)  

var x_min;
var x_max;

co.minmax(x_min,x_max, 22,11);

maxmin
?><
2:2 The larger and the smaller of two values maxmin(x,y)  
x ?>< y  
(max,min)  

var u_min;
var u_max;
var x_min;
var x_max;

x2copy(u_max,u_min, 22?><11);
x2copy(x_max,x_min, maxmin(22,11));

co.maxmin
4 The larger and the smaller of two values

Returns result in double variables max and min

co.maxmin(*max,*min, x,y)  

var x_min;
var x_max;

co.maxmin(x_max,x_min, 22,11);

adev
2 Absolute deviation
adev(x,y)  
abs(x-y)  
nadev
2 Negative absolute deviation
nadev(x,y)  
-abs(x-y)  
nabs(x-y)  
min.adev
3 The smaller absolute deviation.
min.adev(x1,x2, a)

returns:  
min(deviationi) = min(abs(a-xi))

var aa;
var bb;
var cc;

aa = min.adev(1,9, 3); // = 2
bb = min.adev(1,9, 5); // = 4
cc = min.adev(1,9, 4); // = 3

minl.adev
3 The value of the argument with the smaller absolute deviation.
Prefer argument with a lower index
minl.adev(x1,x2, a)
deviationi = abs(a-xi)

var aa;
var bb;
var cc;

aa = minl.adev(2,8, 3); // = 2
bb = minl.adev(2,8, 7); // = 8
cc = minl.adev(2,8, 5); // = 2

minh.adev
3 The value of the argument with the smaller absolute deviation.
Prefer argument with a higher index
minh.adev(xx1,x2, a)
deviationi = abs(a-xi)

var aa;
var bb;
var cc;

aa = minh.adev(2,8, 3); // = 2
bb = minh.adev(2,8, 7); // = 8
cc = minh.adev(2,8, 5); // = 8

max.adev
3 The larger absolute deviation.
max.adev(x1,x2, a)

returns:  
max(deviationi) = max(abs(a-xi))

var aa;
var bb;
var cc;

aa = max.adev(1,9, 3); // = 6
bb = max.adev(1,9, 5); // = 4
cc = max.adev(1,9, 4); // = 5

maxl.adev
3 The value of the argument with the larger absolute deviation.
Prefer argument with a lower index
maxl.adev(x1,x2, a)
deviationi = abs(a-xi)

var aa;
var bb;
var cc;

aa = maxl.adev(2,8, 3); // = 8
bb = maxl.adev(2,8, 7); // = 2
cc = maxl.adev(2,8, 5); // = 2

maxh.adev
3 The value of the argument with the larger absolute deviation.
Prefer argument with a higher index
maxh.adev(x1,x2, a)
deviationi = abs(a-xi)

var aa;
var bb;
var cc;

aa = maxh.adev(2,8, 3); // = 8
bb = maxh.adev(2,8, 7); // = 2
cc = maxh.adev(2,8, 5); // = 8

xsigny
2 The magnitude of x and the sign of y.
The zero sign is considered positive
xsigny(x,y)  
 
xsigny(2,-1) = -2
xsigny(2, 1) =  2
xsigny(2, 0) =  2
ysignx
2 The magnitude of y and the sign of x.
The zero sign is considered positive
ysignx(x,y)  
 
ysignx(-1,2) = -2
ysignx( 1,2) =  2
ysignx( 0,2) =  2
xcosign
2 The magnitude of x and the sign of sign(x)*sign(y).
The zero sign is considered positive
xcosign(x,y)  
 
xcosign( 2,-1) = -2
xcosign( 2, 1) =  2
xcosign( 2, 0) =  2
xcosign(-2,-1) =  2
xcosign(-2, 1) = -2
xcosign(-2, 0) = -2
ycosign
2 The magnitude of y and the sign of sign(x)*sign(y).
The zero sign is considered positive
ycosign(x,y)  
 
ycosign(-1, 2) = -2
ycosign( 1, 2) =  2
ycosign( 0, 2) =  2
ycosign(-1,-2) =  2
ycosign( 1,-2) = -2
ycosign( 0,-2) = -2
clamp
3 Clamp x in range between min and max clamp(x,min,max)  
clamp(x,max,min)  
♦ max ⇐ x > max
♦ min ⇐ x < min
♦   x ⇐ otherwise

clamp( 15,1,5) = 5
clamp( 15,5,1) = 5
clamp(-15,1,5) = 1
clamp(-15,5,1) = 1
clamp(1.5,1,5) = 1.5
clamp(1.5,5,1) = 1.5
saturate
1 Clamp x in range between 0 and 1 saturate(x)  
♦ 1 ⇐ x > 1
♦ 0 ⇐ x < 0
♦ x ⇐ otherwise

saturate( 50) = 1
saturate(-50) = 0
saturate(0.5) = 0.5
lineco
4:2 Coefficients of linear function passing through the points (x1,y1) and (x2,y2)
lineco(x1,y1, x2,y2) = (a,b)
y = a*x + b

// y = 2*x
// a = 2
// b = 0
x2copy(a,b, lineco(1,2, 2,4))

// y = -x + 2
// a = -1
// b = 2
x2copy(a,b, lineco(0,2, 2,0))

// y = -2*x + 4
// a = -2
// b = 4
x2copy(a,b, lineco(0,4, 2,0))

// y = 0.0025*x - 5.12
// a = 0.0025
// b = -5.12
x2copy(a,b, lineco(0,-5.12, 4096,5.12))

co.lineco
6 Coefficients of linear function passing through the points (x1,y1) and (x2,y2)

Returns result in double variables a and b

co.lineco(*a,*b, x1,y1, x2,y2)
y = a*x + b

// y = 2*x
// a = 2
// b = 0
co.lineco(a,b, 1,2, 2,4)

// y = -x + 2
// a = -1
// b = 2
co.lineco(a,b, 0,2, 2,0)

// y = -2*x + 4
// a = -2
// b = 4
co.lineco(a,b, 0,4, 2,0)

// y = 0.0025*x - 5.12
// a = 0.0025
// b = -5.12
co.lineco(a,b, 0,-5.12, 4096,5.12)

rescale
5 Rescale x rescale(x, x1,y1, x2,y2)

returns:
y1+(x-x1)*(y2-y1)/(x2-x1)

f(0, 0,-5.12, 4096,5.12) = -5.12
f(0, 4096,5.12, 0,-5.12) = -5.12
f(-2048, 0,-5.12, 4096,5.12) = -10.24
f(-2048, 4096,5.12, 0,-5.12) = -10.24
f(4096, 0,-5.12, 4096,5.12) = 5.12
f(4096, 4096,5.12, 0,-5.12) = 5.12
f(6144, 0,-5.12, 4096,5.12) = 10.24
f(6144, 4096,5.12, 0,-5.12) = 10.24
f(2048, 0,-5.12, 4096,5.12) = 0
f(2048, 4096,5.12, 0,-5.12) = 0
f(1024, 0,-5.12, 4096,5.12) = -2.56
f(1024, 4096,5.12, 0,-5.12) = -2.56

resclip
5 Rescale x with clipping resclip(x, x1,y1, x2,y2)

returns:
♦ y(xmin) ⇐ x ≤ xmin
♦ y(xmax) ⇐ x ≥ xmax
♦ y1+(x-x1)*(y2-y1)/(x2-x1)  
  ⇐ othewise

f(0, 0,-5.12, 4096,5.12) = -5.12
f(0, 4096,5.12, 0,-5.12) = -5.12
f(-2048, 0,-5.12, 4096,5.12) = -5.12
f(-2048, 4096,5.12, 0,-5.12) = -5.12
f(4096, 0,-5.12, 4096,5.12) = 5.12
f(4096, 4096,5.12, 0,-5.12) = 5.12
f(6144, 0,-5.12, 4096,5.12) = 5.12
f(6144, 4096,5.12, 0,-5.12) = 5.12
f(2048, 0,-5.12, 4096,5.12) = 0
f(2048, 4096,5.12, 0,-5.12) = 0
f(1024, 0,-5.12, 4096,5.12) = -2.56
f(1024, 4096,5.12, 0,-5.12) = -2.56

delta 2 Delta function delta(x,a) =  
♦ 1 ⇐ x = a
♦ 0 ⇐ x ≠ a
deltab 3 Deltab function deltab(x,a,b)  
♦ 1 ⇐ (x ≥ a) and (x ≤ b)
♦ 0 ⇐ otherwise
teta 2 Teta function teta(x,a)  
♦ 1 ⇐ x > a
♦ 0 ⇐ x ≤ a
tetae 2 Tetae function tetae(x,a)  
♦ 1 ⇐ x ≥ a
♦ 0 ⇐ x < a
cycle 3 Cycle function cycle(x,a,P)  
period = P

returns:
♦ P + (x-a) mod P ⇐ x-a < 0
♦     (x-a) mod P ⇐ x-a ≥ 0
♦               0 ⇐ P ≤ 0
gcd
hcf
2 Greatest common divisor
Highest common factor
gcd(12,21) = 3
gcd(24,54) = 6
gcd(51,17) = 17

int p1;
int p2;
int p3;

p1 = 24;
p2 = 54;
p3 = gcd(p1,p2); // = 6

lcm 2 Least common multiple
lcm(16,20) = 80
lcm(21,49) = 147
lcm(36,14) = 252

int p1;
int p2;
int p3;

p1 = 36;
p2 = 14;
p3 = lcm(p1,p2); // = 252

 
Exponential functions
exp
 
1 Exponential function
ex

#FPU

exp(x)  
exp2
pow2x 
 
1 2 raised to a power of x
2x

#FPU

exp2(x)  
pow2x(x)   
exp10
pow10x 
 
1 10 raised to a power of x
10x

#FPU

exp10(x)  
pow10x(x)   
ln
loge 
 
1 Natural logarithm
logex

#FPU

ln(x)  
loge(x)   
lb
log2 
 
1 Base-2 logarithm
log2x

#FPU

lb(x)  
log2(x)   
lg
log10 
 
1 Base-10 logarithm
log10x

#FPU

lg(x)  
log10(x)   
logn
 
2 Base-n logarithm
lognx

#FPU

logn(n,x)  
lognr
 
2 Reverse base-n logarithm
lognx

#FPU

lognr(x,n)  
logn(n,x)   
 
Power functions
pow
power 
 
^
**
2 Power function
xy

#FPU

pow(x,y)  
x ^ y  
x ** y  

int i1 = 2;
var d1 = 2.6;
var v1;
var v2;
var v3;
var v4;

v1 = pow(10,i1:double);
v2 = pow(10,#2:double);
v3 = pow(10,d1);
v4 = pow(10,2.6);

apow
apower 
 
2 Power function
|x|y

#FPU

apow(x,y)  
pow(abs(x),y)   
powr
powerr 
 
~^
~**
2 Reverse power function
yx

#FPU

powr(x,y)  
x ~^ y  
x ~** y  
apowr
apowerr 
 
2 Reverse power function
|y|x

#FPU

apowr(x,y)  
powr(x,abs(y))   
ipow
ipower 
 
2 Integer power function
xn
double ipow (double x, integer n)  
ipow(x,n)  

int i1 = 2;
var d1 = 2.6;
var v1;
var v2;
var v3;
var v4;

v1 = ipow(10,i1);
v2 = ipow(10,#2);
v3 = ipow(10,d1:int);
v4 = ipow(10,2.6:int);

sqr
pow2 
 
1 Square power
x2
sqr(x)  
pow2(x)   
cube
pow3 
 
1 Cube power
x3
cube(x)  
pow3(x)   
pow4
 
1 Power-4 function
x4
pow4(x)  
root
 
*/ 2 Root function
x1/y

#FPU

root(x,y)  
x */ y   
rootr
 
~*/ 2 Reverse root function
y1/x

#FPU

rootr(x,y)  
x ~*/ y   
sqrt
root2 
 
1 Square root
Root-2 function
x1/2
sqrt(x)  
root2(x)   
cbrt
root3 
 
1 Cubic root
Root-3 function
x1/3

#FPU

cbrt(x)  
root3(x)   
root4
 
1 Root-4 function
x1/4
root4(x)  
hypot
hyp 
 
2
3
Hypotenuse (pythagoras) 
(x2 + y2)1/2
(x2 + y2 + z2)1/2
hypot(x,y[,z])  
hyp(x,y[,z])   

var aa=2, bb=8, cc=16;
var up2, up3;

up2 = hypot(aa,bb);    // 8.2462112512353210996428197119482
up3 = hypot(aa,bb,cc); // 18

hypot3
hyp3 
 
3 (x2 + y2 + z2)1/2
hypot3(x,y,z)  
hyp3(x,y,z)   

var aa=2, bb=8, cc=16;
var up3;

up3 = hypot3(aa,bb,cc); // 18

 
Trigonometric functions
sin 1 Sine
|x| < 263

#FPU

cos 1 Cosine
|x| < 263

#FPU

sec 1 Secant
|x| < 263

#FPU

1/cos(x)
csc
cosec 
1 Cosecant
|x| < 263

#FPU

1/sin(x)
tg
tan 
1 Tangent
|x| < 263

#FPU

ctg
cot 
cotan 
1 Cotangent
|x| < 263

#FPU

sincos 1:2 Sine and cosine
|x| < 263

#FPU

sincos(x)  
(sin(x),cos(x))  

var cos1, cos2;
var sin1, sin2;

cos1 = cos(x);
sin1 = sin(x);
x2copy (sin2,cos2, sincos(x));

co.sincos 3 Sine and cosine
|x| < 263

Returns result in double variables sin and cos

#FPU

co.sincos(*sin,*cos, x)  

var cos1, cos2;
var sin1, sin2;

cos1 = cos(x);
sin1 = sin(x);
co.sincos (sin2,cos2, x);

cossin 1:2 Cosine and sine
|x| < 263

#FPU

cossin(x)  
(cos(x),sin(x))  

var cos1, cos2;
var sin1, sin2;

cos1 = cos(x);
sin1 = sin(x);
x2copy (cos2,sin2, cossin(x));

co.cossin 3 Cosine and sine
|x| < 263

Returns result in double variables cos and sin

#FPU

co.cossin(*cos,*sin, x)  

var cos1, cos2;
var sin1, sin2;

cos1 = cos(x);
sin1 = sin(x);
co.cossin (cos2,sin2, x);

versin
vers 
1 Versed sine
|x| < 263

#FPU

1 - cos(x)
vercos
verc 
1 Versed cosine
|x| < 263

#FPU

1 + cos(x)
coversin
covers 
cvs 
1 Coversed sine
|x| < 263

#FPU

1 - sin(x)
covercos
coverc 
cvc 
1 Coversed cosine
|x| < 263

#FPU

1 + sin(x)
haversin
havers 
hvs 
1 Haversed sine
|x| < 263

#FPU

(1 - cos(x))/2
havercos
haverc 
hvc 
1 Haversed cosine
|x| < 263

#FPU

(1 + cos(x))/2
hacoversin
hacovers 
hcs 
1 Hacoversed sine
|x| < 263

#FPU

(1 - sin(x))/2
hacovercos
hacoverc 
hcc 
1 Hacoversed cosine
|x| < 263

#FPU

(1 + sin(x))/2
exsec
1 Exsecant
|x| < 263

#FPU

sec(x) - 1 = 1/cos(x) - 1
excsc
excosec 
1 Excosecant
|x| < 263

#FPU

csc(x) - 1 = 1/sin(x) - 1
asin
arcsin 
1 Inverse sine

#FPU

acos
arccos 
1 Inverse cosine

#FPU

asec
arcsec 
1 Inverse secant

#FPU

acsc
acosec 
arccsc 
arccosec 
1 Inverse cosecant

#FPU

atan
arctg 
arctan 
1 Inverse tangent

#FPU

atan2
arctg2 
arctan2 
2 Inverse tangent of y/x

#FPU

atan2(y,x)  
arctg2(y,x)   
arctan2(y,x)   
atan2r
arctg2r 
arctan2r 
2 Inverse tangent of y/x

#FPU

atan2r(x,y)  
arctg2r(x,y)   
arctan2r(x,y)   
acot
acotan 
arcctg 
arccot 
arccotan 
1 Inverse cotangent

#FPU

 
Hyperbolic functions
sh
sinh 
1 Hyperbolic sine

#FPU

sh(x)  
sinh(x)   
(ex - e-x)/2   
ch
cosh 
1 Hyperbolic cosine

#FPU

ch(x)  
cosh(x)   
(ex + e-x)/2   
sch
sech 
1 Hyperbolic secant

#FPU

sch(x)  
sech(x)   
1/ch(x)   
csh
csch 
cosech 
1 Hyperbolic cosecant

#FPU

csh(x)  
csch(x)   
cosech(x)   
1/sh(x)   
th
tanh 
1 Hyperbolic tangent

#FPU

cth
coth 
cotanh 
1 Hyperbolic cotangent

#FPU

shch
1:2 Hyperbolic sine and cosine

#FPU

shch(x)  
(sh(x),ch(x))  

var ch1, ch2;
var sh1, sh2;

ch1 := ch(x);
sh1 := sh(x);
x2copy(sh2,ch2, shch(x));

co.shch
3 Hyperbolic sine and cosine

Returns result in double variables sh and ch

#FPU

co.shch(*sh,*ch, x)  

var ch1, ch2;
var sh1, sh2;

ch1 := ch(x);
sh1 := sh(x);
co.shch(sh2,ch2, x);

chsh
1:2 Hyperbolic cosine and sine

#FPU

chsh(x)  
(ch(x),sh(x))  

var ch1, ch2;
var sh1, sh2;

ch1 := ch(x);
sh1 := sh(x);
x2copy(ch2,sh2, chsh(x));

co.chsh
3 Hyperbolic cosine and sine

Returns result in double variables ch and sh

#FPU

co.chsh(*ch,*sh, x)  

var ch1, ch2;
var sh1, sh2;

ch1 := ch(x);
sh1 := sh(x);
co.chsh(ch2,sh2, x);

arsh
asinh 
1 Inverse hyperbolic sine

#FPU

arch
acosh 
1 Inverse hyperbolic cosine

#FPU

arsch
asech 
1 Inverse hyperbolic secant

#FPU

arcsh
acsch 
acosech 
1 Inverse hyperbolic cosecant

#FPU

arth
atanh 
1 Inverse hyperbolic tangent

#FPU

arcth
acoth 
acotanh 
1 Inverse hyperbolic cotangent

#FPU

 
Complex number functions
z = (r,θ) = r • ei•θ    
z = (a,b) = a + i•b    
z = (c,d) = c + i•d    
z = (x,y) = x + i•y    
ccovalue
2:2 The value of the complex variable it had at compile time
ccovalue(z)    
ccovalue(z.re, z.im)    

complex z0=11,22;
complex z1, z2;

cmove(z0, 33,44);
cmove(z1, z0);
cmove(z2, ccovalue(z0));

crestore
2:2 Copy covalue to the variable
Return complex
crestore(z)    
crestore(z.re, z.im)    

complex z0=11,22;
complex z1, z2;

cmove(z0, 33,44);
cmove(z1, z0);
cmove(z2, crestore(z0));

creset
2:0 Copy covalue to the variable
Return void
creset(z)    
creset(z.re, z.im)    

complex z0=11,22;
complex z1, z2;

cmove(z0, 33,44);
cmove(z1, z0);
creset(z0);
cmove(z2, z0);

ccopy
x= 
x:=
4:2 Copy complex to complex
Return complex
ccopy(*a,*b, c,d) = (a',b')    
a, b - double variables    
a := c    
b := d    
a' = c    
b' = d    

var z1.re, z1.im;
var z2.re=3, z2.im=4;

ccopy(z1.re,z1.im, z2.re,z2.im);

cvar z0 = 22,88, z1, z2, z3;

z1 = 1,2;
z2 = z1;
z3 := z0;

cmove
4:0 Copy complex to complex
Return void
cmove(*a,*b, c,d) = ∅    
a, b - double variables    
a := c    
b := d    

var z1.re, z1.im;
var z2.re=3, z2.im=4;

cmove(z1.re,z1.im, z2.re,z2.im);

cpcopy
3:2 Copy complex to complex
Indirect
Return complex
cpcopy(p, a,b) = (a,b)    
p - integer variable or pointer    
p = address of T_complex structure    
p.re := a    
p.im := b    

var z.re=333, z.im=444;
var u.re, u.im;
var m.re, m.im;
var n.re, n.im;

// coa - pointer constant
// coa = address of T_complex structure
cpcopy(coa, z.re,z.im);
ccopy(u.re,u.im, coa:pcomplex);
ccopy(m.re,m.im, **coa);
ccopy(n.re,n.im, coa^^);

cpmove
3:0 Copy complex to complex
Indirect
Return void
cpmove(p, a,b) = ∅    
p - integer variable or pointer    
p = address of T_complex structure    
p.re := a    
p.im := b    

var z.re=333, z.im=444;
var u.re, u.im;
var m.re, m.im;
var n.re, n.im;

// coa - pointer constant
// coa = address of T_complex structure
cpmove(coa, z.re,z.im);
ccopy(u.re,u.im, coa:pcomplex);
ccopy(m.re,m.im, **coa);
ccopy(n.re,n.im, coa^^);

cxcopy
3:2 Copy x to complex.re and im
Return complex
cxcopy(*a,*b, x) = (a',b')    
a, b - double variables    
a := x    
b := x    
a' = x    
b' = x    

var z1.re, z1.im;
var vv=8;

cxcopy(z1.re,z1.im, vv);

cxmove
3:0 Copy x to complex.re and im
Return void
cxmove(*a,*b, x) = ∅    
a, b - double variables    
a := x    
b := x    

var z1.re, z1.im;
var vv=8;

cxmove(z1.re,z1.im, vv);

czcopy
2:2 Copy 0 to complex.re and im
Return complex
czcopy(*a,*b) = (a',b')    
a, b - double variables    
a := 0    
b := 0    
a' = 0    
b' = 0    

var z1.re=3, z1.im=4;

czcopy(z1.re,z1.im);

czmove
2:0 Copy 0 to complex.re and im
Return void
czmove(*a,*b) = ∅    
a, b - double variables    
a := 0    
b := 0    

var z1.re=3, z1.im=4;

czmove(z1.re,z1.im);

crrcopy
4:2 Copy complex.re2 to complex.re1
Return complex
crrcopy(*a,*b, c,d) = (a',b')    
a, b - double variables    
a := c    
a' = c    
b' = b    

var z1.re, z1.im;
var z2.re=3, z2.im=4;

crrcopy(z1.re,z1.im, z2.re,z2.im);

crrmove
4:0 Copy complex.re2 to complex.re1
Return void
crrmove(*a,*b, c,d) = ∅    
a, b - double variables    
a := c    

var z1.re, z1.im;
var z2.re=3, z2.im=4;

crrmove(z1.re,z1.im, z2.re,z2.im);

cxrcopy
3:2 Copy x to complex.re
Return complex
cxrcopy(*a,*b, x) = (a',b')    
a, b - double variables    
a := x    
a' = x    
b' = b    

var z1.re, z1.im;
var vv=8;

cxrcopy(z1.re,z1.im, vv);

cxrmove
3:0 Copy x to complex.re
Return void
cxrmove(*a,*b, x) = ∅    
a, b - double variables    
a := x    

var z1.re, z1.im;
var vv=8;

cxrmove(z1.re,z1.im, vv);

czrcopy
2:2 Copy 0 to complex.re
Return complex
czrcopy(*a,*b) = (a',b')    
a, b - double variables    
a := 0    
a' = 0    
b' = b    

var z1.re=3, z1.im=4;

czrcopy(z1.re,z1.im);

czrmove
2:0 Copy 0 to complex.re
Return void
czrmove(*a,*b) = ∅    
a, b - double variables    
a := 0    

var z1.re=3, z1.im=4;

czrmove(z1.re,z1.im);

ciicopy
4:2 Copy complex.im2 to complex.im1
Return complex
ciicopy(*a,*b, c,d) = (a',b')    
a, b - double variables    
b := d    
a' = a    
b' = d    

var z1.re, z1.im;
var z2.re=3, z2.im=4;

ciicopy(z1.re,z1.im, z2.re,z2.im);

ciimove
4:0 Copy complex.im2 to complex.im1
Return void
ciimove(*a,*b, c,d) = ∅    
a, b - double variables    
b := d    

var z1.re, z1.im;
var z2.re=3, z2.im=4;

ciimove(z1.re,z1.im, z2.re,z2.im);

cxicopy
3:2 Copy x to complex.im
Return complex
cxicopy(*a,*b, x) = (a',b')    
a, b - double variables    
b := x    
a' = a    
b' = x    

var z1.re, z1.im;
var vv=8;

cxicopy(z1.re,z1.im, vv);

cximove
3:0 Copy x to complex.im
Return void
cximove(*a,*b, x) = ∅    
a, b - double variables    
b := x    

var z1.re, z1.im;
var vv=8;

cximove(z1.re,z1.im, vv);

czicopy
2:2 Copy 0 to complex.im
Return complex
czicopy(*a,*b) = (a',b')    
a, b - double variables    
b := 0    
a' = a    
b' = 0    

var z1.re=3, z1.im=4;

czicopy(z1.re,z1.im);

czimove
2:0 Copy 0 to complex.im
Return void
czimove(*a,*b) = ∅    
a, b - double variables    
b := 0    

var z1.re=3, z1.im=4;

czimove(z1.re,z1.im);

cswap
:=:
4:2 Swap
Return complex
cswap(*a,*b, *c,*d) = (a',b')    
a, b - double variables    
c, d - double variables    
a :=: c    
b :=: d    
a' = c    
b' = d    

var z1.re=1, z1.im=2;
var z2.re=3, z2.im=4;

cswap(z1.re,z1.im, z2.re,z2.im);

cvar z1 = 22,88;
cvar z2 = 44,99;

z1 :=: z2;

cswop
4:0 Swop
Return void
cswop(*a,*b, *c,*d) = ∅    
a, b - double variables    
c, d - double variables    
a :=: c    
b :=: d    

var z1.re=1, z1.im=2;
var z2.re=3, z2.im=4;

cswop(z1.re,z1.im, z2.re,z2.im);

cpolar
2:2 Complex polar from plane
cpolar(a,b) = (r,θ)    
r = (a2 + b2)1/2    
θ = atan(b/a)    
-π < θ ≤ π    

var a0 = 3;
var b0 = 4;
var r0;
var t0;

cmove(r0,t0, cpolar(a0,b0));

cplane
2:2 Complex plane from polar
cplane(r,θ) = (a,b)    
a = r•cos(θ)    
b = r•sin(θ)    

var r0 = 5;
var t0 = 0.927295218001612;
var a0;
var b0;

cmove(a0,b0, cplane(r0,t0));

creal
 
2 Real part
creal(a,b) = a    
cimag
 
2 Imaginary part
cimag(a,b) = b    
creze
 
2:2 Real part and zero
creze(a,b) = (a,0)    
czeim
 
2:2 Zero and imaginary part
czeim(a,b) = (0,b)    
czero
 
2:2 Zero
czero(a,b) = (0,0)    
cvoid
 
2:0 Void
cvoid(a,b) = ∅    
crere
 
4:2 Re1 + i•Re2
crere(a,b,c,d) = (a,c)    
creim
 
4:2 Re1 + i•Im2
creim(a,b,c,d) = (a,d)    
cimre
 
4:2 Im1 + i•Re2
cimre(a,b,c,d) = (b,c)    
cimim
 
4:2 Im1 + i•Im2
cimim(a,b,c,d) = (b,d)    
cnorm
 
2 Norm value
cnorm(a,b) = a2 + b2    
cnorms
 
4:2 Norm values
cnorms(a,b,c,d) = (n1,n2)    
n1 = a2 + b2    
n2 = c2 + d2    
cabs
 
2 Absolute value
cabs(a,b) = (a2 + b2)1/2    
cabss
 
4:2 Absolute values
cabss(a,b,c,d) = (r1,r2)    
r1 = (a2 + b2)1/2    
r2 = (c2 + d2)1/2    
carg
2 Argument
carg(a,b) = atan(b/a)    
-π < carg(z) ≤ π    
cargs
4:2 Arguments
cargs(a,b,c,d) = (θ12)    
θ1 = atan(b/a)    
θ2 = atan(d/c)    
-π < θiπ    
cconj
2:2 Conjugate
cconj(a,b) = (a,-b)    

var a0 = 3;
var b0 = 4;
var a2;
var b2;

cmove(a2,b2, cconj(a0,b0));

crconj
2:2 Reversed conjugate
crconj(a,b) = (-a,b)    

var a0 = 3;
var b0 = 4;
var a2;
var b2;

cmove(a2,b2, crconj(a0,b0));

cchs
2:2 Change sign
cchs(a,b) = (-a,-b)    

var a0 = 3;
var b0 = 4;
var a2;
var b2;

cmove(a2,b2, cchs(a0,b0));

cxch
2:2 Exchange
cxch(a,b) = (b,a)    

var a0 = 3;
var b0 = 4;
var a2;
var b2;

cmove(a2,b2, cxch(a0,b0));

ccis
1:2 cos + i•sin
ccis(x) = (a',b')    
a' = cos(x)    
b' = sin(x)    

var a0 = 3;
var a2;
var b2;

cmove(a2,b2, ccis(a0));

csign
2:2 Normalized direction
z/|z|
csign(a,b) = (a',b')    
a' = a/r    
b' = b/r    
r  = (a2 + b2)1/2    

var a1 = 3, b1 = 4;
var a2, b2;

cmove(a2,b2, csign(a1,b1));

cprojd
2:3 Projection on the Riemann sphere
ξ2 + η2 + (ζ-1/2)2 = 1/4
Diameter = 1
cprojd(a,b) = (ξ,η,ζ)    

var a0 = 3;
var b0 = 4;
var xi;
var et;
var zt;
var dd;

x3copy(xi,et,zt, cprojd(a0,b0));
dd = 2*sqrt(xi^2 + et^2 + (zt - 1/2)^2);

cprojdx
3:3 Projection on the Riemann sphere
ξ2 + η2 + (ζ-D/2)2 = (D/2)2
Diameter = D
cprojdx(a,b,D) = (ξ,η,ζ)    

var a0 = 3;
var b0 = 4;
var d0 = 1;
var xi;
var et;
var zt;
var dd;

x3copy(xi,et,zt, cprojdx(a0,b0,d0));
dd = 2*sqrt(xi^2 + et^2 + (zt - d0/2)^2);

cprojr
2:3 Projection on the Riemann sphere
ξ2 + η2 + ζ2 = 1
Radius = 1
cprojr(a,b) = (ξ,η,ζ)    

var a0 = 3;
var b0 = 4;
var xi;
var et;
var zt;
var rr;

x3copy(xi,et,zt, cprojr(a0,b0));
rr = sqrt(xi^2 + et^2 + zt^2);

cprojrx
3:3 Projection on the Riemann sphere
ξ2 + η2 + ζ2 = R2
Radius = R
cprojrx(a,b,R) = (ξ,η,ζ)    

var a0 = 3;
var b0 = 4;
var r0 = 1;
var xi;
var et;
var zt;
var rr;

x3copy(xi,et,zt, cprojrx(a0,b0,r0));
rr = sqrt(xi^2 + et^2 + zt^2);

caprojd
3:2 Complex plane from projection on the Riemann sphere
ξ2 + η2 + (ζ-1/2)2 = 1/4
Diameter = 1
caprojd(ξ,η,ζ) = (a,b)    

var a0 = 3, x0;
var b0 = 4, y0;
var xi;
var et;
var zt;

x3copy(xi,et,zt, cprojd(a0,b0));
x2copy(x0,y0, caprojd(xi,et,zt));

caprojdx
4:2 Complex plane from projection on the Riemann sphere
ξ2 + η2 + (ζ-D/2)2 = (D/2)2
Diameter = D
caprojdx(ξ,η,ζ,D) = (a,b)    

var a0 = 3, x0;
var b0 = 4, y0;
var xi;
var et;
var zt;

x3copy(xi,et,zt, cprojdx(a0,b0,1));
x2copy(x0,y0, caprojdx(xi,et,zt,1));

caprojr
3:2 Complex plane from projection on the Riemann sphere
ξ2 + η2 + ζ2 = 1
Radius = 1
caprojr(ξ,η,ζ) = (a,b)    

var a0 = 3, x0;
var b0 = 4, y0;
var xi;
var et;
var zt;

x3copy(xi,et,zt, cprojr(a0,b0));
x2copy(x0,y0, caprojr(xi,et,zt));

caprojrx
4:2 Complex plane from projection on the Riemann sphere
ξ2 + η2 + ζ2 = R2
Radius = R
caprojrx(ξ,η,ζ,R) = (a,b)    

var a0 = 3, x0;
var b0 = 4, y0;
var xi;
var et;
var zt;

x3copy(xi,et,zt, cprojrx(a0,b0,1));
x2copy(x0,y0, caprojrx(xi,et,zt,1));

 
Complex number boolean functions
cequ
4:i Equal
cequ(a,b,c,d)    
♦ 1 ⇐ (a = c) and (b = d)    
♦ 0 ⇐ othewise    

var x0 = 3, y0 = 4;
var x1 = 3, y1 = 4;
var x2 = 3, y2 = 3;
int iz_1, iz_2;

iz_1 = cequ(x0,y0,x1,y1);
iz_2 = cequ(x0,y0,x2,y2);

cnequ
4:i Not equal
cnequ(a,b,c,d)    
♦ 1 ⇐ (a ≠ c) or (b ≠ d)    
♦ 0 ⇐ othewise    

var x0 = 3, y0 = 4;
var x1 = 3, y1 = 4;
var x2 = 3, y2 = 3;
int iz_1, iz_2;

iz_1 = cnequ(x0,y0,x1,y1);
iz_2 = cnequ(x0,y0,x2,y2);

creal.equ
4:i Real equal
creal.equ(a,b,c,d)    
♦ 1 ⇐ a = c    
♦ 0 ⇐ othewise    

var x0 = 3, y0 = 4;
var x1 = 3, y1 = 4;
var x2 = 2, y2 = 4;
int iz_1, iz_2;

iz_1 = creal.equ(x0,y0,x1,y1);
iz_2 = creal.equ(x0,y0,x2,y2);

creal.nequ
4:i Real not equal
creal.nequ(a,b,c,d)    
♦ 1 ⇐ a ≠ c    
♦ 0 ⇐ othewise    

var x0 = 3, y0 = 4;
var x1 = 3, y1 = 4;
var x2 = 2, y2 = 4;
int iz_1, iz_2;

iz_1 = creal.nequ(x0,y0,x1,y1);
iz_2 = creal.nequ(x0,y0,x2,y2);

cimag.equ
4:i Imaginary equal
cimag.equ(a,b,c,d)    
♦ 1 ⇐ b = d    
♦ 0 ⇐ othewise    

var x0 = 3, y0 = 4;
var x1 = 3, y1 = 4;
var x2 = 3, y2 = 2;
int iz_1, iz_2;

iz_1 = cimag.equ(x0,y0,x1,y1);
iz_2 = cimag.equ(x0,y0,x2,y2);

cimag.nequ
4:i Imaginary not equal
cimag.nequ(a,b,c,d)    
♦ 1 ⇐ b ≠ d    
♦ 0 ⇐ othewise    

var x0 = 3, y0 = 4;
var x1 = 3, y1 = 4;
var x2 = 3, y2 = 2;
int iz_1, iz_2;

iz_1 = cimag.nequ(x0,y0,x1,y1);
iz_2 = cimag.nequ(x0,y0,x2,y2);

cabs.equ
4:i Abs equal
cabs.equ(a,b,c,d)    
♦ 1 ⇐ abs1 = abs2    
♦ 0 ⇐ othewise    
abs1 = (a2 + b2)1/2    
abs2 = (c2 + d2)1/2    

var x1 = 3, y1 = 4;
var x2 = 3, y2 = -4;
var x3 = 3, y3 = 4;
var x4 = 3, y4 = 3;
int iz_1, iz_2;

iz_1 = cabs.equ(x1,y1,x2,y2);
iz_2 = cabs.equ(x3,y3,x4,y4);

cabs.nequ
4:i Abs not equal
cabs.nequ(a,b,c,d)    
♦ 1 ⇐ abs1 ≠ abs2    
♦ 0 ⇐ othewise    
abs1 = (a2 + b2)1/2    
abs2 = (c2 + d2)1/2    

var x1 = 3, y1 = 4;
var x2 = 3, y2 = -4;
var x3 = 3, y3 = 4;
var x4 = 3, y4 = 3;
int iz_1, iz_2;

iz_1 = cabs.nequ(x1,y1,x2,y2);
iz_2 = cabs.nequ(x3,y3,x4,y4);

carg.equ
4:i Arg equal
carg.equ(a,b,c,d)    
♦ 1 ⇐ arg1 = arg2    
♦ 0 ⇐ othewise    
arg1 = atan(b/a)    
arg2 = atan(d/c)    

var x1 = 3, y1 = 4;
var x2 = 6, y2 = 8;
var x3 = 3, y3 = 4;
var x4 = 3, y4 = 3;
int iz_1, iz_2;

iz_1 = carg.equ(x1,y1,x2,y2);
iz_2 = carg.equ(x3,y3,x4,y4);

carg.nequ
4:i Arg not equal
carg.nequ(a,b,c,d)    
♦ 1 ⇐ arg1 ≠ arg2    
♦ 0 ⇐ othewise    
arg1 = atan(b/a)    
arg2 = atan(d/c)    

var x1 = 3, y1 = 4;
var x2 = 6, y2 = 8;
var x3 = 3, y3 = 4;
var x4 = 3, y4 = 3;
int iz_1, iz_2;

iz_1 = carg.nequ(x1,y1,x2,y2);
iz_2 = carg.nequ(x3,y3,x4,y4);

cis.zero
2:i Is zero
cis.zero(a,b)    
♦ 1 ⇐ (a = 0) and (b = 0)    
♦ 0 ⇐ othewise    

var a0 = 3, b0 = 4;
var c0 = 0, d0 = 0;
int iz_ab, iz_cd;

iz_ab = cis.zero(a0,b0);
iz_cd = cis.zero(c0,d0);

cisn.zero
2:i Is not zero
cisn.zero(a,b)    
♦ 1 ⇐ (a ≠ 0) or (b ≠ 0)    
♦ 0 ⇐ othewise    

var a0 = 3, b0 = 4;
var c0 = 0, d0 = 0;
int iz_ab, iz_cd;

iz_ab = cisn.zero(a0,b0);
iz_cd = cisn.zero(c0,d0);

cis.real
2:i Is purely real
cis.real(a,b)    
♦ 1 ⇐ b = 0    
♦ 0 ⇐ othewise    

var a0 = 3, b0 = 4;
var c0 = 3, d0 = 0;
int iz_ab, iz_cd;

iz_ab = cis.real(a0,b0);
iz_cd = cis.real(c0,d0);

cisn.real
2:i Is not purely real
cisn.real(a,b)    
♦ 1 ⇐ b ≠ 0    
♦ 0 ⇐ othewise    

var a0 = 3, b0 = 4;
var c0 = 3, d0 = 0;
int iz_ab, iz_cd;

iz_ab = cisn.real(a0,b0);
iz_cd = cisn.real(c0,d0);

cis.imag
2:i Is purely imaginary
cis.imag(a,b)    
♦ 1 ⇐ (a = 0) and (b ≠ 0)    
♦ 0 ⇐ othewise    

var a0 = 3, b0 = 4;
var c0 = 0, d0 = 4;
int iz_ab, iz_cd;

iz_ab = cis.imag(a0,b0);
iz_cd = cis.imag(c0,d0);

cisn.imag
2:i Is not purely imaginary
cisn.imag(a,b)    
♦ 1 ⇐ (a ≠ 0) or (b = 0)    
♦ 0 ⇐ othewise    

var a0 = 3, b0 = 4;
var c0 = 0, d0 = 4;
int iz_ab, iz_cd;

iz_ab = cisn.imag(a0,b0);
iz_cd = cisn.imag(c0,d0);

 
Complex number arithmetic functions
cadd
+ 4:2 Addition
z1+z2
cadd(a,b,c,d) = (a',b')    
a' = a + c    
b' = b + d    

var a0 = 3;
var b0 = 4;
var c0 = 6;
var d0 = 9;
var x0;
var y0;

cmove(x0,y0, cadd(a0,b0,c0,d0));

complex z0, u0;
complex z1=1.2,3.4, z2=5.6,7.8;

$+ complex
z0 = z1 + z2;
$- complex

cmove(u0, cadd(z1,z2));

cradd
3:2 Addition of real number
z+c
cradd(a,b,c) = (a',b')    
a' = a + c    
b' = b    

var a0 = 3;
var b0 = 4;
var c0 = 6;
var x0;
var y0;

cmove(x0,y0, cradd(a0,b0,c0));

ciadd
3:2 Addition of imaginary number
z+i•c
ciadd(a,b,c) = (a',b')    
a' = a    
b' = b + c    

var a0 = 3;
var b0 = 4;
var c0 = 6;
var x0;
var y0;

cmove(x0,y0, ciadd(a0,b0,c0));

cinc
2:2 Addition of 1
z+1
cinc(a,b) = (a',b')    
a' = a + 1    
b' = b    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, cinc(a0,b0));

caddi
cinci 
2:2 Addition of i
z+i
caddi(a,b)    
cinci = (a',b')    
a' = a    
b' = b + 1    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, caddi(a0,b0));

csub
- 4:2 Subtraction
z1-z2
csub(a,b,c,d) = (a',b')    
a' = a - c    
b' = b - d    

var a0 = 3;
var b0 = 4;
var c0 = 6;
var d0 = 9;
var x0;
var y0;

cmove(x0,y0, csub(a0,b0,c0,d0));

complex z0, u0;
complex z1=1.2,3.4, z2=5.6,7.8;

$+ complex
z0 = z1 - z2;
$- complex

cmove(u0, csub(z1,z2));

crsub
3:2 Subtraction of real number
z-c
crsub(a,b,c) = (a',b')    
a' = a - c    
b' = b    

var a0 = 3;
var b0 = 4;
var c0 = 6;
var x0;
var y0;

cmove(x0,y0, crsub(a0,b0,c0));

cisub
3:2 Subtraction of imaginary number
z-i•c
cisub(a,b,c) = (a',b')    
a' = a    
b' = b - c    

var a0 = 3;
var b0 = 4;
var c0 = 6;
var x0;
var y0;

cmove(x0,y0, cisub(a0,b0,c0));

cdec
2:2 Subtraction of 1
z-1
cdec(a,b) = (a',b')    
a' = a - 1    
b' = b    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, cdec(a0,b0));

csubi
cdeci 
2:2 Subtraction of i
z-i
csubi(a,b)    
cdeci = (a',b')    
a' = a    
b' = b - 1    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, csubi(a0,b0));

csubr
~- 4:2 Reverse subtraction
z2-z1
csubr(a,b,c,d) = (a',b')    
a' = c - a    
b' = d - b    

var a0 = 3;
var b0 = 4;
var c0 = 6;
var d0 = 9;
var x0;
var y0;

cmove(x0,y0, csubr(a0,b0,c0,d0));

complex z0, u0;
complex z1=1.2,3.4, z2=5.6,7.8;

$+ complex
z0 = z1 ~- z2;
$- complex

cmove(u0, csubr(z1,z2));

crsubr
3:2 Reverse subtraction of real number
c-z
crsubr(a,b,c) = (a',b')    
a' = c - a    
b' = -b    

var a0 = 3;
var b0 = 4;
var c0 = 6;
var x0;
var y0;

cmove(x0,y0, crsubr(a0,b0,c0));

cisubr
3:2 Reverse subtraction of imaginary number
i•c-z
cisubr(a,b,c) = (a',b')    
a' = -a    
b' = c - b    

var a0 = 3;
var b0 = 4;
var c0 = 6;
var x0;
var y0;

cmove(x0,y0, cisubr(a0,b0,c0));

cdecr
2:2 Reverse subtraction of 1
1-z
cdecr(a,b) = (a',b')    
a' = 1 - a    
b' = -b    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, cdecr(a0,b0));

csubri
cdecri 
2:2 Reverse subtraction of i
i-z
csubri(a,b)    
cdecri = (a',b')    
a' = -a    
b' = 1 - b    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, csubri(a0,b0));

cmul
* 4:2 Multiplication
z1•z2
cmul(a,b,c,d) = (a',b')    
a' = a•c - b•d    
b' = a•d + b•c    

var a0 = 3;
var b0 = 4;
var c0 = 6;
var d0 = 9;
var x0;
var y0;

cmove(x0,y0, cmul(a0,b0,c0,d0));

complex z0, u0;
complex z1=1.2,3.4, z2=5.6,7.8;

$+ complex
z0 = z1 * z2;
$- complex

cmove(u0, cmul(z1,z2));

crmul
3:2 Multiplication by real number
z•c
crmul(a,b,c) = (a',b')    
a' = a•c    
b' = b•c    

var a0 = 3;
var b0 = 4;
var c0 = 6;
var x0;
var y0;

cmove(x0,y0, crmul(a0,b0,c0));

cimul
3:2 Multiplication by imaginary number
z•i•c
cimul(a,b,c) = (a',b')    
a' = -b•c    
b' = a•c    

var a0 = 3;
var b0 = 4;
var c0 = 6;
var x0;
var y0;

cmove(x0,y0, cimul(a0,b0,c0));

cmuli
2:2 Multiplication by i
z•i
cmul(a,b) = (a',b')    
a' = -b    
b' = a    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, cmuli(a0,b0));

cdiv
/ 4:2 Division
z1/z2
cdiv(a,b,c,d) = (a',b')    
a' = (a•c + b•d)/n    
b' = (b•c - a•d)/n    
n  = c2 + d2    

var a0 = 3;
var b0 = 4;
var c0 = 6;
var d0 = 9;
var x0;
var y0;

cmove(x0,y0, cdiv(a0,b0,c0,d0));

complex z0, u0;
complex z1=1.2,3.4, z2=5.6,7.8;

$+ complex
z0 = z1 / z2;
$- complex

cmove(u0, cdiv(z1,z2));

crdiv
3:2 Division by real number
z/c
crdiv(a,b,c) = (a',b')    
a' = a/c    
b' = b/c    

var a0 = 3;
var b0 = 4;
var c0 = 6;
var x0;
var y0;

cmove(x0,y0, crdiv(a0,b0,c0));

cidiv
3:2 Division by imaginary number
z/(i•c)
cidiv(a,b,c) = (a',b')    
a' = b/c    
b' = -a/c    

var a0 = 3;
var b0 = 4;
var c0 = 6;
var x0;
var y0;

cmove(x0,y0, cidiv(a0,b0,c0));

cdivi
2:2 Division by i
z/i
cdivi(a,b) = (a',b')    
a' = b    
b' = -a    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, cdivi(a0,b0));

cdivr
~/ 4:2 Reverse division
z2/z1
cdivr(a,b,c,d) = (a',b')    
a' = (a•c + b•d)/n    
b' = (a•d - b•c)/n    
n  = a2 + b2    

var a0 = 3;
var b0 = 4;
var c0 = 6;
var d0 = 9;
var x0;
var y0;

cmove(x0,y0, cdivr(a0,b0,c0,d0));

complex z0, u0;
complex z1=1.2,3.4, z2=5.6,7.8;

$+ complex
z0 = z1 ~/ z2;
$- complex

cmove(u0, cdivr(z1,z2));

crdivr
3:2 Reverse division by real number
c/z
crdivr(a,b,c) = (a',b')    
a' = a•c/n    
b' = -b•c/n    
n  = a2 + b2    

var a0 = 3;
var b0 = 4;
var c0 = 6;
var x0;
var y0;

cmove(x0,y0, crdivr(a0,b0,c0));

cidivr
3:2 Reverse division by imaginary number
(i•c)/z
cidivr(a,b,c) = (a',b')    
a' = b•c/n    
b' = a•c/n    
n  = a2 + b2    

var a0 = 3;
var b0 = 4;
var c0 = 6;
var x0;
var y0;

cmove(x0,y0, cidivr(a0,b0,c0));

cinv
crecip 
2:2 Reverse division by 1
1/z
cinv(a,b)    
crecip = (a',b')    
a' = a/n    
b' = -b/n    
n  = a2 + b2    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, cinv(a0,b0));

cdivri
cinvi 
crecipi 
2:2 Reverse division by i
i/z
cdivri(a,b)    
cinvi(a,b)    
crecipi = (a',b')    
a' = b/n    
b' = a/n    
n  = a2 + b2    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, cdivri(a0,b0));

 
Complex number exponential functions
cexp
2:2 Exponential function
ez

#FPU

cexp(a,b) = (a',b')    
a' = r'•cos(t')    
b' = r'•sin(t')    
r' = ea    
t' = b    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, cexp(a0,b0));

cexp2
cpow2z 
2:2 2 raised to a power of z
2z

#FPU

cexp2(a,b) = (a',b')    
a' = r'•cos(t')    
b' = r'•sin(t')    
r' = 2a    
t' = b•ln(2)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, cexp2(a0,b0));

cexp10
cpow10z 
2:2 10 raised to a power of z
10z

#FPU

cexp10(a,b) = (a',b')    
a' = r'•cos(t')    
b' = r'•sin(t')    
r' = 10a    
t' = b•ln(10)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, cexp10(a0,b0));

cln
cloge 
2:2 Natural logarithm
logez

#FPU

cln(a,b)    
cloge(a,b) = (a',b')    
a' = ln(r)    
b' = θ    
r  = (a2 + b2)1/2    
θ  = atan(b/a)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, cln(a0,b0));

clb
clog2 
2:2 Base-2 logarithm
log2(z)

#FPU

clb(a,b)    
clog2(a,b) = (a',b')    
a' = log2e•ln(r)    
b' = log2e•θ    
r  = (a2 + b2)1/2    
θ  = atan(b/a)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, clog2(a0,b0));

clg
clog10 
2:2 Base-10 logarithm
log10(z)

#FPU

clg(a,b)    
clog10(a,b) = (a',b')    
a' = log10e•ln(r)    
b' = log10e•θ    
r  = (a2 + b2)1/2    
θ  = atan(b/a)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, clog10(a0,b0));

clogn
3:2 Base-n logarithm
logn(z)

#FPU

clogn(n,a,b) = (a',b')    
a' = logne•ln(r)    
b' = logne•θ    
r  = (a2 + b2)1/2    
θ  = atan(b/a)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, clogn(2,a0,b0));

clognr
3:2 Reverse base-n logarithm
logn(z)

#FPU

clognr(a,b,n) = (a',b')    
a' = logne•ln(r)    
b' = logne•θ    
r  = (a2 + b2)1/2    
θ  = atan(b/a)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, clognr(a0,b0,2));

 
Complex number power functions
cpow
^
**
4:2 Power function
z1z2

#FPU

cpow(z1,z2)    
cpow(a,b,c,d)    
z1z2 = ez2•ln(z1)

var a0 = 3;
var b0 = 4;
var c0 = 6;
var d0 = 9;
var x0;
var y0;

cmove(x0,y0, cpow(a0,b0,c0,d0));

complex z0, u0;
complex z1=1.2,3.4, z2=5.6,7.8;

$+ complex
z0 = z1 ^ z2;
$- complex

cmove(u0, cpow(z1,z2));

cpowr
~^
~**
4:2 Reverse power function
z2z1

#FPU

cpowr(z1,z2)    
cpowr(a,b,c,d)    
z2z1 = ez1•ln(z2)

var a0 = 3;
var b0 = 4;
var c0 = 6;
var d0 = 9;
var x0;
var y0;

cmove(x0,y0, cpowr(a0,b0,c0,d0));

complex z0, u0;
complex z1=1.2,3.4, z2=5.6,7.8;

$+ complex
z0 = z1 ~^ z2;
$- complex

cmove(u0, cpowr(z1,z2));

cxpow
3:2 Power function
xz

#FPU

cxpow(x,a,b) = (a',b')    
a' = r'•cos(t')    
b' = r'•sin(t')    
r' = xa    
t' = b•ln(x)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, cxpow(2,a0,b0));

cpowx
3:2 Power function
zx

#FPU

cpowx(a,b,x)    
zx = ex•ln(z)    
x - double value    

var a0 = 3;
var b0 = 4;
var n0 = 2;
var x0;
var y0;

cmove(x0,y0, cpowx(a0,b0,n0));

cpown
3:2 Power function
zn

#FPU

cpown(a,b,n)    
n - integer value    

var a0 = 3;
var b0 = 4;
int n0 = 6;
var x0;
var y0;

cmove(x0,y0, cpown(a0,b0,n0));

cpow2
csqr 
2:2 Square power
z2
cpow2(a,b)    
csqr(a,b) = (a',b')    
a' = a2 - b2    
b' = 2•a•b    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, cpow2(a0,b0));

cpow3
ccube 
2:2 Cube power
z3
cpow3(a,b)    
ccube(a,b)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, cpow3(a0,b0));

cpow4
2:2 Power-4 function
z4
cpow4(a,b)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, cpow4(a0,b0));

croot
*/ 4:2 Root function
z11/z2

#FPU

croot(z1,z2)    
croot(a,b,c,d)    
z11/z2 = e1/z2•ln(z1)

var a0 = 3;
var b0 = 4;
var c0 = 6;
var d0 = 9;
var x0;
var y0;

cmove(x0,y0, croot(a0,b0,c0,d0));

complex z0, u0;
complex z1=1.2,3.4, z2=5.6,7.8;

$+ complex
z0 = z1 */ z2;
$- complex

cmove(u0, croot(z1,z2));

crootr
~*/ 4:2 Reverse root function
z21/z1

#FPU

crootr(z1,z2)    
crootr(a,b,c,d)    
z21/z1 = e1/z1•ln(z2)

var a0 = 3;
var b0 = 4;
var c0 = 6;
var d0 = 9;
var x0;
var y0;

cmove(x0,y0, crootr(a0,b0,c0,d0));

complex z0, u0;
complex z1=1.2,3.4, z2=5.6,7.8;

$+ complex
z0 = z1 ~*/ z2;
$- complex

cmove(u0, crootr(z1,z2));

crootx
3:2 Root function
z1/x

#FPU

crootx(a,b,x)    
z1/x = e1/x•ln(z)

var a0 = 3;
var b0 = 4;
var n0 = 2;
var x0;
var y0;

cmove(x0,y0, crootx(a0,b0,n0));

crootn
3:2 Root function
z1/n

#FPU

crootn(a,b,n)    
n - integer value    

var a0 = 3;
var b0 = 4;
int n0 = 6;
var x0;
var y0;

cmove(x0,y0, crootn(a0,b0,n0));

crootsn
4:2 Root function
z1/n

#FPU

crootsn(a,b,n,p)    
n - integer value    
p - integer value    
p = root number (0 ≤ p ≤ n-1)    

var a0 = 3;
var b0 = 4;
var x1, y1;
var x2, y2;
var x3, y3;

cmove(x1,y1, crootsn(a0,b0,#3,#0));
cmove(x2,y2, crootsn(a0,b0,#3,#1));
cmove(x3,y3, crootsn(a0,b0,#3,#2));

croot2
csqrt 
2:2 Square root
z1/2

#FPU

croot2(a,b)    
csqrt(a,b) = (a',b')    
a' = ((r + a)/2)1/2    
b' = ((r - a)/2)1/2 • sign(b)    
r  = (a2 + b2)1/2    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, croot2(a0,b0));

 
Complex number trigonometric functions
csin
2:2 Sine
csin(a,b) = (a',b')    
a' = sin(a)•cosh(b)    
b' = cos(a)•sinh(b)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, csin(a0,b0));

ccos
2:2 Cosine
ccos(a,b) = (a',b')    
a' = cos(a)•cosh(b)    
b' = -sin(a)•sinh(b)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, ccos(a0,b0));

csec
2:2 Secant
csec(a,b)    
1/ccos(a,b)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, csec(a0,b0));

ccsc
ccosec 
2:2 Cosecant
ccsc(a,b)    
ccosec(a,b)    
1/csin(a,b)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, ccosec(a0,b0));

ctan
2:2 Tangent
ctan(a,b)    
csin(a,b)/ccos(a,b)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, ctan(a0,b0));

ccot
ccotan 
2:2 Cotangent
ccot(a,b)    
ccotan(a,b)    
ccos(a,b)/csin(a,b)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, ccotan(a0,b0));

casin
2:2 Inverse sine

#FPU

casin(a,b)    
-i•ln(i•z+(1-z2)1/2)    
-i•ln(i•(z+(z2-1)1/2))    

var a0 = 3;
var b0 = 4;
var x1, y1;
var x2, y2;

cmove(x1,y1, casin(a0,b0));
cmove(x2,y2, csin(x1,y1));

cacos
2:2 Inverse cosine

#FPU

cacos(a,b)    
-i•ln(z+(z2-1)1/2)    

var a0 = 3;
var b0 = 4;
var x1, y1;
var x2, y2;

cmove(x1,y1, cacos(a0,b0));
cmove(x2,y2, ccos(x1,y1));

casec
2:2 Inverse secant

#FPU

casec(a,b)    
casec(z) = cacos(1/z)    

var a0 = 3;
var b0 = 4;
var x1, y1;
var x2, y2;

cmove(x1,y1, casec(a0,b0));
cmove(x2,y2, csec(x1,y1));

cacsc
cacosec 
2:2 Inverse cosecant

#FPU

cacsc(a,b)    
cacosec(a,b)    
cacosec(z) = casin(1/z)    

var a0 = 3;
var b0 = 4;
var x1, y1;
var x2, y2;

cmove(x1,y1, cacosec(a0,b0));
cmove(x2,y2, ccosec(x1,y1));

catan
2:2 Inverse tangent

#FPU

catan(a,b)    
(1/2)•(-i)•ln((1+i•z)/(1-i•z))    

var a0 = 3;
var b0 = 4;
var x1, y1;
var x2, y2;

cmove(x1,y1, catan(a0,b0));
cmove(x2,y2, ctan(x1,y1));

cacot
cacotan 
2:2 Inverse cotangent

#FPU

cacot(a,b)    
cacotan(a,b)    
(1/2)•i•ln((i•z+1)/(i•z-1))    

var a0 = 3;
var b0 = 4;
var x1, y1;
var x2, y2;

cmove(x1,y1, cacotan(a0,b0));
cmove(x2,y2, ccotan(x1,y1));

 
Complex number hyperbolic functions
csinh
2:2 Hyperbolic sine
csinh(a,b) = (a',b')    
a' = sinh(a)•cos(b)    
b' = cosh(a)•sin(b)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, csinh(a0,b0));

ccosh
2:2 Hyperbolic cosine
ccosh(a,b) = (a',b')    
a' = cosh(a)•cos(b)    
b' = sinh(a)•sin(b)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, ccosh(a0,b0));

csech
2:2 Hyperbolic secant
csech(a,b)    
1/ccosh(a,b)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, csech(a0,b0));

ccsch
ccosech 
2:2 Hyperbolic cosecant
ccsch(a,b)    
ccosech(a,b)    
1/csinh(a,b)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, ccosech(a0,b0));

ctanh
2:2 Hyperbolic tangent
ctanh(a,b)    
csinh(a,b)/ccosh(a,b)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, ctanh(a0,b0));

ccoth
ccotanh 
2:2 Hyperbolic cotangent
ccoth(a,b)    
ccotanh(a,b)    
ccosh(a,b)/csinh(a,b)    

var a0 = 3;
var b0 = 4;
var x0;
var y0;

cmove(x0,y0, ccotanh(a0,b0));

casinh
2:2 Inverse hyperbolic sine

#FPU

casinh(a,b)    
ln(z+(z2+1)1/2)    

var a0 = 3;
var b0 = 4;
var x1, y1;
var x2, y2;

cmove(x1,y1, casinh(a0,b0));
cmove(x2,y2, csinh(x1,y1));

cacosh
2:2 Inverse hyperbolic cosine

#FPU

cacosh(a,b)    
ln(z+(z2-1)1/2)    

var a0 = 3;
var b0 = 4;
var x1, y1;
var x2, y2;

cmove(x1,y1, cacosh(a0,b0));
cmove(x2,y2, ccosh(x1,y1));

casech
2:2 Inverse hyperbolic secant

#FPU

casech(a,b)    
casech(z) = cacosh(1/z)    

var a0 = 3;
var b0 = 4;
var x1, y1;
var x2, y2;

cmove(x1,y1, casech(a0,b0));
cmove(x2,y2, csech(x1,y1));

cacsch
cacosech 
2:2 Inverse hyperbolic cosecant

#FPU

cacsch(a,b)    
cacosech(a,b)    
cacosech(z) = casinh(1/z)    

var a0 = 3;
var b0 = 4;
var x1, y1;
var x2, y2;

cmove(x1,y1, cacosech(a0,b0));
cmove(x2,y2, ccosech(x1,y1));

catanh
2:2 Inverse hyperbolic tangent

#FPU

catanh(a,b)    
(1/2)*ln((1+z)/(1-z))    

var a0 = 3;
var b0 = 4;
var x1, y1;
var x2, y2;

cmove(x1,y1, catanh(a0,b0));
cmove(x2,y2, ctanh(x1,y1));

cacoth
cacotanh 
2:2 Inverse hyperbolic cotangent

#FPU

cacoth(a,b)    
cacotanh(a,b)    
(1/2)*ln((z+1)/(z-1))    

var a0 = 3;
var b0 = 4;
var x1, y1;
var x2, y2;

cmove(x1,y1, cacotanh(a0,b0));
cmove(x2,y2, ccotanh(x1,y1));

 
Special functions
factln 1 Natural logarithm of factorial   
factln(x) = lgamma(x+1)
fact x! 1 Factorial   
fact(x) = tgamma(x+1)
fact2 x!! 1 Double factorial   
No implementation
x!! ≡ x
erf
 
1 Error function   
erfc
 
1 Complementary error function   
cdfnorm
 
1 Cumulative normal distribution function
erfinv
 
1 Inverse error function   
erfcinv
 
1 Inverse complementary error function   
cdfnorminv
 
1 Inverse of normal distribution function   
lgamma 1 Natural logarithm of the absolute value of gamma function   
|x| < 2.556348E+305  

tgamma 1 Gamma function   
|x| < 171.6  

rgamma 1 Reciprocal gamma function   
|x| < 171.6  

rtgamma 1 Reciprocal gamma function   
|x| < 171.6  

rtgamma(x) = 1/tgamma(x)
beta 2 Beta function   

beta(x,y) =
tgamma(x)*tgamma(y)/tgamma(x+y)
 
Statistical functions
vvart
 
-1 Total variance
vvart(x1,x2,…,xn) =
i(xi - mean)2

vvart(x1) ≡ 0
vvars
 
-2 Variance (sample variance)
vvars(x1,x2,…,xn) = vvart(…)/(n-1)
vvarp
 
-1 Population variance
vvarp(x1,x2,…,xn) = vvart(…)/(n)

vvarp(x1) ≡ 0
vstd
 
-2 Standard deviation (sample standard deviation)
vstd(x1,x2,…,xn) = (vvars(…))1/2
vstdp
 
-1 Population standard deviation
vstdp(x1,x2,…,xn) = (vvarp(…))1/2

vstdp(x1) ≡ 0
 
Variable number of arguments
vncycle
meander 
-6 n-th cycle function

Argument filters varg(…) not allowed.

#FPU

vncycle(x,a,P1,P2,…,Pn,V1,V2,…,Vn)
period = P = P1+P2+…+Pn (Pi > 0)

returns:
♦ Vn ⇐ (x-a ≥ P1+P2+…+Pn-1) and (x-a < P1+P2+…+Pn-1+Pn)
♦ 0 ⇐ P = 0
♦ 0 ⇐ argument count < 6 or odd

vnstep -4 n-th step function

Argument filters varg(…) not allowed.

#FPU

vnstep(x,P1,P2,…,Pn,V0,V1,V2,…,Vn)

returns:
♦ Vn ⇐ x ≥ Pn
♦ V0 ⇐ x < P1
♦ 0  ⇐ argument count < 4 or odd

vadd
vsum 
-1 Sum of values
vadd(x1,x2) ≡ add(x1,x2)

vadd(x1) ≡ x1
vmul -1 Product of values
vmul(x1,x2) ≡ mul(x1,x2)

vmul(x1) ≡ x1
vmin -1 The smaller of values
vmin(x1,x2) ≡ min(x1,x2)

vmin(x1) ≡ x1
vmax -1 The larger of values
vmax(x1,x2) ≡ max(x1,x2)

vmax(x1) ≡ x1
vminmax -1:2 The smaller and the larger of values
vminmax(x1,x2,…,xn) = (min,max)

var x_min;
var x_max;

// x_min = -2
// x_max = 8
x2copy(x_min,x_max, vminmax(-1,6,-2,8,1,2));

co.vminmax -3 The smaller and the larger of values

Returns result in double variables xmin and xmax

Argument filters varg(…) not allowed.

co.vminmax(*xmin,*xmax, x1,x2,…,xn)

var x_min;
var x_max;

// x_min = -2
// x_max = 8
co.vminmax(x_min,x_max, -1,6,-2,8,1,2);

vmaxmin -1:2 The larger and the smaller of values
vmaxmin(x1,x2,…,xn) = (max,min)

var x_max;
var x_min;

// x_max = 8
// x_min = -2
x2copy(x_max,x_min, vmaxmin(-1,6,-2,8,1,2));

co.vmaxmin -3 The larger and the smaller of values

Returns result in double variables xmax and xmin

Argument filters varg(…) not allowed.

co.vmaxmin(*xmax,*xmin, x1,x2,…,xn)

var x_max;
var x_min;

// x_max = 8
// x_min = -2
co.vmaxmin(x_max,x_min, -1,6,-2,8,1,2);

vmin.adev
-2 The smaller absolute deviation.

#FPU

vmin.adev(x1,x2,…,xn, a)

returns:  
min(deviationi) = min(abs(a-xi))

var aa;
var bb;
var cc;
 
aa = vmin.adev(2,6,5,4, 1); // = 1
bb = vmin.adev(2,6,5,4, 8); // = 2
cc = vmin.adev(2,6,5,4, 9); // = 3

vminl.adev
-2 The value of the argument with the smaller absolute deviation.
Prefer argument with a lower index

#FPU

vminl.adev(x1,x2,…,xn, a)
deviationi = abs(a-xi)

var aa;
var bb;
var cc;
 
aa = vminl.adev(2,6,5,4, 1); // = 2
bb = vminl.adev(2,6,5,4, 7); // = 6
cc = vminl.adev(2,6,5,4, 3); // = 2

vminh.adev
-2 The value of the argument with the smaller absolute deviation.
Prefer argument with a higher index

#FPU

vminh.adev(x1,x2,…,xn, a)
deviationi = abs(a-xi)

var aa;
var bb;
var cc;
 
aa = vminh.adev(2,6,5,4, 1); // = 2
bb = vminh.adev(2,6,5,4, 7); // = 6
cc = vminh.adev(2,6,5,4, 3); // = 4

vmax.adev
-2 The larger absolute deviation.

#FPU

vmax.adev(x1,x2,…,xn, a)

returns:  
max(deviationi) = max(abs(a-xi))

var aa;
var bb;
var cc;
 
aa = vmax.adev(7,2,3,1, 9); // = 8
bb = vmax.adev(7,2,3,1, 2); // = 5
cc = vmax.adev(7,2,3,1, 4); // = 3

vmaxl.adev
-2 The value of the argument with the larger absolute deviation.
Prefer argument with a lower index

#FPU

vmaxl.adev(x1,x2,…,xn, a)
deviationi = abs(a-xi)

var aa;
var bb;
var cc;
 
aa = vmaxl.adev(7,2,3,1, 9); // = 1
bb = vmaxl.adev(7,2,3,1, 2); // = 7
cc = vmaxl.adev(7,2,3,1, 4); // = 7

vmaxh.adev
-2 The value of the argument with the larger absolute deviation.
Prefer argument with a higher index

#FPU

vmaxh.adev(x1,x2,…,xn, a)
deviationi = abs(a-xi)

var aa;
var bb;
var cc;
 
aa = vmaxh.adev(7,2,3,1, 9); // = 1
bb = vmaxh.adev(7,2,3,1, 2); // = 7
cc = vmaxh.adev(7,2,3,1, 4); // = 1

vavg
vmean 
-1 Arithmetic average of values
vavg(x1,x2) ≡ avg(x1,x2)

vavg(x1) ≡ x1
vsumsqr
sumsqr 
-1 Sum of squares of values
vsumsqr(x1,x2,…,xn) =
x12 + x22 + ... + xn2

vsumsqr(x1) ≡ x12
vpoly
poly 
-2 Uniform polynomial

Argument filters varg(…) not allowed.

vpoly(x,c0,c1,…,cn) =
c0 + c1*x + c2*x2 + … + cn*xn

vpoly(x,c0) ≡ c0
vnorm
norm 
-1 Euclidean L2-norm
vnorm(x1,x2,…,xn) =
(x12 + x22 + ... + xn2)1/2

vnorm(x1) ≡ abs(x1)
 
Percent functions
percent.mul
*%
2 What is x percent of y x *% y  
(x*y)/100  
percent.div
/%

2 x is what percent of y x /% y  
(x/y)*100  
percent.divr
~/%

2 y is what percent of x x ~/% y  
(y/x)*100  
percent.inc
+%

2 What is the percentage increase from x to y x +% y  
((y-x)/x)*100  
percent.incr
~+%

2 What is the percentage increase from y to x x ~+% y  
((x-y)/y)*100  
percent.dec
-%

2 What is the percentage decrease from x to y x -% y  
((x-y)/x)*100  
percent.decr
~-%
2 What is the percentage decrease from y to x x ~-% y  
((y-x)/y)*100  
 
Angle conversion functions
a2d 3 Arc d:m:s to degrees degrees = d + m/60 + s/3600
a2r 3 Arc d:m:s to radians
a2g 3 Arc d:m:s to grads
a2c 3 Arc d:m:s to cycles
d2a 1:3 Degrees to arc d:m:s
d2a(x) = (d,m,s)

var a.d;
var a.m;
var a.s;

x3copy(a.d,a.m,a.s, d2a(a2d(33,44,55)));

co.d2a 4 Degrees to arc d:m:s

Returns result in double variables d, m and s

co.d2a(*d,*m,*s, x)

var a.d;
var a.m;
var a.s;

co.d2a(a.d,a.m,a.s, a2d(33,44,55));

d2r
radians 
1 Degrees to radians 360 degrees = 2π radians
d2g 1 Degrees to grads 360 degrees = 400 grads  
d2c 1 Degrees to cycles 360 degrees = 1 cycle  
r2d
degrees 
°x 1 Radians to degrees 2π radians = 360 degrees
r2a 1:3 Radians to arc d:m:s
r2a(x) = (d,m,s)

var a.d;
var a.m;
var a.s;

x3copy(a.d,a.m,a.s, r2a(a2r(33,44,55)));

co.r2a 4 Radians to arc d:m:s

Returns result in double variables d, m and s

co.r2a(*d,*m,*s, x)

var a.d;
var a.m;
var a.s;

co.r2a(a.d,a.m,a.s, a2r(33,44,55));

r2g °°x 1 Radians to grads 2π radians = 400 grads
r2c 1 Radians to cycles 2π radians = 1 cycle
g2r x°° 1 Grads to radians 400 grads = 2π radians
g2d 1 Grads to degrees 400 grads = 360 degrees  
g2a 1:3 Grads to arc d:m:s
g2a(x) = (d,m,s)

var a.d;
var a.m;
var a.s;

x3copy(a.d,a.m,a.s, g2a(a2g(33,44,55)));

co.g2a 4 Grads to arc d:m:s

Returns result in double variables d, m and s

co.g2a(*d,*m,*s, x)

var a.d;
var a.m;
var a.s;

co.g2a(a.d,a.m,a.s, a2g(33,44,55));

g2c 1 Grads to cycles 400 grads = 1 cycle  
c2r 1 Cycles to radians 1 cycle = 2π radians
c2d 1 Cycles to degrees 1 cycle = 360 degrees  
c2a 1:3 Cycles to arc d:m:s
c2a(x) = (d,m,s)

var a.d;
var a.m;
var a.s;

x3copy(a.d,a.m,a.s, c2a(a2c(33,44,55)));

co.c2a 4 Cycles to arc d:m:s

Returns result in double variables d, m and s

co.c2a(*d,*m,*s, x)

var a.d;
var a.m;
var a.s;

co.c2a(a.d,a.m,a.s, a2c(33,44,55));

c2g 1 Cycles to grads 1 cycle = 400 grads  
 
Temperature conversion functions
ce2ke 1 Celsius to kelvin K = °C + 273.15
ce2fa 1 Celsius to fahrenheit °F = °C×1.8 + 32
ce2ra 1 Celsius to rankine °Ra = °C×1.8 + 491.67
ce2re 1 Celsius to reaumur °R = °C×0.8
ke2ce 1 Kelvin to celsius °C = K - 273.15
ke2fa 1 Kelvin to fahrenheit °F = K×1.8 - 459.67
ke2ra 1 Kelvin to rankine °Ra = K×1.8
ke2re 1 Kelvin to reaumur °R = (K - 273.15)×0.8
fa2ce 1 Fahrenheit to celsius °C = (°F - 32)/1.8
fa2ke 1 Fahrenheit to kelvin K = (°F + 459.67)/1.8
fa2ra 1 Fahrenheit to rankine °Ra = °F + 459.67
fa2re 1 Fahrenheit to reaumur °R = (°F - 32)/2.25
ra2ce 1 Rankine to celsius °C = (°Ra - 491.67)/1.8
ra2ke 1 Rankine to kelvin K = °Ra/1.8
ra2fa 1 Rankine to fahrenheit °F = °Ra - 459.67
ra2re 1 Rankine to reaumur °R = (°Ra - 491.67)/2.25
re2ce 1 Reaumur to celsius °C = °R×1.25
re2ke 1 Reaumur to kelvin K = °R×1.25 + 273.15
re2fa 1 Reaumur to fahrenheit °F = °R×2.25 + 32
re2ra 1 Reaumur to rankine °Ra = °R×2.25 + 491.67
 
Units functions
bit 1 bit(a) = a÷8 = a×(1/8)  
nibble 1 nibble(a) = a÷2 = a×(1/2)  
byte 1 byte(a) = a×1  
word 1 word(a) = a×2  
dword 1 dword(a) = a×4  
qword 1 qword(a) = a×8  
nword 1 Native integer word nword(a) = a×8 (x64) | a×4 (x32)  
tword 1 tword(a) = a×10  
xword 1 xword(a) = a×16  
oword 1 oword(a) = a×16  
yword 1 yword(a) = a×32  
zword 1 zword(a) = a×64  
kibi 1 kibi (Ki)
kibi(a) = a×210
mebi 1 mebi (Mi)
mebi(a) = a×220
gibi 1 gibi (Gi)
gibi(a) = a×230
tebi 1 tebi (Ti)
tebi(a) = a×240
pebi 1 pebi (Pi)
pebi(a) = a×250
exbi 1 exbi (Ei)
exbi(a) = a×260
zebi 1 zebi (Zi)
zebi(a) = a×270
yobi 1 yobi (Yi)
yobi(a) = a×280
robi 1 robi (Ri)
robi(a) = a×290
quebi 1 quebi (Qi)
quebi(a) = a×2100
kibo 1 kibo(a) = a×2-10
mebo 1 mebo(a) = a×2-20
gibo 1 gibo(a) = a×2-30
tebo 1 tebo(a) = a×2-40
pebo 1 pebo(a) = a×2-50
exbo 1 exbo(a) = a×2-60
zebo 1 zebo(a) = a×2-70
yobo 1 yobo(a) = a×2-80
robo 1 robo(a) = a×2-90
quebo 1 quebo(a) = a×2-100
deca 1 deca (da)
deca(a) = a×101
hecto 1 hecto (h)
hecto(a) = a×102
kilo 1 kilo (k)
kilo(a) = a×103
mega 1 mega (M)
mega(a) = a×106
giga 1 giga (G)
giga(a) = a×109
tera 1 tera (T)
tera(a) = a×1012
peta 1 peta (P)
peta(a) = a×1015
exa 1 exa (E)
exa(a) = a×1018
zetta 1 zetta (Z)
zetta(a) = a×1021
yotta 1 yotta (Y)
yotta(a) = a×1024
ronna 1 ronna (R)
ronna(a) = a×1027
quetta 1 quetta (Q)
quetta(a) = a×1030
deci 1 deci (d)
deci(a) = a×10-1
centi 1 centi (c)
centi(a) = a×10-2
milli 1 milli (m)
milli(a) = a×10-3
micro 1 micro (μ)
micro(a) = a×10-6
nano 1 nano (n)
nano(a) = a×10-9
pico 1 pico (p)
pico(a) = a×10-12
femto 1 femto (f)
femto(a) = a×10-15
atto 1 atto (a)
atto(a) = a×10-18
zepto 1 zepto (z)
zepto(a) = a×10-21
yocto 1 yocto (y)
yocto(a) = a×10-24
ronto 1 ronto (r)
ronto(a) = a×10-27
quecto 1 quecto (q)
quecto(a) = a×10-30
 
Data modifier functions
:+ 1 Positive value or zero a:+  = pos(a)  
:- 1 Negative value or zero a:-  = neg(a)  
:++ 1 Increment by 1 a:++ = inc(a)  
:-- 1 Decrement by 1 a:-- = dec(a)  
:2pi 1 a:2pi = a×(2π)
:pi 1 a:pi  = a×(π)
:pi2 1 a:pi2 = a×(π/2)
:pi4 1 a:pi4 = a×(π/4)
:/2pi 1 a:/2pi = a÷(2π)  = a×(1/2π)
:/pi 1 a:/pi  = a÷(π)   = a×(1/π)
:/pi2 1 a:/pi2 = a÷(π/2) = a×(2/π)
:/pi4 1 a:/pi4 = a÷(π/4) = a×(4/π)
:\2pi 1 a:\2pi = a quo (2π)
:\pi 1 a:\pi  = a quo (π)
:\pi2 1 a:\pi2 = a quo (π/2)
:\pi4 1 a:\pi4 = a quo (π/4)
:%2pi 1 a:%2pi = a mod (2π)
:%pi 1 a:%pi  = a mod (π)
:%pi2 1 a:%pi2 = a mod (π/2)
:%pi4 1 a:%pi4 = a mod (π/4)
 
Approximate exponential functions
fexp
 
1 Exponential function   
x < 1024*loge(2)
fexp2
fpow2x 
 
1 2 raised to a power of x   
x < 1024
fexp10
fpow10x 
 
1 10 raised to a power of x   
x < 1024*log10(2)
fln
floge 
 
1 Natural logarithm   
loge(x) = loge(S*2E) =   
loge(S) + E*loge(2)   

loge(x) = loge(x/√2) + loge(√2)   
√2 ≤ x < 2   

flb
flog2 
 
1 Base-2 logarithm   
log2(x) = log2(S*2E) =   
log2(S) + E =   
log2(e)*loge(S) + E   

log2(x) = log2(x/√2) + 0.5   
√2 ≤ x < 2   

flg
flog10 
 
1 Base-10 logarithm   
log10(x) = log10(S*2E) =   
log10(S) + E*log10(2) =   
log10(e)*loge(S) + E*log10(2)   

log10(x) = log10(x/√2) + log10(√2)   
√2 ≤ x < 2   

flogn
 
1 Base-n logarithm   
logn(x)   
flogn(n,x) = floge(x)/floge(n)   
flognr
 
1 Reverse base-n logarithm   
logn(x)   
flognr(x,n) = floge(x)/floge(n)   
 
Approximate power functions
fpow
fpower 
 
2 Power function
xy
fpow(x,y) = fexp2(z)   
z = y*flog2(x)   
fapow
fapower 
 
2 Power function
|x|y
fapow(x,y)  
fpow(abs(x),y)   
fpowr
fpowerr 
 
2 Reverse power function
yx
fpowr(x,y) = fexp2(z)   
z = x*flog2(y)   
fapowr
fapowerr 
 
2 Reverse power function
|y|x
fapowr(x,y)  
fpowr(x,abs(y))   
 
Approximate trigonometric functions
fsin
 
1 Sine
|x| < 251

r0 = fsin(pi/2);
// = 1

r0 = fsin(pi);
// = 0

r0 = fsin(3*pi/2);
// = -1

r0 = fsin(2*pi);
// = 0

r0 = sin(pi/2);
// = 1

r0 = sin(pi);
// = 1.22460635382238E-16

r0 = sin(3*pi/2);
// = -1

r0 = sin(2*pi);
// = -2.44921270764475E-16

fcos
 
1 Cosine
|x| < 251

r0 = fcos(pi/2);
// = 0

r0 = fcos(pi);
// = -1

r0 = fcos(3*pi/2);
// = 0

r0 = fcos(2*pi);
// = 1

r0 = cos(pi/2);
// = 6.12303176911188E-17

r0 = cos(pi);
// = -1

r0 = cos(3*pi/2);
// = -1.83690953073357E-16

r0 = cos(2*pi);
// = 1

fsec
 
1 Secant
|x| < 251
fsec(x) = 1/fcos(x)

r0 = fsec(pi/2);
// = NaN

r0 = fsec(pi);
// = -1

r0 = fsec(3*pi/2);
// = NaN

r0 = fsec(2*pi);
// = 1

r0 = sec(pi/2);
// = 1.63317787283838E16

r0 = sec(pi);
// = -1

r0 = sec(3*pi/2);
// = -5.44392624279461E15

r0 = sec(2*pi);
// = 1

fcsc
fcosec 
 
1 Cosecant
|x| < 251
fcosec(x) = 1/fsin(x)

r0 = fcosec(pi/2);
// = 1

r0 = fcosec(pi);
// = NaN

r0 = fcosec(3*pi/2);
// = -1

r0 = fcosec(2*pi);
// = NaN

r0 = cosec(pi/2);
// = 1

r0 = cosec(pi);
// = 8.16588936419192E15

r0 = cosec(3*pi/2);
// = -1

r0 = cosec(2*pi);
// = -4.08294468209596E15

ftan
 
1 Tangent
|x| < 251

r0 = ftan(pi/2);
// = NaN

r0 = ftan(pi);
// = 0

r0 = ftan(3*pi/2);
// = NaN

r0 = ftan(2*pi);
// = 0

r0 = tan(pi/2);
// = 1.63317787283838E16

r0 = tan(pi);
// = -1.22460635382238E-16

r0 = tan(3*pi/2);
// = 5.44392624279461E15

r0 = tan(2*pi);
// = -2.44921270764475E-16

fcot
fcotan 
 
1 Cotangent
|x| < 251
fcotan(x) = 1/ftan(x)   

r0 = fcotan(pi/2);
// = 0

r0 = fcotan(pi);
// = NaN

r0 = fcotan(3*pi/2);
// = 0

r0 = fcotan(2*pi);
// = NaN

r0 = cotan(pi/2);
// = 6.12303176911188E-17

r0 = cotan(pi);
// = -8.16588936419192E15

r0 = cotan(3*pi/2);
// = 1.83690953073357E-16

r0 = cotan(2*pi);
// = -4.08294468209596E15

fsinpi
 
1 Sine
fsinpi(x) = fsin(pi*x)   
fcospi
 
1 Cosine
fcospi(x) = fcos(pi*x)   
fsecpi
 
1 Secant
fsecpi(x) = fsec(pi*x)   
fcscpi
fcosecpi 
 
1 Cosecant
fcosecpi(x) = fcosec(pi*x)   
ftanpi
 
1 Tangent
ftanpi(x) = ftan(pi*x)   
fcotpi
fcotanpi 
 
1 Cotangent
fcotanpi(x) = fcotan(pi*x)   
fsincos
 
1:2 Sine and cosine
|x| < 251
fsincos(x)  
(fsin(x),fcos(x))  

var cos1, cos2;
var sin1, sin2;

cos1 = fcos(x);
sin1 = fsin(x);
x2copy (sin2,cos2, fsincos(x));

co.fsincos
 
3 Sine and cosine
|x| < 251
co.fsincos(sin*,cos*, x)  

var cos1, cos2;
var sin1, sin2;

cos1 = fcos(x);
sin1 = fsin(x);
co.fsincos (sin2,cos2, x);

fcossin
 
1:2 Cosine and sine
|x| < 251
fcossin(x)  
(fcos(x),fsin(x))  

var cos1, cos2;
var sin1, sin2;

cos1 = fcos(x);
sin1 = fsin(x);
x2copy (cos2,sin2, fcossin(x));

co.fcossin
 
3 Cosine and sine
|x| < 251
co.fcossin(cos*,sin*, x)  

var cos1, cos2;
var sin1, sin2;

cos1 = fcos(x);
sin1 = fsin(x);
co.fcossin (cos2,sin2, x);

fsincospi
 
1:2 Sine and cosine
fsincospi(x)  
(fsinpi(x),fcospi(x))  

var cos1, cos2;
var sin1, sin2;

cos1 = fcospi(x);
sin1 = fsinpi(x);
x2copy (sin2,cos2, fsincospi(x));

co.fsincospi
 
3 Sine and cosine
co.fsincospi(sin*,cos*, x)  

var cos1, cos2;
var sin1, sin2;

cos1 = fcospi(x);
sin1 = fsinpi(x);
co.fsincospi (sin2,cos2, x);

fcossinpi
 
1:2 Cosine and sine
fcossinpi(x)  
(fcospi(x),fsinpi(x))  

var cos1, cos2;
var sin1, sin2;

cos1 = fcospi(x);
sin1 = fsinpi(x);
x2copy (cos2,sin2, fcossinpi(x));

co.fcossinpi
 
3 Cosine and sine
co.fcossinpi(cos*,sin*, x)  

var cos1, cos2;
var sin1, sin2;

cos1 = fcospi(x);
sin1 = fsinpi(x);
co.fcossinpi (cos2,sin2, x);

fasin
 
1 Inverse sine
facos
 
1 Inverse cosine
fasec
 
1 Inverse secant fasec(x) = facos(1/x)
facsc
facosec 
 
1 Inverse cosecant facosec(x) = fasin(1/x)
fatan
 
1 Inverse tangent
fatan2
 
2 Inverse tangent of y/x
fatan2(y,x)
fatan2r
 
2 Inverse tangent of y/x
fatan2r(x,y)
facot
facotan 
 
1 Inverse cotangent
facotan(x) = pi/2 - fatan(x)
 
Approximate hyperbolic functions
fsh
fsinh 
 
1 Hyperbolic sine
fch
fcosh 
 
1 Hyperbolic cosine
fsech
 
1 Hyperbolic secant fsech(x) = 1/fcosh(x)  
fcsch
fcosech 
 
1 Hyperbolic cosecant fcosech(x) = 1/fsinh(x)  
ftanh
 
1 Hyperbolic tangent
fcoth
fcotanh 
 
1 Hyperbolic cotangent
fshch
 
1:2 Hyperbolic sine and cosine fshch(x)  
(fsh(x),fch(x))  

var ch1, ch2;
var sh1, sh2;

ch1 := fch(x);
sh1 := fsh(x);
x2copy(sh2,ch2, fshch(x));

co.fshch
 
3 Hyperbolic sine and cosine

Returns result in double variables sh and ch

co.fshch(*sh,*ch, x)  

var ch1, ch2;
var sh1, sh2;

ch1 := fch(x);
sh1 := fsh(x);
co.fshch(sh2,ch2, x);

fchsh
 
1:2 Hyperbolic cosine and sine fchsh(x)  
(fch(x),fsh(x))  

var ch1, ch2;
var sh1, sh2;

ch1 := fch(x);
sh1 := fsh(x);
x2copy(ch2,sh2, fchsh(x));

co.fchsh
 
3 Hyperbolic cosine and sine

Returns result in double variables ch and sh

co.fchsh(*ch,*sh, x)  

var ch1, ch2;
var sh1, sh2;

ch1 := fch(x);
sh1 := fsh(x);
co.fchsh(ch2,sh2, x);

fasinh
 
1 Inverse hyperbolic sine
facosh
 
1 Inverse hyperbolic cosine
fasech
 
1 Inverse hyperbolic secant fasech(x) = facosh(1/x)
facsch
facosech 
 
1 Inverse hyperbolic cosecant facosech(x) = fasinh(1/x)
fatanh
 
1 Inverse hyperbolic tangent
facoth
facotanh 
 
1 Inverse hyperbolic cotangent

Fuchsia-colored functions have an implementation with integer parameters.
For such functions, there are both
double func (double x1, double x2, …, double xn) and
double func (integer x1, integer x2, …, integer xn)

Green-colored functions accept only integer parameters.

Description of the functions that have only the FPU implementation contains the #FPU tag.

Third column = argument count [:result count]
Functions with integer result : ‹result count› = i
Functions with pointer result : ‹result count› = p
Default value of ‹result count› is 1

Functions with a variable number of arguments:
  • argument count < 0
  • ABS (argument count) = minimum argument count




List of Native Functions
Top
Details
Symbols
  1.  :%2pi
  2.  :%pi
  3.  :%pi2
  4.  :%pi4
  5.  :+
  6.  :++
  7.  :-
  8.  :--
  9.  :/2pi
  10.  :/pi
  11.  :/pi2
  12.  :/pi4
  13.  :2pi
  14.  :\2pi
  15.  :\pi
  16.  :\pi2
  17.  :\pi4
  18.  :double
  19.  :float
  20.  :int
  21.  :int64
  22.  :pi
  23.  :pi2
  24.  :pi4

  25.  a2c
  26.  a2d
  27.  a2g
  28.  a2r
  29.  abs
  30.  absolute
  31.  acos
  32.  acosec
  33.  acosech
  34.  acosh
  35.  acot
  36.  acotan
  37.  acotanh
  38.  acoth
  39.  acsc
  40.  acsch
  41.  add
  42.  add.div
  43.  add.divr
  44.  add.frac
  45.  add.int
  46.  add.mul
  47.  add.neg
  48.  add.pos
  49.  add.round
  50.  addr
  51.  adev
  52.  aif.a
  53.  aif.ae
  54.  aif.aeb
  55.  aif.aez
  56.  aif.az
  57.  aif.b
  58.  aif.be
  59.  aif.bea
  60.  aif.bez
  61.  aif.bz
  62.  aif.e
  63.  aif.ne
  64.  aif.nz
  65.  aif.z
  66.  and
  67.  apow
  68.  apower
  69.  apowerr
  70.  apowr
  71.  arccos
  72.  arccosec
  73.  arccot
  74.  arccotan
  75.  arccsc
  76.  arcctg
  77.  arch
  78.  arcsec
  79.  arcsh
  80.  arcsin
  81.  arctan
  82.  arctan2
  83.  arctan2r
  84.  arctg
  85.  arctg2
  86.  arctg2r
  87.  arcth
  88.  arsch
  89.  arsh
  90.  arth
  91.  asec
  92.  asech
  93.  asin
  94.  asinh
  95.  assign
  96.  atan
  97.  atan2
  98.  atan2r
  99.  atanh
  100.  atto
  101.  avg

  102.  b2swap
  103.  b4swap
  104.  band
  105.  bandn
  106.  bara
  107.  barr
  108.  barv
  109.  barw
  110.  bcor
  111.  bcorn
  112.  beta
  113.  bit
  114.  bit16swap
  115.  bit32swap
  116.  bit8swap
  117.  bitswap
  118.  bnand
  119.  bnandn
  120.  bnor
  121.  bnorc
  122.  bnorn
  123.  bnot
  124.  bool
  125.  bor
  126.  borc
  127.  born
  128.  breset
  129.  bset
  130.  bsf
  131.  bsr
  132.  bswap
  133.  bt
  134.  btc
  135.  btr
  136.  bts
  137.  bxnor
  138.  bxor
  139.  byte

  140.  c2a
  141.  c2d
  142.  c2g
  143.  c2r
  144.  cabs
  145.  cabs.equ
  146.  cabs.nequ
  147.  cabss
  148.  cacos
  149.  cacosec
  150.  cacosech
  151.  cacosh
  152.  cacot
  153.  cacotan
  154.  cacotanh
  155.  cacoth
  156.  cacsc
  157.  cacsch
  158.  cadd
  159.  caddi
  160.  call
  161.  call.ie
  162.  call.ie.aez
  163.  call.ie.and
  164.  call.ie.az
  165.  call.ie.bez
  166.  call.ie.bz
  167.  call.ie.false
  168.  call.ie.n32
  169.  call.ie.n64
  170.  call.ie.nand
  171.  call.ie.nor
  172.  call.ie.not
  173.  call.ie.nz
  174.  call.ie.or
  175.  call.ie.true
  176.  call.ie.x32
  177.  call.ie.x64
  178.  call.ie.z
  179.  call.if
  180.  call.if.aez
  181.  call.if.and
  182.  call.if.az
  183.  call.if.bez
  184.  call.if.bz
  185.  call.if.false
  186.  call.if.n32
  187.  call.if.n64
  188.  call.if.nand
  189.  call.if.nor
  190.  call.if.not
  191.  call.if.nz
  192.  call.if.or
  193.  call.if.true
  194.  call.if.x32
  195.  call.if.x64
  196.  call.if.z
  197.  calls
  198.  caprojd
  199.  caprojdx
  200.  caprojr
  201.  caprojrx
  202.  carg
  203.  carg.equ
  204.  carg.nequ
  205.  cargs
  206.  case
  207.  case.a
  208.  case.ae
  209.  case.b
  210.  case.be
  211.  case.e
  212.  case.n32
  213.  case.n64
  214.  case.ne
  215.  case.x32
  216.  case.x64
  217.  casec
  218.  casech
  219.  casin
  220.  casinh
  221.  catan
  222.  catanh
  223.  cbrt
  224.  cchs
  225.  ccis
  226.  cconj
  227.  ccopy
  228.  ccos
  229.  ccosec
  230.  ccosech
  231.  ccosh
  232.  ccot
  233.  ccotan
  234.  ccotanh
  235.  ccoth
  236.  ccovalue
  237.  ccsc
  238.  ccsch
  239.  ccube
  240.  cdec
  241.  cdeci
  242.  cdecr
  243.  cdecri
  244.  cdfnorm
  245.  cdfnorminv
  246.  cdiv
  247.  cdivi
  248.  cdivr
  249.  cdivri
  250.  ce2fa
  251.  ce2ke
  252.  ce2ra
  253.  ce2re
  254.  ceavg
  255.  ceil
  256.  cemean
  257.  centi
  258.  cequ
  259.  cexp
  260.  cexp10
  261.  cexp2
  262.  ch
  263.  chavg
  264.  chmean
  265.  chs
  266.  chsh
  267.  ciadd
  268.  cidiv
  269.  cidivr
  270.  ciicopy
  271.  ciimove
  272.  cimag
  273.  cimag.equ
  274.  cimag.nequ
  275.  cimim
  276.  cimre
  277.  cimul
  278.  cinc
  279.  cinci
  280.  cinv
  281.  cinvi
  282.  cis.imag
  283.  cis.real
  284.  cis.zero
  285.  cisn.imag
  286.  cisn.real
  287.  cisn.zero
  288.  cisub
  289.  cisubr
  290.  clamp
  291.  clb
  292.  clg
  293.  cln
  294.  clog10
  295.  clog2
  296.  cloge
  297.  clogn
  298.  clognr
  299.  cmove
  300.  cmul
  301.  cmuli
  302.  cnequ
  303.  cnorm
  304.  cnorms
  305.  co.abs
  306.  co.add
  307.  co.band
  308.  co.bandn
  309.  co.bcor
  310.  co.bcorn
  311.  co.bnand
  312.  co.bnandn
  313.  co.bnor
  314.  co.bnorc
  315.  co.bnorn
  316.  co.bnot
  317.  co.bor
  318.  co.borc
  319.  co.born
  320.  co.breset
  321.  co.bset
  322.  co.bxnor
  323.  co.bxor
  324.  co.c2a
  325.  co.chs
  326.  co.chsh
  327.  co.cossin
  328.  co.d2a
  329.  co.div
  330.  co.divr
  331.  co.fchsh
  332.  co.fcossin
  333.  co.fcossinpi
  334.  co.fshch
  335.  co.fsincos
  336.  co.fsincospi
  337.  co.fxtractes
  338.  co.fxtractse
  339.  co.g2a
  340.  co.lineco
  341.  co.maxmin
  342.  co.minmax
  343.  co.mod
  344.  co.mod.quo
  345.  co.modr
  346.  co.mul
  347.  co.nabs
  348.  co.quo
  349.  co.quo.mod
  350.  co.quor
  351.  co.r2a
  352.  co.rcopy
  353.  co.rol
  354.  co.ror
  355.  co.rxcopy
  356.  co.sal
  357.  co.sar
  358.  co.shch
  359.  co.shl
  360.  co.shr
  361.  co.sincos
  362.  co.sub
  363.  co.subr
  364.  co.vmaxmin
  365.  co.vminmax
  366.  complex
  367.  copx
  368.  copx.frac
  369.  copx.int
  370.  copx.round
  371.  copy
  372.  copy.frac
  373.  copy.int
  374.  copy.round
  375.  cos
  376.  cosec
  377.  cosech
  378.  cosh
  379.  cossin
  380.  cot
  381.  cotan
  382.  cotanh
  383.  coth
  384.  covalue
  385.  coverc
  386.  covercos
  387.  covers
  388.  coversin
  389.  cpcopy
  390.  cplane
  391.  cpmove
  392.  cpolar
  393.  cpow
  394.  cpow10z
  395.  cpow2
  396.  cpow2z
  397.  cpow3
  398.  cpow4
  399.  cpown
  400.  cpowr
  401.  cpowx
  402.  cprojd
  403.  cprojdx
  404.  cprojr
  405.  cprojrx
  406.  cradd
  407.  crconj
  408.  crdiv
  409.  crdivr
  410.  creal
  411.  creal.equ
  412.  creal.nequ
  413.  crecip
  414.  crecipi
  415.  creim
  416.  crere
  417.  creset
  418.  crestore
  419.  creze
  420.  crmul
  421.  croot
  422.  croot2
  423.  crootn
  424.  crootr
  425.  crootsn
  426.  crootx
  427.  crrcopy
  428.  crrmove
  429.  crsub
  430.  crsubr
  431.  csc
  432.  csch
  433.  csec
  434.  csech
  435.  csh
  436.  csign
  437.  csin
  438.  csinh
  439.  csqr
  440.  csqrt
  441.  csub
  442.  csubi
  443.  csubr
  444.  csubri
  445.  cswap
  446.  cswop
  447.  ctan
  448.  ctanh
  449.  ctg
  450.  cth
  451.  cube
  452.  cvar
  453.  cvc
  454.  cvoid
  455.  cvs
  456.  cxch
  457.  cxcopy
  458.  cxicopy
  459.  cximove
  460.  cxmove
  461.  cxpow
  462.  cxrcopy
  463.  cxrmove
  464.  cycle
  465.  czcopy
  466.  czeim
  467.  czero
  468.  czicopy
  469.  czimove
  470.  czmove
  471.  czrcopy
  472.  czrmove

  473.  d2a
  474.  d2c
  475.  d2g
  476.  d2r
  477.  davg
  478.  davgr
  479.  dec
  480.  dec.post
  481.  dec.pre
  482.  deca
  483.  deceil
  484.  deci
  485.  defloor
  486.  defracto
  487.  degrees
  488.  deintto
  489.  delta
  490.  deltab
  491.  derheven
  492.  derhodd
  493.  derinf
  494.  derninf
  495.  deround
  496.  deroundto
  497.  derpinf
  498.  derzero
  499.  div
  500.  div.add
  501.  div.frac
  502.  div.int
  503.  div.neg
  504.  div.pos
  505.  div.round
  506.  div.sub
  507.  div.subr
  508.  divr
  509.  divr.add
  510.  divr.frac
  511.  divr.int
  512.  divr.neg
  513.  divr.pos
  514.  divr.round
  515.  divr.sub
  516.  divr.subr
  517.  dll.bits
  518.  double
  519.  dword

  520.  erf
  521.  erfc
  522.  erfcinv
  523.  erfinv
  524.  exa
  525.  exbi
  526.  exbo
  527.  excosec
  528.  excsc
  529.  exit
  530.  exit.if
  531.  exit.if.false
  532.  exit.if.not
  533.  exit.if.true
  534.  exp
  535.  exp10
  536.  exp2
  537.  exsec

  538.  f2xm1
  539.  fa2ce
  540.  fa2ke
  541.  fa2ra
  542.  fa2re
  543.  facos
  544.  facosec
  545.  facosech
  546.  facosh
  547.  facot
  548.  facotan
  549.  facotanh
  550.  facoth
  551.  facsc
  552.  facsch
  553.  fact
  554.  fact2
  555.  factln
  556.  fapow
  557.  fapower
  558.  fapowerr
  559.  fapowr
  560.  fara
  561.  farr
  562.  farv
  563.  farw
  564.  fasec
  565.  fasech
  566.  fasin
  567.  fasinh
  568.  fatan
  569.  fatan2
  570.  fatan2r
  571.  fatanh
  572.  fch
  573.  fchsh
  574.  fclex
  575.  fcos
  576.  fcosec
  577.  fcosech
  578.  fcosecpi
  579.  fcosh
  580.  fcospi
  581.  fcossin
  582.  fcossinpi
  583.  fcot
  584.  fcotan
  585.  fcotanh
  586.  fcotanpi
  587.  fcoth
  588.  fcotpi
  589.  fcsc
  590.  fcsch
  591.  fcscpi
  592.  femto
  593.  fexp
  594.  fexp10
  595.  fexp2
  596.  flb
  597.  fld1
  598.  fldcw
  599.  fldl2e
  600.  fldl2t
  601.  fldlg2
  602.  fldln2
  603.  fldpi
  604.  fldz
  605.  flg
  606.  fln
  607.  flog10
  608.  flog2
  609.  floge
  610.  flogn
  611.  flognr
  612.  floor
  613.  fmadd132
  614.  fmadd213
  615.  fmadd231
  616.  fmaske
  617.  fmsub132
  618.  fmsub213
  619.  fmsub231
  620.  fnclex
  621.  fninit
  622.  fnmadd132
  623.  fnmadd213
  624.  fnmadd231
  625.  fnmaske
  626.  fnmsub132
  627.  fnmsub213
  628.  fnmsub231
  629.  fnstcw
  630.  fnstef
  631.  fnstsw
  632.  fpow
  633.  fpow10x
  634.  fpow2x
  635.  fpower
  636.  fpowerr
  637.  fpowr
  638.  fprem
  639.  fprem1
  640.  frac
  641.  fracto
  642.  frndint
  643.  frprem
  644.  frprem1
  645.  frscale
  646.  fscale
  647.  fsec
  648.  fsech
  649.  fsecpi
  650.  fsh
  651.  fshch
  652.  fsin
  653.  fsincos
  654.  fsincospi
  655.  fsinh
  656.  fsinpi
  657.  fstcw
  658.  fstef
  659.  fstsw
  660.  ftan
  661.  ftanh
  662.  ftanpi
  663.  fxtracte
  664.  fxtractes
  665.  fxtracts
  666.  fxtractse
  667.  fyl2x
  668.  fyl2xp1

  669.  g2a
  670.  g2c
  671.  g2d
  672.  g2r
  673.  gavg
  674.  gcd
  675.  gibi
  676.  gibo
  677.  giga
  678.  gmean
  679.  goto
  680.  goto.if
  681.  goto.if.aez
  682.  goto.if.and
  683.  goto.if.az
  684.  goto.if.bez
  685.  goto.if.bz
  686.  goto.if.false
  687.  goto.if.n32
  688.  goto.if.n64
  689.  goto.if.nand
  690.  goto.if.nor
  691.  goto.if.not
  692.  goto.if.nz
  693.  goto.if.or
  694.  goto.if.true
  695.  goto.if.x32
  696.  goto.if.x64
  697.  goto.if.z

  698.  hacoverc
  699.  hacovercos
  700.  hacovers
  701.  hacoversin
  702.  hammd
  703.  hammw
  704.  haverc
  705.  havercos
  706.  havers
  707.  haversin
  708.  havg
  709.  hcc
  710.  hcf
  711.  hcs
  712.  heavg
  713.  hecto
  714.  hemean
  715.  hmean
  716.  hvc
  717.  hvs
  718.  hyp
  719.  hyp3
  720.  hypot
  721.  hypot3

  722.  ie
  723.  ie.a
  724.  ie.ae
  725.  ie.aeb
  726.  ie.aez
  727.  ie.and
  728.  ie.az
  729.  ie.b
  730.  ie.be
  731.  ie.bea
  732.  ie.bez
  733.  ie.bz
  734.  ie.e
  735.  ie.false
  736.  ie.nand
  737.  ie.ne
  738.  ie.nor
  739.  ie.not
  740.  ie.nz
  741.  ie.or
  742.  ie.true
  743.  ie.z
  744.  if
  745.  if.a
  746.  if.ae
  747.  if.aeb
  748.  if.aez
  749.  if.and
  750.  if.az
  751.  if.b
  752.  if.be
  753.  if.bea
  754.  if.bez
  755.  if.bz
  756.  if.e
  757.  if.false
  758.  if.nand
  759.  if.ne
  760.  if.nor
  761.  if.not
  762.  if.nz
  763.  if.or
  764.  if.true
  765.  if.z
  766.  inc
  767.  inc.post
  768.  inc.pre
  769.  int (variable)
  770.  int
  771.  int.3
  772.  int3
  773.  integer
  774.  intto
  775.  inv
  776.  ipow
  777.  ipower
  778.  irecip
  779.  is.inf
  780.  is.invalid
  781.  is.n32
  782.  is.n64
  783.  is.nan
  784.  is.valid
  785.  is.x32
  786.  is.x64

  787.  ke2ce
  788.  ke2fa
  789.  ke2ra
  790.  ke2re
  791.  kibi
  792.  kibo
  793.  kilo

  794.  lb
  795.  lcm
  796.  lg
  797.  lgamma
  798.  lineco
  799.  ln
  800.  log10
  801.  log2
  802.  loge
  803.  logn
  804.  lognr

  805.  matrip
  806.  matrip.rc
  807.  max
  808.  max.adev
  809.  maxd
  810.  maxh.adev
  811.  maxl.adev
  812.  maxmin
  813.  mean
  814.  meander
  815.  mebi
  816.  mebo
  817.  mega
  818.  micro
  819.  milli
  820.  min
  821.  min.adev
  822.  mind
  823.  minh.adev
  824.  minl.adev
  825.  minmax
  826.  mod
  827.  mod.frac
  828.  mod.int
  829.  mod.neg
  830.  mod.pos
  831.  mod.quo
  832.  mod.round
  833.  modr
  834.  modr.frac
  835.  modr.int
  836.  modr.neg
  837.  modr.pos
  838.  modr.round
  839.  mul
  840.  mul.add
  841.  mul.frac
  842.  mul.int
  843.  mul.neg
  844.  mul.pos
  845.  mul.round
  846.  mul.sub
  847.  mul.subr

  848.  nabs
  849.  nadev
  850.  nan
  851.  nand
  852.  nano
  853.  nanu
  854.  ncase
  855.  neg
  856.  neps
  857.  nibble
  858.  ninf
  859.  nor
  860.  norm
  861.  not
  862.  nword
  863.  nzero

  864.  or
  865.  ot
  866.  oword

  867.  pbara
  868.  pbarr
  869.  pbarw
  870.  pcomplex
  871.  pcopx
  872.  pcopy
  873.  pdouble
  874.  pebi
  875.  pebo
  876.  peps
  877.  percent.dec
  878.  percent.decr
  879.  percent.div
  880.  percent.divr
  881.  percent.inc
  882.  percent.incr
  883.  percent.mul
  884.  peta
  885.  pfara
  886.  pfarr
  887.  pfarw
  888.  pfloat
  889.  pico
  890.  pinf
  891.  pint
  892.  pint64
  893.  pinteger
  894.  poly
  895.  popcount
  896.  pos
  897.  pow
  898.  pow10x
  899.  pow2
  900.  pow2x
  901.  pow3
  902.  pow4
  903.  power
  904.  powerr
  905.  powr
  906.  proc.begin
  907.  proc.end
  908.  pstr
  909.  pstring
  910.  pxcopy
  911.  pycopx

  912.  qavg
  913.  qmean
  914.  quebi
  915.  quebo
  916.  quecto
  917.  quetta
  918.  quit
  919.  quit.if
  920.  quit.if.false
  921.  quit.if.not
  922.  quit.if.true
  923.  quo
  924.  quo.frac
  925.  quo.int
  926.  quo.mod
  927.  quo.neg
  928.  quo.pos
  929.  quo.round
  930.  quor
  931.  quor.frac
  932.  quor.int
  933.  quor.neg
  934.  quor.pos
  935.  quor.round
  936.  qword

  937.  r2a
  938.  r2c
  939.  r2d
  940.  r2g
  941.  ra2ce
  942.  ra2fa
  943.  ra2ke
  944.  ra2re
  945.  radians
  946.  ramp
  947.  rcalls
  948.  rcase
  949.  rcase.a
  950.  rcase.ae
  951.  rcase.b
  952.  rcase.be
  953.  rcase.e
  954.  rcase.ne
  955.  re2ce
  956.  re2fa
  957.  re2ke
  958.  re2ra
  959.  reassign
  960.  recip
  961.  rescale
  962.  resclip
  963.  reset
  964.  restore
  965.  result.get
  966.  result.set
  967.  retn
  968.  return
  969.  return.if
  970.  return.if.false
  971.  return.if.not
  972.  return.if.true
  973.  rgamma
  974.  rheven
  975.  rhodd
  976.  rinf
  977.  rint
  978.  rncase
  979.  rninf
  980.  rnzero
  981.  robi
  982.  rol
  983.  ronna
  984.  ronto
  985.  root
  986.  root2
  987.  root3
  988.  root4
  989.  rootr
  990.  ror
  991.  round
  992.  roundto
  993.  rpinf
  994.  rsgn
  995.  rsgnbit
  996.  rsign
  997.  rsignbit
  998.  rtgamma
  999.  rxcall
  1000.  rxgoto
  1001.  rzero

  1002.  saddr
  1003.  sal
  1004.  sar
  1005.  saturate
  1006.  sch
  1007.  sec
  1008.  sech
  1009.  set1
  1010.  setz
  1011.  sgn
  1012.  sgnbit
  1013.  sh
  1014.  shch
  1015.  shl
  1016.  shr
  1017.  sign
  1018.  signbit
  1019.  sin
  1020.  sincos
  1021.  sinh
  1022.  sizeof
  1023.  sqr
  1024.  sqrt
  1025.  str
  1026.  string
  1027.  sub
  1028.  sub.div
  1029.  sub.divr
  1030.  sub.frac
  1031.  sub.int
  1032.  sub.mul
  1033.  sub.neg
  1034.  sub.pos
  1035.  sub.round
  1036.  subr
  1037.  subr.div
  1038.  subr.divr
  1039.  subr.frac
  1040.  subr.int
  1041.  subr.mul
  1042.  subr.neg
  1043.  subr.pos
  1044.  subr.round
  1045.  sumsqr
  1046.  swap
  1047.  swap.frac
  1048.  swap.int
  1049.  swap.round
  1050.  swapl
  1051.  swapr

  1052.  tan
  1053.  tanh
  1054.  tcarg
  1055.  tebi
  1056.  tebo
  1057.  tera
  1058.  teta
  1059.  tetae
  1060.  tg
  1061.  tgamma
  1062.  th
  1063.  trunc
  1064.  tword

  1065.  uplus

  1066.  vadd
  1067.  var
  1068.  varg.a
  1069.  varg.ae
  1070.  varg.aez
  1071.  varg.az
  1072.  varg.b
  1073.  varg.be
  1074.  varg.bez
  1075.  varg.bz
  1076.  varg.e
  1077.  varg.ne
  1078.  varg.nz
  1079.  varg.z
  1080.  vavg
  1081.  vcomplex
  1082.  vcopx
  1083.  vcopy
  1084.  vcount
  1085.  vcount.a
  1086.  vcount.ae
  1087.  vcount.aez
  1088.  vcount.az
  1089.  vcount.b
  1090.  vcount.be
  1091.  vcount.bez
  1092.  vcount.bz
  1093.  vcount.e
  1094.  vcount.ne
  1095.  vcount.nz
  1096.  vcount.z
  1097.  vdouble
  1098.  verc
  1099.  vercos
  1100.  vers
  1101.  versin
  1102.  vfloat
  1103.  vint
  1104.  vinteger
  1105.  vmax
  1106.  vmax.adev
  1107.  vmaxh.adev
  1108.  vmaxl.adev
  1109.  vmaxmin
  1110.  vmean
  1111.  vmin
  1112.  vmin.adev
  1113.  vminh.adev
  1114.  vminl.adev
  1115.  vminmax
  1116.  vmul
  1117.  vncycle
  1118.  vnorm
  1119.  vnstep
  1120.  vpoly
  1121.  vstd
  1122.  vstdp
  1123.  vstr
  1124.  vstring
  1125.  vsum
  1126.  vsumsqr
  1127.  vvarp
  1128.  vvars
  1129.  vvart
  1130.  vxcopy
  1131.  vycopx

  1132.  word

  1133.  x2copy
  1134.  x3copy
  1135.  x4copy
  1136.  xcall
  1137.  xcopy
  1138.  xcosign
  1139.  xgoto
  1140.  xnor
  1141.  xor
  1142.  xsigny
  1143.  xword

  1144.  ycopx
  1145.  ycosign
  1146.  yobi
  1147.  yobo
  1148.  yocto
  1149.  yotta
  1150.  ysignx
  1151.  yword

  1152.  zebi
  1153.  zebo
  1154.  zepto
  1155.  zero
  1156.  zetta
  1157.  zword



Function Symbols
Top
Details
List
  1.  (=)   ...
  2.  ==   ...

  3.  &x   ...
  4.  &&x   ...
  5.  *x   ...
  6.  **x   ...
  7.  =x   ...
  8.  :=x   ...
  9.  ~x   ...
  10.  ?x   ...

  11.  <<?x   ...
  12.  >>?x   ...

  13.  !.x   ...
  14.  ~!.x   ...

  15.  !x   ...
  16.  +x   ...
  17.  -x   ...
  18.  /x   ...
  19.  ++x   ...
  20.  --x   ...
  21.  °x   ...
  22.  °°x   ...

  23.  x^   ...
  24.  x^^   ...
  25.  x`   ...
  26.  x=   ...
  27.  x:=   ...
  28.  x++   ...
  29.  x--   ...
  30.  x!   ...
  31.  x!!   ...
  32.     ...
  33.  x°°   ...

  34.  x==.   ...
  35.  x!=.   ...
  36.  x<>.   ...
  37.  x>.   ...
  38.  x>=.   ...
  39.  x!<.   ...
  40.  x<.   ...
  41.  x<=.   ...
  42.  x!>.   ...

  43.  x==.~   ...
  44.  x!=.~   ...
  45.  x<>.~   ...
  46.  x>.~   ...
  47.  x>=.~   ...
  48.  x!<.~   ...
  49.  x<.~   ...
  50.  x<=.~   ...
  51.  x!>.~   ...

  52.  x:+   ...
  53.  x:++   ...
  54.  x:-   ...
  55.  x:--   ...

  56.  x-=   ...
  57.  x~=   ...

  58.  (|x|)   ...
  59.  (!x!)   ...
  60.  [x]   ...
  61.  {x}   ...
  62.  <x>   ...
  63.  [x,y]   ...
  64.  {x,y}   ...
  65.  <x,y>   ...

  66.  x::y   ...
  67.  x=y   ...   ...   ...
  68.  x[=]y   ...
  69.  x{=}y   ...
  70.  x<=>y   ...
  71.  x:=y   ...   ...
  72.  x[:=]y   ...
  73.  x{:=}y   ...
  74.  x<:=>y   ...
  75.  x=:y   ...
  76.  x[=:]y   ...
  77.  x{=:}y   ...
  78.  x<=:>y   ...
  79.  x*:=y   ...
  80.  x=:*y   ...
  81.  x:=:y   ...   ...
  82.  [x:=:y]   ...
  83.  {x:=:y}   ...
  84.  <x:=:y>   ...

  85.  x>?<y   ...
  86.  x>?~<y   ...
  87.  x>?-<y   ...
  88.  x>?+<y   ...

  89.  x|y   ...
  90.  x~|y   ...
  91.  x|~y   ...
  92.  x~|~y   ...
  93.  x|-y   ...
  94.  x~|-y   ...
  95.  x-|y   ...
  96.  x-|~y   ...
  97.  x^y   ...
  98.  x~^y   ...
  99.  x&y   ...
  100.  x~&y   ...
  101.  x&~y   ...
  102.  x~&~y   ...
  103.  x|0|y   ...
  104.  x|1|y   ...
  105.  x>>y   ...
  106.  x<<y   ...
  107.  x>>>y   ...
  108.  x<<<y   ...
  109.  x>><y   ...
  110.  x<<>y   ...

  111.  x||y   ...
  112.  x!|y   ...
  113.  x^^y   ...
  114.  x!^y   ...
  115.  x&&y   ...
  116.  x!&y   ...

  117.  x==y   ...
  118.  x<>y   ...
  119.  x!=y   ...
  120.  x>y   ...
  121.  x>=y   ...
  122.  x!<y   ...
  123.  x<y   ...
  124.  x<=y   ...
  125.  x!>y   ...
  126.  x<==>y   ...
  127.  x>==<y   ...

  128.  x==~y   ...
  129.  x<>~y   ...
  130.  x!=~y   ...
  131.  x>~y   ...
  132.  x>=~y   ...
  133.  x!<~y   ...
  134.  x<~y   ...
  135.  x<=~y   ...
  136.  x!>~y   ...
  137.  x<==>~y   ...
  138.  x>==<~y   ...

  139.  x->y   ...
  140.  x[y]   ...
  141.  x*->y   ...
  142.  x{y}   ...
  143.  x~>y   ...
  144.  x*~>y   ...
  145.  x&->y   ...
  146.  x*&->y   ...
  147.  x&~>y   ...
  148.  x*&~>y   ...
  149.  x->>y   ...
  150.  x~>>y   ...

  151.  x+y   ...  ...
  152.  x++y   ...
  153.  x+-y   ...
  154.  x[+]y   ...
  155.  x{+}y   ...
  156.  x<+>y   ...
  157.  x-y   ...  ...
  158.  x-+y   ...
  159.  x--y   ...
  160.  x[-]y   ...
  161.  x{-}y   ...
  162.  x<->y   ...
  163.  x~-y   ...  ...
  164.  x~-+y   ...
  165.  x~--y   ...
  166.  x[~-]y   ...
  167.  x{~-}y   ...
  168.  x<~->y   ...
  169.  x*y   ...  ...
  170.  x*+y   ...
  171.  x*-y   ...
  172.  x[*]y   ...
  173.  x{*}y   ...
  174.  x<*>y   ...
  175.  x/y   ...  ...
  176.  x/+y   ...
  177.  x/-y   ...
  178.  x[/]y   ...
  179.  x{/}y   ...
  180.  x</>y   ...
  181.  x~/y   ...  ...
  182.  x~/+y   ...
  183.  x~/-y   ...
  184.  x[~/]y   ...
  185.  x{~/}y   ...
  186.  x<~/>y   ...
  187.  x\y   ...
  188.  x\+y   ...
  189.  x\-y   ...
  190.  x[\]y   ...
  191.  x{\}y   ...
  192.  x<\>y   ...
  193.  x\%y   ...
  194.  x~\y   ...
  195.  x~\+y   ...
  196.  x~\-y   ...
  197.  x[~\]y   ...
  198.  x{~\}y   ...
  199.  x<~\>y   ...
  200.  x%y   ...
  201.  x%+y   ...
  202.  x%-y   ...
  203.  x[%]y   ...
  204.  x{%}y   ...
  205.  x<%>y   ...
  206.  x%\y   ...
  207.  x~%y   ...
  208.  x~%+y   ...
  209.  x~%-y   ...
  210.  x[~%]y   ...
  211.  x{~%}y   ...
  212.  x<~%>y   ...

  213.  x|+|y   ...
  214.  x|*|y   ...
  215.  x|/|y   ...
  216.  x|\|y   ...
  217.  x|A|y   ...
  218.  x|G|y   ...
  219.  x|H|y   ...
  220.  x|C|y   ...
  221.  x|Q|y   ...
  222.  x|h|y   ...
  223.  x|c|y   ...

  224.  x^y   ...  ...
  225.  x**y   ...  ...
  226.  x~^y   ...  ...
  227.  x~**y   ...  ...
  228.  x*/y   ...  ...
  229.  x~*/y   ...  ...

  230.  x?<y   ...
  231.  x?>y   ...
  232.  x?<>y   ...
  233.  x?><y   ...

  234.  x+=y   ...
  235.  x-=y   ...
  236.  x~-=y   ...
  237.  x*=y   ...
  238.  x/=y   ...
  239.  x~/=y   ...
  240.  x\=y   ...
  241.  x~\=y   ...
  242.  x%=y   ...
  243.  x~%=y   ...

  244.  x|=y   ...
  245.  x~|=y   ...
  246.  x|~=y   ...
  247.  x~|~=y   ...
  248.  x|-=y   ...
  249.  x~|-=y   ...
  250.  x-|=y   ...
  251.  x-|~=y   ...
  252.  x^=y   ...
  253.  x~^=y   ...
  254.  x&=y   ...
  255.  x~&=y   ...
  256.  x&~=y   ...
  257.  x~&~=y   ...
  258.  x|0|=y   ...
  259.  x|1|=y   ...
  260.  x>>=y   ...
  261.  x<<=y   ...
  262.  x>>>=y   ...
  263.  x<<<=y   ...

  264.  x*%y   ...
  265.  x/%y   ...
  266.  x~/%y   ...
  267.  x+%y   ...
  268.  x~+%y   ...
  269.  x-%y   ...
  270.  x~-%y   ...



Compiler configuration flags
Top

SIC_CFG_FLAG_CASE_SENSITIVE
SIC_CFG_FLAG_NO_UDF – bypass user-defined functions in SICx*.UDF file
SIC_CFG_FLAG_NO_UDC – bypass user-defined constants in SICx*.UDC file
SIC_CFG_FLAG_NO_UDV – bypass user-defined variables in SICx*.UDV file




Compiler options
Top

SIC_OPT_FLAG_OPTIMIZATION
SIC_OPT_FLAG_STACK_FRAME
SIC_OPT_FLAG_LOCALS
SIC_OPT_FLAG_FP_FRAME
SIC_OPT_FLAG_DEBUG
SIC_OPT_FLAG_CPUX64
SIC_OPT_FLAG_CPUX32
SIC_OPT_FLAG_CPUX
SIC_OPT_FLAG_DALIGN
SIC_OPT_FLAG_NO_CALIGN
SIC_OPT_FLAG_NO_ECALC
SIC_OPT_FLAG_COMPLEX
SIC_OPT_FLAG_COMPACT

You can change compiler option inside the multi-line expressions using $... and #... directives.
$+#+  enable option
$-#-  disable option
$>#>  execute option
$=#=  set default options
${#{  save options
$}#}  restore options

For example:
use $+OPTIMIZATION statement to enable SIC_OPT_FLAG_OPTIMIZATION
use $-OPTIMIZATION statement to disable SIC_OPT_FLAG_OPTIMIZATION
and so on.

The compiler option name in $# statements is case insensitive.

You can use both _ or . symbol in option name.
$+stack_frame is identical to $+stack.frame

The depth of the ${$}#{#}  directives is 256.

 

SIC_OPT_FLAG_OPTIMIZATION

Enable/disable the code optimization.
This option is enabled by default.

$+ optimization 
$- optimization 

 

SIC_OPT_FLAG_STACK_FRAME

Enable/disable the generation of stack frames.
This option is enabled by default.

$+ stack.frame 
$+ stack_frame 
$- stack.frame 
$- stack_frame 

 

SIC_OPT_FLAG_LOCALS

$+ locals 
$- locals 

Enable/disable the allocation of local variables.
This option is enabled by default.

 

SIC_OPT_FLAG_FP_FRAME

Enable/disable the generation of FPU/SSE frames.
This option is disabled by default.

$+ fp.frame 
$+ fp_frame 
$- fp.frame 
$- fp_frame 

 

SIC_OPT_FLAG_DEBUG

Enable/disable debug mode.
This option is disabled by default.

$+ debug 
$- debug 

 

SIC_OPT_FLAG_CPUX64  
SIC_OPT_FLAG_CPUX32  
SIC_OPT_FLAG_CPUX  

$+ CPUX64 
$+ CPUX32 
$+ CPUX 
$- CPUX64 
$- CPUX32 
$- CPUX 

Examples:

$+ CPUX64  // the following code is accepted only on a 64-bit CPU
x = 640;   
a = x + 2;   
$+ CPUX32  // the following code is accepted only on a 32-bit CPU
y = 320;   
b = y + 2;   
$+ CPUX    // the following code is accepted on any CPU
z = 888;   
c = z + 2;   

$- CPUX64  // the following code is rejected only on a 64-bit CPU
x = 640;   
a = x + 2;   
$- CPUX32  // the following code is rejected only on a 32-bit CPU
y = 320;   
b = y + 2;   
$- CPUX    // the following code is rejected on any CPU
t = 555;   
d = t + 2;   
$+ CPUX    // the following code is accepted on any CPU
z = 888;   
c = z + 2;   

 

SIC_OPT_FLAG_DALIGN

Enable/disable data alignment.
This option is disabled by default.

$+ dalign N  // enable N-byte data alignment (0 < N ≤ 64)
$+ dalign    // enable default data alignment
$- dalign    // disable data alignment
$> dalign N  // perform N-byte data alignment (0 < N ≤ 64)
$> dalign    // perform default data alignment

Default alignment:
x32-FPU: 8-byte
x32-SSE: 16-byte
x64-FPU: 16-byte
x64-SSE: 16-byte

Examples:

$+ dalign 16  // enable 16-byte data alignment
var z0.re=3; 
$- dalign     // disable data alignment
var z0.im=4; 
complex z0 absolute z0.re; 
// z0.re  - aligned
// z0.im  - not aligned
// Re(z0) = z0.re
// Im(z0) = z0.im

$+ dalign 16  // enable 16-byte data alignment
var z0.re=3;  
var z0.im=4;  
complex z0 absolute z0.re;  
// z0.re  - aligned
// z0.im  - aligned
// Re(z0) = z0.re
// Im(z0) = undefined

$> dalign 16  // perform 16-byte data alignment
var z0.re=3;
var z0.im=4;
complex z0 absolute z0.re;
// z0.re  - aligned
// z0.im  - not aligned
// Re(z0) = z0.re
// Im(z0) = z0.im

$> dalign 16  // perform 16-byte data alignment
var z0.re=3;
$> dalign 16  // perform 16-byte data alignment
var z0.im=4;
complex z0 absolute z0.re;
// z0.re  - aligned
// z0.im  - aligned
// Re(z0) = z0.re
// Im(z0) = undefined

 

SIC_OPT_FLAG_NO_CALIGN

Disable/enable the code alignment.
This option is disabled by default.

$+ no.calign 
$+ no_calign 
$- no.calign 
$- no_calign 

 

SIC_OPT_FLAG_NO_ECALC

Disable/enable the compile-time calculations of external functions with constant arguments.
This option is disabled by default.

$+ no.ecalc 
$+ no_ecalc 
$- no.ecalc 
$- no_ecalc 

 

SIC_OPT_FLAG_COMPLEX

Enable/disable the symbols  +-~-*/~/^~^**~***/~*/  in expressions with complex numbers.
This option is disabled by default.

$+ complex 
$- complex 

Example:

complex z0, z1=1.2,3.4, z2=5.6,7.8;
$+ complex          // enable SIC_OPT_FLAG_COMPLEX
z0 = z1 + z2 * z1;  // SUCCESS
$- complex          // disable SIC_OPT_FLAG_COMPLEX
z0 = z1 + z2 * z1;  // ERROR

 

SIC_OPT_FLAG_COMPACT

Enable/disable the compact mode.
If compact mode is enabled, you can use a line break as an expression separator.
This option is disabled by default.

$+ compact 
$- compact 

Example:

$+ compact // enable SIC_OPT_FLAG_COMPACT
a = sin(x)
b = cos(x)
c = a^2 + b^2
$- compact // disable SIC_OPT_FLAG_COMPACT
a = sin(x);
b = cos(x);
c = a^2 + b^2;




Error codes
Top

SIC_ERROR_SUCCESS = 0
SIC_ERROR_GENERAL = 1
SIC_ERROR_CPU = 2
SIC_ERROR_STRING = 3
SIC_ERROR_MEMORY = 4
SIC_ERROR_BRACKET = 5
SIC_ERROR_TOKEN = 6
SIC_ERROR_RT_TOKEN = 7
SIC_ERROR_STACK = 8
SIC_ERROR_RPN_BUILD = 9
SIC_ERROR_CODE_BUILD = 10
SIC_ERROR_ARGUMENT = 11
SIC_ERROR_EVALUATE = 12
SIC_ERROR_EXECUTE = 13
SIC_ERROR_RANGE = 14
SIC_ERROR_NO_IMPL = 15
SIC_ERROR_POINTER = 16




Constants
Top

Double constants
1
1.1
1E+1
1D+1

Double base-16 constants
$: 400921FB54442D18 = 3.141592653589793
0h 40934A456D5CFAAD = 1234.5678
0H 3FF0000000000000 = 1.0

Integer base-10 constants
 # 111 = 11110
0i 111 = 11110
0I 111 = 11110
0n 111 = 11110
0N 111 = 11110
0t 111 = 11110
0T 111 = 11110

Integer base-16 constants
 $ 111 = 11116 = 27310
0x 111 = 11116 = 27310
0X 111 = 11116 = 27310

Integer base-2 constants
## 111 = 1112 = 710
0b 111 = 1112 = 710
0B 111 = 1112 = 710

Integer base-8 constants
$$ 111 = 1118 = 7310
0o 111 = 1118 = 7310
0O 111 = 1118 = 7310

Passing constant as double parameter
x = sin(100)
x = sin(#100:double)
x = sin(0i100:double)
x = sin($64:double)
x = sin(0x64:double)
x = sin(##01100100:double)
x = sin(0b01100100:double)
x = sin($$144:double)
x = sin(0o144:double)
x = y*100
x = y*0i100:double

Passing constant as integer parameter
x = func(100:int)
x = func(#100)
x = func(0i100)
x = func($64)
x = func(0x64)
x = func(##01100100)
x = func(0b01100100)
x = func($$144)
x = func(0o144)




Labels
Top

Named labels
proc:
no align
proc:0
no align
proc:N
align N (0 < N ≤ 64)
proc:16
align 16
proc::
default align  
Anonymous labels (for code alignment only)
@@:
no align
@@:0
no align
@@:N
align N (0 < N ≤ 64)
@@:16
align 16
@@::
default align  

Default alignment:
x32-FPU: 8-byte
x32-SSE: 16-byte
x64-FPU: 16-byte
x64-SSE: 16-byte

To disable code align at labels, enable SIC_OPT_FLAG_NO_CALIGN compiler option.




Postfix notation
Top

Functions with fixed number of arguments can use postfix notation

Use : concatenation symbol to prefer local functions
(a,b):add   
(x+y):cos   
x:sin   
x:sin:sqr + x:cos:sqr // sin2(x) + cos2(x)   

Use # concatenation symbol to prefer global functions
(a,b)#add   
(x+y)#cos   
x#sin   
x#sin#sqr + x#cos#sqr // sin2(x) + cos2(x)   




Compile-time calculations
Top

SICx calculates at compile time some functions with constant arguments and no-void return value.

For example, the expression sin(logn(2,256)+cos(123)-sqrt(4)*(3-1))
will be replaced in the output code by the single constant 0.0295572548982532

To avoid compile-time calculation, add function (sic_afun) with non-zero dynamic flag.

The list of the argument types for compile-time-calculated functions:

• 0 arguments
func ( void )

• 1 argument
func (  double )
func ( integer )

• 2 arguments
func (  double ,  double )
func (  double , integer )
func ( integer , integer )
func ( integer ,  double )

• 3 arguments
func (  double ,  double ,  double )
func ( integer , integer , integer )

• 4 arguments
func (  double ,  double ,  double ,  double )
func ( integer , integer , integer , integer )

To evaluate any expression at compile time, start it with ':' symbol
: x=y+z; //  evaluate the expression at compile time

Variable declaration is a kind of compile-time-calculated expressions.
For example, the expression
var x1=(x2=222)+(x3=333),x4;    
declares four double variables:
x1 (value = 555)
x2 (value = 222)
x3 (value = 333)
x4 (value = 0)




Examples
Top

double aas;      // declare variable 
: aas = 1/32767; // evaluate at compile time

u->3 = roundto (100000*aas, -6); 

// crt_rand returns integer result
// use :double modifier to get double value
x = crt_rand:double * aas; 

a = sin (x); 
b = cos (x); 
c = a^2 + b^2; 

string aa; 
string ss = "123456.789"; 
string zz = "a\cZ\t\x30"; 
string uu = "\u0031\x32\063"; 

aa = ss; 
x = strtod (uu, null); 
strtod (aa, null) 

int n = 10; 
int m = 20; 
double nn = n; 
a + nn + m:double 

// sum(n), n=1..100 

int n = 0; 
int m = 100; 
double su = 0; 

reset(n); 
reset(m); 
| SE: 
|   n += 1; 
|   su += n; 
| goto.if SE, n<m; // if n<m then goto SE 

result: 
su // return result 

// goto label example

x = 0; 
goto mars; 
x += 2; 

mars: 
x // return result 

// Procedure call example 

call procc; 
goto result; 

| procc: // procedure 
| proc.begin 
|   a = b*c; 
|   a = sin(a); 
| proc.end 

a = 8888; 

result: 
a // return result 

// Create file example 

int file = 0; 
int p2 = 0xC0000000; // GENERIC_READ(0x80000000) or GENERIC_WRITE(0x40000000) 
int p3 = 0x00000001; // FILE_SHARE_READ(0x00000001) 
int p5 = 2;          // CREATE_ALWAYS(2) 
int p6 = 0x00000080; // FILE_ATTRIBUTE_NORMAL(0x00000080) 
int p7 = 0; 
int pp = 0; 

string data = "http://flatassembler.net\r\n\x22\x95\x22\r\n"; 
int sz = lstrlen (data); 

file = CreateFile ( 
  "TEST.FILE", 
  p2, p3, null, 
  p5, p6, p7 
); 

WriteFile (file, 
  data, sz, 
  &pp, null 
); 

CloseHandle (file); 
pp // return result 

// Вычисление элементарной сплайновой 
// кривой Catmull-Rom в трехмерном 
// пространстве 

// Опорные точки 
double x1 = -1; 
double y1 = -1; 
double z1 =  0; 
double x2 = -1; 
double y2 =  1; 
double z2 =  0; 
double x3 =  1; 
double y3 = -1; 
double z3 =  0; 
double x4 =  1; 
double y4 =  1; 
double z4 =  0; 

// Промежуточные переменные 
double px1; 
double py1; 
double pz1; 
double px2; 
double py2; 
double pz2; 
double px3; 
double py3; 
double pz3; 
double px4; 
double py4; 
double pz4; 

double ansx; 
double ansy; 
double ansz; 

int iOptCnt = 50000000; // количество рассчитываемых точек 
double dt = 1.0 / iOptCnt:double; // инкремент параметра tt на каждой итерации 

double t1; 
double t2; 
double t3; 
double n0; 
double n1; 
double n2; 
double n3; // Коэффициент сплайна 

int i; 
double tt; 

i = 0; 
tt = 0; 

| SE: 
|   // n0 = (-tt * ((1 - tt) * (1 - tt))) / 2; 
|   // n1 = (2 - 5 * tt * tt + 3 * tt * tt * tt) / 2; 
|   // n2 = (tt / 2) * (1 + 4 * tt - 3 * tt * tt); 
|   // n3 = -((tt * tt) / 2) * (1 - tt); 
| 
|   t1 = 1 - tt; 
|   t2 = tt * tt; 
|   t3 = tt * t2; 
| 
|   n0 = (-tt * (t1 * t1)) * (1 / 2); 
|   n1 = (2 - 5 * t2 + 3 * t3) * (1 / 2); 
|   n2 = (tt * (1 / 2)) * (1 + 4 * tt - 3 * t2); 
|   n3 = -(t2 * (1 / 2)) * t1; 
| 
|   px1 = x1 * n0; py1 = y1 * n0; pz1 = z1 * n0; 
|   px2 = x2 * n1; py2 = y2 * n1; pz2 = z2 * n1; 
|   px3 = x3 * n2; py3 = y3 * n2; pz3 = z3 * n2; 
|   px4 = x4 * n3; py4 = y4 * n3; pz4 = z4 * n3; 
| 
|   ansx = px1 + px2 + px3 + px4; 
|   ansy = py1 + py2 + py3 + py4; 
|   ansz = pz1 + pz2 + pz3 + pz4; 
| 
|   tt += dt; 
|   i += 1; 
| goto.if SE, i<iOptCnt; // if i<iOptCnt then goto SE 

result: 
x = ansx; 
y = ansy; 
z = ansz; 
t = tt; 

// c := 0; 
// for i := 1 to 100 do begin 
//   c := c + 2; 
// end; 

int i = 1; 
int imax = 100; 

c=0; 

reset(i); 
reset(imax); 
| for.enter: 
|   goto.if for.leave, i>imax; // goto for.leave if i>imax 
| for.body: 
| 
|   c+=2; 
| 
| for.next: 
|   i+=1; 
|   goto.if for.body, i<=imax; // goto for.body if i<=imax 
| for.leave: 

result: 
c 

// c := 0; 
// for i := 1 to 100 do begin 
//   for j := 1 to 100 do begin 
//     c := c + 2; 
//   end; 
// end; 

int i; 
int imax; 
int j; 
int jmax; 

c=0; 

| i=1; imax=100; 
| for.i.enter: 
|   goto.if for.i.leave, i>imax; // goto for.i.leave if i>imax 
| for.i.body: 
| 
|   | j=1; jmax=100; 
|   | for.j.enter: 
|   |   goto.if for.j.leave, j>jmax; // goto for.j.leave if j>jmax 
|   | for.j.body: 
|   | 
|   |   c+=2; 
|   | 
|   | for.j.next: 
|   |   j+=1; 
|   |   goto.if for.j.body, j<=jmax; // goto for.j.body if j<=jmax 
|   | for.j.leave: 
| 
| for.i.next: 
|   i+=1; 
|   goto.if for.i.body, i<=imax; // goto for.i.body if i<=imax 
| for.i.leave: 

result: 
c 

// c := 0; 
// a := 0; 
// b := 8; 
// 
// while a < b do begin 
//   c := c + 1; 
//   b := b - 1; 
// end; 

c=0; a=0; b=8; 

| while.enter: 
|   goto.if while.leave, a>=b; // goto while.leave if a>=b 
| while.body: 
| 
|   c+=1; 
|   b-=1; 
| 
| while.next: 
|   goto.if while.body, a<b; // goto while.body if a<b 
| while.leave: 

result: 
c 

// c := 0; 
// a := 0; 
// b := 8; 
// 
// repeat 
//   c := c + 1; 
//   b := b - 1; 
// until a > b; 

c=0; a=0; b=8; 

| repeat.enter: 
| 
|   c+=1; 
|   b-=1; 
| 
| repeat.next: 
|   goto.if repeat.enter, a<=b; // goto repeat.enter if a<=b 
| repeat.leave: 

result: 
c 

// case a of 
//   x : b := 2; 
//   y : b := 4; 
//   z : b := 8; 
//   else b := 256; 
// end; 

| case.enter: 
|   goto.if case.x, a==x; // goto case.x if a=x 
|   goto.if case.y, a==y; // goto case.y if a=y 
|   goto.if case.z, a==z; // goto case.z if a=z 
| case.else: 
|   b = 256; 
|   goto case.leave; 
| case.x: 
|   b = 2; 
|   goto case.leave; 
| case.y: 
|   b = 4; 
|   goto case.leave; 
| case.z: 
|   b = 8; 
|   // goto case.leave; 
| case.leave: 

result: 
b 

// c := 1; 
// a := 2; 
// b := 8; 
// 
// if a > b then begin 
//   c := c + 1; 
// end else begin 
//   c := c - 1; 
// end; 

c=1; a=2; b=8; 

| if.enter: 
|   goto.if if.then, a>b; // goto if.then if a>b 
| 
| if.else: 
|   c-=1; 
|   goto if.leave; 
| 
| if.then: 
|   c+=1; 
| 
| if.leave: 

result: 
c 

// c := 1; 
// a := 2; 
// b := 8; 
// x := 2.2; 
// y := 8.8; 
// 
// if (a > b) or (x > y) then begin 
//   c := c + 1; 
// end else begin 
//   c := c - 1; 
// end; 

c=1; a=2; b=8; x=2.2; y=8.8; 

| if.enter: 
|   goto.if if.then, a>b; // goto if.then if a>b 
|   goto.if if.then, x>y; // goto if.then if x>y 
| 
| if.else: 
|   c-=1; 
|   goto if.leave; 
| 
| if.then: 
|   c+=1; 
| 
| if.leave: 

result: 
c 

// c := 1; 
// a := 2; 
// b := 8; 
// x := 2.2; 
// y := 8.8; 
// 
// if (a > b) and (x > y) then begin 
//   c := c + 1; 
// end else begin 
//   c := c - 1; 
// end; 

c=1; a=2; b=8; x=2.2; y=8.8; 

| if.enter: 
|   goto.if if.else, a<=b; // goto if.else if a≤b 
|   goto.if if.else, x<=y; // goto if.else if x≤y 
| 
| if.then: 
|   c+=1; 
|   goto if.leave; 
| 
| if.else: 
|   c-=1; 
| 
| if.leave: 

result: 
c 

// c := 1; 
// a := 2; 
// b := 8; 
// d := 6; 
// x := 2.2; 
// y := 8.8; 
// z := 6.6; 
// 
// if ((a > b) and (x > y)) or ((a < d) and (x < z)) then begin 
//   c := c + 1; 
// end else begin 
//   c := c - 1; 
// end; 

c=1; 
a=2; b=8; d=6; 
x=2.2; y=8.8; z=6.6; 

| int if.cond; 
| if.cond=((a > b) and (x > y)) or ((a < d) and (x < z)); 
| if.enter: 
|   // goto if.then if (if.cond=true) 
|   goto.if if.then, if.cond; 
|   
| if.else: 
|   c-=1; 
|   goto if.leave; 
|   
| if.then: 
|   c+=1; 
|   
| if.leave: 
  
result: 
c 

$+ STACK_FRAME 
$+ LOCALS 

int ps;
int pchar;

// allocate 20 bytes for string
ps = malloc (0i20);
return.if(-1,ps==0); // return -1 on error

// convert base-10 integer to string
pchar = ltoa (0i123456789, ps, 0i10);

// get string length
y = lstrlen (pchar);

// convert string to double
x = strtod (pchar, null);

// free string
free (ps);

result:
x;

// FPU Control 
// msvcrt.dll 

int RC_o = 0; 
int PC_o = 0; 
int RC_n = 0x00000300; // _RC_CHOP 
int PC_n = 0x00000000; // _PC_64 

RC_o = controlfp (RC_n, 0x00000300); 
PC_o = controlfp (PC_n, 0x00030000); 

// Rounding Control 
//
// _MCW_RC  = 0x00000300 
//
// _RC_NEAR = 0x00000000 
// _RC_DOWN = 0x00000100 
// _RC_UP   = 0x00000200 
// _RC_CHOP = 0x00000300 

// Precision Control 
//
// _MCW_PC  = 0x00030000 
//
// _PC_64   = 0x00000000 
// _PC_53   = 0x00010000 
// _PC_24   = 0x00020000 

// FPU status word test 

// f[n]stsw ax 
// ah                        al 
// 07 06 05 04 03 02 01 00   07 06 05 04 03 02 01 00 
// ?? C3 ?? ?? ?? C2 C1 C0   ?? ?? PE UE OE ZE DE IE 

// f[n]stcw m2b 
// mh                        ml 
// 07 06 05 04 03 02 01 00   07 06 05 04 03 02 01 00 
// ?? ?? ?? IC RC RC PC PC   ?? ?? PE UE OE ZE DE IE 

var bb; 
var cc; 
int cw_o; 
int ef_n; 

// clear FPU exception flags 
fnclex; 

// save FPU control word 
fnstcw cw_o; 

// mask all FPU exceptions 
fnmaske 0b00111111; 

// divide by zero 
cc = 0; 
bb = a / cc; 

// get exception flags 
fstef ef_n; 

// test OE, ZE and IE flags 
ef_n = ef_n & 0b00001101; 

goto.if.nz E_1, ef_n; // goto E_1 if some flags are set 

E_0: // all flags are clear 
b = 888; 
goto leave; 

E_1: // some flags are set 
b = -888; 

leave: 

// clear FPU exception flags 
fnclex; 

// restore FPU control word 
fldcw cw_o; 

result: 
bb; 

// Bitwise expressions 

var cc = 16; 
int uu_1; 
int uu_2; 
int pp_1; 
int pp_2; 
int nn_1; 
int nn_2; 
int ee_1; 
int ee_2; 

// uu := 0x1 or 0x2 
uu_1 = 0x1 | 0x2; 
uu_2 = 0x1 | (cc/8):int; 

// pp := 0x1 or 0x2 or 0x4 
pp_1 = 0x1 | 0x2 | 0x4; 
pp_2 = 0x1 | 0x2 | (cc/4):int; 

// nn := 0x1 or 0x2 or 0x4 or 0x8 
nn_1 = 0x1 | 0x2 | 0x4 | 0x8; 
nn_2 = 0x1 | 0x2 | 0x4 | (cc/2):int; 

// ee := 0x1 or 0x2 and 0x4 or 0x10 
ee_1 = 0x1 | 0x2 & 0x4 | 0x10; 
ee_2 = 0x1 | 0x2 & 0x4 | cc:int; 

result: 
u->0 = uu_2:double; 
u->1 = pp_2:double; 
u->2 = nn_2:double; 
u->3 = ee_2:double; 
x = uu_1; 
y = pp_1; 
z = nn_1; 

// return example 

$+ STACK_FRAME 
$+ LOCALS 

a = x; 

| case.enter: 
|   goto.if case.x, a==x; // goto case.x if a=x 
|   goto.if case.y, a==y; // goto case.y if a=y 
|   goto.if case.z, a==z; // goto case.z if a=z 
| case.else: 
|   // a=? 
|   return (b = 256); 
| case.x: 
|   // a=x 
|   return (b = 2); 
| case.y: 
|   // a=y 
|   return (b = 4); 
| case.z: 
|   // a=z 
|   return (b = 8); 
| case.leave: 

a = 888; 

// Complex numbers 

complex a0 = 10,20; 
complex b0 = 30,40; 
complex c0 = 50,60; 
complex d0 = 70,80; 
complex z0 = 11,22; 
complex u0, v0, m0, n0; 

// u = (a*z + b)/(c*z + d) 

cmove(u0, 
  cdiv( 
    cadd(cmul(a0,z0), b0), 
    cadd(cmul(c0,z0), d0) 
  ) 
); 

// v = (1/2)*(z + 1/z) 

cmove(v0, 
  crmul(cadd(z0, cinv(z0)), 1/2) 
); 

// m = z^2 + c 

cmove(m0, 
  cadd(csqr(z0), c0) 
); 

// n = z^2.2 + c 

cmove(n0, 
  cadd(cpowx(z0, 2.2), c0) 
); 

// Code benchmark 

int i0, imax = 1000000; // 1E-06 
var x0, y0, r0; int p0, n0; str s0; 

i0 = 0; r0 = 0; 
x0 = x; y0 = y; 
p0 = 0; n0 = 0; 

bench: // code to bench 
r0 = 
sin(x0); 

i0 += 1; 
goto.if bench, i0 < imax; // goto bench if i0 < imax 

r0;





Notes
Top

#1
Valid symbols for function, variable or constant name are:
'.', '_', '@', 'A'…'Z', 'a'…'z', '0'…'9'
Name can`t be a single char: '.', '_' or '@'
First symbol can`t be a digit

#2
Maximum length of function name = 49 symbols
Maximum length of constant name = 43 symbols
Maximum length of variable name = 43 symbols

#3
Base type of variables and numbers is 64-bit float

#4
Default memory settings:
• Memory block size = 64K
• Maximum token count = 20480 (single-line expression)
• Maximum rpn item count = 12287 (single-line expression)
• Maximum code size = 256K - 16B*(1 + rpn item count) (single-line expression)
• Maximum code size = 256K (multi-line expression)

#5
Symbols can be delimitered by space symbol
These expressions are different
(a !> b)(a! > b)
(a!! < b)(a! !< b)

#6
Parentheses are not required if the expression contains a single function
goto(label);   is equivalent to   goto label;
call(proc);   is equivalent to   call proc;
x = min(a,b);   is equivalent to   x = min a,b;
x = min(a,b) + 10;   is equivalent to   x = (min a,b) + 10;

#7
Comments in multi-line expression
//…    — single-line comment
/*…*/  — multi-line comment

#8
Use '!'   '|'   '¦'   '#'   '*'   '+'   '/'   '\'   '•' leading symbols for code markup in multi-line expressions.
Markup symbols must be followed by space symbol, otherwise markup symbol will be considered as a part of an expression.

#9
Use # prefix symbol to prefer global objects
#somefunc(x) — call procedure with name somefunc from global functions table
Use `` prefix symbols to prefer local objects

#10
Calling conversion for user defined and external functions
x32: cdecl or stdcall
x64: fastcall

#11
SSE-versions of compiler (SICs32.DLL and SICs64.DLL).
SICs compiler generates mixed code (SSE2, SSE3, SSE4.1, FPU).
There is a number of functions that have only the FPU implementation.




History
Top

Versions 5.2.1 – 1.1.0

Legend
[+] new
[-] remove
[!] change
[~] change
[@] bug fix


Contacts
Top

E-mail
maa@maalchemist.ru
maalchemist@yandex.ru
maalchemist@gmail.com

WWW
https://maalchemist.ru
http://maalchemist.narod.ru