%Suggested order of slides
% slides-nonlinsvm-featuregen
% slides-nonlinsvm-kernel-trick
% slides-nonlinsvm-kernel-poly
% slides-nonlinsvm-rkhs-repr
% slides-nonlinsvm-kernel-rbf
% slides-nonlinsvm-modelsel
% slides-nonlinsvm-uniapprox

\subsection{Feature Generation for Nonlinear Separation}
\includepdf[pages=-]{../slides-pdf/slides-nonlinsvm-featuregen.pdf}

\subsection{The Kernel Trick}
\includepdf[pages=-]{../slides-pdf/slides-nonlinsvm-kernel-trick.pdf}

\subsection{The Polynomial Kernel}
\includepdf[pages=-]{../slides-pdf/slides-nonlinsvm-kernel-poly.pdf}

\subsection{Reproducing Kernel Hilbert Space and Representer Theorem}
\includepdf[pages=-]{../slides-pdf/slides-nonlinsvm-rkhs-repr.pdf}

\subsection{The Gaussian RBF Kernel}
\includepdf[pages=-]{../slides-pdf/slides-nonlinsvm-kernel-rbf.pdf}

\subsection{SVM Model Selection}
\includepdf[pages=-]{../slides-pdf/slides-nonlinsvm-modelsel.pdf}

\subsection{Details on Support Vector Machines}
\includepdf[pages=-]{../slides-pdf/slides-nonlinsvm-uniapprox.pdf}


\chapter{``Q'' Standard Extension for Quad-Precision Floating-Point,
  Version 2.2}

This chapter describes the Q standard extension for 128-bit quad-precision binary
floating-point instructions compliant with the IEEE 754-2008
arithmetic standard. The quad-precision binary
floating-point instruction-set extension is named ``Q''; it depends
on the double-precision floating-point extension D.
The floating-point registers are now extended to hold either
a single, double, or quad-precision floating-point value (FLEN=128).
The NaN-boxing scheme described in Section~\ref{nanboxing} is now
extended recursively to allow a single-precision value to be NaN-boxed
inside a double-precision value which is itself NaN-boxed inside a
quad-precision value.

\section{Quad-Precision Load and Store Instructions}

New 128-bit variants of LOAD-FP and STORE-FP instructions are added,
encoded with a new value for the funct3 width field.

\vspace{-0.2in}
\begin{center}
\begin{tabular}{M@{}R@{}F@{}R@{}O}
\\
\instbitrange{31}{20} &
\instbitrange{19}{15} &
\instbitrange{14}{12} &
\instbitrange{11}{7} &
\instbitrange{6}{0} \\
\hline
\multicolumn{1}{|c|}{imm[11:0]} &
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{width} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{opcode} \\
\hline
12 & 5 & 3 & 5 & 7 \\
offset[11:0] & base & Q & dest & LOAD-FP \\
\end{tabular}
\end{center}

\vspace{-0.2in}
\begin{center}
\begin{tabular}{O@{}R@{}R@{}F@{}R@{}O}
\\
\instbitrange{31}{25} &
\instbitrange{24}{20} &
\instbitrange{19}{15} &
\instbitrange{14}{12} &
\instbitrange{11}{7} &
\instbitrange{6}{0} \\
\hline
\multicolumn{1}{|c|}{imm[11:5]} &
\multicolumn{1}{c|}{rs2} &
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{width} &
\multicolumn{1}{c|}{imm[4:0]} &
\multicolumn{1}{c|}{opcode} \\
\hline
7 & 5 & 5 & 3 & 5 & 7 \\
offset[11:5] & src & base & Q & offset[4:0] & STORE-FP \\
\end{tabular}
\end{center}

FLQ and FSQ are only guaranteed to execute atomically if the effective address
is naturally aligned and XLEN=128.

FLQ and FSQ do not modify the bits being transferred; in particular, the
payloads of non-canonical NaNs are preserved.

\section{Quad-Precision Computational Instructions}

A new supported format is added to the format field of most
instructions, as shown in Table~\ref{tab:fpextfmt}.

\begin{table}[htp]
\begin{center}
\begin{tabular}{|c|c|l|}
\hline
{\em fmt} field &
Mnemonic &
Meaning \\
\hline
00 & S & 32-bit single-precision \\
01 & D & 64-bit double-precision \\
10 & H & 16-bit half-precision \\
11 & Q & 128-bit quad-precision \\
\hline
\end{tabular}
\end{center}
\caption{Format field encoding.}
\label{tab:fpextfmt}
\end{table}

The quad-precision floating-point computational instructions are
defined analogously to their double-precision counterparts, but operate on
quad-precision operands and produce quad-precision results.

\vspace{-0.2in}
\begin{center}
\begin{tabular}{R@{}F@{}R@{}R@{}F@{}R@{}O}
\\
\instbitrange{31}{27} &
\instbitrange{26}{25} &
\instbitrange{24}{20} &
\instbitrange{19}{15} &
\instbitrange{14}{12} &
\instbitrange{11}{7} &
\instbitrange{6}{0} \\
\hline
\multicolumn{1}{|c|}{funct5} &
\multicolumn{1}{c|}{fmt} &
\multicolumn{1}{c|}{rs2} &
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{opcode} \\
\hline
5 & 2 & 5 & 5 & 3 & 5 & 7 \\
FADD/FSUB & Q & src2 & src1 & RM  & dest & OP-FP  \\
FMUL/FDIV & Q & src2 & src1 & RM  & dest & OP-FP  \\
FMIN-MAX  & Q & src2 & src1 & MIN/MAX & dest & OP-FP  \\
FSQRT     & Q & 0    & src  & RM  & dest & OP-FP  \\
\end{tabular}
\end{center}

\vspace{-0.2in}
\begin{center}
\begin{tabular}{R@{}F@{}R@{}R@{}F@{}R@{}O}
\\
\instbitrange{31}{27} &
\instbitrange{26}{25} &
\instbitrange{24}{20} &
\instbitrange{19}{15} &
\instbitrange{14}{12} &
\instbitrange{11}{7} &
\instbitrange{6}{0} \\
\hline
\multicolumn{1}{|c|}{rs3} &
\multicolumn{1}{c|}{fmt} &
\multicolumn{1}{c|}{rs2} &
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{opcode} \\
\hline
5 & 2 & 5 & 5 & 3 & 5 & 7 \\
src3 & Q & src2 & src1 & RM  & dest & F[N]MADD/F[N]MSUB  \\
\end{tabular}
\end{center}

\section{Quad-Precision Convert and Move Instructions}

New floating-point-to-integer and integer-to-floating-point conversion
instructions are added.  These instructions are defined analogously to the
double-precision-to-integer and integer-to-double-precision conversion
instructions.  FCVT.W.Q or FCVT.L.Q converts a quad-precision floating-point
number to a signed 32-bit or 64-bit integer, respectively.  FCVT.Q.W or
FCVT.Q.L converts a 32-bit or 64-bit signed integer, respectively, into a
quad-precision floating-point number. FCVT.WU.Q, FCVT.LU.Q, FCVT.Q.WU, and
FCVT.Q.LU variants convert to or from unsigned integer values.  FCVT.L[U].Q and
FCVT.Q.L[U] are RV64-only instructions.

\vspace{-0.2in}
\begin{center}
\begin{tabular}{R@{}F@{}R@{}R@{}F@{}R@{}O}
\\
\instbitrange{31}{27} &
\instbitrange{26}{25} &
\instbitrange{24}{20} &
\instbitrange{19}{15} &
\instbitrange{14}{12} &
\instbitrange{11}{7} &
\instbitrange{6}{0} \\
\hline
\multicolumn{1}{|c|}{funct5} &
\multicolumn{1}{c|}{fmt} &
\multicolumn{1}{c|}{rs2} &
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{opcode} \\
\hline
5 & 2 & 5 & 5 & 3 & 5 & 7 \\
FCVT.{\em int}.Q & Q & W[U]/L[U] & src & RM  & dest & OP-FP  \\
FCVT.Q.{\em int} & Q & W[U]/L[U] & src & RM  & dest & OP-FP  \\
\end{tabular}
\end{center}

New floating-point-to-floating-point conversion instructions are added.  These
instructions are defined analogously to the double-precision floating-point-to-floating-point
conversion instructions.  FCVT.S.Q or FCVT.Q.S converts a quad-precision
floating-point number to a single-precision floating-point number, or
vice-versa, respectively.  FCVT.D.Q or FCVT.Q.D converts a quad-precision
floating-point number to a double-precision floating-point number, or
vice-versa, respectively.

\vspace{-0.2in}
\begin{center}
\begin{tabular}{R@{}F@{}R@{}R@{}F@{}R@{}O}
\\
\instbitrange{31}{27} &
\instbitrange{26}{25} &
\instbitrange{24}{20} &
\instbitrange{19}{15} &
\instbitrange{14}{12} &
\instbitrange{11}{7} &
\instbitrange{6}{0} \\
\hline
\multicolumn{1}{|c|}{funct5} &
\multicolumn{1}{c|}{fmt} &
\multicolumn{1}{c|}{rs2} &
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{opcode} \\
\hline
5 & 2 & 5 & 5 & 3 & 5 & 7 \\
FCVT.S.Q & S & Q & src & RM  & dest & OP-FP  \\
FCVT.Q.S & Q & S & src & RM  & dest & OP-FP  \\
FCVT.D.Q & D & Q & src & RM  & dest & OP-FP  \\
FCVT.Q.D & Q & D & src & RM  & dest & OP-FP  \\
\end{tabular}
\end{center}

Floating-point to floating-point sign-injection instructions, FSGNJ.Q,
FSGNJN.Q, and FSGNJX.Q are defined analogously to the double-precision
sign-injection instruction.

\vspace{-0.2in}
\begin{center}
\begin{tabular}{R@{}F@{}R@{}R@{}F@{}R@{}O}
\\
\instbitrange{31}{27} &
\instbitrange{26}{25} &
\instbitrange{24}{20} &
\instbitrange{19}{15} &
\instbitrange{14}{12} &
\instbitrange{11}{7} &
\instbitrange{6}{0} \\
\hline
\multicolumn{1}{|c|}{funct5} &
\multicolumn{1}{c|}{fmt} &
\multicolumn{1}{c|}{rs2} &
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{opcode} \\
\hline
5 & 2 & 5 & 5 & 3 & 5 & 7 \\
FSGNJ & Q & src2 & src1 & J[N]/JX & dest & OP-FP  \\
\end{tabular}
\end{center}

FMV.X.Q and FMV.Q.X instructions are not provided in RV32 or RV64, so
quad-precision bit patterns must be moved to the integer registers via
memory.

\begin{commentary}
RV128 will support FMV.X.Q and FMV.Q.X in the Q extension.
\end{commentary}

\section{Quad-Precision Floating-Point Compare Instructions}

The quad-precision floating-point compare instructions are
defined analogously to their double-precision counterparts, but operate on
quad-precision operands.

\vspace{-0.2in}
\begin{center}
\begin{tabular}{S@{}F@{}R@{}R@{}F@{}R@{}O}
\\
\instbitrange{31}{27} &
\instbitrange{26}{25} &
\instbitrange{24}{20} &
\instbitrange{19}{15} &
\instbitrange{14}{12} &
\instbitrange{11}{7} &
\instbitrange{6}{0} \\
\hline
\multicolumn{1}{|c|}{funct5} &
\multicolumn{1}{c|}{fmt} &
\multicolumn{1}{c|}{rs2} &
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{opcode} \\
\hline
5 & 2 & 5 & 5 & 3 & 5 & 7 \\
FCMP & Q & src2 & src1 & EQ/LT/LE & dest & OP-FP  \\
\end{tabular}
\end{center}

\section{Quad-Precision Floating-Point Classify Instruction}

The quad-precision floating-point classify instruction, FCLASS.Q, is
defined analogously to its double-precision counterpart, but operates on
quad-precision operands.

\vspace{-0.2in}
\begin{center}
\begin{tabular}{S@{}F@{}R@{}R@{}F@{}R@{}O}
\\
\instbitrange{31}{27} &
\instbitrange{26}{25} &
\instbitrange{24}{20} &
\instbitrange{19}{15} &
\instbitrange{14}{12} &
\instbitrange{11}{7} &
\instbitrange{6}{0} \\
\hline
\multicolumn{1}{|c|}{funct5} &
\multicolumn{1}{c|}{fmt} &
\multicolumn{1}{c|}{rs2} &
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{opcode} \\
\hline
5 & 2 & 5 & 5 & 3 & 5 & 7 \\
FCLASS & Q & 0 & src & 001 & dest & OP-FP  \\
\end{tabular}
\end{center}


\documentclass[%
 %twocolumn,
 %preprint,
 onecolumn,
 amsmath, amssymb, aps, pra, 10pt
]{revtex4-2}
\usepackage{amsmath}
\usepackage{appendix}
\usepackage[colorlinks,citecolor=blue,urlcolor=black,bookmarks=false,hypertexnames=true]{hyperref}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\begin{document}
\title{Invertible Calculus}% Force line breaks with \
\author{Luke A. Siemens}
\email{luke.siemens@lsiemens.com}
\noaffiliation
\date{\today}
\maketitle

Paraphrasing some of my notes from 09/02/2018 to 09/27/2018. At the time I was interested in Fractional Calculus (FC) but found the semigroup propertie of FC inellegent. I noteiced that an equivelent semigroup propertie aplied in calculus and that it was a result of the fact that the derivative is not invertible. The goal of this project was to develop and investigate the properties of an invertible calculus with the hope that replacing the semigroup propertiy in calculus with an additive group propertie might provide some hints on how to apply a simular procedure to fractional calculus.

Goal define object such that $\frac{d}{dx}f(x)=f'(x)$, $\frac{d}{dx}^{-1}f(x) = \int	f(x)dx$, $\frac{d}{dx}\frac{d}{dx}^{-1}f(x) = \frac{d}{dx}^{-1}\frac{d}{dx}f(x) = f(x)$ and where $\frac{d}{dx}$ is a linear operator.

\section{Stacks}
Given two elements $a$ and $b$ the denote an ordered pair as $(a, b)$. The coordenants of the ordered pair can be extracted using the functions $\pi_1$ and $\pi_2$. Given the ordered pair $p=(a, b)$, then $\pi_1(p) =  a$ and $\pi_2(p) =  b$. Using ordered pairs it is posible to define a stack. Given $a_i \in \mathbb{C}$ are elements of the stack indexed by $i \in \mathbb{N}$. The stack $p$ can be defined by nesting ordered pairs,
\begin{equation}
p = (a_1, (a_2, (a_3, (\dots, (a_{k-2}, (a_{k-1}, a_k))\dots))))
\label{definition_finite_stack}
\end{equation}
or for an infinite stack,
\begin{equation}
p = (a_1, (a_2, (a_3, (a_4, \dots))))
\label{definition_infinite_stack}
\end{equation}
The top element of the stack is given by $\pi_1(p)$, and the remainder of the stack after removing the top element is given by $\pi_2(p)$. To simplify the notation let $[a_1, a_2, a_3, \cdots, a_{k-2}, a_{k-1}, a_k]$ denote nested pairs such that,
\[ [a_1, a_2, a_3, \cdots, a_{k-2}, a_{k-1}, a_k] = (a_1, (a_2, (a_3, (\dots, (a_{k-2}, (a_{k-1}, a_k))\dots)))) \]
So if $a_i$ for $i \in \{1, 2, 3, \cdots, k\}$ are elements of a stack $p$ then the stack can be defined as,
\[p = [a_1, a_2, a_3, \cdots, a_{k-2}, a_{k-1}, a_k] = (a_1, (a_2, (a_3, (\dots, (a_{k-2}, (a_{k-1}, a_k))\dots))))\]
So given two stacks $p$ with elements $a_i$ for $i \in \{1, 2, \cdots, k\}$ and $q$ with elements $b_i$ for $i \in \{1, 2, \cdots, j\}$, $q$ appended to $p$ is,
\[[a_1, a_2, \cdots, a_k, b_1, b_2, \cdots, b_j] = [a_1, a_2, \cdots, a_k, [b_1, b_2, \cdots, b_j]] = [a_1, a_2, \cdots, a_k, q]\]
Note, using this notation for any stack $p$, it can be writen as $p = [\pi_1(p), \pi_2(p)]$
From now on unless otherwise spesified all stacks used will be infinite stacks, if only a finite number of elements are specified assume it is padded with zeros. Given two stacks $p = [a_1, a_2, \cdots, a_i, \cdots]$ and $p = [b_1, b_2, \cdots, b_i, \cdots]$ then let
\[p + q = [a_1 + b_1, a_2 + b_2, \cdots, a_i + b_i, \cdots]\]
\[p \cdot q = [a_1 \cdot b_1, a_2 \cdot b_2, \cdots, a_i \cdot b_i, \cdots]\]
and for $\alpha \in \mathbb{C}$
\[\alpha + p = [a_1 + \alpha, a_2 + \alpha, \cdots, a_i + \alpha, \cdots]\]
\[\alpha \cdot p = [\alpha \cdot a_1, \alpha \cdot a_2, \cdots, \alpha \cdot a_i, \cdots]\]
also if $p$ is a stack with elements $a_i$ for $i \in \mathbb{N}$ and $q$ is a finite stack with elements $b_i$ for $i \in \{1, 2, \cdots, k\}$ then a new stack $r$ can be constructed by appending $p$ to $q$,
\[r = [b_1, b_2, \cdots, b_k, p] = [b_1, b_2, \cdots, b_k, [a_1, a_2, \cdots, a_i, \cdots]] = [b_1, b_2, \cdots, b_k, a_1, a_2, \cdots, a_i, \cdots]\]
Also define the action of a function $f$ that acts on stacks can be defined element wise. So given stacks $p_i$ with elements $a_{j, i}$ for $j \in \mathbb{N}$ and $i \in \{1, 2, \cdots, n\}$ and a function $f:\mathbb{C}^n \leftarrow \mathbb{C}$. Then let $f(p_1, p_2, \cdots)$ be defined as,
\[f(p_1, p_2, \cdots) = [f(a_{1, 1}, a_{1, 2}, a_{1, 3}, \cdots, a_{1, n}), f(a_{2, 1}, a_{2, 2}, a_{2, 3}, \cdots, a_{2, n}), \cdots, f(a_{j, 1}, a_{j, 2}, a_{j, 3}, \cdots, a_{j, n}), \cdots]\]

\section{Stack Function}
Informaly the antiderivative is described as the invers operation to the derivateive, however this is not formaly true. Spesificaly $\frac{d}{dx} \int_{0}^x f(t)dt = f(x) \neq \int_{0}^x \frac{d}{dt} f(t) dt$. Using the fundimental theorem of calculus $\int_{0}^x \frac{d}{dt} f(t) dt + f(0) = f(x) = \frac{d}{dx} \left( \int_{0}^x f(t) dt + F(0) \right)$, where $F'(x) = f(x)$. However $F(x)$ is not uniquely defined by $f(x)$ but a collection of functions wich all have the derivative $f(x)$. Thinking of $\frac{d}{dx}$ as a linear operator, it is a linear transform with nontrivial kernel and assuch is not invertible.

The goal is to produce an analogue to the derivative which is a linear operator with a trivial kernel , and to find its invers. The first step is to define a new type of generalized function, I will call a stack function. Let $a(x)$ be an analytic function $a:\mathbb{C}\rightarrow\mathbb{C}$ and a stack $p_a$ with elements $a_i \in \mathbb{C}$ for $i \in \mathbb{N}$ so $p_a = [a_1, a_2, \cdots, a_i, \cdots]$. Let $A$ be a stack function $A = (a(x), p_a)$.

The idea behind this object is that the first component should be a function $f(x):\mathbb{C}\rightarrow\mathbb{C}$ that should maintain the expected behavior from calculus as much as possible, while the seccond component retains all of the information that is lost during differentiation. So the values in the stack when deffining a specific function is like setting the intal values of an IVP. Given this retention of information, for each stack function the result of any iterated integration and differentiation should be uniquely determined.

Given a stack function $A(x)=(a(x), p_a)$, let the derivative be $A'(x) = \frac{d}{dx}A(x) = (a'(x), [a(0), p_a])$, note the choice of refrence point $x=0$ is arbitrary. Let the antiderivative be $\frac{d}{dx}^{-1}A(x) = \left(\int_{0}^x a(t)dt + \pi_1(p_a), \pi_2(p_a)\right)$. Given an arbitrary stack function $A = (a(x), p_a)$ if $a(x)$ is both integrable and differentiable then,
\[\frac{d}{dx}\frac{d}{dx}^{-1} A(x) = \frac{d}{dx}\left( \int_{0}^x a(t)dt + \pi_1(p_a), \pi_2(p_a) \right) = \left(\frac{d}{dx}\left(\int_{0}^x a(t)dt + \pi_1(p_a)\right), \left[\int_{0}^0 a(t)dt + \pi_1(p_a), \pi_2(p_a)\right]\right)\]
simplifying yields,
\[ \frac{d}{dx}\frac{d}{dx}^{-1} A(x) = (a(x), p_a) = A(x)\]
also,
\[\frac{d}{dx}^{-1}\frac{d}{dx}A(x) = \frac{d}{dx}^{-1} \left(a'(x), [a(0), p_a]\right) = \left(\int_{0}^x a'(t)dt + a(0), p_a\right)=(a(x)-a(0) + a(0), p_a) = A(x)\]
So under this definition $\frac{d}{dx}^{-1}$ is the inverse of $\frac{d}{dx}$.

\end{document}