\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amsfonts,amssymb}
%\usepackage[francais]{babel}
\usepackage{times}
\usepackage{xspace}
\usepackage{makeidx}
\usepackage{ifpdf}
\ifpdf
 \usepackage[colorlinks,pdftex]{hyperref}
\else
 \usepackage[ps2pdf,breaklinks=true,colorlinks=true,linkcolor=red,citecolor=green]{hyperref}
\fi
\newcommand{\bs}{\symbol{92}}
\newtheorem{thm}{Theorem}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{defn}[thm]{Definition}
\makeindex

% \renewcommand{\cuttingunit}{subsection} (add HEVEA after % for hacha)
\input{giac.tex}
\ifhevea
\(
\newcommand{\R}{{\mathbb{R}}}
\newcommand{\C}{{\mathbb{C}}}
\newcommand{\Z}{{\mathbb{Z}}}
\newcommand{\N}{{\mathbb{N}}}
\newcommand{\Q}{{\mathbb{Q}}}
\newcommand{\tr}{\mbox{tr\,}}
\)
\else
\newcommand{\R}{{\mathbb{R}}}
\newcommand{\C}{{\mathbb{C}}}
\newcommand{\Z}{{\mathbb{Z}}}
\newcommand{\N}{{\mathbb{N}}}
\newcommand{\Q}{{\mathbb{Q}}}
\newcommand{\tr}{\mbox{tr\,}}
\fi
%HEVEA\htmlfoot{Back to \ahref{http://www-fourier.univ-grenoble-alpes.fr/\home{parisse}/giac.html}{Giac/Xcas} homepage.}
\giacmathjax
%HEVEA\renewcommand{\footertext}{}

\begin{document}
\title{$\chi$CAS for Numworks calculators}
\author{Bernard.Parisse@univ-grenoble-alpes.fr}
\date{2024}

\begin{giacjshere}


\maketitle

%{\bf Beware: work in progress: this document is adapted from the Casio KhiCAS manual. It is still in alpha stage.}

\begin{abstract}
This document explains how to run efficiently $\chi$CAS
on Numworks calculators (N0110, N0115, N0120).
$\chi$CAS is a port of
the \ahref{https://www-fourier.univ-grenoble-alpes.fr.fr/\home{parisse}/giac.html}{Giac/Xcas} computer algebra system (CAS) for these calculators.
Main features are: CAS, spreadsheet, 2d/3d interactive/analytic geometry,
like on high-end CAS calculators, and more in some areas.

This document is interactive, you can modify and run commands by clicking
in the \framebox{ok} button or by hitting Enter.
\end{abstract}

\tableofcontents

%\printindex

\section{Introduction and installation} \label{sec:install}
$\chi$CAS is a port of the
\ahref{https://www-fourier.univ-grenoble-alpes.fr.fr/\home{parisse}/giac.html}{Giac/Xcas}
computer algebra system (CAS) for the following Numworks calculators 
(N0110, N0115, N0120).
\begin{itemize}
\item
{\bf In some countries, CAS calculators are not allowed during exams,
it is the user responsability to check the rules before running $\chi$CAS
in an exam. The authors shall not be held responsible for misuse
of $\chi$CAS in exam conditions.}
\item
{\bf $\chi$CAS is not compatible with exam mode except 
on old ``unlocked'' N0110}. 
In countries where
CAS calculators are allowed, there is no reason to forbid $\chi$CAS. If
many teachers send a mail to Numworks asking for $\chi$CAS compatibility,
we increase the chances that Numworks sign the addin and make it
compatible with exam mode.
\end{itemize}

The following versions of $\chi$CAS are available for the Numworks~:
\begin{itemize}
\item The initial port, for old Numworks N0110 with Epsilon version at most 
15.5 (or unlocked N0110 with Omega or Upsilon). This version is
compatible with exam mode.
\item An N0110/N0115 external app running on Epsilon 22 or 23. This
app is not compatible with exam mode. It is available in short
and long version. The long version has full online Xcas documentation
and additional support for help in German, Spanish and Greek. 
\item An N0120 external app running on Epsilon 22 or 23.  This
app is not compatible with exam mode. It is available in short
and long version. The long version has full online Xcas documentation
and additional support for help in German, Spanish and Greek.
\end{itemize}
Refer to the developer section \ref{sec:dev} for technical information.

\subsection{Calculator}
If you have a ``locked'' Numworks with Epsilon version 16 or above, it
is most probably required that you update your Epsilon version. To do that,
press the 6 button, hold it down, press RESET, release the 6 button
and go on \ahref{https://www.numworks.com/calculator/update/}{Numworks site}
to update, then close the Numworks site tab/window.

To install or update  $\chi$CAS, connect the USB cable of the calculator, 
and open a web-usb compatible browser 
\ahref{https://xcas.univ-grenoble-alpes.fr/nw/nws_en.html}{on this link}
click on Install on the top bar and follow instructions.

\subsection{Simulator} \label{sec:simulator}
$\chi$CAS can be installed inside the Numworks simulator, but the 
current Epsilon
license ("All rights reserved'') 
does currently not allow redistribution of binaries.
You can either run Upsilon (based on Epsilon 15.5)+Xcas
or compile the simulator yourself.
{\bf Run Upsilon+Xcas}:
\begin{enumerate}
\item Version without installation,
\ahref{https://www-fourier.univ-grenoble-alpes.fr/\home{parisse}/kcasen.html}{runs inside a browser} like Firefox, Chrome,....\\
Shortcut to run Xcas from Numworks main menu: press the Back key.\\
With this version, you can share a session by displaying a QR code:
press Power (on a real calculator, you can display the QR code by saving
the session: press shift EXE then 2 or 3). Press Back to return to the shell.
\item Windows: download
\ahref{https://www-fourier.univ-grenoble-alpes.fr/\home{parisse}/numworks/upsilon.zip}{upsilon.zip},
open the archive and run {\tt upsilon.exe}
\item Mac, stable version (checked on OS 12.7.1 and 14.4): download
\ahref{https://www-fourier.univ-grenoble-alpes.fr/\home{parisse}/numworks/Upsilon.dmg}{Upsilon.dmg},
open the disk image {\tt Upsilon.dmg}\\
Many thanks to Adrien Bertrand who helped me doing the port and build
the signed package.
% \item Mac latest version: download
% \ahref{https://www-fourier.univ-grenoble-alpes.fr/\home{parisse}/numworks/upsilon.dmg}{upsilon.dmg},
% open the disk image {\tt
%   upsilon.dmg}. Right-click on {\tt Upsilon.pkg} while keeping
% the Control key pressed, choose Open, follow instructions.
% The {\tt upsilon.app} application will be installed in {\tt
%   /Applications}.\\
% If you do not have admin priviledges, open a Terminal (type Terminal
% in launchpad) and copy-paste
% \begin{verbatim}
% cd /tmp
% tar xvf /Volumes/upsilon/Upsilon.pkg Payload
% cd /Applications
% tar xvf /tmp/Payload
% \end{verbatim}
\item Linux or compile from sources~:
\begin{verbatim}
wget https://www-fourier.univ-grenoble-alpes.fr/~parisse/numworks/upsilon.tar.bz2
tar xfj upsilon.tar.bz2
cd Upsilon
wget https://www-fourier.univ-grenoble-alpes.fr/~parisse/numworks/ext.tar.bz2
tar xfj ext.tar.bz2
wget https://www-fourier.univ-grenoble-alpes.fr/~parisse/numworks/upsilon_cas_full.tgz
tar xfz upsilon_cas_full.tgz
\end{verbatim}
then run \verb|mksimu| (Linux) or \verb|mkmac| (Mac) or
\verb|mkwin| (Windows). Target javascript can be compiled with
emscripten 1.40 and script \verb|mkw|, it requires
versions of GMP, MPFR and MPFI libraries compiled with \verb|-fPIC|,
these libraries can be found in
\ahref{https://www-fourier.univ-grenoble-alpes.fr/\home{parisse}/giac/emgiac3.tgz}{emgiac3}, this directory
contains a copy of an install of 
\ahref{https://www-fourier.univ-grenoble-alpes.fr/\home{parisse}/giac/emsdk_1.40.1.tar.bz2}{emscripten 1.40.1} 
on  Ubuntu 20 \verb|x86_64| architecture.
\end{enumerate}
{\bf Short procedure to compile Epsilon 22+Xcas}, for more
details, refer to \ref{sec:dev})
\begin{enumerate}
\item Windows
\begin{enumerate}
\item Install \ahref{https://www.msys2.org}{msys2/mingw64}
\item
Open a terminal mingw64 from Windows main menu, submenu msys2.
In the option menu of the windows (up left corner)
select Keys, then check Ctrl-shift-letter shortcut,
this enables paste with Ctrl-shift-V.
\item
copy-paste the following commands (ctrl-c then ctrl-shift-v)\\
\verb|  pacman -S wget|\\
\verb|  wget https://www-fourier.univ-grenoble-alpes.fr/~parisse/numworks/nwwin|\\
\verb|  ./nwwin|\\
Wait some time. If everything went well, the simulator \verb|epsilon.exe| 
will open. The simulator executable is 
\verb|c:\msys64\home\username\epsilon\epsilon.exe| 
where \verb|username|
is your Windows username.
You can move it to another folder or copy it on another PC.\\
Beware that software licenses do not allow public redistribution.
\end{enumerate}
\item Mac~:
\begin{enumerate}
\item From launchpad, type Terminal in the research field,
then Enter, this will open a Terminal.
\item Download
  \ahref{https://www-fourier.univ-grenoble-alpes.fr/\home{parisse}/numworks/nwmac}{nwmac}, check that it is in your Downloads folder.
\item Copy-paste (command-c and command-v) the command \\
  \verb|  ~/Downloads/nwmac|\\
Wait some time. If everything went well, the simulator
will open. It has been copied to \verb|/Applications|
and may be opened like any other application.
\item Optionnal, if you want to copy the simulator on another Mac\\
A package \verb|Khicasnw.pkg| has been created in your Download
directory. Open the Mac disk utility, in the File menu select New image,
create a disk image. Copy the package to the disk image, eject the
disk image from Finder. Now you can copy the disk image (by net or
USB key) on another Mac. On the other Mac, open the disk image from Finder
then click on the package while pushing the Control key and install.\\
Beware that software licenses do not allow public redistribution.
\end{enumerate}
\item Linux~: see \ref{sec:dev}
\end{enumerate}

{\bf Simulator info}\\
Run \verb|upsilon.exe| (Windows), 
or \verb|upsilon.app| in \verb|Applications| (Mac), 
or \verb|./simu| from \verb|epsilon| directory (Linux).
Press Esc to run KhiCAS (or move to KhiCAS at the end of
the Numworks main menu and press Enter).
Note that the shift calculator key does not link to the shift
key of the calculator, so that you can enter a shifted keystroke
from the PC keyboard. Click on the shift key of the simulator
or type the PC left alt key (or Mac left opt key) to simulate a shift key.
Type Ctrl-P to save a screenshot, note that Linux screenshot is saved in
\verb|/tmp/epsilon.png|, rename it before doing another screenshot.
Shift-Ctrl-P will copy the screen to the clipboard on Mac only.
%% Type Ctrl-S to save the state of the simulator, note that Linux state 
%% file is \verb|/tmp/epsilon.nws|. The state can be restored
%% by calling the simulator with \verb|-l filename|.

The simulator can emulate user flash with a tar file named
\verb|scripts.tar|. You can create this file with the standard \verb|tar|
program, archiving several Python scripts and/or Xcas sessions
(saved with Xcas in the File, Export, HP Prime/Casio). 
The file \ahref{https://www-fourier.univ-grenoble-alpes.fr/\home{parisse}/numworks/khi92.tar}{khi92.tar} may be used as an example, it is proposed when
installing KhiCAS on the Numworks hardware calculator, just
rename it as \verb|scripts.tar| and copy to
\verb|Documents| folder on a Mac or in the current
directory.
The files in the tarfile will be listed in the file menu and may be modified
from inside KhiCAS in the simulator. 

If you want to have debug support, edit \verb|build/defaults.mak| 
and exchange the \verb|#| at line 22 and 23, and recompile. 
Note that Python support will not work on x86 if compiled with
debug enabled, the \verb|nlr*| object files should be compiled
without \verb|-g|, this can be achieved by compiling everything
in debug mode, then modify \verb|defaults.mak|, then 
\verb|touch python/port/mpconfigport.h|, recompile.

\section{First steps}
From the main menu (HOME), move the cursor to the $\chi$CAS icon
and hit EXE. This opens the ``shell'' (or history) where you can write
most Xcas commands. The Toolbox key will open a menu of important 
CAS commands, the most commonly CAS commands may be
retrieved with fast menus obtained by pressing shift followed
by a key of the lower part of the Numworks keyboard (keys without
a yellow legend). The application menu (save/restore sessions,
...) is assigned to shift EXE.

For example, type
\verb|1/2+1/6|
then EXE, you should see the result \verb|2/3| 
displayed below.

Hint~: If you can not find a character on the calculator keyboard, press
\verb|shift *|.

You can copy a level from the history of commands by hitting the
up and down arrow keys (once or more) and EXE. Then you can
modify the command and run it with EXE. For example, up arrow twice,
EXE, replace \verb|1/6| by \verb|1/3| and hit EXE.

The last result is stored in \verb|ans()|, hit the \verb|Ans|
calculator key to get it.
It is recommended to store the result in a variable if you want
to reuse it later. There are two ways to store a value in a
variable
\begin{itemize}
\item right-store with \verb|=>| using the
$\rightarrow$ key (shifted $x^y$ key, labelled F in alpha mode), 
for example \verb|2=>A| stores 2 in variable A.
Now, every time you write \verb|A| in a computation, it
will be replaced by 2.
\item left-store with \verb|:=| (alpha $x,n,t$ keys then shift $\pi$ keys), 
for example \verb|A:=2| does the same as \verb|2=>A|.
Since it requires 4 keystrokes, \verb|=| (2 keystrokes)
is accepted as a synonym for
most simple commands.
\end{itemize}
%If you begin a commandline by hitting $\rightarrow$,
%the system will automatically insert \verb|Ans=>|, 
%it is therefore easy to store a result in a variable.

The most popular Xcas commands are available from shift-1 (algebra)
shift-2 (calculus) and shift-3 (plot), from various shortcuts (cf. section
\ref{sec:shortcuts}), 
or from the cmds (Toolbox), where
they is a short online help with an example.
Hit Toolbox (cmds), choose a submenu, 
for example \verb|Algebra|, hit EXE,
move the selection to a command,  for example \verb|factor|.
Now Toolbox will display a short help with an example. Hit EXE or Ans
to copy the example in the commandline.
You can run it as is (EXE) or modify it and run it (EXE) if
you want to factor another polynomial.

When a command returns an expression, it is displayed in 2d mode.
You can move with the pad if the expression is larger than the display.
Type shift-5 to modify the fontsize. 
Type Back to go back to the shell.
The 2d view is in fact a 2d editor that will be explained later.

Now, try to type the command \verb|plot(sin(x))|.
Hint: type shift-3 (plot), then EXE.

When a command returns a graph, it will be displayed in a 2d frame.
You can modify the displayed area with \verb|+| or \verb|-| 
(zoom in or out, \verb|/| (orthonormalisation of the frame),
\verb|*| (autoscale).
Type Toolbox to modify the graphic window settings Xmin, Xmax, Ymin, Ymax.
Type Back to go back to the shell.

The KhiCAS File menu (shift-EXE) has an item \verb|Clear| that will erase
the display. This will not clear the variables, to achieve that
type \verb|VARS|, select the last item (\verb|restart|)
and confirm with EXE.

Hit HOME to leave $\chi$CAS.
Variables and history are saved each time you run a command with EXE, 
they will be restored if you come back to $\chi$CAS.


\section{Common CAS commands}
\subsection{Expand and factor}
From Toolbox commands catalog, select \verb|Algebra|, or type shift-1.
\begin{itemize}
\item \verb|factor|~: factorization. Shortcut \verb|=>*|
($\rightarrow$ key then *),
for example \giacinputmath{x^4-1=>*}.
Run \verb|cfactor| to factor over $\C$.
\item \verb|partfrac|~: expands a polynomial or
performs partial fraction expansion over a fraction.
Shortcut \verb|=>+| ($\rightarrow$ then + key), 
for example \giacinputmath{ (x+1)^4=>+} 
or \giacinputmath{1/(x^4-1)=>+}.
\item \verb|simplify|~: tries to simplify an expression.
Shortcut \verb|=>/| ($\rightarrow$ key then /), 
for example \giacinputmath{sin(3x)/sin(x)=>/}
\item \verb|ratnormal|~: rewrite as an irreducible fraction.
\end{itemize}

\subsection{Calculus}
From Toolbox commands catalog, select \verb|Calculus|, or type shift-2
\begin{itemize}
\item \verb|diff|~: derivative. 
Shortcut \verb|'| for derivative with respect to $x$, example
\giacinputmath{diff(sin(x),x)} and \giacinputmath{sin(x)'} are equivalent.
For $n$th-derivative, add $n$,
for example 3rd derivative \giacinputmath{diff(sin(x^2),x,3)}.
\item \verb|integrate|~: antiderivative (1 or 2 or 4 arguments)
for example 
\giacinputmath{integrate(sin(x))} or \giacinputmath{integrate(1/(t^4-1),t)}
for $\int \frac{1}{t^4-1} \ dt $\\
Defined integration with  4 arguments, for
example \giacinputmath{integrate(sin(x)^4,x,0,pi)}
computes $\int_0^\pi \sin(x)^4 \ dx$.
For an approximate computation, enter one boundary as
an approx number, for example
\giacinputmath{integrate(sin(x)^4,x,0.0,pi)}
\item \verb|limit|~: limit of an expression.
Example \giacinputmath{limit((cos(x)-1)/x^2,x=0)}
\item \verb|tabvar|~: table of variations of an expression.
for example \giacinputmath{tabvar(x^3-7x+5)}
one can check with the graph \giacinput{plot(x^3-7x+5,x,-4,4)}
\item \verb|taylor| and \verb|series|~: Taylor expansion
or asymptotic serie expansion, for example
\giacinput{taylor(sin(x),x=0,5)}\\
Add \verb|polynomial| if you do not want to have the remainder term.
\item \verb|sum|~: discrete summation, for example
\giacinputmath{sum(k^2,k,1,n)} computes $\sum_{k=1}^n k^2$,
\giacinputmath{sum(k^2,k,1,n)=>*} computes the sum and 
rewrites it factored.
\end{itemize}

\subsection{Solvers}
From Toolbox commands catalog, select \verb|Solve|.
\begin{itemize}
\item \verb|solve| solves an equation exactly. Takes the variable
to solve for as second argument, unless it is \verb|x|, for
example \giacinputmath{solve(t^2-1=0,t)}.\\
If exact solving fails, run \verb|fsolve|
for approx solving, either with an iterative method
starting with a guess \giacinputmath{fsolve(cos(x)=x,x=0.0)}
or by dichotomy \giacinputmath{fsolve(cos(x)=x,x=0..1)}\\
For complex solutions, run \verb|csolve|.\\
It is possible to restrict solutions using assumptions on the variable,
for example \giacinputmath{assume(m>1)} then \giacinputmath{solve(m^2-4=0,m)}.
\item \verb|solve| can also solve (simple) polynomial systems,
enter a list of equations as 1st argument and a list of variables
as 2nd argument, for example intersection of a circle and a line:
\giacinputmath{solve([x^2+y^2+2y=3,x+y=1],[x,y])}
\item Run \verb|linsolve| to solve linear systems.
enter a list of equations as 1st argument and a list of variables
as 2nd argument, example:
\giacinputmath{linsolve([x+2y=3,x-y=7],[x,y])}
\item Run \verb|desolve| to solve exactly a differential equation.
for example, to solve $y'=2y$, type \verb|desolve(y'=2y)|.\\
Another example with an initial condition:\\
\verb|desolve([y'=2y,y(0)=1],x,y)|\\
Run \verb|odesolve| for approx solving or \verb|plotode| 
for a graphic representation of the approx. solution. 
\item \verb|rsolve| solves some recurrence relations
 $u_{n+1}=f(u_n,...)$,
for example to solve the arithmetico-geometric recurrence
 $u_{n+1}=2u_n+3, u_0=1$, type:
\giacinputmath{rsolve(u(n+1)=2*u(n)+3,u(n),u(0)=1)}
\end{itemize}

\subsection{Arithmetic}
When required, the distinction between integer arithmetic 
and polynomial arithmetic is done by a prefix \verb|i| for
integer commands. For example \verb|ifactor| for integer factorization
and  \verb|factor| for polynomial factorization
(or \verb|cfactor| for polynomial factorization over $\C$).
Some commands work for integers and polynomials, like
\verb|gcd| and \verb|lcm|. 

\subsubsection{Integers}
From Toolbox catalog, select \verb|Arithmetic, Crypto|. Shortcut 
shift S$\leftrightarrow$D
\begin{itemize}
\item \verb|iquo(a,b)|, 
\verb|irem(a,b)| quotient and remainder of euclidean division
of two integers.\\
\giacinputmath{iquo(23,13),irem(23,13)}
\item \verb|isprime(n)| checks whether $n$ is prime.
This is a probabilisitic test for large values of $n$.
\giacinputmath{isprime(2^64+1)}
\item \verb|ifactor(n)| factorizes an integer
(not too large, since algorithms used are trial division and
Pollard-$\rho$, there is not enough RAM for quadratic sieve),
for example
\giacinputmath{ifactor(2^64+1)}\\
Shortcut $\rightarrow$ then * (\verb|=>*|)
\item \verb|gcd(a,b)|, \verb|lcm(a,b)| GCD and LCM
of two integers or polynomials.\\
\giacinputmath{gcd(25,15),lcm(25,15)}\\
\giacinputmath{gcd(x^3-1,x^2-1),lcm(x^3-1,x^2-1)}
\item \verb|iegcd(a,b)| (integer extended GCD)
returns 3 integers  $u,v,d$ such that
$au+bv=d$ where $d$ is the GCD of $a$ et $b$, $|u|<|b|$ and
$|v|<|a|$.\\
\giacinputmath{u,v,d:=iegcd(23,13); 23u+13v}
\item \verb|ichinrem([a,m],[b,n])| returns (if possible)
$c$ such that $c=a \pmod m$ and $c=b \pmod n$ (if $m$ are $n$
coprime, $c$ exists).
\giacinputmath{c,n:=ichinrem([1,23],[2,13]); irem(c,23); irem(c,13)}
\item \verb|powmod(a,n,m)| returns $a^n \pmod m$ 
computed by the fast modular powering algorithm\\
\giacinputmath{powmod(7,22,23)}
\item \verb|asc|  converts a string to a list of
ASCII code, \verb|char| converts back a list to a string.
These commands may be used to easily write cryptographic algorithms
with string messages.
\end{itemize}

\subsubsection{Polynomials}
From Toolbox catalog, select \verb|Polynomials|.

The default variable is $x$, otherwise you can specify it as last 
optional argument. For example \verb|degree(x^2*y)|
or \verb|degree(x^2*y,x)| return 2, 
\verb|degree(x^2*y,y)| returns 1.

Polynomials may have
coefficients in the rationals (example \verb|2/3*x+1|), or floats 
(example \verb|0.5*x+1|),
or in $\mathbb{Z}/p\mathbb{Z}$ 
(example \verb|3*x+5 mod 7|) 
or in a Galois fields (example, call once \verb|GF(2,4)|
to define the finite field with 16 elements with generator
\verb|g| by default, then
\verb|g^2*x+g+1|)

\begin{itemize}
\item \verb|coeff(P,n)| coefficient of $x^n$ in $P$, \verb|lcoeff(P)|
leading coefficient of $P$, for example
\giacinputmath{P:=x^3+3x; coeff(P,1); lcoeff(P)}
\item \verb|degre(P)| degree of polynomial $P$
\giacinput{degree(x^3)}
\item \verb|quo(P,Q)|, \verb|rem(P,Q)| quotient and remainder
of euclidean division of \verb|P| by \verb|Q|
\giacinputmath{P:=x^3+7x-5; Q:=x^2+x; quo(P,Q); rem(P,Q)}
\item \verb|proot(P)|~: approx. roots of $P$
(all roots, real and complex)\\
\giacinput{proot(x^5+x+1)}
Graphic representation\\
\giacinput{point(proot(x^5+x+1))}
\item \verb|interp(X,Y)|~: for two lists of the same size,
returns the interpolating polynomial $P$ such that $P(X_i)=Y_i$. \\
\giacinputmath{X,Y:=[0,1,2,3],[1,-3,-2,0]; P:=interp(X,Y)=>+}
Graphic representation\\
\giacinput{scatterplot(X,Y); plot(P,x,-1,4)}
\item \verb|resultant(P,Q)|~: resultant of polynomials
$P$ and $Q$
\giacinput{P:=x^3+7x-5; Q:=x^2+x; resultant(P,Q)}
\item \verb|hermite(x,n)|~: $n$-th Hermite polynomial 
(orthogonal for the density $e^{-x^2}dx$ on $\R$)
\item \verb|laguerre(x,n,a)|~: $n$-th Laguerre polynomial 
\item \verb|legendre(x,n)|~: $n$-th Legendre polynomial 
(orthogonal for the density $dx$ on $[-1,1]$)
\item \verb|tchebyshev1(n)| and \verb|tchebyshev2(n)|
Tchebyshev polynomials of 1st and 2nd kind
defined by~:
$$T_n(\cos(x))=\cos(nx), \quad U_n(\cos(x))\sin(x)=\sin((n+1)x)$$
%\item \verb|bernoulli(n,x)| polynomial de Bernoulli
\end{itemize}

\subsection{Linear algebra, vectors, matrices}
Xcas does not make distinction between vectors and lists. For
example,
\begin{giaconload}v:=[1,2]; w:=[3,4]\end{giaconload}
defines 2 vectors $v$ and $w$, then \verb|dot| will compute
the scalar product of $v$ and $w$:
\giacinput{dot(v,w)}

A matrix is a list of lists of the same size.
You can enter a matrix element by element using the
matrix editor (shift-7 EXE or shift-EXE i). Enter a new variable
name to create a new matrix 
or the name of an existing variable to edit a matrix.
The \verb|,| key may be used to insert a line or column, and
the \verb|Del| key erases the line or column of the selection.
Type \verb|shift-3| if you want to undo one edition step.
For small matrices, it is also convenient to enter them directly in the
commandline, for example to define
$$ A=\left(\begin{array}{cc} 1 & 2 \\ 3 & 4 \end{array}\right)$$
type \begin{giaconload}A:=[[1,2],[3,4]]\end{giaconload} 
or \giacinputmath{[[1,2],[3,4]]=>A}
It is recommended to store matrices in variables!

If a matrix is defined by a formula, then it's better to use the
\verb|matrix| command (shift-7 EXE Back), for example:
\giacinputmath{matrix(2,2,(j,k)->1/(j+k+1))} 
returns the matrix where coefficient line $j$ and column $k$
is $\frac{1}{j+k+1}$ (beware, indices begin at 0).

Run \verb|idn(n)| to get the identity matrix of order $n$
and  \verb|ranm(n,m,law,[parameter])| to
get a matrix with random coefficients with dimensions $n,m$.
for example 
\giacinputmath{U:=ranm(4,4,uniformd,0,1)}
\giacinputmath{N:=ranm(4,4,normald,0,1)}

For basic arithmetic on matrices, use keyboard operators
(\verb|+ - *|, inverse). Otherwise, open catalog and
select \verb|Matrices|
\begin{itemize}
\item \giacinputmath{eigenvals(A)}
\giacinputmath{eigenvects(A)} 
eigenvalues and eigenvectors of matrix $A$.
\item \giacinputmath{P,D:=jordan(A)} 
finds the Jordan normal form of matrix $A$, returns
matrices $P$ and $D$ such that
$P^{-1}AP=D$, with $D$ upper triangular (diagonal if $A$ is
diagonalizable)
\item \giacinputmath{Ak:=matpow(A,k)} computes
matrix $A$ to the $k$-th power, where $k$ is symbolic.
\item \verb|rref|: row reduction to echelon form
\item \verb|lu|: $LU$ factorization of matrix $A$,
returns a permutation $P$ and two matrices $L$ (lower)
and $U$ (upper) such that
$PA=LU$. The result of
\giacinput{P,L,U:=lu(A)} 
may be passed as an argument to the command \giacinput{linsolve(P,L,U,v)}
to solve a system $Ax=b$ by solving two triangular systems
(in $O(n^2)$ instead of $O(n^3)$).
\item \verb|qr| $QR$ factorization of matrix $A$,
$Q$ is orthogonal and $R$ upper triangular, $A=QR$.
\item \verb|svd(A)| singular value decomposition of matrix $A$
returns $U$ orthogonal, $S$ vector of singular values, $Q$
orthogonal such that \verb|A=U*diag(S)*tran(Q)|. \\
The ratio of the largest and the smallest singular value of $S$
is the condition number of $A$ relative to the Euclidean norm.
\end{itemize}


\section{Probabilities and statistics}

\subsection{Random numbers}
From Toolbox catalog, select \verb|Probabilities|
then \giacinput{rand()} (real in $[0,1)$) or 
\giacinput{n:=6:; randint(n)} 
(integer between 1 and $n$). 
Other commands with prefix \verb|rand| are available, followed
by the name of the law, for example \verb|randbinomial(n,p)| 
returns a random integer according to binomial law of parameters $n,p$.
For a random vector or matrix, run
\verb|ranv| or \verb|ranm| (from \verb|Alglin, Matrice| submenu), 
for example for a vector with 10 random
reals according to normal law (mean 0, stddev 1), type\\
\giacinputmath{ranv(10,normald,0,1)}

\subsection{Probabilities}
From Toolbox catalog, select \verb|Probabilities| (8).
There you will find a few distribution laws: 
\verb|binomial|, \verb|normald|, \verb|exponentiald|
and \verb|uniformd|. Other distribution must be keyed in
or entered with the
help of the main catalog (Toolbox EXE):
\verb|chisquared|, \verb|geometric|, \verb|multinomial|,
\verb|studentd|, \verb|fisherd|, \verb|poisson|.

To get the cumulated distribution function, enter the law name then
the \verb|_cdf| suffix (shortcut: select 
\verb|cdf| in the catalog at the end and press shift-1).
Inverse cumulated distribution function follows the same principle
with \verb|_icdf| suffix (shortcut:
select \verb|cdf| in the catalog and press shift-2).

Example~: find the centered interval $I$ for the normal law of
mean 5000, standard deviation 200, such that the probability
to be outside $I$ is 5\%
\giacinput{M:=5000; S:=200; normald_icdf(M,S,0.025);normald_icdf(M,S,0.975)}

\subsection{1-d statistics}
The statistic functions are taking lists as arguments,
for example \begin{giaconload}l:=[9,11,6,13,17,10]\end{giaconload}
From Toolbox catalog, select \verb|Statistics|:
\begin{itemize}
\item \giacinput{mean(l)}~: arithmetic mean of a list
\item \giacinput{stddev(l)}~: standard deviation of a list.\\
Run
\giacinput{stddevp(l)} to get an unbiaised estimate of the standard
deviation of a population from a sample \verb|l|
\item \giacinput{median(l)}, \giacinput{quartile1(l)}, 
\giacinput{quartile3(l)}
returns respectivly the median, first and third quartile
of a list.
\end{itemize}
For 1-d statistics with frequencies, replace \verb|l|
by two lists of the same length, the first list being the
values of the serie, the second list the frequencies.
For graphic representations, open catalog, \verb|Graphic| 
and select \verb|histogram| or \verb|barplot|.

\subsection{2-d statistics}
From Toolbox catalog, select \verb|Statistics|:
\begin{itemize}
\item \verb|correlation(X,Y)|: correlation of two 
lists $X$ and $Y$ of the same length.
\item \verb|covariance(X,Y)|:: covariance of two 
lists $X$ and $Y$ of the same length.
\item regression computations:
run commands with suffix \verb|_regression(X,Y)|,
for example \verb|linear_regression(X,Y)| returns
coefficients $m,p$ of the linear regression line
$y=mx+p$.
\item \verb|linear_regression_plot(X,Y)| 
and all commands
of suffix \verb|_regression_plot|
will display the line (or curve) of the regression.
These commands will also print the $R^2$ coefficient
that give information on the quality of adjustment
($R^2$ near 1 is good).
\end{itemize}

\section{Graphics}
From Toolbox catalog, select \verb|Graphics| 
(or type the plot fast menu shortcut shift-3)
and choose a graphic command. If you want to have more than one curve
on the same graphic, enter several commands with \verb|;| as separator.
\begin{itemize}
\item \verb|plot(f(x),x=a..b)| plot expression $f(x)$ for $x\in [a,b]$.
Discretization option: \verb|xstep=|,
for example \giacinput{plot(x^2,x=-4..4,xstep=1)}
Default is 384 evaluations per plot (one per horizontal pixel).
\item \verb|plotseq(f(x),x=[u0,a,b])| webplot for a recurrent
sequence $u_{n+1}=f(u_n)$ of first term $u_0$,
for example if $u_{n+1}=\sqrt{2+u_n}, u_0=6$, with a plot
on $[0,7]$
\giacinput{plotseq(sqrt(2+x),x=[6,0,7])}
\item \verb|plotparam([x(t),y(t)],t=tm..tM)| parametric plot
$(x(t),y(t))$ for $t\in [t_m,t_M]$. Discretization option: \verb|tstep=|.
Example
\giacinput{plotparam([sin(2t),cos(3t)],t,0,2*pi)}
\item \verb|plotpolar(r(theta),theta=a..b)| polar plot
of $r(\theta)$ for $\theta \in [a,b]$,
for example
\giacinput{plotpolar(sin(3*theta),theta,0,2*pi)}
\item \verb|plotlist(l)|: plot a list \verb|l|,
i.e. draws a polygonal line 
with vertices $(i,l_i)$ (index $i$ starts at 0).\\
\verb|plotlist([X1,Y1],[X2,Y2],...)| 
polygonal line with vertices the points of coordinates $(X_i,Y_i)$ 
\item \verb|scatterplot(X,Y)|, \verb|polygonscatterplot(X,Y)|
for two lists \verb|X,Y| of the same size,
draws the points or a polygonal line of vertices $(X_i,Y_i)$ 
\item \verb|histogram(l,class_min,class_size)|
plots the histogram of data in \verb|l|, class size
\verb|class_size|, first class starts at
\verb|class_min|. Example: check the random generator quality\\
\giacinput{l:=ranv(500,normald,0,1); histogram(l,-4,0.25); plot(normald(x),x,-4,4)}
\item \verb|plotcontour(f(x,y),[x=xmin..xmax,y=ymin..ymax],[l0,l1,...])|
plot implicit curves $f(x,y)=l_0, f(x,y)=l_1,...$.
\item \verb|plotfield(f(t,y),[t=tmin..tmax,y=ymin..ymax])|
plot the field of tangents for the differential equation
$y'=f(t,y)$. Add the optional last parameter \verb|,plotode=[t0,y0]|
to plot simultaneously the solution with initial condition
 $y(t_0)=y_0$. Example $y'=\sin(ty)$ for $t \in [-3,3]$
and $y \in [-2,2]$\\
\giacinput{plotfield(sin(t*y),[t=-3..3,y=-3..3],plotode=[0,1])}
N.B.: \verb|plotode| may be used outside of \verb|plotfield|.
\item For simultaneous plots, write commands separated by \verb|;|
\end{itemize}
If a command returns an arc of curve, the trace mode is active by
default. In this mode, typing the left or right key will move a
pointer on the active arc of curve, and display the pointer
coordinates (and the parameter value for parametric curves), and
a tangent vector (speed). If there are several curves, press up or
down to change active curve. Type shift-2 to get info on the active curve,
then EXE to see a table of value.

Press Toolbox to get the curve study menu. 
From the curve study menu, you can move
the pointer to a location, or to a remarkable point: root, horizontal
or vertical tangent, inflexion point, intersection with another curve
arc. You can also compute an arc length or
the area under the curve between pointer and mark.

When a curve is active, the variables \verb|x0,x1,x2,y0,y1,y2|
are set with the expressions of position, speed and acceleration
of $x(t)$ and $y(t)$ (for a function curve $x=t$). When
you search a root, horizontal tangent, inflexion, arc length or area
under curve, variables are set with the last value.

Press shift-1 for short help on the plotter.
There you will learn that you can add/remove a normal vector pointing to the
center of curvature (shift-4), and/or the osculating circle and radius
of curvature (shift-5) or get the curve study menu by pressing the
$x,n,\theta$ key.  

For display options, you can enter an optional argument at the end
of the plot command, 
\begin{itemize}
\item \verb|display=color| color option: 
for example to get
\giacinput{plot(sin(x),display=red)}
type \verb|shift-3 EXE sin x| then cursor right, \verb|, Toolbox EXE d i s p EXE shift = Toolbox , r e d|
\item \verb|display=line_width_2| to \verb|display=line_width_8|:
change segments width (including inside polygonal line used to
plot a curve).
Simultaneous display options should be added with \verb|+|.
For example \verb|display=red+line_width_2|
\item Circles and rectangles with edges parallel to the coordinate
axis may be filled with 
\verb|display=filled| (this attribute might be added to other attributes)
\item If you want to define the display window (overwriting
the autoscale computation), select \verb|gl_x| or/and \verb|gl_y| 
and add an $x$ or $y$ interval, for example 
\giacinput{gl_x=-2..2;gl_y=-1..4;plot(exp(x))}
Note that \verb|gl_| commands must preced the plotting command.
\item
If you want to remove axes, select  \verb|axes| and press shift-2
(\verb|axes=0|). Like \verb|gl_| commands, \verb|axes=0|
must preced the plotting command. Axes can be removed interactively
when the graph screen is displayed by pressing the \verb|sin| key.
\end{itemize}

\section{Programs}
You can program either with Xcas-like syntax (English or French) 
or with Python-like syntax.

Example~: function defined by an algebraic expression
\verb|nom_fonction(parametres):=expression|
for example simple confidence interval for a frequency $p$ in a sample
of size $N$, type from the shell commandline\\
\giacinput{F(P,N):=[P-1/sqrt(N),P+1/sqrt(N)]}\\
Test with \giacinput{F(0.4,30)}

Second example~: more precise confidence interval for a frequency $p$
in a sample of size $N$:\\
\giacinput{f(P,N):=[P-1.96*sqrt(P*(1-P)/N),P+1.96*sqrt(P*(1-P)/N)]}
To avoid computing twice the same quantity, one can insert
a local variable. 
The commandline is not well adapted to write these kinds
of functions. For non algebraic functions, it is best to run the 
program editor. Press Toolbox, select Script Editor, clear the editor if it
is not empty (shift-EXE Clear) and 
type with the help of test (shift-1), loop (shift-2)
for programming structures
the following program, in Xcas syntax:
\giacinput{function f(P,N) 
  local D; 
  D:=1.96*sqrt(P*(1-P)/N); 
  return [P-D,P+D]; 
ffunction;}\\
or in Python syntax:
\begin{giacprog}
def f(P,N):
  D=1.96*sqrt(P*(1-P)/N)
  return [P-D,P+D]
\end{giacprog}
Type OK to check the syntax. Once
the program is correct, save it (shift-EXE 2), then type Back. Now you
can call your program from the commandline like this\\
\verb|f(0.5,30)|

Third example~: a loop printing integer squares
from 1 to $n$ in Python syntax.
Enable Python syntax with shift-EXE 8.
Open the Script Editor (shift EXE or Esc from the shell), 
if there is some old script source,
clear it (shift-EXE Clear).
Select \verb|f(x):=| from shift-2 (or from Toolbox, Program, function def), 
you should get \verb|def f(x):|.
Replace \verb|x| by \verb|n| 
move to the end of the line and press EXE to input a newline.
Type Shift-2 then EXE, then j space, then
Shift-2 then 3. Type \verb|1,n+1)| 
then shift-4 select \verb|:|. Type EXE to insert a newline
then Alpha SPACE,
Toolbox, EXE (\verb|1 All|), P, R select \verb|print| with the cursor 
then type EXE, type \verb|j,j^2)| then EXE.
\begin{giacprog}
def f(n):
  for j in range(1,n+1):
    print(j,j^2)
\end{giacprog}
Inside Xcas \verb|^| means power, \verb|**| is also accepted like in
Python.

Now, type OK. If syntax is correct,
you will see \verb|Success| in the status line. Otherwise, the
first error line number and token will be displayed and cursor will
be positionned at the line where the error was detected. Note that
the error may be before this line but it was only detected later. Note
also that if you are using Python syntax compatibility, programming
structures are translated into Xcas, errors are displayed after
translation, therefore you might see token errors like \verb|end|
that were added by the translator.

If the program is correct, you can save it with the shift-EXE menu 
(save or save as).
You can run it from the commandline by pressing Back then for
example \verb|f(10)| should display all squares from 1 to 10.

The turtle is a nice way to learn programming. The turtle is a small
robot that you can move, it handles a pen that marks its path.
Type shift-EXE, Script Editor, then shift-EXE Clear. Type shift-6 select
\verb|efface| which means clear the screen. You can
access to the turtle commands using shift-6 or \verb|Toolbox )|. 
For example try \verb|avance|
(forward). Checking the syntax (OK) 
will display the turtle window moves.
You can enter several moves in your script, and organize them 
inside tests, loops and functions.
For example:
\begin{verbatim}
function square(n)
  repete(4,avance n,tourne_gauche);
ffunction:;
  
efface;
for n from 1 to 10 do
  square(10*n);
od;
\end{verbatim}

Another example of non algebraic function: the euclidean algorithm
to compute the GCD of two integers. 
Press EXE to insert a newline. \verb|!| is in the
submenu \verb|Programmation_cmds| (11, shortcut $X,\theta,T$)
or in the test shift-4 menu.
Xcas syntax
\begin{giacprog}
function pgcd(a,b)
  while b!=0 do
    a,b:=b,irem(a,b);
  od;
  return a;
ffunction
\end{giacprog}
Python syntax
\begin{giacprog}
def pgcd(a,b):
  while b!=0:
    a,b=b,a % b
  return a
\end{giacprog}
Check with \giacinput{pgcd(12345,3425)}

If your program has runtime errors or if you want
to see it run step by step, run \verb|debug| on it,
for example\\
\verb|debug(pgcd(12345,3425))|\\

Unlike adaptations of Micro-Python by calculator manufacturers (including
Numworks), the Python syntax in Xcas is fully integrated.
You can therefore use all Xcas commands and data types in your programs.
This corresponds approximatively to importing Python modules
\verb|math|, \verb|cmath|, \verb|random|,
\verb|scipy|, \verb|numpy|, \verb|turtle|, \verb|giacpy|.
There is also a small
pixelised graphic commands set
(\verb|set_pixel(x,y,c)|, \verb|set_pixel()| to synchronize
display, \verb|clearscreen()|, \verb|draw_line(x1,y1,x2,y2,c)|, 
\verb|draw_polygon([[x1,y1],[x2,y2],...],c)|,
\verb|draw_rectangle(x,y,w,h,c)|, \verb|draw_circle(x,y,r,c)|,
the color+width+filled \verb|c| parameter is optional,
\verb|draw_arc(x,y,rx,ry,t1,t2,c)| draws an ellipsis arc).
And you can somewhat replace \verb|matplotlib| 
with graphic commands of  $\chi$CAS
(\verb|point|, \verb|line|, \verb|segment|, \verb|circle|,
\verb|barplot|, \verb|histogram| and all \verb|...plot...|
commands). Plus you have natural access to data types
like rationnals or expressions, and you can run CAS commands on them.
The complete list of commands available on the calculator
is given in appendix. For documentation on commands not listed
in the catalog categories, please refer to Xcas documentation.

\section{The 2d editor.}
If a computation returns an expression, it will be displayed in the 2d 
expression editor. This also happens if you press shift-5 or left arrow
key when the selected
level is an expression, or if you press shift-5 from the commandline if the line
is empty or contains a syntaxically correct expression.

Once the 2d editor is open, the expression is displayed in full screen and
all or part of the expression is selected. One can run a command
on the selection (from the menus or from the keyboard), or edit 
(in 1d mode) the selection. This is an efficient way to rewrite
expressions or edit them.

Example 1~: enter
$$ \lim_{x \rightarrow 0} \frac{\sin(x)}{x}$$
From an empty commandline, type shift-5 (view), you should see 0 selected.
Type x then EXE, this will replace 0 by x selected. Type \verb|sin|, now
$\sin(x)$ should be selected. Type the division key (above -), you
should see $\frac{\sin(x)}{0}$ with 0 selected, type x then EXE,
you should now see $\frac{\sin(x)}{x}$ with x (below the fraction)
selected. Type the up arrow key, now $\frac{\sin(x)}{x}$
should be selected. Now type shift-2 4 (for limit). The expression
is ready to eval, type EXE to copy it to the commandline and EXE
again to eval it. For the same limit at $+\infty$, before leaving
the 2d editor with EXE,
move the selection with the right arrow key, then type shift-1 8 (oo) EXE.

Example 2~: 
$$ \int_0^{+\infty} \frac{1}{x^4+1} \ dx $$
From an empty commandline, type shift-5 (view), then shift-2 3 (integrate),
you should see:
$$ \int_0^1 0 \ dx$$
with $x$ selected. We must modify the 1 (upper bound) and
the 0 (integrand). Press left arrow key, this will select the
integrand 0, type \verb|1/(x^4+1)| EXE, then left arrow key shift-1 8 EXE.
Type again EXE to copy to commandline, EXE again to run the computation,
the result will be displayed in the 2d editor, EXE will leave the 2d
editor, with the integral and its value in the history.

Example 3~: compute and simplify
$$ \int \frac{1}{x^4+1} \ dx $$
From an empty commandline, type shift-5 (view), then shift-2 3 (integrate),
you should see
$$ \int_0^1 0 \ dx$$
Move the selection to the lower bound 0 (right arrow key), 
type Del, you should see
$$ \int 0 \ dx$$
selected. With the down arrow key, select 0, type \verb|1/(x^4+1)| EXE,
EXE copy to the commandline, EXE to run the compuation, the result
is now displayed in the 2d editor.\\
With the arrow key, select one of the arctangent, type shift-1 EXE (simplify),
this will make a partial simplification, do the same on the second
arctangent.\\
For a more complete simplification, we will collect the logarithms.
The first step is to exchange two terms of the main sum so that the
logarithms are grouped. Select one of the logarithm with the arrow keys,
then type shift-left or right arrow key
this will exchange the selection with the right or left sibling.
Now type ALPHA right or left arrow key to extend the selection adding
the right or left sibling. Once the two logarithm terms are selected,
press shift-1 2 EXE (factor), decrease the selection to the numerator,
type Toolbox EXE (All), type the letters l, n, c, this moves in the
catalog to the first command beginning with \verb|lnc|, select
\verb|lncollect|, EXE and shift-6 (eval).

\section{Managing sessions}
\subsection{Modifying a session}
With the up/down cursor keys, you can move in the history, the current
level is printed with reverse colors.

You can move one level in another position with ALPHA-up and ALPHA-down.
You can delete a level with the Del key (the level is copied into 
the clipboad).

You can modify an existing level with left shift or right shift.
With left shift, the 2d
editor is called if the level is an expression, with right shift the level
is edited in the text (program) editor. Type Back if you want to cancel
modifications, or OK if you confirm the modifications. If you confirm
the modifications, the commandlines below the current level will 
automatically be re-evaled. This way, if you modify for example
a level like \verb|A:=1|, all levels below that depend on the value
of \verb|A| will be up to date. If you want to do that several times,
it is best to introduce a parameter with the Toolbox Parameter wizzard. Then
pressing + or - on the \verb|assume(...)| or \verb|parameter| level
will modify the value of the parameter (press * or / for faster move).

\subsection{Variables}
Press \verb|vars| to see which variables are assigned to a value. 
Select a variable
name, press EXE to copy it to the commandline, Del will input the command
that erases the variable (confirm with EXE). \verb|restart| will
purge all variables at once (press \verb|shift EXE 0| to clear the history
and start a fresh new session). \verb|assume| is a command to 
make assumptions on a variable, like \verb|assume(x>5)|.

\subsection{Archiving and exchanging with Xcas}
On the calculator, go back to the history (type Back if you are in the
programming editor or the 2d expression editor). 
From the shift-EXE menu, you can save/restore sessions in the
calculator scriptstore. If you save a session that is not too long,
a QR code is displayed that can be used to clone the session
inside Xcas for Firefox.
Session filenames have the \verb|_xw.py| suffix, they
are not real Python scripts, that's just a trick to be recognized
if you want to publish them on Numworks servers. They
can be copied to your computer 
using the connectivity kit 
from \ahref{https://xcas.univ-grenoble-alpes.fr/nw/nws_en.html}{this link},
They may be opened with Xcas or Xcas for Firefox.
From Xcas, choose the File menu then Numworks
From 
\ahref{https://www-fourier.univ-grenoble-alpes.fr/\home{parisse}/xcasfr.html}{Xcas for Firefox}, press the Load button.

Conversely you can save a session from Xcas (choose File, Export to Khicas)
or from Xcas for Firefox (choose Export at the right of the session name).

Python scripts may be saved to the Numworks RAM scriptstore, using
the shift-EXE menu. They are shared with the builtin Python
application of the Numworks. In addition, you can archive
them to the user flash on the Numworks, using shift-EXE 1 0.
Scripts stored in the user flash can be accessed readonly
from KhiCAS even if they
are not copied to the RAM scriptstore. 

\section{Keyboard shortcuts.} \label{sec:shortcuts}

These shortcuts are valid inside the shell and text programming
editor. With default configuration:
\begin{itemize}
\item HOME: back to main Numworks menu 
\item Back: cancel (if there is something to cancel)
or switch from shell to editor
\item Toolbox: commands menu
\item shift-EXE: $\chi$CAS menu
\item \verb|shift *|: table of ASCII characters
\item vars: variables list
\item shift-1-shift-6: see legend at screen bottom,
\item shift-7: matrix fast menu
\item shift-8: complex fast menu
\item shift-9: arithmetic fast menu
\item shift-(: list fast menu
\item shift-): function fast menu
\item shift-) 8: switch from Xcas interpreter to MicroPython interpreter
\item shift-0: misc fast menu (probabilities and periodic table)
\item shift-.: real fast menu
\item shift-$10^x$: polynomial fast menu and Galois Field command
\item shift Ans (or shift-EXE 1): $\chi$CAS applications 
(Geometry, Spreadsheet, ...)
\item \verb|shift /|: \verb| % | inside shell, 
\end{itemize}
You can modify fast menus shortcuts by editing the file
\verb|FMENU.py|. Delete the file 
to reset to default configuration.

In programming editor
\begin{itemize}
\item shift then cursor key: move to begin/end of line or file
\item shift and cursor key simultaneously: select. 
Move the cursor to the selection end, type Back to remove the selection
(it will be copied to clipboard) or again shift-copy to copy selection
to clipboard without removal.
Type Back to cancel selection.
\item OK: if a search/replace is currently active (Toolbox 6)
find next word occurence. Otherwise parse/execute.
\item EXE: add a newline.
\item Del: remove selection or previous character if no selection active
\end{itemize}

\section{Remarks}
If KhiCAS is inside a long computation, you should be able to interrupt
it by pressing Back. If it does not interrupt, try the HOME key.
If that does not work, you may have to press
the reset button, but beware that this will disable $\chi$CAS
on locked Numworks calculators, which means you will have
to connect to a computer and reinstall the small launcher application/

The memory available for computations is about 128K with an empty session,
it is displayed in the statusline. You can defragment memory
(keeping variables and history) by pressing HOME then 
restarting $\chi$CAS. For a fresh restart, press vars, select
restart then EXE, then shift-EXE Clear history, then HOME.

\section{$\chi$CAS applications}
\subsection{MicroPython}
You can select the shell interpreter by shift-EXE ln or switch
interpreter with shift-) 8. The menu
background color of the shell reflects the active interpreter
(yellow=MicroPython, magenta or cyan for Xcas native or Xcas Python
compatible).

This MicroPython implementation has the following modules: turtle,
graphic (both with filled objects), 
matplotl, arit (integer
arithmetic), linalg/numpy (linear algebra, matrices), ulab (scipy
compatibility), cas (CAS from Python).

\subsection{3d and 4d graphs}
$\chi$CAS can plot
2 variables function or parametric plots, cones, solids, planes, ...
For example type \verb|Toolbox * 5 shift-2 EXE| 
to draw a cube or \verb|shift 1| to select the plot command, 
and enter \verb|x^2-y^2|.

For fonctions plots from $\mathbb{C}$  to
$\mathbb{C}$, run the \verb|plot| command with argument
a complex valued expression of 2 variables (real and imaginary parts)
like for example \verb|plot((x+i*y)^2-9)|. For
expression depending directly on the complex variable
(without requiring real/imaginary part), run the
\verb|plot3d| command, for example
\verb|plot3d(x^2-9)| (the \verb|plot(x^2-9)| command would not
work, because it is already used for a graph from $\mathbb{R}$ to
$\mathbb{R}$). The modulus is represented along the $Oz$ axis and
the argument using raimbow colors: from  $-\pi$
in blue magenta to 0 in green (through yellow orange)  and from
0 to $\pi$ via cyan.

If you need precise options, run the  \verb|plotfunc| command, for example\\
\verb|plotfunc((x+i*y)^3-1,[x=-2..2,y=-2..2],nstep=500)|\\
will plot $z \rightarrow z^3-1$ from a square in the complex plane
centered at origin, size 4 with a 500 small reectangles discretization.

Beware, 3d plots require much memory, you should avoid simultaneous plots
(polyhedrons, lines, planes or spheres do not require much memory, only plots
and objects handled by a plot like cones). 
You can modify the rendering precision with shift-2 
(faster, less precise) or shift-3 (slower, more precise). 

If you just want one time a higher
precision rendering, type \verb|^| and be patient. If you want to
interrupt this rendering, press Back. Use the cursor keys to change the
viewpoint, 5 to reset to default viewpoint, and \verb|-| or \verb|+|
to zoom in/out. 
While a cursor key is
kept pressed, the precision is lower, when the key is released the
last position is redrawn with the default precision.


\subsection{Interactive geometry application}
The geometry application lets you construct figures in the 2d plane or
in 3d space. It is possible to move one point of the figure and
observe how the construction evolves, illustrating some properties
(dynamic geometry). Pure geometric constructions may be mixed 
with function graphs and other analytic constructions.
This application has two view: the graphic view where the
figure is rendered and the symbolic view where you see
the Xcas instructions to construct the figure. The philosophy
is similar to Geogebra, but with Xcas commands instead.

You will find here a short description of this application,
cf. \ahref{https://www-fourier.univ-grenoble-alpes.fr/\home{parisse}/casio/geoen.html}{here} for
 a more complete documentation of the geometry application, with a few
screenshots.


\subsubsection{Modes, graphical and symbolic view}
Type shift-Ans or Toolbox to display the list
of additional applications, then EXE then select an existing figure
or create a new 2d or 3d figure. You may also open the
geometry application from an existing graph displayed from the shell
(for example after running \verb|plot(sin(x))|)
by typing shift-EXE then Save figure.

At startup, you are in graphical view in frame mode. The cursor key
will modify the viewpoint (move the frame in 2d, rotate viewpoint in 3d).
Press Toolbox to change mode. Type OK to switch to symbolic view or back.
For example, type Toolbox 3 to enter point mode, move the pointer and press
EXE where you want to create a point. Or type Toolbox 5 to enter triangle mode
move the pointer to each vertex and press EXE on each vertex.
You can move the pointer with the keypad (use shift cursor key for a fast move),
or if there is an existing
point, type the name (e.g. type ALPHA A to move the pointer to the point A
if it has already been defined).

In a 3d figure, objects will be created in the yellow plane. Press 4 or 6 to
move this plane. It is recommended to keep a viewpoint with $Oz$ vertical
(therefore change viewpoint only with the right and left cursor keys
that make a rotation of axis $Oz$).

Dynamic geometry howto:
switch to pointer mode (Toolbox 2), move near an exising point and select
it with EXE, then move the point with the cursor keys, you will see
how the whole figure depends on that point, this helps conjectures
or illustration of some
geometric properties, like the fact that 3 lines of a triangle have
a common intersection.

If you type Back in the graphical view, it will reset mode to frame mode
if you were not in frame mode, or it will switch to symbolic view if
you were in frame mode. In the symbolic view, you can modifiy existing
commands or create new geometric objects with new commandlines (one line
per object). You can save the construction in text format 
from shift-EXE menu, note
that the file generated will have a \verb|.py| extension
despite the fact that
it is not a Python script.
Type Back again to leave the geometry application.

When leaving the geometry application, the figure is saved in
an Xcas variable that has the same identifier than the filename
displayed in the symbolic view. You can erase this Xcas variable
if you want to clear the figure.

{\bf Example~: circumcircle.}\\
From KhiCAS shell, type shift-EXE 1 then select new figure 2d EXE.
Type Toolbox  5 Triangle, EXE to create the first vertex, move the pointer
with cursor keys and type EXE for the second vertex, move the pointer
again and type EXE to create the 3rd vertex and the triangle.

Long version, construction of the center:
Type Toolbox 7, select 8 Perpen bisector, move the pointer so that
only one edge of the triangle is selected (this is displayed
at the bottom right, something like \verb|perpen_bisector D5,D|,
type EXE will create the perpendicular bisector. Move the pointer
to another edge of the triangle, type EXE to create the 2nd bisector.
You may optionnaly create the 3rd bisector.
Then type Toolbox 6, select 4 Single intersection. Move the pointer
to a perpen bisector, type EXE, move the pointer to another perpen
bisector and type EXE. This will create the circumcircle center.
Type Toolbox 4, move the pointer to the center (with the cursor keys
or by typing ALPHA H or the center name if it is not H), then EXE,
move to one of the triangle vertex and press EXE.

Short version with the \verb|circumcircle| command:
Type Toolbox 9, select circumcircle, select each vertex with
pointer move + EXE (ALPHA A EXE ALPHA B EXE ALPHA C EXE, replace
A, B, C with the vertices names).

Symbolic view version:
If you are in the graphical view, type Back to move to the symbolic view.
Move to the script end and add a newline if required (shift EXE).
Enter\\
\verb|c:=circonscrit(A,B,C)| EXE

{\bf 3d Example}\\
Type shift-EXE 1 from the shell, then select new 3d figure.
Then Back or OK to switch to the symbolic view. Then alpha c shift =
Toolbox uparrow twice, select 3D, EXE 5 for cube, Toolbox for help on the cube
command, press shift-2 to copy+paste the first example in the symbolic
view. You should see\\
\verb|c=cube([0,0,0],[1,0,0],[0,1,0])|\\
Type OK, this display a small cube, type + a few times to zoom in. Then
OK to switch back to symbolic view.
Type EXE to begin a new commandline.
Now we define the vertices of the cube with
\verb|A,B,C,D,E,F,G,H:=|
(type alpha shift A , alpha shift B etc.). 
Then type Toolbox and uparrow 3 times
to select Geometry then uparrow 4 times to select
\verb|sommets| EXE, put c as argument to get \verb|sommets(c)|.
Type OK to display the cube and the vertices with their names.
Type OK again to go back to symbolic view. Then EXE to
enter a new commandline, that will define the plane ABC.
Type ALPHA P = then shift-2 to open the fast menu lines and 8, this will
copy \verb|plane(|.
This command takes 3 points as argument (or a cartesian equation), here
A, B, G, \verb|P=plan(A,B,G,|. We now add a color to the plane
with the shift-3 disp fast menu
\verb|display=filled+green|. Check by OK OK.
Go to the next line (EXE) and create segment DE
ALPHA S = shift-2 select segment command with EXE, type D, E, 
and give a color\\
\verb|S=segment(D,E,color=cyan)|
The whole construction should be
\begin{verbatim}
c=cube([0,0,0],[1,0,0],[0,1,0])
A,B,C,D,E,F,G,H=sommets(c)
P=plan(A,B,G,display=filled+green)
S=segment(D,E,display=cyan)
\end{verbatim}
Type OK to display it and use the keypad to change the viewpoint.
Type OK or Back to go back to symbolic view and Back to leave the
geometry application. Type shift-1 to save the figure if you did not
save it from the shift-EXE menu.
You can access analytic geometry information from KhiCAS shell, for
example \verb|equation(P)| (Toolbox select Geometry submenu) will
return the cartesian equation of the plane $P$, or
\verb|is_orthogonal(P,S)| (Toolbox Geometry)
will confirm that the plane $P$
is orthogonal to the segment $S$ (this  should be apparent from
3d rendering).

\subsubsection{Cursors}
Cursors are parametric values that live in a given inteval and may be
moved by 1\% steps from the graphical view. They are created
with the \verb|element| command in the symbolic view or from Toolbox
menu in the graphical view.

{\bf Example~: quadratic explorer}\\
This example demonstrates how the curve of the parabola of equation
$y=ax^2+bx+c$ depends on the value of $a,b,c$.
Create 3 cursors from Toolbox menu while you are inside the graphical view
(for each cursor Toolbox uparrow 4 times EXE EXE). In the symbolic view
you should have something like
\begin{verbatim}
a:=element(-1..1)
b:=element(0..1,0.5)
c:=element(-1..1)
\end{verbatim}
then add the parabole graph, from graphical view, 
type Toolbox 0 (for 10 Curves)
and select plot, or from the symbolic view 
shift 6 5 select plot
fill inside the parenthesis with \verb|a*x^2+b*x+c| (beware,
do not forget the \verb|*|), then EXE.
From the graphical view, you should see 3 cursors
\verb|a|, \verb|b| and \verb|c| and the corresponding graph.
You can now modify the value of $a,b,c$ and see how it affects the shape
of the parabola. Type Toolbox 2 (pointer mode), 
then a (or b or c) EXE
to select $a$ (or ($b$ or $c$). 
Type EXE then the right and left arrow keys,
EXE again to stop moving the cursor.

A lot of variations may be done, some of them simpler with one or two cursors
and a curve depending on one or two parameters. For example a line equation
explorer with \verb|line(y=a*x+b)| or a trigonometic explorer with
\verb|plot(sin(a*x+b))|.

\subsubsection{Measures and legends}
From the graphical view, type Toolbox and select 13 Measure.
You can compute and display a measure at some point of the figure.
For example after creating a triangle, one can display the
perimeter of the triangle or its area. Type Toolbox then uparrow twice EXE.
Move the pointer near the triangle, type EXE, move the pointer
where you want to display the measure and type EXE.

From the symbolic view, you can display a legend with the
\verb|legend()| command.
The first argument of legend may be a point of the figure, or
a vector of 2 integers giving the absolute position in pixels
(measured from the top left corner). The second argument
is the legend, it may be a string or any expression.

If the legend is a numeric value, it can be used as a numeric parameter
for commands that require such an argument, like transformations
(angle of rotation, homothety ratio...)\\
\verb|r:=legend([20,40],"2")|\\
\verb|homothety(A,extract_measure(r),B)| 

\subsubsection{Traces}
The \verb|trace()| command lets you keep track of all the positions of
a geometric object when the figure is recomputed while moving a point

{\bf Example} Enveloppe of the normals to a parametric curve (here an ellipse)
\begin{verbatim}
E:=plotparam([cos(t),2*sin(t)],t=-pi..pi)
a:=element(-pi..pi)
M:=element(E,a)
T:=tangent(M)
N:=perpendiculaire(M,T)
trace(N)
\end{verbatim}
If you change the value of $a$ (Toolbox 2 for pointer mode, a),
you will see a curve that separates the area of normals to the curve
and a free area, this is the enveloppe of normals, it is also
the evolute of the ellipse\\
\verb|evolute(E,color=red)|\\
You can remove the traces in the graphical view from the shift-EXE menu 
(last item).


\subsection{CAS spreadsheet}
The spreadsheet is launched from the application menu (shift-EXE EXE or
shift-Ans shortcut).

Unlike pure numeric spreadsheet, the CAS spreadsheet can handle exact or
symbolic values. You can compute cells whose values are
fractions, square roots or expressions containing variables like
$x,y...$.
A cell can contain any valid Xcas value, numbers, strings, etc.
If you enter a list of values, or an Xcas command returning a list
of values, the list will fill consecutives cells (downwards or to the
right, according to the setup). For example type shift-1 \verb|range(|
10 EXE, this will fill 10 cells with numbers from 0 to 9.

Defining a cell content with reference to other cells
is similar to other spreadsheet, begin with
\verb|=|, and enter an expression that may contain cell references 
(characters \verb|:| and \verb|$| are available from shift-3 menu,
\verb|:| is also accessible with shift $\rightarrow$). While editing
the cell content, you can select another cell by pressing the up or
down cursor key followed by any other cursor key. To select a range,
move to the begin of selection cell, 
press shift-arrow key then move to the end of selection and type EXE.

While defining a cell, any Xcas commands may be used, you can get
them from Toolbox menu, or fast menus (shift-1 etc.). 
Programming Xcas structures may also be used as well
as Xcas functions that you have defined. Beware that MicroPython functions
are not supported.
 
A cell can be defined with a command returning a graphic result. Type
shift-6  to display the graphic corresponding to
the graphical output of the whole spreadsheet.

\section{Copyright and Thanks to.}
\begin{itemize}
\item Giac and $\chi$CAS, computing kernel (c) B. Parisse 
and R. De Graeve, 2024.
\item $\chi$CAS interface adapted by B. Parisse from
Eigenmath source code by Gabrial Maia and from Xcas source code.
\item Initial port 
 OS \ahref{https://github.com/numworks/epsilon}{Epsilon 15.5}
  de la Numworks, (c) 2021 Numworks, license
  \ahref{https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode}
      {Creative Commons Attribution-NonCommercial-
        ShareAlike 4.0 International Public License}\\
      Modifications by Damien Nicolet and Bernard Parisse, (c) 2019, 2021
      (Delta and Khi projects), same license. Modifications by
      \ahref{https://github.com/Omega-Numworks/Omega}{Omega}
and \ahref{https://getupsilon.web.app/}{Upsilon}
  (c) 2024 same license
\item
$\chi$CAS license GPL2. See details in
the \verb|LICENSE.GPL2| file, inside 
\ahref{https://www-fourier.univ-grenoble-alpes.fr.fr/\home{parisse}/casio/khicasio.zip}{khicasio.zip}
or
\ahref{https://www.gnu.org/licenses/old-licenses/gpl-2.0.html}{GPL2}
on the Free Software Foundation website.
The source code of $\chi$CAS is available at
\ahref{https://www-fourier.univ-grenoble-alpes.fr/\home{parisse}/numworks/}{Numworks section} of my webpage (see section \ref{sec:dev}).
\item Thanks to Damien Nicolet who first ported giac to a Numworks N0100
with hardware modifications, and later built the Epsilon External app
for unlocked Numworks N0110.
\item The periodic table is (c) 
\ahref{https://github.com/M4xi1m3/nw-atom}{Maxime Friess}
and redistributed under GPL2 with his authorization.
\item Thanks to the mysterious ScarlettSpell who created
the (discontinued) Nwagyu website with the first KhiCAS
external app for locked Numworks. It was unfortunately not stable
and installation was more tricky than the current install method,
that was the main reason for me to make this port.
\item Thanks to the active members
of tiplanet and Planete Casio for answering questions and testing
during the time I developed  $\chi$CAS. Special thanks to LePhenixNoir 
(Prizm/35+eii help), Nemhardy (Prizm), and to critor
for articles, tests and advertising.
\item Thanks to Yann Couturier for insightfull discussions
about Epsilon 16 and above (locked Numworks).
\end{itemize}

\section{Developer infos.} \label{sec:dev}
The simulator installation for the impatient
is described in \ref{sec:simulator}. The detailled installation procedure
follows~:
\begin{enumerate}
\item
{\bf Windows} users~: \\
First method~: 
install \ahref{https://wiki.debian.org/InstallingDebianOn/Microsoft/Windows/SubsystemForLinux}{WSL} or a Linux distribution inside a virtualization
software like VirtualBox, and follow Linux instructions.\\
Second method~: First install
\ahref{https://www.msys2.org/}{Msys2/mingw64} then open from Msys2 menu
a mingw64 terminal. In the Options menu of the windows, 
click keys, check Ctrl-shift-letter shortcut, this
way you can paste in the terminal with Ctrl-shift-V. Run~:
\begin{verbatim}
pacman -S git wget mingw-w64-x86_64-gcc mingw-w64-x86_64-freetype mingw-w64-x86_64-pkg-config mingw-w64-x86_64-libusb make mingw-w64-x86_64-python3 mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-libpng mingw-w64-x86_64-imagemagick mingw-w64-x86_64-librsvg mingw-w64-x86_64-inkscape mingw-w64-x86_64-python3-pip mingw-w64-x86_64-python-lz4 mingw-w64-x86_64-libpng gmp mpfr
echo "export PATH=/mingw64/bin:$PATH" >> .bashrc
pip3 install pypng stringcase
\end{verbatim}
Check that you can compile Epsilon without KhiCAS
\begin{verbatim}
git clone https://github.com/parisseb/epsilon
cd epsilon
make PLATFORM=simulator
\end{verbatim}
If everything is ok, run
\begin{verbatim}
wget https://www-fourier.univ-grenoble-alpes.fr/~parisse/numworks/ext.tar.bz2
tar xfj ext.tar.bz2
wget https://www-fourier.univ-grenoble-alpes.fr/~parisse/numworks/nwsimu.tgz
tar xfz nwsimu.tgz
\end{verbatim}
Now
\begin{itemize}
\item either download
\ahref{http://perso.ens-lyon.fr/nathalie.revol/softwares/mpfi-1.5.4.tar.bz2}{MPFI} 
unarchive it
\verb|tar xfj /chemin/vers/mpfi-1.5.4.tar.bz2|
configure with \verb|./configure --prefix=/usr|
run \verb|make| and \verb|make install|,
\item or remove \verb|-lmpfi| in the \verb|mkwin| script
\end{itemize}
run the script\\
\verb|./mkwin|\\
(instead of \verb|mk|).

If everything went well, type \verb|./epsilon.exe| from
\verb|epsilon| directory. The simulator should display.

\item
{\bf Native MacOS compilation} is more complicated
because we will build a universal binary for 2 architectures
arm64 and x86. The first step is to install homebrew and
dependencies for both, on a recent Mac (arm64), open
a Terminal (type Terminal in launchpad) and copy-paste
(with command-C command-V)
\begin{verbatim}
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install numworks/tap/epsilon-sdk
brew install libpng gmp mpfr mpfi
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
arch -x86_64 /usr/local/bin/brew install libpng gmp mpfr mpfi
\end{verbatim}
Then 
\begin{verbatim}
git clone https://github.com/parisseb/epsilon
cd epsilon
wget https://www-fourier.univ-grenoble-alpes.fr/~parisse/numworks/ext.tar.bz2
tar xfj ext.tar.bz2
wget https://www-fourier.univ-grenoble-alpes.fr/~parisse/numworks/nwsimu.tgz
tar xfz nwsimu.tgz
./mkmac
ln -sf output/release/simulator/macos/epsilon.app
epsilon.app/Contents/MacOS/Epsilon
\end{verbatim}
\\
Note that Mac OS Intel users can also install
\ahref{https://mac.getutm.app/}{UTM}
then install a Debian distribution, but Epsilon 22 does not compile
on an ARM Mac with UTM. 
\item
Now assuming we are on a {\bf Debian based Linux}, 
install Epsilon dependencies
from a Terminal or Konsole, copy-paste (select commands, press Ctrl-C,
then in the Terminal press shift-Ctrl-V simultaneously) the following commands:
\begin{verbatim}
sudo apt-get install wget build-essential git imagemagick libx11-dev libxext-dev libfreetype6-dev libpng-dev libjpeg-dev pkg-config python3 python3-pip
sudo apt-get install gcc g++ libgmp-dev libmpfr-dev libmpfi-dev libpari-dev libgsl0-dev libxext-dev libpng-dev libjpeg-dev libreadline-dev libncurses5-dev mesa-common-dev libx11-dev libxt-dev libxft-dev libntl-dev libgl1-mesa-dev libgl-dev libao-dev hevea debhelper libecm1-dev libnauty2-dev libcliquer-dev libresample1-dev libxinerama-dev libsamplerate0-dev libfltk1.3-dev
pip3 install lz4 pypng stringcase
\end{verbatim}
then copy-paste from a Terminal (or Konsole)
\begin{verbatim}
git clone https://github.com/parisseb/epsilon
cd epsilon
wget https://www-fourier.univ-grenoble-alpes.fr/~parisse/numworks/ext.tar.bz2
tar xfj ext.tar.bz2
wget https://www-fourier.univ-grenoble-alpes.fr/~parisse/numworks/nwsimu.tgz
tar xfz nwsimu.tgz
./mk
ln -sf output/release/simulator/linux/epsilon.bin simu
\end{verbatim}
Note that compilation with mk is done in two steps: first a
normal compilation of Epsilon that will error (because it does
not link to Xcas libraries) then a link step with Xcas libraries,
this final step should not error.

If everything went well, type \verb|./simu| from
\verb|epsilon| directory. The simulator should display.
\end{enumerate}

Once the simulator is compiled, you can modify Xcas source code in
the \verb|src| directory, and you can debug the simulator with
\verb|gdb|.

We describe here the external app build process for Epsilon 22/23.
$\chi$CAS is a large application (size 4M or 5M), it can not be handled
like a ``normal'' external app as supported by Numworks (upper limit 2.6M
because they must be in one of the 2 ``slots'' of 4M of the Numworks).
Moreover, the current protection mechanism of the Numworks erase
all external apps at each reset or crash and we do not want
to reflash a large app each time this happens. Therefore, $\chi$CAS
is divided in 2 files (short version) or 3 files (large version), 
with a launcher Numworks external app (of size a few K) that will
start $\chi$CAS code in the second slot of the Numworks, overwriting
one of the two copies of Epsilon firmware. The long version is compiled
with data located at the end of slot A, the short version has data
located in slot B together with the code.

Source code for the hardware calc is available in the two archives
\ahref{https://www-fourier.univ-grenoble-alpes.fr/\home{parisse}/numworks/launch.tgz}{launcher} and \ahref{https://www-fourier.univ-grenoble-alpes.fr/\home{parisse}/numworks/khib.tgz}{KhiCAS}.

The launcher should not need recompilation.
If you really want to modify it, install Numworks EADK then
compile by \verb|make|, this will generates a standard
Numworks external app in \verb|output/khicas.nwa|, this app
will install from
\ahref{https://my.numworks.com/apps}{Numworks external app site}.
It is linked to Numworks EADK with a few additions for missing functions
in order to match the same API as the old External unlocked N0110 API
\begin{verbatim}
  extern "C" void (* const apiPointers[])(void) = {
    (void (*)(void)) extapp_millis,
    (void (*)(void)) extapp_msleep,
    (void (*)(void)) extapp_scanKeyboard,
    (void (*)(void)) extapp_pushRect,
    (void (*)(void)) extapp_pushRectUniform, // 4
    (void (*)(void)) extapp_pullRect,
    (void (*)(void)) extapp_drawTextLarge,
    (void (*)(void)) extapp_drawTextSmall,
    (void (*)(void)) extapp_waitForVBlank, // 8
    (void (*)(void)) extapp_clipboardStore,
    (void (*)(void)) extapp_clipboardText,
    (void (*)(void)) extapp_fileListWithExtension,
    (void (*)(void)) extapp_fileExists, // 12
    (void (*)(void)) extapp_fileErase,
    (void (*)(void)) extapp_fileRead,
    (void (*)(void)) extapp_fileWrite,
    (void (*)(void)) extapp_lockAlpha, // 16
    (void (*)(void)) extapp_resetKeyboard,
    (void (*)(void)) extapp_getKey,
    (void (*)(void)) extapp_restorebackup,
    (void (*)(void)) extapp_erasesector, // 20
    (void (*)(void)) extapp_writememory,
    (void (*)(void)) extapp_inexammode,
    (void (*)(void)) extapp_isalphaactive, 
    (void (*)(void)) extapp_kbdstatus,  // 24
    (void (*)(void)) nullptr,
  };
\end{verbatim} 
This array address is passed as a parameter to  \verb|extapp_start| 
in \verb|khib/startup.c|\\
\verb|uint32_t _extapp_start(const uint32_t api_version, const void * api_base, void * heap, const uint32_t heap_size);|\\
this function is responsible for copying these parameters, including
the apiPointers array, used by KhiCAS C-SDK in \verb|khib/api.c|,
initialize static RAM, and call  \verb|extapp_main|
in \verb|khib/main.c|, this function calls
\verb|ext_main| that calls \verb|caseval("*")|
which is a convention in Giac/Xcas library to start the interactive shell.

KhiCAS can be compiled in 2 versions~: the short version without 
full online help will fit in Numworks 2nd slot
starting at 0x90400000, and the long version
that generates two binary files, the first one starting at 0x90260000 
ending at 0x903f0000 (read-only data),
and the second one starting at 0x90400000 (code).
Binaries are stored in a tar archive file, where script files
can be added, that will be accessible readonly on the calculator.
Run \verb|./mkb| or \verb|./mkab|. 
An additionnal tarfile can be sent to the calc at  0x90200000
with data/scripts that can be read or modified from the calculator.
There are 4 ld scriptfiles (2 versions and 2 calculator models, where 
N0110 and N0115 are identical) 
\verb|n01?0.ld, n01?0ab.ld|. 
Compilation is done by pair, with target \verb|khi110b.tar khi120b.tar| or 
\verb|khi110ab.tar khi120ab.tar| with compile commandline g++ define
\verb|-DNUMWORKS_SLOTB| or
\verb|-DNUMWORKS_SLOTAB|.
Static RAM is located 16K before the end of RAM for external apps
(13K are used now), and the launcher allocates 128K for KhiCAS malloc heap.

Memory modem
\begin{itemize}
\item RAM heap starts at \verb|0x2?012A28| with Epsilon 22.2.1
(replace ? by 0 or 4 depending on mdel)
\item
static RAM: \verb|0x2?033000| (16K reserved, 13K used)
\item
flash tar file R/W:  \verb|0x90200000| (6*64K available)
\item
flash \verb|.rodata 0x90260000-0x903f0000|: \verb|khia| file, 
read only data for long version
\item
flash \verb|.text 0x90400000-0x907f0000| (about
0.5M free for RO data tarfile in long version), 
file
\verb|khi1?0ab.tar| (long), or file \verb|khi1?0b.tar| (short)
\end{itemize}
Local dfu command to flash without Internet access
\begin{verbatim}
dfu-util -i 0 -a 0 -s 0x90400000 -D khi120b.tar
    (short) or (long)
dfu-util -i 0 -a 0 -s 0x90400000 -D khi120ab.tar
dfu-util -i 0 -a 0 -s 0x90260000 -D khia
    script exemples:
dfu-util -i 0 -a 0 -s 0x90200000 -D khi92
\end{verbatim}
In order to reflash the launcher app locally, get it once, when KhiCAS
is visible in the Numorks home menu, on a N0120:
\begin{verbatim}
#! /bin/bash
dfu-util -i 0 -a 0 -s 0x90190000:0x10000:force -U sector19
\end{verbatim}
on a N0110/N0115:
\begin{verbatim}
#! /bin/bash
dfu-util -i 0 -a 0 -s 0x90180000:0x10000:force -U sector18
\end{verbatim}
then reflash a N0120 with:
\begin{verbatim}
#! /bin/bash
dfu-util -i 0 -a 0 -s 0x90190000 -D sector19
\end{verbatim}
and a N0110/N0115
\begin{verbatim}
#! /bin/bash
dfu-util -i 0 -a 0 -s 0x90180000 -D sector18
\end{verbatim}

{\bf Remarks~:}
\begin{itemize} 
\item KhiCAS can be compiled in a short version in French by
running \verb|./mkfr|, this version is 4M-90K. It could be 
further shortened by removing MicroPython support
(remove \verb|-DMICROPY_LIB| in Makefile).
\item
The launcher compulation could probably be faster and could
work without Internet access by bypassing the Numworks
linker, with a ld file using a fixed sector in flash
(\verb|0x90190000| for N0120 Epsilon 22)
and the lowest address of the stack for static RAM 
(\verb|0x2?380000|) since the stack has room available.
EADK calls should be replaced by SVC calls, and some header code
should be added to be recognized as a Numworks external app
\begin{verbatim}
ion/src/device/userland/drivers/external_apps.cpp
ion/include/ion/external_apps.h
  /* The ExternalApp start with its info layout as:
   * - 4 bytes: a magic code 0xBABECODE
   * - 4 bytes: the API level of the AppInfo layout
   * - 4 bytes: the address of the app name
   * - 4 bytes: the size of the compressed icon
   * - 4 bytes: the address of the compressed icon data
   * - 4 bytes: the address of the entry point
   * - 4 bytes: the size of the external app including the AppInfo header
   * - 4 bytes: the same magic code 0xBABECODE
   */
apps/home/controller.cpp: affichage et lancement par switchToExternalApp
apps/apps_container.cpp:void AppsContainer::switchToExternalApp(Ion::ExternalApps::App app)
\end{verbatim}
\end{itemize}


\end{giacjshere}
\end{document}

\appendix
\section{Command list.}
You can test a command in the commandline at the bottom of the document.
To get short help on a command, click on \verb|+| to increase
the document console size, then type \verb|?| followed
by the commandname.
\begin{itemize}
\item \verb|a2q|
\item \verb|abcuv|
\item \verb|about|
\item \verb|abs|
\item \verb|acos|
\item \verb|acos2asin|
\item \verb|acos2atan|
\item \verb|acosh|
\item \verb|acot|
\item \verb|acsc|
\item \verb|add|
\item \verb|add_autosimplify|
\item \verb|additionally|
\item \verb|adjoint_matrix|
\item \verb|alg|
\item \verb|algsubs|
\item \verb|algvar|
\item \verb|alog10|
\item \verb|and|
\item \verb|ans|
\item \verb|append|
\item \verb|apply|
\item \verb|approx|
\item \verb|arclen|
\item \verb|arg|
\item \verb|array_sto|
\item \verb|asc|
\item \verb|asec|
\item \verb|asin|
\item \verb|asin2acos|
\item \verb|asin2atan|
\item \verb|asinh|
\item \verb|assert|
\item \verb|assume|
\item \verb|atan|
\item \verb|atan2|
\item \verb|atan2acos|
\item \verb|atan2asin|
\item \verb|atanh|
\item \verb|atrig2ln|
\item \verb|augment|
\item \verb|autosimplify|
\item \verb|barplot|
\item \verb|basis|
\item \verb|bernoulli|
\item \verb|betad|
\item \verb|betad_cdf|
\item \verb|betad_icdf|
\item \verb|bin|
\item \verb|binomial|
\item \verb|binomial_cdf|
\item \verb|binomial_icdf|
\item \verb|blockmatrix|
\item \verb|border|
\item \verb|bounded_function|
\item \verb|break|
\item \verb|breakpoint|
\item \verb|canonical_form|
\item \verb|cas_setup|
\item \verb|cat|
\item \verb|cauchyd|
\item \verb|cauchyd_cdf|
\item \verb|cauchyd_icdf|
\item \verb|ceil|
\item \verb|ceiling|
\item \verb|cfactor|
\item \verb|cfsolve|
\item \verb|changebase|
\item \verb|char|
\item \verb|charpoly|
\item \verb|chinrem|
\item \verb|chisquared|
\item \verb|chisquared_cdf|
\item \verb|chisquared_icdf|
\item \verb|choice|
\item \verb|cholesky|
\item \verb|chr|
\item \verb|chrem|
\item \verb|circle|
\item \verb|clear|
\item \verb|clearscreen|
\item \verb|click|
\item \verb|coeff|
\item \verb|coeffs|
\item \verb|col|
\item \verb|coldim|
\item \verb|collect|
\item \verb|colnorm|
\item \verb|color|
\item \verb|comDenom|
\item \verb|comb|
\item \verb|combine|
\item \verb|comment|
\item \verb|companion|
\item \verb|compare|
\item \verb|complex|
\item \verb|concat|
\item \verb|{|
\item \verb|conj|
\item \verb|cont|
\item \verb|contains|
\item \verb|content|
\item \verb|convert|
\item \verb|coordinates|
\item \verb|copy|
\item \verb|correlation|
\item \verb|cos|
\item \verb|cos2sintan|
\item \verb|cosh|
\item \verb|count|
\item \verb|count_eq|
\item \verb|count_inf|
\item \verb|count_sup|
\item \verb|covariance|
\item \verb|cpartfrac|
\item \verb|cross|
\item \verb|crossproduct|
\item \verb|csolve|
\item \verb|curl|
\item \verb|curve|
\item \verb|cyclotomic|
\item \verb|cylinder|
\item \verb|czeros|
\item \verb|debug|
\item \verb|debug_infolevel|
\item \verb|decrement|
\item \verb|degree|
\item \verb|del|
\item \verb|delcols|
\item \verb|delrows|
\item \verb|denom|
\item \verb|deriver|
\item \verb|desolve|
\item \verb|det|
\item \verb|dfc|
\item \verb|dfc2f|
\item \verb|diag|
\item \verb|diff|
\item \verb|dim|
\item \verb|display|
\item \verb|div|
\item \verb|divcrement|
\item \verb|divergence|
\item \verb|divis|
\item \verb|divisors|
\item \verb|divmod|
\item \verb|divpc|
\item \verb|domain|
\item \verb|dot|
\item \verb|draw_circle|
\item \verb|draw_line|
\item \verb|draw_rectangle|
\item \verb|draw_string|
\item \verb|dtype|
\item \verb|e2r|
\item \verb|egcd|
\item \verb|egv|
\item \verb|egvl|
\item \verb|eigenvals|
\item \verb|eigenvalues|
\item \verb|eigenvectors|
\item \verb|eigenvects|
\item \verb|eliminate|
\item \verb|epsilon2zero|
\item \verb|equal2diff|
\item \verb|equal2list|
\item \verb|equation|
\item \verb|erf|
\item \verb|erfc|
\item \verb|erfs|
\item \verb|euler|
\item \verb|euler_mac_laurin|
\item \verb|eval|
\item \verb|eval_level|
\item \verb|evalb|
\item \verb|evalc|
\item \verb|evalf|
\item \verb|evalm|
\item \verb|even|
\item \verb|exact|
\item \verb|execute|
\item \verb|exp|
\item \verb|exp2pow|
\item \verb|exp2trig|
\item \verb|expexpand|
\item \verb|expln2trig|
\item \verb|exponential_regression|
\item \verb|exponential_regression_plot|
\item \verb|exponentiald|
\item \verb|exponentiald_cdf|
\item \verb|exponentiald_icdf|
\item \verb|expr|
\item \verb|extend|
\item \verb|f2nd|
\item \verb|fMax|
\item \verb|fMin|
\item \verb|factor|
\item \verb|factor_xn|
\item \verb|factorial|
\item \verb|factors|
\item \verb|fclose|
\item \verb|fcoeff|
\item \verb|fft|
\item \verb|fft_mult_size|
\item \verb|filter|
\item \verb|find|
\item \verb|findhelp|
\item \verb|fisher|
\item \verb|fisher_cdf|
\item \verb|fisher_icdf|
\item \verb|fisherd|
\item \verb|fisherd_cdf|
\item \verb|fisherd_icdf|
\item \verb|flatten|
\item \verb|flatten1|
\item \verb|float|
\item \verb|float2rational|
\item \verb|floor|
\item \verb|fopen|
\item \verb|format|
\item \verb|fourier_an|
\item \verb|fourier_bn|
\item \verb|fourier_cn|
\item \verb|fprint|
\item \verb|frac|
\item \verb|fracmod|
\item \verb|frobenius_norm|
\item \verb|froot|
\item \verb|fsolve|
\item \verb|function_diff|
\item \verb|fxnd|
\item \verb|galoisconj|
\item \verb|gammad|
\item \verb|gammad_cdf|
\item \verb|gammad_icdf|
\item \verb|gauss|
\item \verb|gaussquad|
\item \verb|gbasis|
\item \verb|gcd|
\item \verb|genpoly|
\item \verb|geometric|
\item \verb|geometric_cdf|
\item \verb|geometric_icdf|
\item \verb|getDenom|
\item \verb|getKey|
\item \verb|getNum|
\item \verb|goto|
\item \verb|grad|
\item \verb|gramschmidt|
\item \verb|greduce|
\item \verb|hadamard|
\item \verb|halftan|
\item \verb|halftan_hyp2exp|
\item \verb|halt|
\item \verb|has|
\item \verb|heapify|
\item \verb|heappop|
\item \verb|heappush|
\item \verb|help|
\item \verb|hermite|
\item \verb|hessenberg|
\item \verb|hessian|
\item \verb|hex|
\item \verb|hilbert|
\item \verb|histogram|
\item \verb|hold|
\item \verb|horner|
\item \verb|hyp2exp|
\item \verb|iabcuv|
\item \verb|ibasis|
\item \verb|ibpdv|
\item \verb|ibpu|
\item \verb|ichinrem|
\item \verb|ichrem|
\item \verb|icontent|
\item \verb|id|
\item \verb|idivis|
\item \verb|idn|
\item \verb|iegcd|
\item \verb|ifactor|
\item \verb|ifactors|
\item \verb|ifft|
\item \verb|igamma_exp|
\item \verb|igcd|
\item \verb|ilaplace|
\item \verb|im|
\item \verb|imag|
\item \verb|image|
\item \verb|in_ideal|
\item \verb|increment|
\item \verb|indets|
\item \verb|index|
\item \verb|inferieur_strict_sort|
\item \verb|input|
\item \verb|insert|
\item \verb|int|
\item \verb|integer_format|
\item \verb|integrate|
\item \verb|interp|
\item \verb|inv|
\item \verb|inverse|
\item \verb|invlaplace|
\item \verb|iquo|
\item \verb|iquorem|
\item \verb|iquosto|
\item \verb|iratrecon|
\item \verb|irem|
\item \verb|iremsto|
\item \verb|is_prime|
\item \verb|is_pseudoprime|
\item \verb|isfinite|
\item \verb|isinf|
\item \verb|isnan|
\item \verb|isprime|
\item \verb|ithprime|
\item \verb|jacobi_symbol|
\item \verb|join|
\item \verb|jordan|
\item \verb|ker|
\item \verb|kernel|
\item \verb|kill|
\item \verb|l1norm|
\item \verb|l2norm|
\item \verb|label|
\item \verb|lagrange|
\item \verb|laguerre|
\item \verb|laplace|
\item \verb|laplacian|
\item \verb|lcm|
\item \verb|lcoeff|
\item \verb|ldegree|
\item \verb|left|
\item \verb|legend|
\item \verb|legendre|
\item \verb|legendre_symbol|
\item \verb|len|
\item \verb|length|
\item \verb|lgcd|
\item \verb|lhs|
\item \verb|limit|
\item \verb|limite|
\item \verb|lin|
\item \verb|line|
\item \verb|linear_regression|
\item \verb|linear_regression_plot|
\item \verb|linetan|
\item \verb|linfnorm|
\item \verb|linsolve|
\item \verb|linspace|
\item \verb|list2mat|
\item \verb|lll|
\item \verb|ln|
\item \verb|lname|
\item \verb|lncollect|
\item \verb|lnexpand|
\item \verb|log10|
\item \verb|logarithmic_regression|
\item \verb|logarithmic_regression_plot|
\item \verb|logb|
\item \verb|lower|
\item \verb|lu|
\item \verb|lvar|
\item \verb|makelist|
\item \verb|makemat|
\item \verb|makemod|
\item \verb|makesuite|
\item \verb|makevector|
\item \verb|map|
\item \verb|mat2list|
\item \verb|matpow|
\item \verb|matrix|
\item \verb|matrix_norm|
\item \verb|max|
\item \verb|max_algext|
\item \verb|maxnorm|
\item \verb|mean|
\item \verb|member|
\item \verb|mid|
\item \verb|min|
\item \verb|mods|
\item \verb|moyal|
\item \verb|mult_c_conjugate|
\item \verb|mult_conjugate|
\item \verb|multcrement|
\item \verb|multinomial|
\item \verb|multiply|
\item \verb|ncols|
\item \verb|negbinomial|
\item \verb|negbinomial_cdf|
\item \verb|negbinomial_icdf|
\item \verb|newton|
\item \verb|nextprime|
\item \verb|nop|
\item \verb|nops|
\item \verb|norm|
\item \verb|normal|
\item \verb|normald|
\item \verb|normald_cdf|
\item \verb|normald_icdf|
\item \verb|normalize|
\item \verb|nprimes|
\item \verb|nrows|
\item \verb|numer|
\item \verb|oct|
\item \verb|odd|
\item \verb|odesolve|
\item \verb|op|
\item \verb|or|
\item \verb|ord|
\item \verb|order_size|
\item \verb|ou|
\item \verb|part|
\item \verb|partfrac|
\item \verb|pcar|
\item \verb|pcoeff|
\item \verb|periodic|
\item \verb|peval|
\item \verb|piecewise|
\item \verb|plot|
\item \verb|plotfield|
\item \verb|plotfunc|
\item \verb|plotlist|
\item \verb|plotode|
\item \verb|plotparam|
\item \verb|plotpolar|
\item \verb|plotseq|
\item \verb|pmin|
\item \verb|point|
\item \verb|poisson|
\item \verb|poisson_cdf|
\item \verb|poisson_icdf|
\item \verb|polar2rectangular|
\item \verb|poly2symb|
\item \verb|polygamma|
\item \verb|polygon|
\item \verb|polygonplot|
\item \verb|polygonscatterplot|
\item \verb|polynomial_regression|
\item \verb|polynomial_regression_plot|
\item \verb|pop|
\item \verb|potential|
\item \verb|pow2exp|
\item \verb|power_regression|
\item \verb|power_regression_plot|
\item \verb|powermod|
\item \verb|powexpand|
\item \verb|powmod|
\item \verb|prepend|
\item \verb|preval|
\item \verb|prevprime|
\item \verb|primpart|
\item \verb|print|
\item \verb|printf|
\item \verb|printpow|
\item \verb|product|
\item \verb|prog_eval_level|
\item \verb|proot|
\item \verb|propfrac|
\item \verb|ptayl|
\item \verb|python|
\item \verb|python_compat|
\item \verb|python_list|
\item \verb|q2a|
\item \verb|qr|
\item \verb|quo|
\item \verb|quorem|
\item \verb|quote|
\item \verb|r2e|
\item \verb|rand|
\item \verb|randbinomial|
\item \verb|randchisquare|
\item \verb|randchisquared|
\item \verb|randexp|
\item \verb|randfisherd|
\item \verb|randgeometric|
\item \verb|randint|
\item \verb|randmatrix|
\item \verb|randmultinomial|
\item \verb|randnormald|
\item \verb|random|
\item \verb|randpoisson|
\item \verb|randpoly|
\item \verb|randrange|
\item \verb|randstudentd|
\item \verb|randvector|
\item \verb|range|
\item \verb|rank|
\item \verb|ranm|
\item \verb|ranv|
\item \verb|rassembler_trigo|
\item \verb|rat_jordan|
\item \verb|ratnormal|
\item \verb|re|
\item \verb|read|
\item \verb|real|
\item \verb|realproot|
\item \verb|rectangular2polar|
\item \verb|rectangular2spherical|
\item \verb|regroup|
\item \verb|rem|
\item \verb|remove|
\item \verb|reorder|
\item \verb|resultant|
\item \verb|reverse|
\item \verb|reverse_rsolve|
\item \verb|reverse|
\item \verb|revlist|
\item \verb|rhs|
\item \verb|right|
\item \verb|rm_a_z|
\item \verb|rm_all_vars|
\item \verb|rmbreakpoint|
\item \verb|rmwatch|
\item \verb|rootof|
\item \verb|roots|
\item \verb|rotate|
\item \verb|round|
\item \verb|row|
\item \verb|rowdim|
\item \verb|rownorm|
\item \verb|rpn|
\item \verb|rref|
\item \verb|rsolve|
\item \verb|sample|
\item \verb|scatterplot|
\item \verb|sec|
\item \verb|segment|
\item \verb|select|
\item \verb|semi_augment|
\item \verb|seq|
\item \verb|series|
\item \verb|set_pixel|
\item \verb|shift|
\item \verb|shift_phase|
\item \verb|shuffle|
\item \verb|sign|
\item \verb|simp2|
\item \verb|simplify|
\item \verb|sin|
\item \verb|sin2costan|
\item \verb|sincos|
\item \verb|sinh|
\item \verb|size|
\item \verb|sizes|
\item \verb|smod|
\item \verb|snedecord|
\item \verb|snedecord_cdf|
\item \verb|snedecord_icdf|
\item \verb|solve|
\item \verb|solve_zero_extremum|
\item \verb|sommet|
\item \verb|sort|
\item \verb|sorta|
\item \verb|sortd|
\item \verb|sorted|
\item \verb|sphere|
\item \verb|spherical2rectangular|
\item \verb|split|
\item \verb|sq|
\item \verb|sqrfree|
\item \verb|sqrt|
\item \verb|srand|
\item \verb|sst|
\item \verb|sst_in|
\item \verb|stddev|
\item \verb|sto|
\item \verb|str|
\item \verb|string|
\item \verb|strip|
\item \verb|studentd|
\item \verb|studentd_cdf|
\item \verb|studentd_icdf|
\item \verb|sturm|
\item \verb|sturmab|
\item \verb|sturmseq|
\item \verb|subst|
\item \verb|substituer|
\item \verb|subtype|
\item \verb|sum|
\item \verb|suppress|
\item \verb|surd|
\item \verb|svd|
\item \verb|sylvester|
\item \verb|symb2poly|
\item \verb|table|
\item \verb|tabvar|
\item \verb|tan|
\item \verb|tan2cossin2|
\item \verb|tan2sincos|
\item \verb|tan2sincos2|
\item \verb|tanh|
\item \verb|taux_accroissement|
\item \verb|taylor|
\item \verb|tchebyshev1|
\item \verb|tchebyshev2|
\item \verb|tcoeff|
\item \verb|tcollect|
\item \verb|tcollectsin|
\item \verb|texpand|
\item \verb|throw|
\item \verb|time|
\item \verb|tlin|
\item \verb|total_degree|
\item \verb|trace|
\item \verb|tran|
\item \verb|trig2exp|
\item \verb|trigcos|
\item \verb|trigexpand|
\item \verb|trigsimplify|
\item \verb|trigsin|
\item \verb|trigtan|
\item \verb|trn|
\item \verb|trunc|
\item \verb|truncate|
\item \verb|tsimplify|
\item \verb|type|
\item \verb|unapply|
\item \verb|uniform|
\item \verb|uniform_cdf|
\item \verb|uniform_icdf|
\item \verb|uniformd|
\item \verb|uniformd_cdf|
\item \verb|uniformd_icdf|
\item \verb|unquote|
\item \verb|upper|
\item \verb|valuation|
\item \verb|vandermonde|
\item \verb|variance|
\item \verb|vector|
\item \verb|version|
\item \verb|vpotential|
\item \verb|warn_equal_in_prog|
\item \verb|watch|
\item \verb|weibulld|
\item \verb|weibulld_cdf|
\item \verb|weibulld_icdf|
\item \verb|when|
\item \verb|with_sqrt|
\item \verb|write|
\item \verb|wz_certificate|
\item \verb|xcas|
\item \verb|xcas_mode|
\item \verb|zeros|
\item \verb|zip|
\end{itemize}
\end{giacjshere}
\end{document}
