Test de schéma exponentiel sur les équations de Lorenz
===

> Il s'agit ici seulement de génération de code C++ pour tester les équations de Lorenz. La génération se fait pour différents schémas avec différents approximants de Padé. Il serait peut-être plus judicieux de convertir ce notebook en simple script (ou bibliothèque permettant d'écrire un schéma avec `sympy` et de le convertir en code C++ avec le choix de la méthode de Lawson avec différents approximants de Padé. Pour cela il peut être intéressant de regarder du côté d'un autre notebook où j'ai fait un *hack* pour pouvoir utiliser des exponentielles de matrices avec des `sympy.MatrixSymbol`, puis de les substituer par n'importe quel approximant de Padé ou la fonction exponentielle.

Les équations de Lorenz sont données par :

$$
  \begin{cases}
    \dot{x} = \sigma (y-x) \\
    \dot{y} = x(\rho-z)-y \\
    \dot{z} = xy-\beta z \\
  \end{cases}
$$

Soit de manière matricielle, en posant $u = \left(x\ y\ z\right)^T$ :

$$
  \dot{u} =
  \begin{pmatrix}
    -\sigma & \sigma & 0 \\
    \rho    & -1     & 0 \\
    0       & 0      & -\beta \\
  \end{pmatrix} u
  +
  \begin{pmatrix}
    0 \\ -xz \\ xy
  \end{pmatrix}
$$

On note :
$$
  L = \begin{pmatrix}
    -\sigma & \sigma & 0 \\
    \rho    & -1     & 0 \\
    0       & 0      & -\beta \\
  \end{pmatrix}
  \qquad
  N:u\mapsto \begin{pmatrix}
    0 \\ -xz \\ xy
  \end{pmatrix}
$$

On peut ainsi écrire le schéma de Lawson RK(3,3) de Shu-Osher pour résoudre l'équation $\dot{u} = Lu + N(u)$ :

$$
  \begin{aligned}
    u^{(1)} &= \Delta t e^{L \Delta t} N{\left(u^{n} \right)} + u^{n} e^{L \Delta t} \\
    u^{(2)} &= \frac{\Delta t e^{- \frac{L \Delta t}{2}} N{\left(u^{(1)} \right)}}{4} + \frac{3 u^{n} e^{\frac{L \Delta t}{2}}}{4} + \frac{u^{(1)} e^{- \frac{L \Delta t}{2}}}{4} \\
    u^{n+1} &= \frac{2 \Delta t e^{\frac{L \Delta t}{2}} N{\left(u^{(2)} \right)}}{3} + \frac{u^{n} e^{L \Delta t}}{3} + \frac{2 u^{(2)} e^{\frac{L \Delta t}{2}}}{3}
  \end{aligned}
$$

On prendra les paramètres numériques suivant pour assurer le caractère chaotique du problème : $\sigma = 10$, $\beta=8/3$, $\rho=28$ et $u_0 = (1,1,1)$.

> Ce système est choisi car :
> * Il est multi-dimentionel ;
> * Il possède une partie linéaire et non-linéaire, ce qui permet la mise en place d'une méthode de Lawson ;
> * Le calcul de l'exponentielle de la matrice de la partie linéaire $\Delta t L$ est réalisable avec `sympy`, ce qui permettra de comparer la méthode de Lawson classique avec une méthode de Lawson-Padé, où l'exponentielle de la matrice est approchée par un approximant de Padé.

L'idée est donc de résoudre ce problème avec différentes méthodes de résolution :

* La méthode Runge-Kutta classique, qui nous servira de référence ;
* La méthode de Lawson induite par la même méthode Runge-Kutta que la résolution de référence ;
* La méthode de Lawson-Padé induite la par la méthode de Lawson précédente, en utilisant un approximant de Padé pour résoudre la partie linéaire du problème, ceci pouvant être effectué à différent ordre d'approximant de Padé.

```python
import sympy as sp
x,y,z = sp.symbols("x y z")
u = sp.Matrix([x,y,z])

s,b,r = sp.symbols(r"\sigma \beta \rho")
L = sp.Matrix([
  [-s , s , 0],
  [ r ,-1 , 0],
  [ 0 , 0 ,-b]
])
def N(u):
  return sp.Matrix([
    0,
    -u[0]*u[2],
    u[0]*u[1]
  ])
```

```python
dt = sp.symbols(r"\Delta\ t")
```

```python
num_val = [(s,10),(b,sp.Rational(8,3)),(r,28)]
```

```python
import numpy as np
import matplotlib.pyplot as plt
dts = np.linspace(1e-5,0.1)
for i,x in enumerate(sp.exp(dt*L).eigenvals()):
  plt.plot(dts,[x.subs(num_val).subs(dt,ndt).evalf() for ndt in dts ],"x-",label="$ev_{}$".format(i))
plt.xlabel(r"$\Delta t$")
plt.legend()
plt.show()
```

Donc nous ne sommes pas du tout dans un cas favorable pour les méthodes de Lawson, car les trois valeurs propres de la matrice $L$ sont réelles et une est plus grande que 1. Dans le cadre des équations de Lawson il n'y a pas de schéma en espace, donc pas de problème de stabilité.

Les équations de Lorenz, avec ces paramètres numériques, n'ont pas un comportement de divergence à l'infini, cela signifie, qu'en utilisant une méthode de Lawson nous résolvons exactement en temps un phénomène divergent, qui est compensé par la partie non-linéaire.

```python
un_s,u1_s,u2_s = (sp.Matrix(sp.symbols(r"x^{%s} y^{%s} z^{%s}"%(stage,stage,stage))) for stage in ['n','(1)','(2)'])

u1 = sp.exp(dt*L)*un_s + dt*sp.exp(dt*L)*N(un_s)
u2 = sp.Rational(3,4)*sp.exp(sp.Rational(1,2)*dt*L)*un_s + sp.Rational(1,4)*sp.exp(-sp.Rational(1,2)*dt*L)*u1_s + dt*sp.Rational(1,4)*sp.exp(-sp.Rational(1,2)*dt*L)*N(u1_s)
un1= sp.Rational(1,3)*sp.exp(dt*L)*un_s + sp.Rational(2,3)*sp.exp(sp.Rational(1,2)*dt*L)*u2_s + dt*sp.Rational(2,3)*sp.exp(sp.Rational(1,2)*dt*L)*N(u2_s)

display(u1)
display(u2)
display(un1)
```

$\displaystyle \left[\begin{matrix}- \Delta t x^{n} z^{n} \left(\frac{4 \rho \sigma^{2} e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} + \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{\left(\sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \left(4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)} + \frac{2 \sigma \left(2 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right) e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} - \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{\left(\sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \left(4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)}\right) + x^{n} \left(\frac{2 \rho \sigma e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} + \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{\left(\sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}} - \frac{2 \rho \sigma e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} - \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{\left(\sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}\right) + y^{n} \left(\frac{4 \rho \sigma^{2} e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} + \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{\left(\sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \left(4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)} + \frac{2 \sigma \left(2 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right) e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} - \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{\left(\sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \left(4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)}\right)\\- \Delta t x^{n} z^{n} \left(\frac{2 \rho \sigma e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} + \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1} + \frac{\left(2 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right) e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} - \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1}\right) + x^{n} \left(- \frac{\rho e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} - \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{\sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}} + \frac{\rho e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} + \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{\sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}\right) + y^{n} \left(\frac{2 \rho \sigma e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} + \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1} + \frac{\left(2 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right) e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} - \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1}\right)\\\Delta t x^{n} y^{n} e^{- \Delta t \beta} + z^{n} e^{- \Delta t \beta}\end{matrix}\right]$

$\displaystyle \left[\begin{matrix}- \frac{\Delta t x^{(1)} z^{(1)} \left(\frac{4 \rho \sigma^{2} e^{\frac{\Delta t \left(\sigma + 1\right)}{4} + \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{\left(\sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \left(4 \rho \sigma + \sigma^{2} + \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)} + \frac{2 \sigma \left(2 \rho \sigma + \sigma^{2} + \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right) e^{\frac{\Delta t \left(\sigma + 1\right)}{4} - \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{\left(\sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \left(4 \rho \sigma + \sigma^{2} + \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)}\right)}{4} + x^{(1)} \left(\frac{\rho \sigma e^{\frac{\Delta t \left(\sigma + 1\right)}{4} - \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{2 \left(\sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}} - \frac{\rho \sigma e^{\frac{\Delta t \left(\sigma + 1\right)}{4} + \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{2 \left(\sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}\right) + x^{n} \left(\frac{3 \rho \sigma e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} + \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{2 \left(\sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}} - \frac{3 \rho \sigma e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} - \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{2 \left(\sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}\right) + y^{(1)} \left(\frac{\rho \sigma^{2} e^{\frac{\Delta t \left(\sigma + 1\right)}{4} + \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{\left(\sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \left(4 \rho \sigma + \sigma^{2} + \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)} + \frac{\sigma \left(2 \rho \sigma + \sigma^{2} + \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right) e^{\frac{\Delta t \left(\sigma + 1\right)}{4} - \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{2 \left(\sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \left(4 \rho \sigma + \sigma^{2} + \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)}\right) + y^{n} \left(\frac{3 \rho \sigma^{2} e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} + \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{\left(\sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \left(4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)} + \frac{3 \sigma \left(2 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right) e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} - \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{2 \left(\sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \left(4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)}\right)\\- \frac{\Delta t x^{(1)} z^{(1)} \left(\frac{2 \rho \sigma e^{\frac{\Delta t \left(\sigma + 1\right)}{4} + \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{4 \rho \sigma + \sigma^{2} + \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1} + \frac{\left(2 \rho \sigma + \sigma^{2} + \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right) e^{\frac{\Delta t \left(\sigma + 1\right)}{4} - \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{4 \rho \sigma + \sigma^{2} + \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1}\right)}{4} + x^{(1)} \left(\frac{\rho e^{\frac{\Delta t \left(\sigma + 1\right)}{4} - \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{4 \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}} - \frac{\rho e^{\frac{\Delta t \left(\sigma + 1\right)}{4} + \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{4 \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}\right) + x^{n} \left(- \frac{3 \rho e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} - \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{4 \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}} + \frac{3 \rho e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} + \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{4 \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}\right) + y^{(1)} \left(\frac{\rho \sigma e^{\frac{\Delta t \left(\sigma + 1\right)}{4} + \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{2 \left(4 \rho \sigma + \sigma^{2} + \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)} + \frac{\left(2 \rho \sigma + \sigma^{2} + \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right) e^{\frac{\Delta t \left(\sigma + 1\right)}{4} - \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{4 \left(4 \rho \sigma + \sigma^{2} + \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)}\right) + y^{n} \left(\frac{3 \rho \sigma e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} + \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{2 \left(4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)} + \frac{3 \left(2 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right) e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} - \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{4 \left(4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)}\right)\\\frac{\Delta t x^{(1)} y^{(1)} e^{\frac{\Delta t \beta}{2}}}{4} + \frac{z^{(1)} e^{\frac{\Delta t \beta}{2}}}{4} + \frac{3 z^{n} e^{- \frac{\Delta t \beta}{2}}}{4}\end{matrix}\right]$

$\displaystyle \left[\begin{matrix}- \frac{2 \Delta t x^{(2)} z^{(2)} \left(\frac{4 \rho \sigma^{2} e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} + \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{\left(\sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \left(4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)} + \frac{2 \sigma \left(2 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right) e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} - \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{\left(\sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \left(4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)}\right)}{3} + x^{(2)} \left(\frac{4 \rho \sigma e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} + \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{3 \left(\sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}} - \frac{4 \rho \sigma e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} - \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{3 \left(\sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}\right) + x^{n} \left(\frac{2 \rho \sigma e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} + \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{3 \left(\sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}} - \frac{2 \rho \sigma e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} - \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{3 \left(\sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}\right) + y^{(2)} \left(\frac{8 \rho \sigma^{2} e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} + \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{3 \left(\sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \left(4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)} + \frac{4 \sigma \left(2 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right) e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} - \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{3 \left(\sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \left(4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)}\right) + y^{n} \left(\frac{4 \rho \sigma^{2} e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} + \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{3 \left(\sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \left(4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)} + \frac{2 \sigma \left(2 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right) e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} - \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{3 \left(\sigma - \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 1\right) \left(4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)}\right)\\- \frac{2 \Delta t x^{(2)} z^{(2)} \left(\frac{2 \rho \sigma e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} + \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1} + \frac{\left(2 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right) e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} - \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1}\right)}{3} + x^{(2)} \left(- \frac{2 \rho e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} - \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{3 \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}} + \frac{2 \rho e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} + \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{3 \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}\right) + x^{n} \left(- \frac{\rho e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} - \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{3 \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}} + \frac{\rho e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} + \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{3 \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}\right) + y^{(2)} \left(\frac{4 \rho \sigma e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} + \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{3 \left(4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)} + \frac{2 \left(2 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right) e^{- \frac{\Delta t \left(\sigma + 1\right)}{4} - \frac{\Delta t \sqrt{\rho \sigma + \frac{\sigma^{2}}{4} - \frac{\sigma}{2} + \frac{1}{4}}}{2}}}{3 \left(4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)}\right) + y^{n} \left(\frac{2 \rho \sigma e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} + \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{3 \left(4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)} + \frac{\left(2 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right) e^{- \frac{\Delta t \left(\sigma + 1\right)}{2} - \frac{\Delta t \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1}}{2}}}{3 \left(4 \rho \sigma + \sigma^{2} - \sigma \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} - 2 \sigma + \sqrt{4 \rho \sigma + \sigma^{2} - 2 \sigma + 1} + 1\right)}\right)\\\frac{2 \Delta t x^{(2)} y^{(2)} e^{- \frac{\Delta t \beta}{2}}}{3} + \frac{2 z^{(2)} e^{- \frac{\Delta t \beta}{2}}}{3} + \frac{z^{n} e^{- \Delta t \beta}}{3}\end{matrix}\right]$

```python

sym_to_code = [
  (dt,sp.symbols("dt")),
  (sp.symbols("x^{n}"),sp.symbols("xn")),
  (sp.symbols("y^{n}"),sp.symbols("yn")),
  (sp.symbols("z^{n}"),sp.symbols("zn")),
  (sp.symbols("x^{(1)}"),sp.symbols("x1")),
  (sp.symbols("y^{(1)}"),sp.symbols("y1")),
  (sp.symbols("z^{(1)}"),sp.symbols("z1")),
  (sp.symbols("x^{(2)}"),sp.symbols("x2")),
  (sp.symbols("y^{(2)}"),sp.symbols("y2")),
  (sp.symbols("z^{(2)}"),sp.symbols("z2")),
]
func_to_code = []

def expr_to_code (expr,symbols_replace,function_replace):
  math_to_stl = [(f,"std::"+f) for f in ("sin","cos","exp","sqrt")]

  a = sp.Wild('a')

  tmp = sp.simplify(expr.subs(symbols_replace))
  for old,new in function_replace:
    tmp = tmp.replace(old,new)
  tmp = tmp.replace(a/2,0.5*a,exact=True).evalf()

  stmp = str(tmp)
  for old,new in math_to_stl:
    stmp = stmp.replace(old,new)
  return stmp

un_c,u1_c,u2_c,utmp_c = (sp.Matrix(sp.symbols(r"x%s y%s z%s"%(stage,stage,stage))) for stage in ['n','1','2','tmp'])

for us,stage in zip([u1_c,u2_c,utmp_c],[u1,u2,un1]):
  for xs,eq in zip(us,stage):
    print(str(xs)+" = "+expr_to_code(eq.subs(num_val).evalf(),sym_to_code,func_to_code)+";")
  print("//---")
for xtmp,xn in zip(utmp_c,un_c):
  print(str(xn)+" = "+str(xtmp)+";")
```

    x1 = 1.0*(-0.288554928412381*dt*xn*zn*std::exp(1.0*std::sqrt(1201)*dt) + 0.288554928412381*dt*xn*zn + 0.370150282214429*xn*std::exp(1.0*std::sqrt(1201)*dt) + 0.629849717785571*xn + 0.288554928412381*yn*std::exp(1.0*std::sqrt(1201)*dt) - 0.288554928412381*yn)*std::exp(-0.5*dt*(11.0 + 1.0*std::sqrt(1201)));
    y1 = 1.0*(-0.629849717785571*dt*xn*zn*std::exp(1.0*std::sqrt(1201)*dt) - 0.370150282214429*dt*xn*zn + 0.807953799554666*xn*std::exp(1.0*std::sqrt(1201)*dt) - 0.807953799554666*xn + 0.629849717785571*yn*std::exp(1.0*std::sqrt(1201)*dt) + 0.370150282214429*yn)*std::exp(-0.5*dt*(11.0 + 1.0*std::sqrt(1201)));
    z1 = 1.0*(1.0*dt*xn*yn + 1.0*zn)*std::exp(-2.66666666666667*dt);
    //---
    x2 = 0.0721387321030952*dt*x1*z1*(-1.0*std::exp(0.25*dt*(11.0 - 1.0*std::sqrt(1201))) + 1.0*std::exp(0.25*dt*(11.0 + 1.0*std::sqrt(1201)))) + 1.0*x1*(0.0925375705536072*std::exp(0.25*dt*(11.0 - 1.0*std::sqrt(1201))) + 0.157462429446393*std::exp(0.25*dt*(11.0 + 1.0*std::sqrt(1201)))) + 1.0*xn*(0.277612711660822*std::exp(0.25*dt*(-11.0 + 1.0*std::sqrt(1201))) + 0.472387288339178*std::exp(-0.25*dt*(11.0 + 1.0*std::sqrt(1201)))) - 0.0721387321030952*y1*(-1.0*std::exp(0.25*dt*(11.0 - 1.0*std::sqrt(1201))) + 1.0*std::exp(0.25*dt*(11.0 + 1.0*std::sqrt(1201)))) + 0.216416196309285*yn*(1.0*std::exp(0.25*dt*(-11.0 + 1.0*std::sqrt(1201))) - 1.0*std::exp(-0.25*dt*(11.0 + 1.0*std::sqrt(1201))));
    y2 = -0.25*dt*x1*z1*(0.629849717785571*std::exp(0.25*dt*(11.0 - 1.0*std::sqrt(1201))) + 0.370150282214429*std::exp(0.25*dt*(11.0 + 1.0*std::sqrt(1201)))) - 0.201988449888666*x1*(-1.0*std::exp(0.25*dt*(11.0 - 1.0*std::sqrt(1201))) + 1.0*std::exp(0.25*dt*(11.0 + 1.0*std::sqrt(1201)))) + 0.605965349665999*xn*(1.0*std::exp(0.25*dt*(-11.0 + 1.0*std::sqrt(1201))) - 1.0*std::exp(-0.25*dt*(11.0 + 1.0*std::sqrt(1201)))) + 1.0*y1*(0.157462429446393*std::exp(0.25*dt*(11.0 - 1.0*std::sqrt(1201))) + 0.0925375705536072*std::exp(0.25*dt*(11.0 + 1.0*std::sqrt(1201)))) + 1.0*yn*(0.472387288339178*std::exp(0.25*dt*(-11.0 + 1.0*std::sqrt(1201))) + 0.277612711660822*std::exp(-0.25*dt*(11.0 + 1.0*std::sqrt(1201))));
    z2 = 1.0*(0.75*zn + 0.25*(1.0*dt*x1*y1 + 1.0*z1)*std::exp(2.66666666666667*dt))*std::exp(-1.33333333333333*dt);
    //---
    xtmp = -0.19236995227492*dt*x2*z2*(1.0*std::exp(0.25*dt*(-11.0 + 1.0*std::sqrt(1201))) - 1.0*std::exp(-0.25*dt*(11.0 + 1.0*std::sqrt(1201)))) + 1.0*x2*(0.246766854809619*std::exp(0.25*dt*(-11.0 + 1.0*std::sqrt(1201))) + 0.419899811857048*std::exp(-0.25*dt*(11.0 + 1.0*std::sqrt(1201)))) + 1.0*xn*(0.12338342740481*std::exp(0.5*dt*(-11.0 + 1.0*std::sqrt(1201))) + 0.209949905928524*std::exp(-0.5*dt*(11.0 + 1.0*std::sqrt(1201)))) + 0.19236995227492*y2*(1.0*std::exp(0.25*dt*(-11.0 + 1.0*std::sqrt(1201))) - 1.0*std::exp(-0.25*dt*(11.0 + 1.0*std::sqrt(1201)))) + 0.0961849761374602*yn*(1.0*std::exp(0.5*dt*(-11.0 + 1.0*std::sqrt(1201))) - 1.0*std::exp(-0.5*dt*(11.0 + 1.0*std::sqrt(1201))));
    ytmp = -0.666666666666667*dt*x2*z2*(0.629849717785571*std::exp(0.25*dt*(-11.0 + 1.0*std::sqrt(1201))) + 0.370150282214429*std::exp(-0.25*dt*(11.0 + 1.0*std::sqrt(1201)))) + 0.538635866369777*x2*(1.0*std::exp(0.25*dt*(-11.0 + 1.0*std::sqrt(1201))) - 1.0*std::exp(-0.25*dt*(11.0 + 1.0*std::sqrt(1201)))) + 0.269317933184889*xn*(1.0*std::exp(0.5*dt*(-11.0 + 1.0*std::sqrt(1201))) - 1.0*std::exp(-0.5*dt*(11.0 + 1.0*std::sqrt(1201)))) + 1.0*y2*(0.419899811857047*std::exp(0.25*dt*(-11.0 + 1.0*std::sqrt(1201))) + 0.246766854809619*std::exp(-0.25*dt*(11.0 + 1.0*std::sqrt(1201)))) + 1.0*yn*(0.209949905928524*std::exp(0.5*dt*(-11.0 + 1.0*std::sqrt(1201))) + 0.12338342740481*std::exp(-0.5*dt*(11.0 + 1.0*std::sqrt(1201))));
    ztmp = 1.0*(0.333333333333333*zn + 0.666666666666667*(1.0*dt*x2*y2 + 1.0*z2)*std::exp(1.33333333333333*dt))*std::exp(-2.66666666666667*dt);
    //---
    xn = xtmp;
    yn = ytmp;
    zn = ztmp;

```python
def M(u):
  return sp.Matrix([
    s*(u[1]-u[0]),
    u[0]*(r-u[2])-u[1],
    u[0]*u[1]-b*u[2]
  ])

u1 = un_s + dt*M(un_s)
u2 = sp.Rational(3,4)*un_s + sp.Rational(1,4)*u1_s + dt*sp.Rational(1,4)*M(u1_s)
un1= sp.Rational(1,3)*un_s + sp.Rational(2,3)*u2_s + dt*sp.Rational(2,3)*M(u2_s)

display(u1)
display(u2)
display(un1)
```

$\displaystyle \left[\begin{matrix}\Delta t \sigma \left(- x^{n} + y^{n}\right) + x^{n}\\\Delta t \left(x^{n} \left(\rho - z^{n}\right) - y^{n}\right) + y^{n}\\\Delta t \left(- \beta z^{n} + x^{n} y^{n}\right) + z^{n}\end{matrix}\right]$

$\displaystyle \left[\begin{matrix}\frac{\Delta t \sigma \left(- x^{(1)} + y^{(1)}\right)}{4} + \frac{x^{(1)}}{4} + \frac{3 x^{n}}{4}\\\frac{\Delta t \left(x^{(1)} \left(\rho - z^{(1)}\right) - y^{(1)}\right)}{4} + \frac{y^{(1)}}{4} + \frac{3 y^{n}}{4}\\\frac{\Delta t \left(- \beta z^{(1)} + x^{(1)} y^{(1)}\right)}{4} + \frac{z^{(1)}}{4} + \frac{3 z^{n}}{4}\end{matrix}\right]$

$\displaystyle \left[\begin{matrix}\frac{2 \Delta t \sigma \left(- x^{(2)} + y^{(2)}\right)}{3} + \frac{2 x^{(2)}}{3} + \frac{x^{n}}{3}\\\frac{2 \Delta t \left(x^{(2)} \left(\rho - z^{(2)}\right) - y^{(2)}\right)}{3} + \frac{2 y^{(2)}}{3} + \frac{y^{n}}{3}\\\frac{2 \Delta t \left(- \beta z^{(2)} + x^{(2)} y^{(2)}\right)}{3} + \frac{2 z^{(2)}}{3} + \frac{z^{n}}{3}\end{matrix}\right]$

```python
for us,stage in zip([u1_c,u2_c,utmp_c],[u1,u2,un1]):
  for xs,eq in zip(us,stage):
    print(str(xs)+" = "+expr_to_code(eq.subs(num_val).evalf(),sym_to_code,func_to_code)+";")
  print("//---")
for xtmp,xn in zip(utmp_c,un_c):
  print(str(xn)+" = "+str(xtmp)+";")
```

    x1 = -10.0*dt*(1.0*xn - 1.0*yn) + 1.0*xn;
    y1 = -1.0*dt*(1.0*xn*(1.0*zn - 28.0) + 1.0*yn) + 1.0*yn;
    z1 = 1.0*dt*(1.0*xn*yn - 2.66666666666667*zn) + 1.0*zn;
    //---
    x2 = -2.5*dt*(1.0*x1 - 1.0*y1) + 0.25*x1 + 0.75*xn;
    y2 = -0.25*dt*(1.0*x1*(1.0*z1 - 28.0) + 1.0*y1) + 0.25*y1 + 0.75*yn;
    z2 = 0.25*dt*(1.0*x1*y1 - 2.66666666666667*z1) + 0.25*z1 + 0.75*zn;
    //---
    xtmp = -6.66666666666667*dt*(1.0*x2 - 1.0*y2) + 0.666666666666667*x2 + 0.333333333333333*xn;
    ytmp = -0.666666666666667*dt*(1.0*x2*(1.0*z2 - 28.0) + 1.0*y2) + 0.666666666666667*y2 + 0.333333333333333*yn;
    ztmp = 0.666666666666667*dt*(1.0*x2*y2 - 2.66666666666667*z2) + 0.666666666666667*z2 + 0.333333333333333*zn;
    //---
    xn = xtmp;
    yn = ytmp;
    zn = ztmp;

```python
def one(z):
  if isinstance(z,sp.Matrix) or isinstance(z,sp.ImmutableDenseMatrix):
    return sp.eye(z.cols)
  return 1
def zero(z):
  if isinstance(z,sp.Matrix) or isinstance(z,sp.ImmutableDenseMatrix):
    return sp.zeros(z.cols)
  return 0
def inv(z):
  if isinstance(z,sp.Matrix) or isinstance(z,sp.ImmutableDenseMatrix):
    return z.inv()
  return 1/z

def pade(n,m):
  def h(p,q):
    fac = sp.factorial
    return lambda x : sum([
      ((fac(p)/fac(p-i)).simplify()/(fac(p+q)/fac(p+q-i)).simplify()*one(x)*x**i/fac(i))
      for i in range(0,p+1)
    ],start=zero(x))

  def k(p,q):
    fac = sp.factorial
    return lambda x : sum([
      (-1)**j*(fac(q)/fac(q-j)).simplify()/(fac(p+q)/fac(p+q-j)).simplify()*one(x)*x**j/fac(j)
      for j in range(0,q+1)
    ],start=zero(x))

  return lambda z: h(n,m)(z)*inv(k(n,m)(z))

p_exp = pade(3,3)
```

```python
nL = sp.simplify(L.subs(num_val))
t = sp.symbols("t",real=True,positive=True)
exp_nLt = pade(3,3)(t*nL)
exp_nLt
```

$\displaystyle \left[\begin{matrix}\frac{\left(- 10948 t^{3} - 3696 t^{2} - 1680 t\right) \left(\frac{391 t^{3}}{12} - 11 t^{2} + 5 t\right)}{164025 t^{6} - 80190 t^{5} + 1755 t^{4} + 7579 t^{3} + 168 t^{2} - 660 t - 120} + \frac{\left(- 3361 t^{3} - 3372 t^{2} - 60 t - 120\right) \left(- \frac{172 t^{3}}{3} + 38 t^{2} - 5 t + 1\right)}{164025 t^{6} - 80190 t^{5} + 1755 t^{4} + 7579 t^{3} + 168 t^{2} - 660 t - 120} & \frac{\left(- 3910 t^{3} - 1320 t^{2} - 600 t\right) \left(- \frac{172 t^{3}}{3} + 38 t^{2} - 5 t + 1\right)}{164025 t^{6} - 80190 t^{5} + 1755 t^{4} + 7579 t^{3} + 168 t^{2} - 660 t - 120} + \frac{\left(\frac{391 t^{3}}{12} - 11 t^{2} + 5 t\right) \left(- 6880 t^{3} - 4560 t^{2} - 600 t - 120\right)}{164025 t^{6} - 80190 t^{5} + 1755 t^{4} + 7579 t^{3} + 168 t^{2} - 660 t - 120} & 0\\\frac{\left(- 10948 t^{3} - 3696 t^{2} - 1680 t\right) \left(- \frac{3361 t^{3}}{120} + \frac{281 t^{2}}{10} - \frac{t}{2} + 1\right)}{164025 t^{6} - 80190 t^{5} + 1755 t^{4} + 7579 t^{3} + 168 t^{2} - 660 t - 120} + \frac{\left(\frac{2737 t^{3}}{30} - \frac{154 t^{2}}{5} + 14 t\right) \left(- 3361 t^{3} - 3372 t^{2} - 60 t - 120\right)}{164025 t^{6} - 80190 t^{5} + 1755 t^{4} + 7579 t^{3} + 168 t^{2} - 660 t - 120} & \frac{\left(- 3910 t^{3} - 1320 t^{2} - 600 t\right) \left(\frac{2737 t^{3}}{30} - \frac{154 t^{2}}{5} + 14 t\right)}{164025 t^{6} - 80190 t^{5} + 1755 t^{4} + 7579 t^{3} + 168 t^{2} - 660 t - 120} + \frac{\left(- 6880 t^{3} - 4560 t^{2} - 600 t - 120\right) \left(- \frac{3361 t^{3}}{120} + \frac{281 t^{2}}{10} - \frac{t}{2} + 1\right)}{164025 t^{6} - 80190 t^{5} + 1755 t^{4} + 7579 t^{3} + 168 t^{2} - 660 t - 120} & 0\\0 & 0 & \frac{405 \left(- \frac{64 t^{3}}{405} + \frac{32 t^{2}}{45} - \frac{4 t}{3} + 1\right)}{64 t^{3} + 288 t^{2} + 540 t + 405}\end{matrix}\right]$

```python
p_exp = lambda dt:exp_nLt.subs(t,dt)
```

```python
u1 = p_exp(dt)*un_s + dt*p_exp(dt)*N(un_s)
u2 = sp.Rational(3,4)*p_exp(sp.Rational(1,2)*dt)*un_s + sp.Rational(1,4)*p_exp(-sp.Rational(1,2)*dt)*u1_s + dt*sp.Rational(1,4)*p_exp(-sp.Rational(1,2)*dt)*N(u1_s)
un1= sp.Rational(1,3)*p_exp(dt)*un_s + sp.Rational(2,3)*p_exp(sp.Rational(1,2)*dt)*u2_s + dt*sp.Rational(2,3)*p_exp(sp.Rational(1,2)*dt)*N(u2_s)

display(u1)
display(u2)
display(un1)
```

$\displaystyle \left[\begin{matrix}- \Delta t x^{n} z^{n} \left(\frac{\left(- 3910 \Delta t^{3} - 1320 \Delta t^{2} - 600 \Delta t\right) \left(- \frac{172 \Delta t^{3}}{3} + 38 \Delta t^{2} - 5 \Delta t + 1\right)}{164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120} + \frac{\left(\frac{391 \Delta t^{3}}{12} - 11 \Delta t^{2} + 5 \Delta t\right) \left(- 6880 \Delta t^{3} - 4560 \Delta t^{2} - 600 \Delta t - 120\right)}{164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120}\right) + x^{n} \left(\frac{\left(- 10948 \Delta t^{3} - 3696 \Delta t^{2} - 1680 \Delta t\right) \left(\frac{391 \Delta t^{3}}{12} - 11 \Delta t^{2} + 5 \Delta t\right)}{164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120} + \frac{\left(- 3361 \Delta t^{3} - 3372 \Delta t^{2} - 60 \Delta t - 120\right) \left(- \frac{172 \Delta t^{3}}{3} + 38 \Delta t^{2} - 5 \Delta t + 1\right)}{164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120}\right) + y^{n} \left(\frac{\left(- 3910 \Delta t^{3} - 1320 \Delta t^{2} - 600 \Delta t\right) \left(- \frac{172 \Delta t^{3}}{3} + 38 \Delta t^{2} - 5 \Delta t + 1\right)}{164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120} + \frac{\left(\frac{391 \Delta t^{3}}{12} - 11 \Delta t^{2} + 5 \Delta t\right) \left(- 6880 \Delta t^{3} - 4560 \Delta t^{2} - 600 \Delta t - 120\right)}{164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120}\right)\\- \Delta t x^{n} z^{n} \left(\frac{\left(- 3910 \Delta t^{3} - 1320 \Delta t^{2} - 600 \Delta t\right) \left(\frac{2737 \Delta t^{3}}{30} - \frac{154 \Delta t^{2}}{5} + 14 \Delta t\right)}{164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120} + \frac{\left(- 6880 \Delta t^{3} - 4560 \Delta t^{2} - 600 \Delta t - 120\right) \left(- \frac{3361 \Delta t^{3}}{120} + \frac{281 \Delta t^{2}}{10} - \frac{\Delta t}{2} + 1\right)}{164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120}\right) + x^{n} \left(\frac{\left(- 10948 \Delta t^{3} - 3696 \Delta t^{2} - 1680 \Delta t\right) \left(- \frac{3361 \Delta t^{3}}{120} + \frac{281 \Delta t^{2}}{10} - \frac{\Delta t}{2} + 1\right)}{164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120} + \frac{\left(\frac{2737 \Delta t^{3}}{30} - \frac{154 \Delta t^{2}}{5} + 14 \Delta t\right) \left(- 3361 \Delta t^{3} - 3372 \Delta t^{2} - 60 \Delta t - 120\right)}{164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120}\right) + y^{n} \left(\frac{\left(- 3910 \Delta t^{3} - 1320 \Delta t^{2} - 600 \Delta t\right) \left(\frac{2737 \Delta t^{3}}{30} - \frac{154 \Delta t^{2}}{5} + 14 \Delta t\right)}{164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120} + \frac{\left(- 6880 \Delta t^{3} - 4560 \Delta t^{2} - 600 \Delta t - 120\right) \left(- \frac{3361 \Delta t^{3}}{120} + \frac{281 \Delta t^{2}}{10} - \frac{\Delta t}{2} + 1\right)}{164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120}\right)\\\frac{405 \Delta t x^{n} y^{n} \left(- \frac{64 \Delta t^{3}}{405} + \frac{32 \Delta t^{2}}{45} - \frac{4 \Delta t}{3} + 1\right)}{64 \Delta t^{3} + 288 \Delta t^{2} + 540 \Delta t + 405} + \frac{405 z^{n} \left(- \frac{64 \Delta t^{3}}{405} + \frac{32 \Delta t^{2}}{45} - \frac{4 \Delta t}{3} + 1\right)}{64 \Delta t^{3} + 288 \Delta t^{2} + 540 \Delta t + 405}\end{matrix}\right]$

$\displaystyle \left[\begin{matrix}- \frac{\Delta t x^{(1)} z^{(1)} \left(\frac{\left(- \frac{391 \Delta t^{3}}{96} - \frac{11 \Delta t^{2}}{4} - \frac{5 \Delta t}{2}\right) \left(860 \Delta t^{3} - 1140 \Delta t^{2} + 300 \Delta t - 120\right)}{\frac{164025 \Delta t^{6}}{64} + \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} - \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} + 330 \Delta t - 120} + \frac{\left(\frac{1955 \Delta t^{3}}{4} - 330 \Delta t^{2} + 300 \Delta t\right) \left(\frac{43 \Delta t^{3}}{6} + \frac{19 \Delta t^{2}}{2} + \frac{5 \Delta t}{2} + 1\right)}{\frac{164025 \Delta t^{6}}{64} + \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} - \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} + 330 \Delta t - 120}\right)}{4} + x^{(1)} \left(\frac{\left(- \frac{391 \Delta t^{3}}{96} - \frac{11 \Delta t^{2}}{4} - \frac{5 \Delta t}{2}\right) \left(\frac{2737 \Delta t^{3}}{2} - 924 \Delta t^{2} + 840 \Delta t\right)}{4 \left(\frac{164025 \Delta t^{6}}{64} + \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} - \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} + 330 \Delta t - 120\right)} + \frac{\left(\frac{43 \Delta t^{3}}{6} + \frac{19 \Delta t^{2}}{2} + \frac{5 \Delta t}{2} + 1\right) \left(\frac{3361 \Delta t^{3}}{8} - 843 \Delta t^{2} + 30 \Delta t - 120\right)}{4 \left(\frac{164025 \Delta t^{6}}{64} + \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} - \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} + 330 \Delta t - 120\right)}\right) + x^{n} \left(\frac{3 \left(- \frac{2737 \Delta t^{3}}{2} - 924 \Delta t^{2} - 840 \Delta t\right) \left(\frac{391 \Delta t^{3}}{96} - \frac{11 \Delta t^{2}}{4} + \frac{5 \Delta t}{2}\right)}{4 \left(\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120\right)} + \frac{3 \left(- \frac{3361 \Delta t^{3}}{8} - 843 \Delta t^{2} - 30 \Delta t - 120\right) \left(- \frac{43 \Delta t^{3}}{6} + \frac{19 \Delta t^{2}}{2} - \frac{5 \Delta t}{2} + 1\right)}{4 \left(\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120\right)}\right) + y^{(1)} \left(\frac{\left(- \frac{391 \Delta t^{3}}{96} - \frac{11 \Delta t^{2}}{4} - \frac{5 \Delta t}{2}\right) \left(860 \Delta t^{3} - 1140 \Delta t^{2} + 300 \Delta t - 120\right)}{4 \left(\frac{164025 \Delta t^{6}}{64} + \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} - \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} + 330 \Delta t - 120\right)} + \frac{\left(\frac{1955 \Delta t^{3}}{4} - 330 \Delta t^{2} + 300 \Delta t\right) \left(\frac{43 \Delta t^{3}}{6} + \frac{19 \Delta t^{2}}{2} + \frac{5 \Delta t}{2} + 1\right)}{4 \left(\frac{164025 \Delta t^{6}}{64} + \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} - \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} + 330 \Delta t - 120\right)}\right) + y^{n} \left(\frac{3 \left(- \frac{1955 \Delta t^{3}}{4} - 330 \Delta t^{2} - 300 \Delta t\right) \left(- \frac{43 \Delta t^{3}}{6} + \frac{19 \Delta t^{2}}{2} - \frac{5 \Delta t}{2} + 1\right)}{4 \left(\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120\right)} + \frac{3 \left(\frac{391 \Delta t^{3}}{96} - \frac{11 \Delta t^{2}}{4} + \frac{5 \Delta t}{2}\right) \left(- 860 \Delta t^{3} - 1140 \Delta t^{2} - 300 \Delta t - 120\right)}{4 \left(\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120\right)}\right)\\- \frac{\Delta t x^{(1)} z^{(1)} \left(\frac{\left(- \frac{2737 \Delta t^{3}}{240} - \frac{77 \Delta t^{2}}{10} - 7 \Delta t\right) \left(\frac{1955 \Delta t^{3}}{4} - 330 \Delta t^{2} + 300 \Delta t\right)}{\frac{164025 \Delta t^{6}}{64} + \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} - \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} + 330 \Delta t - 120} + \frac{\left(\frac{3361 \Delta t^{3}}{960} + \frac{281 \Delta t^{2}}{40} + \frac{\Delta t}{4} + 1\right) \left(860 \Delta t^{3} - 1140 \Delta t^{2} + 300 \Delta t - 120\right)}{\frac{164025 \Delta t^{6}}{64} + \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} - \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} + 330 \Delta t - 120}\right)}{4} + x^{(1)} \left(\frac{\left(- \frac{2737 \Delta t^{3}}{240} - \frac{77 \Delta t^{2}}{10} - 7 \Delta t\right) \left(\frac{3361 \Delta t^{3}}{8} - 843 \Delta t^{2} + 30 \Delta t - 120\right)}{4 \left(\frac{164025 \Delta t^{6}}{64} + \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} - \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} + 330 \Delta t - 120\right)} + \frac{\left(\frac{2737 \Delta t^{3}}{2} - 924 \Delta t^{2} + 840 \Delta t\right) \left(\frac{3361 \Delta t^{3}}{960} + \frac{281 \Delta t^{2}}{40} + \frac{\Delta t}{4} + 1\right)}{4 \left(\frac{164025 \Delta t^{6}}{64} + \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} - \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} + 330 \Delta t - 120\right)}\right) + x^{n} \left(\frac{3 \left(- \frac{2737 \Delta t^{3}}{2} - 924 \Delta t^{2} - 840 \Delta t\right) \left(- \frac{3361 \Delta t^{3}}{960} + \frac{281 \Delta t^{2}}{40} - \frac{\Delta t}{4} + 1\right)}{4 \left(\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120\right)} + \frac{3 \left(\frac{2737 \Delta t^{3}}{240} - \frac{77 \Delta t^{2}}{10} + 7 \Delta t\right) \left(- \frac{3361 \Delta t^{3}}{8} - 843 \Delta t^{2} - 30 \Delta t - 120\right)}{4 \left(\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120\right)}\right) + y^{(1)} \left(\frac{\left(- \frac{2737 \Delta t^{3}}{240} - \frac{77 \Delta t^{2}}{10} - 7 \Delta t\right) \left(\frac{1955 \Delta t^{3}}{4} - 330 \Delta t^{2} + 300 \Delta t\right)}{4 \left(\frac{164025 \Delta t^{6}}{64} + \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} - \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} + 330 \Delta t - 120\right)} + \frac{\left(\frac{3361 \Delta t^{3}}{960} + \frac{281 \Delta t^{2}}{40} + \frac{\Delta t}{4} + 1\right) \left(860 \Delta t^{3} - 1140 \Delta t^{2} + 300 \Delta t - 120\right)}{4 \left(\frac{164025 \Delta t^{6}}{64} + \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} - \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} + 330 \Delta t - 120\right)}\right) + y^{n} \left(\frac{3 \left(- \frac{1955 \Delta t^{3}}{4} - 330 \Delta t^{2} - 300 \Delta t\right) \left(\frac{2737 \Delta t^{3}}{240} - \frac{77 \Delta t^{2}}{10} + 7 \Delta t\right)}{4 \left(\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120\right)} + \frac{3 \left(- 860 \Delta t^{3} - 1140 \Delta t^{2} - 300 \Delta t - 120\right) \left(- \frac{3361 \Delta t^{3}}{960} + \frac{281 \Delta t^{2}}{40} - \frac{\Delta t}{4} + 1\right)}{4 \left(\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120\right)}\right)\\\frac{405 \Delta t x^{(1)} y^{(1)} \left(\frac{8 \Delta t^{3}}{405} + \frac{8 \Delta t^{2}}{45} + \frac{2 \Delta t}{3} + 1\right)}{4 \left(- 8 \Delta t^{3} + 72 \Delta t^{2} - 270 \Delta t + 405\right)} + \frac{405 z^{(1)} \left(\frac{8 \Delta t^{3}}{405} + \frac{8 \Delta t^{2}}{45} + \frac{2 \Delta t}{3} + 1\right)}{4 \left(- 8 \Delta t^{3} + 72 \Delta t^{2} - 270 \Delta t + 405\right)} + \frac{1215 z^{n} \left(- \frac{8 \Delta t^{3}}{405} + \frac{8 \Delta t^{2}}{45} - \frac{2 \Delta t}{3} + 1\right)}{4 \left(8 \Delta t^{3} + 72 \Delta t^{2} + 270 \Delta t + 405\right)}\end{matrix}\right]$

$\displaystyle \left[\begin{matrix}- \frac{2 \Delta t x^{(2)} z^{(2)} \left(\frac{\left(- \frac{1955 \Delta t^{3}}{4} - 330 \Delta t^{2} - 300 \Delta t\right) \left(- \frac{43 \Delta t^{3}}{6} + \frac{19 \Delta t^{2}}{2} - \frac{5 \Delta t}{2} + 1\right)}{\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120} + \frac{\left(\frac{391 \Delta t^{3}}{96} - \frac{11 \Delta t^{2}}{4} + \frac{5 \Delta t}{2}\right) \left(- 860 \Delta t^{3} - 1140 \Delta t^{2} - 300 \Delta t - 120\right)}{\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120}\right)}{3} + x^{(2)} \left(\frac{2 \left(- \frac{2737 \Delta t^{3}}{2} - 924 \Delta t^{2} - 840 \Delta t\right) \left(\frac{391 \Delta t^{3}}{96} - \frac{11 \Delta t^{2}}{4} + \frac{5 \Delta t}{2}\right)}{3 \left(\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120\right)} + \frac{2 \left(- \frac{3361 \Delta t^{3}}{8} - 843 \Delta t^{2} - 30 \Delta t - 120\right) \left(- \frac{43 \Delta t^{3}}{6} + \frac{19 \Delta t^{2}}{2} - \frac{5 \Delta t}{2} + 1\right)}{3 \left(\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120\right)}\right) + x^{n} \left(\frac{\left(- 10948 \Delta t^{3} - 3696 \Delta t^{2} - 1680 \Delta t\right) \left(\frac{391 \Delta t^{3}}{12} - 11 \Delta t^{2} + 5 \Delta t\right)}{3 \left(164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120\right)} + \frac{\left(- 3361 \Delta t^{3} - 3372 \Delta t^{2} - 60 \Delta t - 120\right) \left(- \frac{172 \Delta t^{3}}{3} + 38 \Delta t^{2} - 5 \Delta t + 1\right)}{3 \left(164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120\right)}\right) + y^{(2)} \left(\frac{2 \left(- \frac{1955 \Delta t^{3}}{4} - 330 \Delta t^{2} - 300 \Delta t\right) \left(- \frac{43 \Delta t^{3}}{6} + \frac{19 \Delta t^{2}}{2} - \frac{5 \Delta t}{2} + 1\right)}{3 \left(\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120\right)} + \frac{2 \left(\frac{391 \Delta t^{3}}{96} - \frac{11 \Delta t^{2}}{4} + \frac{5 \Delta t}{2}\right) \left(- 860 \Delta t^{3} - 1140 \Delta t^{2} - 300 \Delta t - 120\right)}{3 \left(\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120\right)}\right) + y^{n} \left(\frac{\left(- 3910 \Delta t^{3} - 1320 \Delta t^{2} - 600 \Delta t\right) \left(- \frac{172 \Delta t^{3}}{3} + 38 \Delta t^{2} - 5 \Delta t + 1\right)}{3 \left(164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120\right)} + \frac{\left(\frac{391 \Delta t^{3}}{12} - 11 \Delta t^{2} + 5 \Delta t\right) \left(- 6880 \Delta t^{3} - 4560 \Delta t^{2} - 600 \Delta t - 120\right)}{3 \left(164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120\right)}\right)\\- \frac{2 \Delta t x^{(2)} z^{(2)} \left(\frac{\left(- \frac{1955 \Delta t^{3}}{4} - 330 \Delta t^{2} - 300 \Delta t\right) \left(\frac{2737 \Delta t^{3}}{240} - \frac{77 \Delta t^{2}}{10} + 7 \Delta t\right)}{\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120} + \frac{\left(- 860 \Delta t^{3} - 1140 \Delta t^{2} - 300 \Delta t - 120\right) \left(- \frac{3361 \Delta t^{3}}{960} + \frac{281 \Delta t^{2}}{40} - \frac{\Delta t}{4} + 1\right)}{\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120}\right)}{3} + x^{(2)} \left(\frac{2 \left(- \frac{2737 \Delta t^{3}}{2} - 924 \Delta t^{2} - 840 \Delta t\right) \left(- \frac{3361 \Delta t^{3}}{960} + \frac{281 \Delta t^{2}}{40} - \frac{\Delta t}{4} + 1\right)}{3 \left(\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120\right)} + \frac{2 \left(\frac{2737 \Delta t^{3}}{240} - \frac{77 \Delta t^{2}}{10} + 7 \Delta t\right) \left(- \frac{3361 \Delta t^{3}}{8} - 843 \Delta t^{2} - 30 \Delta t - 120\right)}{3 \left(\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120\right)}\right) + x^{n} \left(\frac{\left(- 10948 \Delta t^{3} - 3696 \Delta t^{2} - 1680 \Delta t\right) \left(- \frac{3361 \Delta t^{3}}{120} + \frac{281 \Delta t^{2}}{10} - \frac{\Delta t}{2} + 1\right)}{3 \left(164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120\right)} + \frac{\left(\frac{2737 \Delta t^{3}}{30} - \frac{154 \Delta t^{2}}{5} + 14 \Delta t\right) \left(- 3361 \Delta t^{3} - 3372 \Delta t^{2} - 60 \Delta t - 120\right)}{3 \left(164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120\right)}\right) + y^{(2)} \left(\frac{2 \left(- \frac{1955 \Delta t^{3}}{4} - 330 \Delta t^{2} - 300 \Delta t\right) \left(\frac{2737 \Delta t^{3}}{240} - \frac{77 \Delta t^{2}}{10} + 7 \Delta t\right)}{3 \left(\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120\right)} + \frac{2 \left(- 860 \Delta t^{3} - 1140 \Delta t^{2} - 300 \Delta t - 120\right) \left(- \frac{3361 \Delta t^{3}}{960} + \frac{281 \Delta t^{2}}{40} - \frac{\Delta t}{4} + 1\right)}{3 \left(\frac{164025 \Delta t^{6}}{64} - \frac{40095 \Delta t^{5}}{16} + \frac{1755 \Delta t^{4}}{16} + \frac{7579 \Delta t^{3}}{8} + 42 \Delta t^{2} - 330 \Delta t - 120\right)}\right) + y^{n} \left(\frac{\left(- 3910 \Delta t^{3} - 1320 \Delta t^{2} - 600 \Delta t\right) \left(\frac{2737 \Delta t^{3}}{30} - \frac{154 \Delta t^{2}}{5} + 14 \Delta t\right)}{3 \left(164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120\right)} + \frac{\left(- 6880 \Delta t^{3} - 4560 \Delta t^{2} - 600 \Delta t - 120\right) \left(- \frac{3361 \Delta t^{3}}{120} + \frac{281 \Delta t^{2}}{10} - \frac{\Delta t}{2} + 1\right)}{3 \left(164025 \Delta t^{6} - 80190 \Delta t^{5} + 1755 \Delta t^{4} + 7579 \Delta t^{3} + 168 \Delta t^{2} - 660 \Delta t - 120\right)}\right)\\\frac{270 \Delta t x^{(2)} y^{(2)} \left(- \frac{8 \Delta t^{3}}{405} + \frac{8 \Delta t^{2}}{45} - \frac{2 \Delta t}{3} + 1\right)}{8 \Delta t^{3} + 72 \Delta t^{2} + 270 \Delta t + 405} + \frac{270 z^{(2)} \left(- \frac{8 \Delta t^{3}}{405} + \frac{8 \Delta t^{2}}{45} - \frac{2 \Delta t}{3} + 1\right)}{8 \Delta t^{3} + 72 \Delta t^{2} + 270 \Delta t + 405} + \frac{135 z^{n} \left(- \frac{64 \Delta t^{3}}{405} + \frac{32 \Delta t^{2}}{45} - \frac{4 \Delta t}{3} + 1\right)}{64 \Delta t^{3} + 288 \Delta t^{2} + 540 \Delta t + 405}\end{matrix}\right]$

```python
func_to_code.append((sp.Pow,sp.Function("std::pow",nargs=2)))

for us,stage in zip([u1_c,u2_c,utmp_c],[u1,u2,un1]):
  for xs,eq in zip(us,stage):
    print(str(xs)+" = "+expr_to_code(eq.subs(num_val).evalf(),sym_to_code,func_to_code)+";")
  print("//---")
for xtmp,xn in zip(utmp_c,un_c):
  print(str(xn)+" = "+str(xtmp)+";")
```

    x1 = 1.0*(540.0*dt*xn - 1200.0*dt*yn + 1200.0*xn*zn*std::pow(1.0*dt, 2) + 40220.0*xn*zn*std::pow(1.0*dt, 4) + 145800.0*xn*zn*std::pow(1.0*dt, 6) - 16032.0*xn*std::pow(1.0*dt, 2) + 18099.0*xn*std::pow(1.0*dt, 3) - 176715.0*xn*std::pow(1.0*dt, 4) + 65610.0*xn*std::pow(1.0*dt, 5) - 164025.0*xn*std::pow(1.0*dt, 6) - 120.0*xn - 40220.0*yn*std::pow(1.0*dt, 3) - 145800.0*yn*std::pow(1.0*dt, 5))*std::pow(-660.0*dt + 168.0*std::pow(1.0*dt, 2) + 7579.0*std::pow(1.0*dt, 3) + 1755.0*std::pow(1.0*dt, 4) - 80190.0*std::pow(1.0*dt, 5) + 164025.0*std::pow(1.0*dt, 6) - 120.0, -1);
    y1 = 1.0*(120.0*dt*xn*zn - 3360.0*dt*xn - 540.0*dt*yn + 540.0*xn*zn*std::pow(1.0*dt, 2) + 16032.0*xn*zn*std::pow(1.0*dt, 3) + 18099.0*xn*zn*std::pow(1.0*dt, 4) + 176715.0*xn*zn*std::pow(1.0*dt, 5) + 65610.0*xn*zn*std::pow(1.0*dt, 6) + 164025.0*xn*zn*std::pow(1.0*dt, 7) - 112616.0*xn*std::pow(1.0*dt, 3) - 408240.0*xn*std::pow(1.0*dt, 5) - 16032.0*yn*std::pow(1.0*dt, 2) - 18099.0*yn*std::pow(1.0*dt, 3) - 176715.0*yn*std::pow(1.0*dt, 4) - 65610.0*yn*std::pow(1.0*dt, 5) - 164025.0*yn*std::pow(1.0*dt, 6) - 120.0*yn)*std::pow(-660.0*dt + 168.0*std::pow(1.0*dt, 2) + 7579.0*std::pow(1.0*dt, 3) + 1755.0*std::pow(1.0*dt, 4) - 80190.0*std::pow(1.0*dt, 5) + 164025.0*std::pow(1.0*dt, 6) - 120.0, -1);
    z1 = -1.0*(1.0*dt*xn*yn + 1.0*zn)*(540.0*dt - 288.0*std::pow(1.0*dt, 2) + 64.0*std::pow(1.0*dt, 3) - 405.0)*std::pow(540.0*dt + 288.0*std::pow(1.0*dt, 2) + 64.0*std::pow(1.0*dt, 3) + 405.0, -1);
    //---
    x2 = 1.0*(-0.75*(1.0*dt*yn*(1.0*(-2.75*dt + 4.07291666666667*std::pow(1.0*dt, 2) + 2.5)*(300.0*dt + 1140.0*std::pow(1.0*dt, 2) + 860.0*std::pow(1.0*dt, 3) + 120.0) - 1.0*(330.0*dt + 488.75*std::pow(1.0*dt, 2) + 300.0)*(2.5*dt - 9.5*std::pow(1.0*dt, 2) + 7.16666666666667*std::pow(1.0*dt, 3) - 1.0)) + 1.0*xn*(1.0*(-2.75*dt + 4.07291666666667*std::pow(1.0*dt, 2) + 2.5)*(924.0*dt + 1368.5*std::pow(1.0*dt, 2) + 840.0)*std::pow(1.0*dt, 2) - 1.0*(2.5*dt - 9.5*std::pow(1.0*dt, 2) + 7.16666666666667*std::pow(1.0*dt, 3) - 1.0)*(30.0*dt + 843.0*std::pow(1.0*dt, 2) + 420.125*std::pow(1.0*dt, 3) + 120.0)))*(330.0*dt + 42.0*std::pow(1.0*dt, 2) - 947.375*std::pow(1.0*dt, 3) + 109.6875*std::pow(1.0*dt, 4) + 2505.9375*std::pow(1.0*dt, 5) + 2562.890625*std::pow(1.0*dt, 6) - 120.0) + 0.25*(-1.0*dt*y1*(-1.0*(-330.0*dt + 488.75*std::pow(1.0*dt, 2) + 300.0)*(2.5*dt + 9.5*std::pow(1.0*dt, 2) + 7.16666666666667*std::pow(1.0*dt, 3) + 1.0) + 1.0*(2.75*dt + 4.07291666666667*std::pow(1.0*dt, 2) + 2.5)*(300.0*dt - 1140.0*std::pow(1.0*dt, 2) + 860.0*std::pow(1.0*dt, 3) - 120.0)) + 1.0*x1*z1*(-1.0*(-330.0*dt + 488.75*std::pow(1.0*dt, 2) + 300.0)*(2.5*dt + 9.5*std::pow(1.0*dt, 2) + 7.16666666666667*std::pow(1.0*dt, 3) + 1.0) + 1.0*(2.75*dt + 4.07291666666667*std::pow(1.0*dt, 2) + 2.5)*(300.0*dt - 1140.0*std::pow(1.0*dt, 2) + 860.0*std::pow(1.0*dt, 3) - 120.0))*std::pow(1.0*dt, 2) - 1.0*x1*(1.0*(-924.0*dt + 1368.5*std::pow(1.0*dt, 2) + 840.0)*(2.75*dt + 4.07291666666667*std::pow(1.0*dt, 2) + 2.5)*std::pow(1.0*dt, 2) - 1.0*(2.5*dt + 9.5*std::pow(1.0*dt, 2) + 7.16666666666667*std::pow(1.0*dt, 3) + 1.0)*(30.0*dt - 843.0*std::pow(1.0*dt, 2) + 420.125*std::pow(1.0*dt, 3) - 120.0)))*(-330.0*dt + 42.0*std::pow(1.0*dt, 2) + 947.375*std::pow(1.0*dt, 3) + 109.6875*std::pow(1.0*dt, 4) - 2505.9375*std::pow(1.0*dt, 5) + 2562.890625*std::pow(1.0*dt, 6) - 120.0))*std::pow(-330.0*dt + 42.0*std::pow(1.0*dt, 2) + 947.375*std::pow(1.0*dt, 3) + 109.6875*std::pow(1.0*dt, 4) - 2505.9375*std::pow(1.0*dt, 5) + 2562.890625*std::pow(1.0*dt, 6) - 120.0, -1)*std::pow(330.0*dt + 42.0*std::pow(1.0*dt, 2) - 947.375*std::pow(1.0*dt, 3) + 109.6875*std::pow(1.0*dt, 4) + 2505.9375*std::pow(1.0*dt, 5) + 2562.890625*std::pow(1.0*dt, 6) - 120.0, -1);
    y2 = 1.0*(-0.75*(1.0*dt*xn*(1.0*(-7.7*dt + 11.4041666666667*std::pow(1.0*dt, 2) + 7.0)*(30.0*dt + 843.0*std::pow(1.0*dt, 2) + 420.125*std::pow(1.0*dt, 3) + 120.0) - 1.0*(924.0*dt + 1368.5*std::pow(1.0*dt, 2) + 840.0)*(0.25*dt - 7.025*std::pow(1.0*dt, 2) + 3.50104166666667*std::pow(1.0*dt, 3) - 1.0)) + 1.0*yn*(1.0*(-7.7*dt + 11.4041666666667*std::pow(1.0*dt, 2) + 7.0)*(330.0*dt + 488.75*std::pow(1.0*dt, 2) + 300.0)*std::pow(1.0*dt, 2) - 1.0*(0.25*dt - 7.025*std::pow(1.0*dt, 2) + 3.50104166666667*std::pow(1.0*dt, 3) - 1.0)*(300.0*dt + 1140.0*std::pow(1.0*dt, 2) + 860.0*std::pow(1.0*dt, 3) + 120.0)))*(330.0*dt + 42.0*std::pow(1.0*dt, 2) - 947.375*std::pow(1.0*dt, 3) + 109.6875*std::pow(1.0*dt, 4) + 2505.9375*std::pow(1.0*dt, 5) + 2562.890625*std::pow(1.0*dt, 6) - 120.0) + 0.25*(1.0*dt*x1*z1*(1.0*(-330.0*dt + 488.75*std::pow(1.0*dt, 2) + 300.0)*(7.7*dt + 11.4041666666667*std::pow(1.0*dt, 2) + 7.0)*std::pow(1.0*dt, 2) - 1.0*(0.25*dt + 7.025*std::pow(1.0*dt, 2) + 3.50104166666667*std::pow(1.0*dt, 3) + 1.0)*(300.0*dt - 1140.0*std::pow(1.0*dt, 2) + 860.0*std::pow(1.0*dt, 3) - 120.0)) - 1.0*dt*x1*(-1.0*(-924.0*dt + 1368.5*std::pow(1.0*dt, 2) + 840.0)*(0.25*dt + 7.025*std::pow(1.0*dt, 2) + 3.50104166666667*std::pow(1.0*dt, 3) + 1.0) + 1.0*(7.7*dt + 11.4041666666667*std::pow(1.0*dt, 2) + 7.0)*(30.0*dt - 843.0*std::pow(1.0*dt, 2) + 420.125*std::pow(1.0*dt, 3) - 120.0)) - 1.0*y1*(1.0*(-330.0*dt + 488.75*std::pow(1.0*dt, 2) + 300.0)*(7.7*dt + 11.4041666666667*std::pow(1.0*dt, 2) + 7.0)*std::pow(1.0*dt, 2) - 1.0*(0.25*dt + 7.025*std::pow(1.0*dt, 2) + 3.50104166666667*std::pow(1.0*dt, 3) + 1.0)*(300.0*dt - 1140.0*std::pow(1.0*dt, 2) + 860.0*std::pow(1.0*dt, 3) - 120.0)))*(-330.0*dt + 42.0*std::pow(1.0*dt, 2) + 947.375*std::pow(1.0*dt, 3) + 109.6875*std::pow(1.0*dt, 4) - 2505.9375*std::pow(1.0*dt, 5) + 2562.890625*std::pow(1.0*dt, 6) - 120.0))*std::pow(-330.0*dt + 42.0*std::pow(1.0*dt, 2) + 947.375*std::pow(1.0*dt, 3) + 109.6875*std::pow(1.0*dt, 4) - 2505.9375*std::pow(1.0*dt, 5) + 2562.890625*std::pow(1.0*dt, 6) - 120.0, -1)*std::pow(330.0*dt + 42.0*std::pow(1.0*dt, 2) - 947.375*std::pow(1.0*dt, 3) + 109.6875*std::pow(1.0*dt, 4) + 2505.9375*std::pow(1.0*dt, 5) + 2562.890625*std::pow(1.0*dt, 6) - 120.0, -1);
    z2 = -1.0*(303.75*zn*(0.666666666666667*dt - 0.177777777777778*std::pow(1.0*dt, 2) + 0.0197530864197531*std::pow(1.0*dt, 3) - 1.0)*(270.0*dt - 72.0*std::pow(1.0*dt, 2) + 8.0*std::pow(1.0*dt, 3) - 405.0) + 1.0*(1.0*dt*x1*y1 + 1.0*z1)*(67.5*dt + 18.0*std::pow(1.0*dt, 2) + 2.0*std::pow(1.0*dt, 3) + 101.25)*(270.0*dt + 72.0*std::pow(1.0*dt, 2) + 8.0*std::pow(1.0*dt, 3) + 405.0))*std::pow(270.0*dt - 72.0*std::pow(1.0*dt, 2) + 8.0*std::pow(1.0*dt, 3) - 405.0, -1)*std::pow(270.0*dt + 72.0*std::pow(1.0*dt, 2) + 8.0*std::pow(1.0*dt, 3) + 405.0, -1);
    //---
    xtmp = 1.0*(-0.333333333333333*(1.0*dt*yn*(1.0*(-11.0*dt + 32.5833333333333*std::pow(1.0*dt, 2) + 5.0)*(600.0*dt + 4560.0*std::pow(1.0*dt, 2) + 6880.0*std::pow(1.0*dt, 3) + 120.0) - 1.0*(1320.0*dt + 3910.0*std::pow(1.0*dt, 2) + 600.0)*(5.0*dt - 38.0*std::pow(1.0*dt, 2) + 57.3333333333333*std::pow(1.0*dt, 3) - 1.0)) + 1.0*xn*(1.0*(-11.0*dt + 32.5833333333333*std::pow(1.0*dt, 2) + 5.0)*(3696.0*dt + 10948.0*std::pow(1.0*dt, 2) + 1680.0)*std::pow(1.0*dt, 2) - 1.0*(5.0*dt - 38.0*std::pow(1.0*dt, 2) + 57.3333333333333*std::pow(1.0*dt, 3) - 1.0)*(60.0*dt + 3372.0*std::pow(1.0*dt, 2) + 3361.0*std::pow(1.0*dt, 3) + 120.0)))*(-330.0*dt + 42.0*std::pow(1.0*dt, 2) + 947.375*std::pow(1.0*dt, 3) + 109.6875*std::pow(1.0*dt, 4) - 2505.9375*std::pow(1.0*dt, 5) + 2562.890625*std::pow(1.0*dt, 6) - 120.0) + 0.666666666666667*(-1.0*dt*y2*(1.0*(-2.75*dt + 4.07291666666667*std::pow(1.0*dt, 2) + 2.5)*(300.0*dt + 1140.0*std::pow(1.0*dt, 2) + 860.0*std::pow(1.0*dt, 3) + 120.0) - 1.0*(330.0*dt + 488.75*std::pow(1.0*dt, 2) + 300.0)*(2.5*dt - 9.5*std::pow(1.0*dt, 2) + 7.16666666666667*std::pow(1.0*dt, 3) - 1.0)) + 1.0*x2*z2*(1.0*(-2.75*dt + 4.07291666666667*std::pow(1.0*dt, 2) + 2.5)*(300.0*dt + 1140.0*std::pow(1.0*dt, 2) + 860.0*std::pow(1.0*dt, 3) + 120.0) - 1.0*(330.0*dt + 488.75*std::pow(1.0*dt, 2) + 300.0)*(2.5*dt - 9.5*std::pow(1.0*dt, 2) + 7.16666666666667*std::pow(1.0*dt, 3) - 1.0))*std::pow(1.0*dt, 2) - 1.0*x2*(1.0*(-2.75*dt + 4.07291666666667*std::pow(1.0*dt, 2) + 2.5)*(924.0*dt + 1368.5*std::pow(1.0*dt, 2) + 840.0)*std::pow(1.0*dt, 2) - 1.0*(2.5*dt - 9.5*std::pow(1.0*dt, 2) + 7.16666666666667*std::pow(1.0*dt, 3) - 1.0)*(30.0*dt + 843.0*std::pow(1.0*dt, 2) + 420.125*std::pow(1.0*dt, 3) + 120.0)))*(-660.0*dt + 168.0*std::pow(1.0*dt, 2) + 7579.0*std::pow(1.0*dt, 3) + 1755.0*std::pow(1.0*dt, 4) - 80190.0*std::pow(1.0*dt, 5) + 164025.0*std::pow(1.0*dt, 6) - 120.0))*std::pow(-660.0*dt + 168.0*std::pow(1.0*dt, 2) + 7579.0*std::pow(1.0*dt, 3) + 1755.0*std::pow(1.0*dt, 4) - 80190.0*std::pow(1.0*dt, 5) + 164025.0*std::pow(1.0*dt, 6) - 120.0, -1)*std::pow(-330.0*dt + 42.0*std::pow(1.0*dt, 2) + 947.375*std::pow(1.0*dt, 3) + 109.6875*std::pow(1.0*dt, 4) - 2505.9375*std::pow(1.0*dt, 5) + 2562.890625*std::pow(1.0*dt, 6) - 120.0, -1);
    ytmp = 1.0*(-0.333333333333333*(1.0*dt*xn*(1.0*(-30.8*dt + 91.2333333333333*std::pow(1.0*dt, 2) + 14.0)*(60.0*dt + 3372.0*std::pow(1.0*dt, 2) + 3361.0*std::pow(1.0*dt, 3) + 120.0) - 1.0*(3696.0*dt + 10948.0*std::pow(1.0*dt, 2) + 1680.0)*(0.5*dt - 28.1*std::pow(1.0*dt, 2) + 28.0083333333333*std::pow(1.0*dt, 3) - 1.0)) + 1.0*yn*(1.0*(-30.8*dt + 91.2333333333333*std::pow(1.0*dt, 2) + 14.0)*(1320.0*dt + 3910.0*std::pow(1.0*dt, 2) + 600.0)*std::pow(1.0*dt, 2) - 1.0*(0.5*dt - 28.1*std::pow(1.0*dt, 2) + 28.0083333333333*std::pow(1.0*dt, 3) - 1.0)*(600.0*dt + 4560.0*std::pow(1.0*dt, 2) + 6880.0*std::pow(1.0*dt, 3) + 120.0)))*(-330.0*dt + 42.0*std::pow(1.0*dt, 2) + 947.375*std::pow(1.0*dt, 3) + 109.6875*std::pow(1.0*dt, 4) - 2505.9375*std::pow(1.0*dt, 5) + 2562.890625*std::pow(1.0*dt, 6) - 120.0) + 0.666666666666667*(1.0*dt*x2*z2*(1.0*(-7.7*dt + 11.4041666666667*std::pow(1.0*dt, 2) + 7.0)*(330.0*dt + 488.75*std::pow(1.0*dt, 2) + 300.0)*std::pow(1.0*dt, 2) - 1.0*(0.25*dt - 7.025*std::pow(1.0*dt, 2) + 3.50104166666667*std::pow(1.0*dt, 3) - 1.0)*(300.0*dt + 1140.0*std::pow(1.0*dt, 2) + 860.0*std::pow(1.0*dt, 3) + 120.0)) - 1.0*dt*x2*(1.0*(-7.7*dt + 11.4041666666667*std::pow(1.0*dt, 2) + 7.0)*(30.0*dt + 843.0*std::pow(1.0*dt, 2) + 420.125*std::pow(1.0*dt, 3) + 120.0) - 1.0*(924.0*dt + 1368.5*std::pow(1.0*dt, 2) + 840.0)*(0.25*dt - 7.025*std::pow(1.0*dt, 2) + 3.50104166666667*std::pow(1.0*dt, 3) - 1.0)) - 1.0*y2*(1.0*(-7.7*dt + 11.4041666666667*std::pow(1.0*dt, 2) + 7.0)*(330.0*dt + 488.75*std::pow(1.0*dt, 2) + 300.0)*std::pow(1.0*dt, 2) - 1.0*(0.25*dt - 7.025*std::pow(1.0*dt, 2) + 3.50104166666667*std::pow(1.0*dt, 3) - 1.0)*(300.0*dt + 1140.0*std::pow(1.0*dt, 2) + 860.0*std::pow(1.0*dt, 3) + 120.0)))*(-660.0*dt + 168.0*std::pow(1.0*dt, 2) + 7579.0*std::pow(1.0*dt, 3) + 1755.0*std::pow(1.0*dt, 4) - 80190.0*std::pow(1.0*dt, 5) + 164025.0*std::pow(1.0*dt, 6) - 120.0))*std::pow(-660.0*dt + 168.0*std::pow(1.0*dt, 2) + 7579.0*std::pow(1.0*dt, 3) + 1755.0*std::pow(1.0*dt, 4) - 80190.0*std::pow(1.0*dt, 5) + 164025.0*std::pow(1.0*dt, 6) - 120.0, -1)*std::pow(-330.0*dt + 42.0*std::pow(1.0*dt, 2) + 947.375*std::pow(1.0*dt, 3) + 109.6875*std::pow(1.0*dt, 4) - 2505.9375*std::pow(1.0*dt, 5) + 2562.890625*std::pow(1.0*dt, 6) - 120.0, -1);
    ztmp = -1.0*(135.0*zn*(1.33333333333333*dt - 0.711111111111111*std::pow(1.0*dt, 2) + 0.158024691358025*std::pow(1.0*dt, 3) - 1.0)*(270.0*dt + 72.0*std::pow(1.0*dt, 2) + 8.0*std::pow(1.0*dt, 3) + 405.0) + 1.0*(1.0*dt*x2*y2 + 1.0*z2)*(180.0*dt - 48.0*std::pow(1.0*dt, 2) + 5.33333333333333*std::pow(1.0*dt, 3) - 270.0)*(540.0*dt + 288.0*std::pow(1.0*dt, 2) + 64.0*std::pow(1.0*dt, 3) + 405.0))*std::pow(270.0*dt + 72.0*std::pow(1.0*dt, 2) + 8.0*std::pow(1.0*dt, 3) + 405.0, -1)*std::pow(540.0*dt + 288.0*std::pow(1.0*dt, 2) + 64.0*std::pow(1.0*dt, 3) + 405.0, -1);
    //---
    xn = xtmp;
    yn = ytmp;
    zn = ztmp;

```python
exp_nLt = pade(9,9)(t*nL)
p_exp = lambda dt:exp_nLt.subs(t,dt)

u1 = p_exp(dt)*un_s + dt*p_exp(dt)*N(un_s)
u2 = sp.Rational(3,4)*p_exp(sp.Rational(1,2)*dt)*un_s + sp.Rational(1,4)*p_exp(-sp.Rational(1,2)*dt)*u1_s + dt*sp.Rational(1,4)*p_exp(-sp.Rational(1,2)*dt)*N(u1_s)
un1= sp.Rational(1,3)*p_exp(dt)*un_s + sp.Rational(2,3)*p_exp(sp.Rational(1,2)*dt)*u2_s + dt*sp.Rational(2,3)*p_exp(sp.Rational(1,2)*dt)*N(u2_s)

for us,stage in zip([u1_c,u2_c,utmp_c],[u1,u2,un1]):
  for xs,eq in zip(us,stage):
    print(str(xs)+" = "+expr_to_code(eq.subs(num_val).evalf(),sym_to_code,func_to_code)+";")
  print("//---")
for xtmp,xn in zip(utmp_c,un_c):
  print(str(xn)+" = "+str(xtmp)+";")
```

    x1 = 1.0*(1.3510564651584e+15*dt*xn - 3.002347700352e+15*dt*yn + 3.002347700352e+15*xn*zn*std::pow(1.0*dt, 2) + 1.35650189971296e+17*xn*zn*std::pow(1.0*dt, 4) + 1.56390443380211e+18*xn*zn*std::pow(1.0*dt, 6) - 64.0*xn*zn*std::pow(1.0*dt, 7) + 7.01886385188228e+18*xn*zn*std::pow(1.0*dt, 8) - 1024.0*xn*zn*std::pow(1.0*dt, 9) + 1.42429862196713e+19*xn*zn*std::pow(1.0*dt, 10) - 1536.0*xn*zn*std::pow(1.0*dt, 11) + 1.36347773479928e+19*xn*zn*std::pow(1.0*dt, 12) - 4096.0*xn*zn*std::pow(1.0*dt, 13) + 5.96326071319382e+18*xn*zn*std::pow(1.0*dt, 14) - 2048.0*xn*zn*std::pow(1.0*dt, 15) + 1.04315118999299e+18*xn*zn*std::pow(1.0*dt, 16) + 4.90329056390623e+16*xn*zn*std::pow(1.0*dt, 18) + 64.0*xn*zn*std::pow(1.0*dt, 19) - 4.36135155648192e+16*xn*std::pow(1.0*dt, 2) + 6.10425854870832e+16*xn*std::pow(1.0*dt, 3) - 9.12552021713012e+17*xn*std::pow(1.0*dt, 4) + 7.0375699521095e+17*xn*std::pow(1.0*dt, 5) - 6.37788870264041e+18*xn*std::pow(1.0*dt, 6) + 3.15848873334703e+18*xn*std::pow(1.0*dt, 7) - 1.90464899209574e+19*xn*std::pow(1.0*dt, 8) + 6.40934379885211e+18*xn*std::pow(1.0*dt, 9) - 2.65316341182173e+19*xn*std::pow(1.0*dt, 10) + 6.13564980659675e+18*xn*std::pow(1.0*dt, 11) - 1.73208841729507e+19*xn*std::pow(1.0*dt, 12) + 2.68346732093722e+18*xn*std::pow(1.0*dt, 13) - 4.91808046363741e+18*xn*std::pow(1.0*dt, 14) + 4.69418035496848e+17*xn*std::pow(1.0*dt, 15) - 4.84735673080687e+17*xn*std::pow(1.0*dt, 16) + 2.2064807537579e+16*xn*std::pow(1.0*dt, 17) - 7.35493584585933e+15*xn*std::pow(1.0*dt, 18) - 300234770035200.0*xn - 1.35650189971296e+17*yn*std::pow(1.0*dt, 3) - 1.56390443380211e+18*yn*std::pow(1.0*dt, 5) + 64.0*yn*std::pow(1.0*dt, 6) - 7.01886385188228e+18*yn*std::pow(1.0*dt, 7) + 1024.0*yn*std::pow(1.0*dt, 8) - 1.42429862196713e+19*yn*std::pow(1.0*dt, 9) + 1536.0*yn*std::pow(1.0*dt, 10) - 1.36347773479928e+19*yn*std::pow(1.0*dt, 11) + 4096.0*yn*std::pow(1.0*dt, 12) - 5.96326071319382e+18*yn*std::pow(1.0*dt, 13) + 2048.0*yn*std::pow(1.0*dt, 14) - 1.04315118999299e+18*yn*std::pow(1.0*dt, 15) - 4.90329056390623e+16*yn*std::pow(1.0*dt, 17) - 64.0*yn*std::pow(1.0*dt, 18))*std::pow(-1.6512912351936e+15*dt - 3.0818216100672e+15*std::pow(1.0*dt, 2) - 299498900500800.0*std::pow(1.0*dt, 3) + 6.76242891756432e+15*std::pow(1.0*dt, 4) + 6.63475771766808e+15*std::pow(1.0*dt, 5) - 6.79435938437256e+15*std::pow(1.0*dt, 6) - 1.36214777467969e+16*std::pow(1.0*dt, 7) + 3.95617098823947e+15*std::pow(1.0*dt, 8) + 1.89373966838987e+16*std::pow(1.0*dt, 9) - 1.36620205312091e+15*std::pow(1.0*dt, 10) - 2.306065391635e+16*std::pow(1.0*dt, 11) + 2.23153351768463e+15*std::pow(1.0*dt, 12) + 2.73223415703026e+16*std::pow(1.0*dt, 13) - 1.15546935208444e+16*std::pow(1.0*dt, 14) - 2.8777809156525e+16*std::pow(1.0*dt, 15) + 4.3439522329125e+16*std::pow(1.0*dt, 16) - 2.69680981014844e+16*std::pow(1.0*dt, 17) + 7.35493584585938e+15*std::pow(1.0*dt, 18) - 300234770035200.0, -1);
    y1 = 1.0*(300234770035200.0*dt*xn*zn - 8.4065735609856e+15*dt*xn - 1.3510564651584e+15*dt*yn + 1.3510564651584e+15*xn*zn*std::pow(1.0*dt, 2) + 4.36135155648192e+16*xn*zn*std::pow(1.0*dt, 3) + 6.10425854870832e+16*xn*zn*std::pow(1.0*dt, 4) + 9.12552021713012e+17*xn*zn*std::pow(1.0*dt, 5) + 7.0375699521095e+17*xn*zn*std::pow(1.0*dt, 6) + 6.37788870264042e+18*xn*zn*std::pow(1.0*dt, 7) + 3.15848873334703e+18*xn*zn*std::pow(1.0*dt, 8) + 1.90464899209574e+19*xn*zn*std::pow(1.0*dt, 9) + 6.40934379885211e+18*xn*zn*std::pow(1.0*dt, 10) + 2.65316341182173e+19*xn*zn*std::pow(1.0*dt, 11) + 6.13564980659676e+18*xn*zn*std::pow(1.0*dt, 12) + 1.73208841729506e+19*xn*zn*std::pow(1.0*dt, 13) + 2.68346732093722e+18*xn*zn*std::pow(1.0*dt, 14) + 4.91808046363741e+18*xn*zn*std::pow(1.0*dt, 15) + 4.69418035496846e+17*xn*zn*std::pow(1.0*dt, 16) + 4.84735673080687e+17*xn*zn*std::pow(1.0*dt, 17) + 2.2064807537578e+16*xn*zn*std::pow(1.0*dt, 18) + 7.35493584585946e+15*xn*zn*std::pow(1.0*dt, 19) - 3.79820531919629e+17*xn*std::pow(1.0*dt, 3) - 64.0*xn*std::pow(1.0*dt, 4) - 4.37893241464591e+18*xn*std::pow(1.0*dt, 5) + 512.0*xn*std::pow(1.0*dt, 6) - 1.96528187852704e+19*xn*std::pow(1.0*dt, 7) - 2560.0*xn*std::pow(1.0*dt, 8) - 3.98803614150798e+19*xn*std::pow(1.0*dt, 9) - 4096.0*xn*std::pow(1.0*dt, 10) - 3.81773765743798e+19*xn*std::pow(1.0*dt, 11) - 1024.0*xn*std::pow(1.0*dt, 12) - 1.66971299969427e+19*xn*std::pow(1.0*dt, 13) - 2.9208233319804e+18*xn*std::pow(1.0*dt, 15) - 1024.0*xn*std::pow(1.0*dt, 16) - 1.37292135789376e+17*xn*std::pow(1.0*dt, 17) + 128.0*xn*std::pow(1.0*dt, 18) - 4.36135155648192e+16*yn*std::pow(1.0*dt, 2) - 6.10425854870832e+16*yn*std::pow(1.0*dt, 3) - 9.12552021713012e+17*yn*std::pow(1.0*dt, 4) - 7.0375699521095e+17*yn*std::pow(1.0*dt, 5) - 6.37788870264042e+18*yn*std::pow(1.0*dt, 6) - 3.15848873334703e+18*yn*std::pow(1.0*dt, 7) - 1.90464899209574e+19*yn*std::pow(1.0*dt, 8) - 6.40934379885211e+18*yn*std::pow(1.0*dt, 9) - 2.65316341182173e+19*yn*std::pow(1.0*dt, 10) - 6.13564980659676e+18*yn*std::pow(1.0*dt, 11) - 1.73208841729506e+19*yn*std::pow(1.0*dt, 12) - 2.68346732093722e+18*yn*std::pow(1.0*dt, 13) - 4.91808046363741e+18*yn*std::pow(1.0*dt, 14) - 4.69418035496846e+17*yn*std::pow(1.0*dt, 15) - 4.84735673080687e+17*yn*std::pow(1.0*dt, 16) - 2.2064807537578e+16*yn*std::pow(1.0*dt, 17) - 7.35493584585946e+15*yn*std::pow(1.0*dt, 18) - 300234770035200.0*yn)*std::pow(-1.6512912351936e+15*dt - 3.0818216100672e+15*std::pow(1.0*dt, 2) - 299498900500800.0*std::pow(1.0*dt, 3) + 6.76242891756432e+15*std::pow(1.0*dt, 4) + 6.63475771766808e+15*std::pow(1.0*dt, 5) - 6.79435938437256e+15*std::pow(1.0*dt, 6) - 1.36214777467969e+16*std::pow(1.0*dt, 7) + 3.95617098823947e+15*std::pow(1.0*dt, 8) + 1.89373966838987e+16*std::pow(1.0*dt, 9) - 1.36620205312091e+15*std::pow(1.0*dt, 10) - 2.306065391635e+16*std::pow(1.0*dt, 11) + 2.23153351768463e+15*std::pow(1.0*dt, 12) + 2.73223415703026e+16*std::pow(1.0*dt, 13) - 1.15546935208444e+16*std::pow(1.0*dt, 14) - 2.8777809156525e+16*std::pow(1.0*dt, 15) + 4.3439522329125e+16*std::pow(1.0*dt, 16) - 2.69680981014844e+16*std::pow(1.0*dt, 17) + 7.35493584585938e+15*std::pow(1.0*dt, 18) - 300234770035200.0, -1);
    z1 = -1.0*(1.0*dt*xn*yn + 1.0*zn)*(904353149700.0*dt - 567437270400.0*std::pow(1.0*dt, 2) + 220670049600.0*std::pow(1.0*dt, 3) - 58845346560.0*std::pow(1.0*dt, 4) + 11208637440.0*std::pow(1.0*dt, 5) - 1532805120.0*std::pow(1.0*dt, 6) + 145981440.0*std::pow(1.0*dt, 7) - 8847360.0*std::pow(1.0*dt, 8) + 262144.0*std::pow(1.0*dt, 9) - 678264862275.0)*std::pow(904353149700.0*dt + 567437270400.0*std::pow(1.0*dt, 2) + 220670049600.0*std::pow(1.0*dt, 3) + 58845346560.0*std::pow(1.0*dt, 4) + 11208637440.0*std::pow(1.0*dt, 5) + 1532805120.0*std::pow(1.0*dt, 6) + 145981440.0*std::pow(1.0*dt, 7) + 8847360.0*std::pow(1.0*dt, 8) + 262144.0*std::pow(1.0*dt, 9) + 678264862275.0, -1);
    //---
    x2 = 1.0*(0.75*(1.0*dt*yn*(1.0*(-3.23529411764706*dt + 8.38541666666667*std::pow(1.0*dt, 2) - 7.79672181372549*std::pow(1.0*dt, 3) + 7.10596660539216*std::pow(1.0*dt, 4) - 3.9320078792735*std::pow(1.0*dt, 5) + 1.65084357310633*std::pow(1.0*dt, 6) - 0.421786073140695*std::pow(1.0*dt, 7) + 0.0539151946678599*std::pow(1.0*dt, 8) + 2.5)*(750586925088000.0*dt + 3.355565076864e+15*std::pow(1.0*dt, 2) + 4.429934597088e+15*std::pow(1.0*dt, 3) + 5.7395984009364e+15*std::pow(1.0*dt, 4) + 4.3907035525353e+15*std::pow(1.0*dt, 5) + 2.6575350388587e+15*std::pow(1.0*dt, 6) + 1.06482256907276e+15*std::pow(1.0*dt, 7) + 278706404837798.0*std::pow(1.0*dt, 8) + 35182442773524.9*std::pow(1.0*dt, 9) + 300234770035200.0) - 1.0*(971347785408000.0*dt + 2.517593644566e+15*std::pow(1.0*dt, 2) + 2.3408469807723e+15*std::pow(1.0*dt, 3) + 2.13345824964773e+15*std::pow(1.0*dt, 4) + 1.18052548141028e+15*std::pow(1.0*dt, 5) + 495640640535666.0*std::pow(1.0*dt, 6) + 126634844673446.0*std::pow(1.0*dt, 7) + 16187216072507.9*std::pow(1.0*dt, 8) + 750586925088000.0)*(2.5*dt - 11.1764705882353*std::pow(1.0*dt, 2) + 14.7549019607843*std::pow(1.0*dt, 3) - 19.1170343137255*std::pow(1.0*dt, 4) + 14.6242340686275*std::pow(1.0*dt, 5) - 8.85152322146807*std::pow(1.0*dt, 6) + 3.54663308632748*std::pow(1.0*dt, 7) - 0.928294896707408*std::pow(1.0*dt, 8) + 0.117183105638964*std::pow(1.0*dt, 9) - 1.0)) + 1.0*xn*(1.0*(-3.23529411764706*dt + 8.38541666666667*std::pow(1.0*dt, 2) - 7.79672181372549*std::pow(1.0*dt, 3) + 7.10596660539216*std::pow(1.0*dt, 4) - 3.9320078792735*std::pow(1.0*dt, 5) + 1.65084357310633*std::pow(1.0*dt, 6) - 0.421786073140695*std::pow(1.0*dt, 7) + 0.0539151946678599*std::pow(1.0*dt, 8) + 2.5)*(2.7197737991424e+15*dt + 7.0492622047848e+15*std::pow(1.0*dt, 2) + 6.55437154616244e+15*std::pow(1.0*dt, 3) + 5.97368309901363e+15*std::pow(1.0*dt, 4) + 3.30547134794877e+15*std::pow(1.0*dt, 5) + 1.38779379349986e+15*std::pow(1.0*dt, 6) + 354577565085650.0*std::pow(1.0*dt, 7) + 45324205003022.3*std::pow(1.0*dt, 8) + 2.1016433902464e+15)*std::pow(1.0*dt, 2) - 1.0*(2.5*dt - 11.1764705882353*std::pow(1.0*dt, 2) + 14.7549019607843*std::pow(1.0*dt, 3) - 19.1170343137255*std::pow(1.0*dt, 4) + 14.6242340686275*std::pow(1.0*dt, 5) - 8.85152322146807*std::pow(1.0*dt, 6) + 3.54663308632748*std::pow(1.0*dt, 7) - 0.928294896707408*std::pow(1.0*dt, 8) + 0.117183105638964*std::pow(1.0*dt, 9) - 1.0)*(75058692508800.0*dt + 2.4813520699968e+15*std::pow(1.0*dt, 2) + 2.1641003169786e+15*std::pow(1.0*dt, 3) + 3.63283611824133e+15*std::pow(1.0*dt, 4) + 2.47059112785235e+15*std::pow(1.0*dt, 5) + 1.59506210558945e+15*std::pow(1.0*dt, 6) + 618745992590664.0*std::pow(1.0*dt, 7) + 164735044631697.0*std::pow(1.0*dt, 8) + 20613948308267.8*std::pow(1.0*dt, 9) + 300234770035200.0)))*(825645617596800.0*dt - 770455402516800.0*std::pow(1.0*dt, 2) + 37437362562600.0*std::pow(1.0*dt, 3) + 422651807347770.0*std::pow(1.0*dt, 4) - 207336178677128.0*std::pow(1.0*dt, 5) - 106161865380821.0*std::pow(1.0*dt, 6) + 106417794896851.0*std::pow(1.0*dt, 7) + 15453792922810.4*std::pow(1.0*dt, 8) - 36987102898239.6*std::pow(1.0*dt, 9) - 1334181692500.88*std::pow(1.0*dt, 10) + 11260084920092.8*std::pow(1.0*dt, 11) + 544807987715.973*std::pow(1.0*dt, 12) - 3335246773718.58*std::pow(1.0*dt, 13) - 705242524465.599*std::pow(1.0*dt, 14) + 878229039200.592*std::pow(1.0*dt, 15) + 662834508195.877*std::pow(1.0*dt, 16) + 205750260173.678*std::pow(1.0*dt, 17) + 28056853660.0471*std::pow(1.0*dt, 18) - 300234770035200.0) + 0.25*(-1.0*dt*y1*(-1.0*(-971347785408000.0*dt + 2.517593644566e+15*std::pow(1.0*dt, 2) - 2.3408469807723e+15*std::pow(1.0*dt, 3) + 2.13345824964773e+15*std::pow(1.0*dt, 4) - 1.18052548141028e+15*std::pow(1.0*dt, 5) + 495640640535666.0*std::pow(1.0*dt, 6) - 126634844673446.0*std::pow(1.0*dt, 7) + 16187216072507.9*std::pow(1.0*dt, 8) + 750586925088000.0)*(2.5*dt + 11.1764705882353*std::pow(1.0*dt, 2) + 14.7549019607843*std::pow(1.0*dt, 3) + 19.1170343137255*std::pow(1.0*dt, 4) + 14.6242340686275*std::pow(1.0*dt, 5) + 8.85152322146807*std::pow(1.0*dt, 6) + 3.54663308632748*std::pow(1.0*dt, 7) + 0.928294896707408*std::pow(1.0*dt, 8) + 0.117183105638964*std::pow(1.0*dt, 9) + 1.0) + 1.0*(3.23529411764706*dt + 8.38541666666667*std::pow(1.0*dt, 2) + 7.79672181372549*std::pow(1.0*dt, 3) + 7.10596660539216*std::pow(1.0*dt, 4) + 3.9320078792735*std::pow(1.0*dt, 5) + 1.65084357310633*std::pow(1.0*dt, 6) + 0.421786073140695*std::pow(1.0*dt, 7) + 0.0539151946678599*std::pow(1.0*dt, 8) + 2.5)*(750586925088000.0*dt - 3.355565076864e+15*std::pow(1.0*dt, 2) + 4.429934597088e+15*std::pow(1.0*dt, 3) - 5.7395984009364e+15*std::pow(1.0*dt, 4) + 4.3907035525353e+15*std::pow(1.0*dt, 5) - 2.6575350388587e+15*std::pow(1.0*dt, 6) + 1.06482256907276e+15*std::pow(1.0*dt, 7) - 278706404837798.0*std::pow(1.0*dt, 8) + 35182442773524.9*std::pow(1.0*dt, 9) - 300234770035200.0)) + 1.0*x1*z1*(-1.0*(-971347785408000.0*dt + 2.517593644566e+15*std::pow(1.0*dt, 2) - 2.3408469807723e+15*std::pow(1.0*dt, 3) + 2.13345824964773e+15*std::pow(1.0*dt, 4) - 1.18052548141028e+15*std::pow(1.0*dt, 5) + 495640640535666.0*std::pow(1.0*dt, 6) - 126634844673446.0*std::pow(1.0*dt, 7) + 16187216072507.9*std::pow(1.0*dt, 8) + 750586925088000.0)*(2.5*dt + 11.1764705882353*std::pow(1.0*dt, 2) + 14.7549019607843*std::pow(1.0*dt, 3) + 19.1170343137255*std::pow(1.0*dt, 4) + 14.6242340686275*std::pow(1.0*dt, 5) + 8.85152322146807*std::pow(1.0*dt, 6) + 3.54663308632748*std::pow(1.0*dt, 7) + 0.928294896707408*std::pow(1.0*dt, 8) + 0.117183105638964*std::pow(1.0*dt, 9) + 1.0) + 1.0*(3.23529411764706*dt + 8.38541666666667*std::pow(1.0*dt, 2) + 7.79672181372549*std::pow(1.0*dt, 3) + 7.10596660539216*std::pow(1.0*dt, 4) + 3.9320078792735*std::pow(1.0*dt, 5) + 1.65084357310633*std::pow(1.0*dt, 6) + 0.421786073140695*std::pow(1.0*dt, 7) + 0.0539151946678599*std::pow(1.0*dt, 8) + 2.5)*(750586925088000.0*dt - 3.355565076864e+15*std::pow(1.0*dt, 2) + 4.429934597088e+15*std::pow(1.0*dt, 3) - 5.7395984009364e+15*std::pow(1.0*dt, 4) + 4.3907035525353e+15*std::pow(1.0*dt, 5) - 2.6575350388587e+15*std::pow(1.0*dt, 6) + 1.06482256907276e+15*std::pow(1.0*dt, 7) - 278706404837798.0*std::pow(1.0*dt, 8) + 35182442773524.9*std::pow(1.0*dt, 9) - 300234770035200.0))*std::pow(1.0*dt, 2) - 1.0*x1*(1.0*(-2.7197737991424e+15*dt + 7.0492622047848e+15*std::pow(1.0*dt, 2) - 6.55437154616244e+15*std::pow(1.0*dt, 3) + 5.97368309901363e+15*std::pow(1.0*dt, 4) - 3.30547134794877e+15*std::pow(1.0*dt, 5) + 1.38779379349986e+15*std::pow(1.0*dt, 6) - 354577565085650.0*std::pow(1.0*dt, 7) + 45324205003022.3*std::pow(1.0*dt, 8) + 2.1016433902464e+15)*(3.23529411764706*dt + 8.38541666666667*std::pow(1.0*dt, 2) + 7.79672181372549*std::pow(1.0*dt, 3) + 7.10596660539216*std::pow(1.0*dt, 4) + 3.9320078792735*std::pow(1.0*dt, 5) + 1.65084357310633*std::pow(1.0*dt, 6) + 0.421786073140695*std::pow(1.0*dt, 7) + 0.0539151946678599*std::pow(1.0*dt, 8) + 2.5)*std::pow(1.0*dt, 2) - 1.0*(2.5*dt + 11.1764705882353*std::pow(1.0*dt, 2) + 14.7549019607843*std::pow(1.0*dt, 3) + 19.1170343137255*std::pow(1.0*dt, 4) + 14.6242340686275*std::pow(1.0*dt, 5) + 8.85152322146807*std::pow(1.0*dt, 6) + 3.54663308632748*std::pow(1.0*dt, 7) + 0.928294896707408*std::pow(1.0*dt, 8) + 0.117183105638964*std::pow(1.0*dt, 9) + 1.0)*(75058692508800.0*dt - 2.4813520699968e+15*std::pow(1.0*dt, 2) + 2.1641003169786e+15*std::pow(1.0*dt, 3) - 3.63283611824133e+15*std::pow(1.0*dt, 4) + 2.47059112785235e+15*std::pow(1.0*dt, 5) - 1.59506210558945e+15*std::pow(1.0*dt, 6) + 618745992590664.0*std::pow(1.0*dt, 7) - 164735044631697.0*std::pow(1.0*dt, 8) + 20613948308267.8*std::pow(1.0*dt, 9) - 300234770035200.0)))*(825645617596800.0*dt + 770455402516800.0*std::pow(1.0*dt, 2) + 37437362562600.0*std::pow(1.0*dt, 3) - 422651807347770.0*std::pow(1.0*dt, 4) - 207336178677128.0*std::pow(1.0*dt, 5) + 106161865380821.0*std::pow(1.0*dt, 6) + 106417794896851.0*std::pow(1.0*dt, 7) - 15453792922810.4*std::pow(1.0*dt, 8) - 36987102898239.6*std::pow(1.0*dt, 9) + 1334181692500.88*std::pow(1.0*dt, 10) + 11260084920092.8*std::pow(1.0*dt, 11) - 544807987715.973*std::pow(1.0*dt, 12) - 3335246773718.58*std::pow(1.0*dt, 13) + 705242524465.599*std::pow(1.0*dt, 14) + 878229039200.592*std::pow(1.0*dt, 15) - 662834508195.877*std::pow(1.0*dt, 16) + 205750260173.678*std::pow(1.0*dt, 17) - 28056853660.0471*std::pow(1.0*dt, 18) + 300234770035200.0))*std::pow(825645617596800.0*dt - 770455402516800.0*std::pow(1.0*dt, 2) + 37437362562600.0*std::pow(1.0*dt, 3) + 422651807347770.0*std::pow(1.0*dt, 4) - 207336178677128.0*std::pow(1.0*dt, 5) - 106161865380821.0*std::pow(1.0*dt, 6) + 106417794896851.0*std::pow(1.0*dt, 7) + 15453792922810.4*std::pow(1.0*dt, 8) - 36987102898239.6*std::pow(1.0*dt, 9) - 1334181692500.88*std::pow(1.0*dt, 10) + 11260084920092.8*std::pow(1.0*dt, 11) + 544807987715.973*std::pow(1.0*dt, 12) - 3335246773718.58*std::pow(1.0*dt, 13) - 705242524465.599*std::pow(1.0*dt, 14) + 878229039200.592*std::pow(1.0*dt, 15) + 662834508195.877*std::pow(1.0*dt, 16) + 205750260173.678*std::pow(1.0*dt, 17) + 28056853660.0471*std::pow(1.0*dt, 18) - 300234770035200.0, -1)*std::pow(825645617596800.0*dt + 770455402516800.0*std::pow(1.0*dt, 2) + 37437362562600.0*std::pow(1.0*dt, 3) - 422651807347770.0*std::pow(1.0*dt, 4) - 207336178677128.0*std::pow(1.0*dt, 5) + 106161865380821.0*std::pow(1.0*dt, 6) + 106417794896851.0*std::pow(1.0*dt, 7) - 15453792922810.4*std::pow(1.0*dt, 8) - 36987102898239.6*std::pow(1.0*dt, 9) + 1334181692500.88*std::pow(1.0*dt, 10) + 11260084920092.8*std::pow(1.0*dt, 11) - 544807987715.973*std::pow(1.0*dt, 12) - 3335246773718.58*std::pow(1.0*dt, 13) + 705242524465.599*std::pow(1.0*dt, 14) + 878229039200.592*std::pow(1.0*dt, 15) - 662834508195.877*std::pow(1.0*dt, 16) + 205750260173.678*std::pow(1.0*dt, 17) - 28056853660.0471*std::pow(1.0*dt, 18) + 300234770035200.0, -1);
    y2 = 1.0*(0.75*(1.0*dt*xn*(1.0*(-9.05882352941176*dt + 23.4791666666667*std::pow(1.0*dt, 2) - 21.8308210784314*std::pow(1.0*dt, 3) + 19.896706495098*std::pow(1.0*dt, 4) - 11.0096220619658*std::pow(1.0*dt, 5) + 4.62236200469771*std::pow(1.0*dt, 6) - 1.18100100479394*std::pow(1.0*dt, 7) + 0.150962545070008*std::pow(1.0*dt, 8) + 7.0)*(75058692508800.0*dt + 2.4813520699968e+15*std::pow(1.0*dt, 2) + 2.1641003169786e+15*std::pow(1.0*dt, 3) + 3.63283611824133e+15*std::pow(1.0*dt, 4) + 2.47059112785235e+15*std::pow(1.0*dt, 5) + 1.59506210558945e+15*std::pow(1.0*dt, 6) + 618745992590664.0*std::pow(1.0*dt, 7) + 164735044631697.0*std::pow(1.0*dt, 8) + 20613948308267.8*std::pow(1.0*dt, 9) + 300234770035200.0) - 1.0*(2.7197737991424e+15*dt + 7.0492622047848e+15*std::pow(1.0*dt, 2) + 6.55437154616244e+15*std::pow(1.0*dt, 3) + 5.97368309901363e+15*std::pow(1.0*dt, 4) + 3.30547134794877e+15*std::pow(1.0*dt, 5) + 1.38779379349986e+15*std::pow(1.0*dt, 6) + 354577565085650.0*std::pow(1.0*dt, 7) + 45324205003022.3*std::pow(1.0*dt, 8) + 2.1016433902464e+15)*(0.25*dt - 8.26470588235294*std::pow(1.0*dt, 2) + 7.20802696078431*std::pow(1.0*dt, 3) - 12.0999846813725*std::pow(1.0*dt, 4) + 8.22886412377451*std::pow(1.0*dt, 5) - 5.31271613012192*std::pow(1.0*dt, 6) + 2.06087387053179*std::pow(1.0*dt, 7) - 0.548687430880783*std::pow(1.0*dt, 8) + 0.0686594304378902*std::pow(1.0*dt, 9) - 1.0)) + 1.0*yn*(1.0*(-9.05882352941176*dt + 23.4791666666667*std::pow(1.0*dt, 2) - 21.8308210784314*std::pow(1.0*dt, 3) + 19.896706495098*std::pow(1.0*dt, 4) - 11.0096220619658*std::pow(1.0*dt, 5) + 4.62236200469771*std::pow(1.0*dt, 6) - 1.18100100479394*std::pow(1.0*dt, 7) + 0.150962545070008*std::pow(1.0*dt, 8) + 7.0)*(971347785408000.0*dt + 2.517593644566e+15*std::pow(1.0*dt, 2) + 2.3408469807723e+15*std::pow(1.0*dt, 3) + 2.13345824964773e+15*std::pow(1.0*dt, 4) + 1.18052548141028e+15*std::pow(1.0*dt, 5) + 495640640535666.0*std::pow(1.0*dt, 6) + 126634844673446.0*std::pow(1.0*dt, 7) + 16187216072507.9*std::pow(1.0*dt, 8) + 750586925088000.0)*std::pow(1.0*dt, 2) - 1.0*(0.25*dt - 8.26470588235294*std::pow(1.0*dt, 2) + 7.20802696078431*std::pow(1.0*dt, 3) - 12.0999846813725*std::pow(1.0*dt, 4) + 8.22886412377451*std::pow(1.0*dt, 5) - 5.31271613012192*std::pow(1.0*dt, 6) + 2.06087387053179*std::pow(1.0*dt, 7) - 0.548687430880783*std::pow(1.0*dt, 8) + 0.0686594304378902*std::pow(1.0*dt, 9) - 1.0)*(750586925088000.0*dt + 3.355565076864e+15*std::pow(1.0*dt, 2) + 4.429934597088e+15*std::pow(1.0*dt, 3) + 5.7395984009364e+15*std::pow(1.0*dt, 4) + 4.3907035525353e+15*std::pow(1.0*dt, 5) + 2.6575350388587e+15*std::pow(1.0*dt, 6) + 1.06482256907276e+15*std::pow(1.0*dt, 7) + 278706404837798.0*std::pow(1.0*dt, 8) + 35182442773524.9*std::pow(1.0*dt, 9) + 300234770035200.0)))*(825645617596800.0*dt - 770455402516800.0*std::pow(1.0*dt, 2) + 37437362562600.0*std::pow(1.0*dt, 3) + 422651807347770.0*std::pow(1.0*dt, 4) - 207336178677128.0*std::pow(1.0*dt, 5) - 106161865380821.0*std::pow(1.0*dt, 6) + 106417794896851.0*std::pow(1.0*dt, 7) + 15453792922810.4*std::pow(1.0*dt, 8) - 36987102898239.6*std::pow(1.0*dt, 9) - 1334181692500.88*std::pow(1.0*dt, 10) + 11260084920092.8*std::pow(1.0*dt, 11) + 544807987715.973*std::pow(1.0*dt, 12) - 3335246773718.58*std::pow(1.0*dt, 13) - 705242524465.599*std::pow(1.0*dt, 14) + 878229039200.592*std::pow(1.0*dt, 15) + 662834508195.877*std::pow(1.0*dt, 16) + 205750260173.678*std::pow(1.0*dt, 17) + 28056853660.0471*std::pow(1.0*dt, 18) - 300234770035200.0) + 0.25*(1.0*dt*x1*z1*(1.0*(-971347785408000.0*dt + 2.517593644566e+15*std::pow(1.0*dt, 2) - 2.3408469807723e+15*std::pow(1.0*dt, 3) + 2.13345824964773e+15*std::pow(1.0*dt, 4) - 1.18052548141028e+15*std::pow(1.0*dt, 5) + 495640640535666.0*std::pow(1.0*dt, 6) - 126634844673446.0*std::pow(1.0*dt, 7) + 16187216072507.9*std::pow(1.0*dt, 8) + 750586925088000.0)*(9.05882352941176*dt + 23.4791666666667*std::pow(1.0*dt, 2) + 21.8308210784314*std::pow(1.0*dt, 3) + 19.896706495098*std::pow(1.0*dt, 4) + 11.0096220619658*std::pow(1.0*dt, 5) + 4.62236200469771*std::pow(1.0*dt, 6) + 1.18100100479394*std::pow(1.0*dt, 7) + 0.150962545070008*std::pow(1.0*dt, 8) + 7.0)*std::pow(1.0*dt, 2) - 1.0*(0.25*dt + 8.26470588235294*std::pow(1.0*dt, 2) + 7.20802696078431*std::pow(1.0*dt, 3) + 12.0999846813725*std::pow(1.0*dt, 4) + 8.22886412377451*std::pow(1.0*dt, 5) + 5.31271613012192*std::pow(1.0*dt, 6) + 2.06087387053179*std::pow(1.0*dt, 7) + 0.548687430880783*std::pow(1.0*dt, 8) + 0.0686594304378902*std::pow(1.0*dt, 9) + 1.0)*(750586925088000.0*dt - 3.355565076864e+15*std::pow(1.0*dt, 2) + 4.429934597088e+15*std::pow(1.0*dt, 3) - 5.7395984009364e+15*std::pow(1.0*dt, 4) + 4.3907035525353e+15*std::pow(1.0*dt, 5) - 2.6575350388587e+15*std::pow(1.0*dt, 6) + 1.06482256907276e+15*std::pow(1.0*dt, 7) - 278706404837798.0*std::pow(1.0*dt, 8) + 35182442773524.9*std::pow(1.0*dt, 9) - 300234770035200.0)) - 1.0*dt*x1*(-1.0*(-2.7197737991424e+15*dt + 7.0492622047848e+15*std::pow(1.0*dt, 2) - 6.55437154616244e+15*std::pow(1.0*dt, 3) + 5.97368309901363e+15*std::pow(1.0*dt, 4) - 3.30547134794877e+15*std::pow(1.0*dt, 5) + 1.38779379349986e+15*std::pow(1.0*dt, 6) - 354577565085650.0*std::pow(1.0*dt, 7) + 45324205003022.3*std::pow(1.0*dt, 8) + 2.1016433902464e+15)*(0.25*dt + 8.26470588235294*std::pow(1.0*dt, 2) + 7.20802696078431*std::pow(1.0*dt, 3) + 12.0999846813725*std::pow(1.0*dt, 4) + 8.22886412377451*std::pow(1.0*dt, 5) + 5.31271613012192*std::pow(1.0*dt, 6) + 2.06087387053179*std::pow(1.0*dt, 7) + 0.548687430880783*std::pow(1.0*dt, 8) + 0.0686594304378902*std::pow(1.0*dt, 9) + 1.0) + 1.0*(9.05882352941176*dt + 23.4791666666667*std::pow(1.0*dt, 2) + 21.8308210784314*std::pow(1.0*dt, 3) + 19.896706495098*std::pow(1.0*dt, 4) + 11.0096220619658*std::pow(1.0*dt, 5) + 4.62236200469771*std::pow(1.0*dt, 6) + 1.18100100479394*std::pow(1.0*dt, 7) + 0.150962545070008*std::pow(1.0*dt, 8) + 7.0)*(75058692508800.0*dt - 2.4813520699968e+15*std::pow(1.0*dt, 2) + 2.1641003169786e+15*std::pow(1.0*dt, 3) - 3.63283611824133e+15*std::pow(1.0*dt, 4) + 2.47059112785235e+15*std::pow(1.0*dt, 5) - 1.59506210558945e+15*std::pow(1.0*dt, 6) + 618745992590664.0*std::pow(1.0*dt, 7) - 164735044631697.0*std::pow(1.0*dt, 8) + 20613948308267.8*std::pow(1.0*dt, 9) - 300234770035200.0)) - 1.0*y1*(1.0*(-971347785408000.0*dt + 2.517593644566e+15*std::pow(1.0*dt, 2) - 2.3408469807723e+15*std::pow(1.0*dt, 3) + 2.13345824964773e+15*std::pow(1.0*dt, 4) - 1.18052548141028e+15*std::pow(1.0*dt, 5) + 495640640535666.0*std::pow(1.0*dt, 6) - 126634844673446.0*std::pow(1.0*dt, 7) + 16187216072507.9*std::pow(1.0*dt, 8) + 750586925088000.0)*(9.05882352941176*dt + 23.4791666666667*std::pow(1.0*dt, 2) + 21.8308210784314*std::pow(1.0*dt, 3) + 19.896706495098*std::pow(1.0*dt, 4) + 11.0096220619658*std::pow(1.0*dt, 5) + 4.62236200469771*std::pow(1.0*dt, 6) + 1.18100100479394*std::pow(1.0*dt, 7) + 0.150962545070008*std::pow(1.0*dt, 8) + 7.0)*std::pow(1.0*dt, 2) - 1.0*(0.25*dt + 8.26470588235294*std::pow(1.0*dt, 2) + 7.20802696078431*std::pow(1.0*dt, 3) + 12.0999846813725*std::pow(1.0*dt, 4) + 8.22886412377451*std::pow(1.0*dt, 5) + 5.31271613012192*std::pow(1.0*dt, 6) + 2.06087387053179*std::pow(1.0*dt, 7) + 0.548687430880783*std::pow(1.0*dt, 8) + 0.0686594304378902*std::pow(1.0*dt, 9) + 1.0)*(750586925088000.0*dt - 3.355565076864e+15*std::pow(1.0*dt, 2) + 4.429934597088e+15*std::pow(1.0*dt, 3) - 5.7395984009364e+15*std::pow(1.0*dt, 4) + 4.3907035525353e+15*std::pow(1.0*dt, 5) - 2.6575350388587e+15*std::pow(1.0*dt, 6) + 1.06482256907276e+15*std::pow(1.0*dt, 7) - 278706404837798.0*std::pow(1.0*dt, 8) + 35182442773524.9*std::pow(1.0*dt, 9) - 300234770035200.0)))*(825645617596800.0*dt + 770455402516800.0*std::pow(1.0*dt, 2) + 37437362562600.0*std::pow(1.0*dt, 3) - 422651807347770.0*std::pow(1.0*dt, 4) - 207336178677128.0*std::pow(1.0*dt, 5) + 106161865380821.0*std::pow(1.0*dt, 6) + 106417794896851.0*std::pow(1.0*dt, 7) - 15453792922810.4*std::pow(1.0*dt, 8) - 36987102898239.6*std::pow(1.0*dt, 9) + 1334181692500.88*std::pow(1.0*dt, 10) + 11260084920092.8*std::pow(1.0*dt, 11) - 544807987715.973*std::pow(1.0*dt, 12) - 3335246773718.58*std::pow(1.0*dt, 13) + 705242524465.599*std::pow(1.0*dt, 14) + 878229039200.592*std::pow(1.0*dt, 15) - 662834508195.877*std::pow(1.0*dt, 16) + 205750260173.678*std::pow(1.0*dt, 17) - 28056853660.0471*std::pow(1.0*dt, 18) + 300234770035200.0))*std::pow(825645617596800.0*dt - 770455402516800.0*std::pow(1.0*dt, 2) + 37437362562600.0*std::pow(1.0*dt, 3) + 422651807347770.0*std::pow(1.0*dt, 4) - 207336178677128.0*std::pow(1.0*dt, 5) - 106161865380821.0*std::pow(1.0*dt, 6) + 106417794896851.0*std::pow(1.0*dt, 7) + 15453792922810.4*std::pow(1.0*dt, 8) - 36987102898239.6*std::pow(1.0*dt, 9) - 1334181692500.88*std::pow(1.0*dt, 10) + 11260084920092.8*std::pow(1.0*dt, 11) + 544807987715.973*std::pow(1.0*dt, 12) - 3335246773718.58*std::pow(1.0*dt, 13) - 705242524465.599*std::pow(1.0*dt, 14) + 878229039200.592*std::pow(1.0*dt, 15) + 662834508195.877*std::pow(1.0*dt, 16) + 205750260173.678*std::pow(1.0*dt, 17) + 28056853660.0471*std::pow(1.0*dt, 18) - 300234770035200.0, -1)*std::pow(825645617596800.0*dt + 770455402516800.0*std::pow(1.0*dt, 2) + 37437362562600.0*std::pow(1.0*dt, 3) - 422651807347770.0*std::pow(1.0*dt, 4) - 207336178677128.0*std::pow(1.0*dt, 5) + 106161865380821.0*std::pow(1.0*dt, 6) + 106417794896851.0*std::pow(1.0*dt, 7) - 15453792922810.4*std::pow(1.0*dt, 8) - 36987102898239.6*std::pow(1.0*dt, 9) + 1334181692500.88*std::pow(1.0*dt, 10) + 11260084920092.8*std::pow(1.0*dt, 11) - 544807987715.973*std::pow(1.0*dt, 12) - 3335246773718.58*std::pow(1.0*dt, 13) + 705242524465.599*std::pow(1.0*dt, 14) + 878229039200.592*std::pow(1.0*dt, 15) - 662834508195.877*std::pow(1.0*dt, 16) + 205750260173.678*std::pow(1.0*dt, 17) - 28056853660.0471*std::pow(1.0*dt, 18) + 300234770035200.0, -1);
    z2 = -1.0*(508698646706.25*zn*(0.666666666666667*dt - 0.209150326797386*std::pow(1.0*dt, 2) + 0.0406681190994916*std::pow(1.0*dt, 3) - 0.00542241587993222*std::pow(1.0*dt, 4) + 0.000516420559993545*std::pow(1.0*dt, 5) - 3.53108075209261e-5*std::pow(1.0*dt, 6) + 1.68146702480601e-6*std::pow(1.0*dt, 7) - 5.09535462062426e-8*std::pow(1.0*dt, 8) + 7.54867351203594e-10*std::pow(1.0*dt, 9) - 1.0)*(452176574850.0*dt - 141859317600.0*std::pow(1.0*dt, 2) + 27583756200.0*std::pow(1.0*dt, 3) - 3677834160.0*std::pow(1.0*dt, 4) + 350269920.0*std::pow(1.0*dt, 5) - 23950080.0*std::pow(1.0*dt, 6) + 1140480.0*std::pow(1.0*dt, 7) - 34560.0*std::pow(1.0*dt, 8) + 512.0*std::pow(1.0*dt, 9) - 678264862275.0) + 1.0*(1.0*dt*x1*y1 + 1.0*z1)*(113044143712.5*dt + 35464829400.0*std::pow(1.0*dt, 2) + 6895939050.0*std::pow(1.0*dt, 3) + 919458540.0*std::pow(1.0*dt, 4) + 87567480.0*std::pow(1.0*dt, 5) + 5987520.0*std::pow(1.0*dt, 6) + 285120.0*std::pow(1.0*dt, 7) + 8640.0*std::pow(1.0*dt, 8) + 128.0*std::pow(1.0*dt, 9) + 169566215568.75)*(452176574850.0*dt + 141859317600.0*std::pow(1.0*dt, 2) + 27583756200.0*std::pow(1.0*dt, 3) + 3677834160.0*std::pow(1.0*dt, 4) + 350269920.0*std::pow(1.0*dt, 5) + 23950080.0*std::pow(1.0*dt, 6) + 1140480.0*std::pow(1.0*dt, 7) + 34560.0*std::pow(1.0*dt, 8) + 512.0*std::pow(1.0*dt, 9) + 678264862275.0))*std::pow(452176574850.0*dt - 141859317600.0*std::pow(1.0*dt, 2) + 27583756200.0*std::pow(1.0*dt, 3) - 3677834160.0*std::pow(1.0*dt, 4) + 350269920.0*std::pow(1.0*dt, 5) - 23950080.0*std::pow(1.0*dt, 6) + 1140480.0*std::pow(1.0*dt, 7) - 34560.0*std::pow(1.0*dt, 8) + 512.0*std::pow(1.0*dt, 9) - 678264862275.0, -1)*std::pow(452176574850.0*dt + 141859317600.0*std::pow(1.0*dt, 2) + 27583756200.0*std::pow(1.0*dt, 3) + 3677834160.0*std::pow(1.0*dt, 4) + 350269920.0*std::pow(1.0*dt, 5) + 23950080.0*std::pow(1.0*dt, 6) + 1140480.0*std::pow(1.0*dt, 7) + 34560.0*std::pow(1.0*dt, 8) + 512.0*std::pow(1.0*dt, 9) + 678264862275.0, -1);
    //---
    xtmp = 1.0*(0.333333333333333*(1.0*dt*yn*(1.0*(-12.9411764705882*dt + 67.0833333333333*std::pow(1.0*dt, 2) - 124.747549019608*std::pow(1.0*dt, 3) + 227.390931372549*std::pow(1.0*dt, 4) - 251.648504273504*std::pow(1.0*dt, 5) + 211.30797735761*std::pow(1.0*dt, 6) - 107.977234724018*std::pow(1.0*dt, 7) + 27.6045796699443*std::pow(1.0*dt, 8) + 5.0)*(1.501173850176e+15*dt + 1.3422260307456e+16*std::pow(1.0*dt, 2) + 3.5439476776704e+16*std::pow(1.0*dt, 3) + 9.18335744149824e+16*std::pow(1.0*dt, 4) + 1.4050251368113e+17*std::pow(1.0*dt, 5) + 1.70082242486957e+17*std::pow(1.0*dt, 6) + 1.36297288841314e+17*std::pow(1.0*dt, 7) + 7.13488396384764e+16*std::pow(1.0*dt, 8) + 1.80134107000448e+16*std::pow(1.0*dt, 9) + 300234770035200.0) - 1.0*(3.885391141632e+15*dt + 2.0140749156528e+16*std::pow(1.0*dt, 2) + 3.74535516923568e+16*std::pow(1.0*dt, 3) + 6.82706639887272e+16*std::pow(1.0*dt, 4) + 7.55536308102576e+16*std::pow(1.0*dt, 5) + 6.34420019885652e+16*std::pow(1.0*dt, 6) + 3.24185202364023e+16*std::pow(1.0*dt, 7) + 8.28785462912407e+15*std::pow(1.0*dt, 8) + 1.501173850176e+15)*(5.0*dt - 44.7058823529412*std::pow(1.0*dt, 2) + 118.039215686275*std::pow(1.0*dt, 3) - 305.872549019608*std::pow(1.0*dt, 4) + 467.975490196078*std::pow(1.0*dt, 5) - 566.497486173957*std::pow(1.0*dt, 6) + 453.969035049917*std::pow(1.0*dt, 7) - 237.643493557096*std::pow(1.0*dt, 8) + 59.9977500871496*std::pow(1.0*dt, 9) - 1.0)) + 1.0*xn*(1.0*(-12.9411764705882*dt + 67.0833333333333*std::pow(1.0*dt, 2) - 124.747549019608*std::pow(1.0*dt, 3) + 227.390931372549*std::pow(1.0*dt, 4) - 251.648504273504*std::pow(1.0*dt, 5) + 211.30797735761*std::pow(1.0*dt, 6) - 107.977234724018*std::pow(1.0*dt, 7) + 27.6045796699443*std::pow(1.0*dt, 8) + 5.0)*(1.08790951965696e+16*dt + 5.63940976382784e+16*std::pow(1.0*dt, 2) + 1.04869944738599e+17*std::pow(1.0*dt, 3) + 1.91157859168436e+17*std::pow(1.0*dt, 4) + 2.11550166268721e+17*std::pow(1.0*dt, 5) + 1.77637605567983e+17*std::pow(1.0*dt, 6) + 9.07718566619264e+16*std::pow(1.0*dt, 7) + 2.32059929615474e+16*std::pow(1.0*dt, 8) + 4.2032867804928e+15)*std::pow(1.0*dt, 2) - 1.0*(5.0*dt - 44.7058823529412*std::pow(1.0*dt, 2) + 118.039215686275*std::pow(1.0*dt, 3) - 305.872549019608*std::pow(1.0*dt, 4) + 467.975490196078*std::pow(1.0*dt, 5) - 566.497486173957*std::pow(1.0*dt, 6) + 453.969035049917*std::pow(1.0*dt, 7) - 237.643493557096*std::pow(1.0*dt, 8) + 59.9977500871496*std::pow(1.0*dt, 9) - 1.0)*(150117385017600.0*dt + 9.9254082799872e+15*std::pow(1.0*dt, 2) + 1.73128025358288e+16*std::pow(1.0*dt, 3) + 5.81253778918613e+16*std::pow(1.0*dt, 4) + 7.90589160912751e+16*std::pow(1.0*dt, 5) + 1.02083974757725e+17*std::pow(1.0*dt, 6) + 7.91994870516049e+16*std::pow(1.0*dt, 7) + 4.21721714257143e+16*std::pow(1.0*dt, 8) + 1.05543415338331e+16*std::pow(1.0*dt, 9) + 300234770035200.0)))*(825645617596800.0*dt + 770455402516800.0*std::pow(1.0*dt, 2) + 37437362562600.0*std::pow(1.0*dt, 3) - 422651807347770.0*std::pow(1.0*dt, 4) - 207336178677128.0*std::pow(1.0*dt, 5) + 106161865380821.0*std::pow(1.0*dt, 6) + 106417794896851.0*std::pow(1.0*dt, 7) - 15453792922810.4*std::pow(1.0*dt, 8) - 36987102898239.6*std::pow(1.0*dt, 9) + 1334181692500.88*std::pow(1.0*dt, 10) + 11260084920092.8*std::pow(1.0*dt, 11) - 544807987715.973*std::pow(1.0*dt, 12) - 3335246773718.58*std::pow(1.0*dt, 13) + 705242524465.599*std::pow(1.0*dt, 14) + 878229039200.592*std::pow(1.0*dt, 15) - 662834508195.877*std::pow(1.0*dt, 16) + 205750260173.678*std::pow(1.0*dt, 17) - 28056853660.0471*std::pow(1.0*dt, 18) + 300234770035200.0) + 0.666666666666667*(1.0*dt*y2*(1.0*(-3.23529411764706*dt + 8.38541666666667*std::pow(1.0*dt, 2) - 7.79672181372549*std::pow(1.0*dt, 3) + 7.10596660539216*std::pow(1.0*dt, 4) - 3.9320078792735*std::pow(1.0*dt, 5) + 1.65084357310633*std::pow(1.0*dt, 6) - 0.421786073140695*std::pow(1.0*dt, 7) + 0.0539151946678599*std::pow(1.0*dt, 8) + 2.5)*(750586925088000.0*dt + 3.355565076864e+15*std::pow(1.0*dt, 2) + 4.429934597088e+15*std::pow(1.0*dt, 3) + 5.7395984009364e+15*std::pow(1.0*dt, 4) + 4.3907035525353e+15*std::pow(1.0*dt, 5) + 2.6575350388587e+15*std::pow(1.0*dt, 6) + 1.06482256907276e+15*std::pow(1.0*dt, 7) + 278706404837798.0*std::pow(1.0*dt, 8) + 35182442773524.9*std::pow(1.0*dt, 9) + 300234770035200.0) - 1.0*(971347785408000.0*dt + 2.517593644566e+15*std::pow(1.0*dt, 2) + 2.3408469807723e+15*std::pow(1.0*dt, 3) + 2.13345824964773e+15*std::pow(1.0*dt, 4) + 1.18052548141028e+15*std::pow(1.0*dt, 5) + 495640640535666.0*std::pow(1.0*dt, 6) + 126634844673446.0*std::pow(1.0*dt, 7) + 16187216072507.9*std::pow(1.0*dt, 8) + 750586925088000.0)*(2.5*dt - 11.1764705882353*std::pow(1.0*dt, 2) + 14.7549019607843*std::pow(1.0*dt, 3) - 19.1170343137255*std::pow(1.0*dt, 4) + 14.6242340686275*std::pow(1.0*dt, 5) - 8.85152322146807*std::pow(1.0*dt, 6) + 3.54663308632748*std::pow(1.0*dt, 7) - 0.928294896707408*std::pow(1.0*dt, 8) + 0.117183105638964*std::pow(1.0*dt, 9) - 1.0)) - 1.0*x2*z2*(1.0*(-3.23529411764706*dt + 8.38541666666667*std::pow(1.0*dt, 2) - 7.79672181372549*std::pow(1.0*dt, 3) + 7.10596660539216*std::pow(1.0*dt, 4) - 3.9320078792735*std::pow(1.0*dt, 5) + 1.65084357310633*std::pow(1.0*dt, 6) - 0.421786073140695*std::pow(1.0*dt, 7) + 0.0539151946678599*std::pow(1.0*dt, 8) + 2.5)*(750586925088000.0*dt + 3.355565076864e+15*std::pow(1.0*dt, 2) + 4.429934597088e+15*std::pow(1.0*dt, 3) + 5.7395984009364e+15*std::pow(1.0*dt, 4) + 4.3907035525353e+15*std::pow(1.0*dt, 5) + 2.6575350388587e+15*std::pow(1.0*dt, 6) + 1.06482256907276e+15*std::pow(1.0*dt, 7) + 278706404837798.0*std::pow(1.0*dt, 8) + 35182442773524.9*std::pow(1.0*dt, 9) + 300234770035200.0) - 1.0*(971347785408000.0*dt + 2.517593644566e+15*std::pow(1.0*dt, 2) + 2.3408469807723e+15*std::pow(1.0*dt, 3) + 2.13345824964773e+15*std::pow(1.0*dt, 4) + 1.18052548141028e+15*std::pow(1.0*dt, 5) + 495640640535666.0*std::pow(1.0*dt, 6) + 126634844673446.0*std::pow(1.0*dt, 7) + 16187216072507.9*std::pow(1.0*dt, 8) + 750586925088000.0)*(2.5*dt - 11.1764705882353*std::pow(1.0*dt, 2) + 14.7549019607843*std::pow(1.0*dt, 3) - 19.1170343137255*std::pow(1.0*dt, 4) + 14.6242340686275*std::pow(1.0*dt, 5) - 8.85152322146807*std::pow(1.0*dt, 6) + 3.54663308632748*std::pow(1.0*dt, 7) - 0.928294896707408*std::pow(1.0*dt, 8) + 0.117183105638964*std::pow(1.0*dt, 9) - 1.0))*std::pow(1.0*dt, 2) + 1.0*x2*(1.0*(-3.23529411764706*dt + 8.38541666666667*std::pow(1.0*dt, 2) - 7.79672181372549*std::pow(1.0*dt, 3) + 7.10596660539216*std::pow(1.0*dt, 4) - 3.9320078792735*std::pow(1.0*dt, 5) + 1.65084357310633*std::pow(1.0*dt, 6) - 0.421786073140695*std::pow(1.0*dt, 7) + 0.0539151946678599*std::pow(1.0*dt, 8) + 2.5)*(2.7197737991424e+15*dt + 7.0492622047848e+15*std::pow(1.0*dt, 2) + 6.55437154616244e+15*std::pow(1.0*dt, 3) + 5.97368309901363e+15*std::pow(1.0*dt, 4) + 3.30547134794877e+15*std::pow(1.0*dt, 5) + 1.38779379349986e+15*std::pow(1.0*dt, 6) + 354577565085650.0*std::pow(1.0*dt, 7) + 45324205003022.3*std::pow(1.0*dt, 8) + 2.1016433902464e+15)*std::pow(1.0*dt, 2) - 1.0*(2.5*dt - 11.1764705882353*std::pow(1.0*dt, 2) + 14.7549019607843*std::pow(1.0*dt, 3) - 19.1170343137255*std::pow(1.0*dt, 4) + 14.6242340686275*std::pow(1.0*dt, 5) - 8.85152322146807*std::pow(1.0*dt, 6) + 3.54663308632748*std::pow(1.0*dt, 7) - 0.928294896707408*std::pow(1.0*dt, 8) + 0.117183105638964*std::pow(1.0*dt, 9) - 1.0)*(75058692508800.0*dt + 2.4813520699968e+15*std::pow(1.0*dt, 2) + 2.1641003169786e+15*std::pow(1.0*dt, 3) + 3.63283611824133e+15*std::pow(1.0*dt, 4) + 2.47059112785235e+15*std::pow(1.0*dt, 5) + 1.59506210558945e+15*std::pow(1.0*dt, 6) + 618745992590664.0*std::pow(1.0*dt, 7) + 164735044631697.0*std::pow(1.0*dt, 8) + 20613948308267.8*std::pow(1.0*dt, 9) + 300234770035200.0)))*(1.6512912351936e+15*dt + 3.0818216100672e+15*std::pow(1.0*dt, 2) + 299498900500800.0*std::pow(1.0*dt, 3) - 6.76242891756432e+15*std::pow(1.0*dt, 4) - 6.63475771766808e+15*std::pow(1.0*dt, 5) + 6.79435938437256e+15*std::pow(1.0*dt, 6) + 1.36214777467969e+16*std::pow(1.0*dt, 7) - 3.95617098823947e+15*std::pow(1.0*dt, 8) - 1.89373966838987e+16*std::pow(1.0*dt, 9) + 1.36620205312091e+15*std::pow(1.0*dt, 10) + 2.306065391635e+16*std::pow(1.0*dt, 11) - 2.23153351768463e+15*std::pow(1.0*dt, 12) - 2.73223415703026e+16*std::pow(1.0*dt, 13) + 1.15546935208444e+16*std::pow(1.0*dt, 14) + 2.8777809156525e+16*std::pow(1.0*dt, 15) - 4.3439522329125e+16*std::pow(1.0*dt, 16) + 2.69680981014844e+16*std::pow(1.0*dt, 17) - 7.35493584585938e+15*std::pow(1.0*dt, 18) + 300234770035200.0))*std::pow(825645617596800.0*dt + 770455402516800.0*std::pow(1.0*dt, 2) + 37437362562600.0*std::pow(1.0*dt, 3) - 422651807347770.0*std::pow(1.0*dt, 4) - 207336178677128.0*std::pow(1.0*dt, 5) + 106161865380821.0*std::pow(1.0*dt, 6) + 106417794896851.0*std::pow(1.0*dt, 7) - 15453792922810.4*std::pow(1.0*dt, 8) - 36987102898239.6*std::pow(1.0*dt, 9) + 1334181692500.88*std::pow(1.0*dt, 10) + 11260084920092.8*std::pow(1.0*dt, 11) - 544807987715.973*std::pow(1.0*dt, 12) - 3335246773718.58*std::pow(1.0*dt, 13) + 705242524465.599*std::pow(1.0*dt, 14) + 878229039200.592*std::pow(1.0*dt, 15) - 662834508195.877*std::pow(1.0*dt, 16) + 205750260173.678*std::pow(1.0*dt, 17) - 28056853660.0471*std::pow(1.0*dt, 18) + 300234770035200.0, -1)*std::pow(1.6512912351936e+15*dt + 3.0818216100672e+15*std::pow(1.0*dt, 2) + 299498900500800.0*std::pow(1.0*dt, 3) - 6.76242891756432e+15*std::pow(1.0*dt, 4) - 6.63475771766808e+15*std::pow(1.0*dt, 5) + 6.79435938437256e+15*std::pow(1.0*dt, 6) + 1.36214777467969e+16*std::pow(1.0*dt, 7) - 3.95617098823947e+15*std::pow(1.0*dt, 8) - 1.89373966838987e+16*std::pow(1.0*dt, 9) + 1.36620205312091e+15*std::pow(1.0*dt, 10) + 2.306065391635e+16*std::pow(1.0*dt, 11) - 2.23153351768463e+15*std::pow(1.0*dt, 12) - 2.73223415703026e+16*std::pow(1.0*dt, 13) + 1.15546935208444e+16*std::pow(1.0*dt, 14) + 2.8777809156525e+16*std::pow(1.0*dt, 15) - 4.3439522329125e+16*std::pow(1.0*dt, 16) + 2.69680981014844e+16*std::pow(1.0*dt, 17) - 7.35493584585938e+15*std::pow(1.0*dt, 18) + 300234770035200.0, -1);
    ytmp = 1.0*(0.333333333333333*(1.0*dt*xn*(1.0*(-36.2352941176471*dt + 187.833333333333*std::pow(1.0*dt, 2) - 349.293137254902*std::pow(1.0*dt, 3) + 636.694607843137*std::pow(1.0*dt, 4) - 704.615811965812*std::pow(1.0*dt, 5) + 591.662336601307*std::pow(1.0*dt, 6) - 302.33625722725*std::pow(1.0*dt, 7) + 77.2928230758439*std::pow(1.0*dt, 8) + 14.0)*(150117385017600.0*dt + 9.9254082799872e+15*std::pow(1.0*dt, 2) + 1.73128025358288e+16*std::pow(1.0*dt, 3) + 5.81253778918613e+16*std::pow(1.0*dt, 4) + 7.90589160912751e+16*std::pow(1.0*dt, 5) + 1.02083974757725e+17*std::pow(1.0*dt, 6) + 7.91994870516049e+16*std::pow(1.0*dt, 7) + 4.21721714257143e+16*std::pow(1.0*dt, 8) + 1.05543415338331e+16*std::pow(1.0*dt, 9) + 300234770035200.0) - 1.0*(1.08790951965696e+16*dt + 5.63940976382784e+16*std::pow(1.0*dt, 2) + 1.04869944738599e+17*std::pow(1.0*dt, 3) + 1.91157859168436e+17*std::pow(1.0*dt, 4) + 2.11550166268721e+17*std::pow(1.0*dt, 5) + 1.77637605567983e+17*std::pow(1.0*dt, 6) + 9.07718566619264e+16*std::pow(1.0*dt, 7) + 2.32059929615474e+16*std::pow(1.0*dt, 8) + 4.2032867804928e+15)*(0.5*dt - 33.0588235294118*std::pow(1.0*dt, 2) + 57.6642156862745*std::pow(1.0*dt, 3) - 193.599754901961*std::pow(1.0*dt, 4) + 263.323651960784*std::pow(1.0*dt, 5) - 340.013832327803*std::pow(1.0*dt, 6) + 263.791855428069*std::pow(1.0*dt, 7) - 140.46398230548*std::pow(1.0*dt, 8) + 35.1536283841998*std::pow(1.0*dt, 9) - 1.0)) + 1.0*yn*(1.0*(-36.2352941176471*dt + 187.833333333333*std::pow(1.0*dt, 2) - 349.293137254902*std::pow(1.0*dt, 3) + 636.694607843137*std::pow(1.0*dt, 4) - 704.615811965812*std::pow(1.0*dt, 5) + 591.662336601307*std::pow(1.0*dt, 6) - 302.33625722725*std::pow(1.0*dt, 7) + 77.2928230758439*std::pow(1.0*dt, 8) + 14.0)*(3.885391141632e+15*dt + 2.0140749156528e+16*std::pow(1.0*dt, 2) + 3.74535516923568e+16*std::pow(1.0*dt, 3) + 6.82706639887272e+16*std::pow(1.0*dt, 4) + 7.55536308102576e+16*std::pow(1.0*dt, 5) + 6.34420019885652e+16*std::pow(1.0*dt, 6) + 3.24185202364023e+16*std::pow(1.0*dt, 7) + 8.28785462912407e+15*std::pow(1.0*dt, 8) + 1.501173850176e+15)*std::pow(1.0*dt, 2) - 1.0*(0.5*dt - 33.0588235294118*std::pow(1.0*dt, 2) + 57.6642156862745*std::pow(1.0*dt, 3) - 193.599754901961*std::pow(1.0*dt, 4) + 263.323651960784*std::pow(1.0*dt, 5) - 340.013832327803*std::pow(1.0*dt, 6) + 263.791855428069*std::pow(1.0*dt, 7) - 140.46398230548*std::pow(1.0*dt, 8) + 35.1536283841998*std::pow(1.0*dt, 9) - 1.0)*(1.501173850176e+15*dt + 1.3422260307456e+16*std::pow(1.0*dt, 2) + 3.5439476776704e+16*std::pow(1.0*dt, 3) + 9.18335744149824e+16*std::pow(1.0*dt, 4) + 1.4050251368113e+17*std::pow(1.0*dt, 5) + 1.70082242486957e+17*std::pow(1.0*dt, 6) + 1.36297288841314e+17*std::pow(1.0*dt, 7) + 7.13488396384764e+16*std::pow(1.0*dt, 8) + 1.80134107000448e+16*std::pow(1.0*dt, 9) + 300234770035200.0)))*(825645617596800.0*dt + 770455402516800.0*std::pow(1.0*dt, 2) + 37437362562600.0*std::pow(1.0*dt, 3) - 422651807347770.0*std::pow(1.0*dt, 4) - 207336178677128.0*std::pow(1.0*dt, 5) + 106161865380821.0*std::pow(1.0*dt, 6) + 106417794896851.0*std::pow(1.0*dt, 7) - 15453792922810.4*std::pow(1.0*dt, 8) - 36987102898239.6*std::pow(1.0*dt, 9) + 1334181692500.88*std::pow(1.0*dt, 10) + 11260084920092.8*std::pow(1.0*dt, 11) - 544807987715.973*std::pow(1.0*dt, 12) - 3335246773718.58*std::pow(1.0*dt, 13) + 705242524465.599*std::pow(1.0*dt, 14) + 878229039200.592*std::pow(1.0*dt, 15) - 662834508195.877*std::pow(1.0*dt, 16) + 205750260173.678*std::pow(1.0*dt, 17) - 28056853660.0471*std::pow(1.0*dt, 18) + 300234770035200.0) + 0.666666666666667*(-1.0*dt*x2*z2*(1.0*(-9.05882352941176*dt + 23.4791666666667*std::pow(1.0*dt, 2) - 21.8308210784314*std::pow(1.0*dt, 3) + 19.896706495098*std::pow(1.0*dt, 4) - 11.0096220619658*std::pow(1.0*dt, 5) + 4.62236200469771*std::pow(1.0*dt, 6) - 1.18100100479394*std::pow(1.0*dt, 7) + 0.150962545070008*std::pow(1.0*dt, 8) + 7.0)*(971347785408000.0*dt + 2.517593644566e+15*std::pow(1.0*dt, 2) + 2.3408469807723e+15*std::pow(1.0*dt, 3) + 2.13345824964773e+15*std::pow(1.0*dt, 4) + 1.18052548141028e+15*std::pow(1.0*dt, 5) + 495640640535666.0*std::pow(1.0*dt, 6) + 126634844673446.0*std::pow(1.0*dt, 7) + 16187216072507.9*std::pow(1.0*dt, 8) + 750586925088000.0)*std::pow(1.0*dt, 2) - 1.0*(0.25*dt - 8.26470588235294*std::pow(1.0*dt, 2) + 7.20802696078431*std::pow(1.0*dt, 3) - 12.0999846813725*std::pow(1.0*dt, 4) + 8.22886412377451*std::pow(1.0*dt, 5) - 5.31271613012192*std::pow(1.0*dt, 6) + 2.06087387053179*std::pow(1.0*dt, 7) - 0.548687430880783*std::pow(1.0*dt, 8) + 0.0686594304378902*std::pow(1.0*dt, 9) - 1.0)*(750586925088000.0*dt + 3.355565076864e+15*std::pow(1.0*dt, 2) + 4.429934597088e+15*std::pow(1.0*dt, 3) + 5.7395984009364e+15*std::pow(1.0*dt, 4) + 4.3907035525353e+15*std::pow(1.0*dt, 5) + 2.6575350388587e+15*std::pow(1.0*dt, 6) + 1.06482256907276e+15*std::pow(1.0*dt, 7) + 278706404837798.0*std::pow(1.0*dt, 8) + 35182442773524.9*std::pow(1.0*dt, 9) + 300234770035200.0)) + 1.0*dt*x2*(1.0*(-9.05882352941176*dt + 23.4791666666667*std::pow(1.0*dt, 2) - 21.8308210784314*std::pow(1.0*dt, 3) + 19.896706495098*std::pow(1.0*dt, 4) - 11.0096220619658*std::pow(1.0*dt, 5) + 4.62236200469771*std::pow(1.0*dt, 6) - 1.18100100479394*std::pow(1.0*dt, 7) + 0.150962545070008*std::pow(1.0*dt, 8) + 7.0)*(75058692508800.0*dt + 2.4813520699968e+15*std::pow(1.0*dt, 2) + 2.1641003169786e+15*std::pow(1.0*dt, 3) + 3.63283611824133e+15*std::pow(1.0*dt, 4) + 2.47059112785235e+15*std::pow(1.0*dt, 5) + 1.59506210558945e+15*std::pow(1.0*dt, 6) + 618745992590664.0*std::pow(1.0*dt, 7) + 164735044631697.0*std::pow(1.0*dt, 8) + 20613948308267.8*std::pow(1.0*dt, 9) + 300234770035200.0) - 1.0*(2.7197737991424e+15*dt + 7.0492622047848e+15*std::pow(1.0*dt, 2) + 6.55437154616244e+15*std::pow(1.0*dt, 3) + 5.97368309901363e+15*std::pow(1.0*dt, 4) + 3.30547134794877e+15*std::pow(1.0*dt, 5) + 1.38779379349986e+15*std::pow(1.0*dt, 6) + 354577565085650.0*std::pow(1.0*dt, 7) + 45324205003022.3*std::pow(1.0*dt, 8) + 2.1016433902464e+15)*(0.25*dt - 8.26470588235294*std::pow(1.0*dt, 2) + 7.20802696078431*std::pow(1.0*dt, 3) - 12.0999846813725*std::pow(1.0*dt, 4) + 8.22886412377451*std::pow(1.0*dt, 5) - 5.31271613012192*std::pow(1.0*dt, 6) + 2.06087387053179*std::pow(1.0*dt, 7) - 0.548687430880783*std::pow(1.0*dt, 8) + 0.0686594304378902*std::pow(1.0*dt, 9) - 1.0)) + 1.0*y2*(1.0*(-9.05882352941176*dt + 23.4791666666667*std::pow(1.0*dt, 2) - 21.8308210784314*std::pow(1.0*dt, 3) + 19.896706495098*std::pow(1.0*dt, 4) - 11.0096220619658*std::pow(1.0*dt, 5) + 4.62236200469771*std::pow(1.0*dt, 6) - 1.18100100479394*std::pow(1.0*dt, 7) + 0.150962545070008*std::pow(1.0*dt, 8) + 7.0)*(971347785408000.0*dt + 2.517593644566e+15*std::pow(1.0*dt, 2) + 2.3408469807723e+15*std::pow(1.0*dt, 3) + 2.13345824964773e+15*std::pow(1.0*dt, 4) + 1.18052548141028e+15*std::pow(1.0*dt, 5) + 495640640535666.0*std::pow(1.0*dt, 6) + 126634844673446.0*std::pow(1.0*dt, 7) + 16187216072507.9*std::pow(1.0*dt, 8) + 750586925088000.0)*std::pow(1.0*dt, 2) - 1.0*(0.25*dt - 8.26470588235294*std::pow(1.0*dt, 2) + 7.20802696078431*std::pow(1.0*dt, 3) - 12.0999846813725*std::pow(1.0*dt, 4) + 8.22886412377451*std::pow(1.0*dt, 5) - 5.31271613012192*std::pow(1.0*dt, 6) + 2.06087387053179*std::pow(1.0*dt, 7) - 0.548687430880783*std::pow(1.0*dt, 8) + 0.0686594304378902*std::pow(1.0*dt, 9) - 1.0)*(750586925088000.0*dt + 3.355565076864e+15*std::pow(1.0*dt, 2) + 4.429934597088e+15*std::pow(1.0*dt, 3) + 5.7395984009364e+15*std::pow(1.0*dt, 4) + 4.3907035525353e+15*std::pow(1.0*dt, 5) + 2.6575350388587e+15*std::pow(1.0*dt, 6) + 1.06482256907276e+15*std::pow(1.0*dt, 7) + 278706404837798.0*std::pow(1.0*dt, 8) + 35182442773524.9*std::pow(1.0*dt, 9) + 300234770035200.0)))*(1.6512912351936e+15*dt + 3.0818216100672e+15*std::pow(1.0*dt, 2) + 299498900500800.0*std::pow(1.0*dt, 3) - 6.76242891756432e+15*std::pow(1.0*dt, 4) - 6.63475771766808e+15*std::pow(1.0*dt, 5) + 6.79435938437256e+15*std::pow(1.0*dt, 6) + 1.36214777467969e+16*std::pow(1.0*dt, 7) - 3.95617098823947e+15*std::pow(1.0*dt, 8) - 1.89373966838987e+16*std::pow(1.0*dt, 9) + 1.36620205312091e+15*std::pow(1.0*dt, 10) + 2.306065391635e+16*std::pow(1.0*dt, 11) - 2.23153351768463e+15*std::pow(1.0*dt, 12) - 2.73223415703026e+16*std::pow(1.0*dt, 13) + 1.15546935208444e+16*std::pow(1.0*dt, 14) + 2.8777809156525e+16*std::pow(1.0*dt, 15) - 4.3439522329125e+16*std::pow(1.0*dt, 16) + 2.69680981014844e+16*std::pow(1.0*dt, 17) - 7.35493584585938e+15*std::pow(1.0*dt, 18) + 300234770035200.0))*std::pow(825645617596800.0*dt + 770455402516800.0*std::pow(1.0*dt, 2) + 37437362562600.0*std::pow(1.0*dt, 3) - 422651807347770.0*std::pow(1.0*dt, 4) - 207336178677128.0*std::pow(1.0*dt, 5) + 106161865380821.0*std::pow(1.0*dt, 6) + 106417794896851.0*std::pow(1.0*dt, 7) - 15453792922810.4*std::pow(1.0*dt, 8) - 36987102898239.6*std::pow(1.0*dt, 9) + 1334181692500.88*std::pow(1.0*dt, 10) + 11260084920092.8*std::pow(1.0*dt, 11) - 544807987715.973*std::pow(1.0*dt, 12) - 3335246773718.58*std::pow(1.0*dt, 13) + 705242524465.599*std::pow(1.0*dt, 14) + 878229039200.592*std::pow(1.0*dt, 15) - 662834508195.877*std::pow(1.0*dt, 16) + 205750260173.678*std::pow(1.0*dt, 17) - 28056853660.0471*std::pow(1.0*dt, 18) + 300234770035200.0, -1)*std::pow(1.6512912351936e+15*dt + 3.0818216100672e+15*std::pow(1.0*dt, 2) + 299498900500800.0*std::pow(1.0*dt, 3) - 6.76242891756432e+15*std::pow(1.0*dt, 4) - 6.63475771766808e+15*std::pow(1.0*dt, 5) + 6.79435938437256e+15*std::pow(1.0*dt, 6) + 1.36214777467969e+16*std::pow(1.0*dt, 7) - 3.95617098823947e+15*std::pow(1.0*dt, 8) - 1.89373966838987e+16*std::pow(1.0*dt, 9) + 1.36620205312091e+15*std::pow(1.0*dt, 10) + 2.306065391635e+16*std::pow(1.0*dt, 11) - 2.23153351768463e+15*std::pow(1.0*dt, 12) - 2.73223415703026e+16*std::pow(1.0*dt, 13) + 1.15546935208444e+16*std::pow(1.0*dt, 14) + 2.8777809156525e+16*std::pow(1.0*dt, 15) - 4.3439522329125e+16*std::pow(1.0*dt, 16) + 2.69680981014844e+16*std::pow(1.0*dt, 17) - 7.35493584585938e+15*std::pow(1.0*dt, 18) + 300234770035200.0, -1);
    ztmp = -1.0*(226088287425.0*zn*(1.33333333333333*dt - 0.836601307189543*std::pow(1.0*dt, 2) + 0.325344952795933*std::pow(1.0*dt, 3) - 0.0867586540789155*std::pow(1.0*dt, 4) + 0.0165254579197934*std::pow(1.0*dt, 5) - 0.00225989168133927*std::pow(1.0*dt, 6) + 0.000215227779175169*std::pow(1.0*dt, 7) - 1.30441078287981e-5*std::pow(1.0*dt, 8) + 3.8649208381624e-7*std::pow(1.0*dt, 9) - 1.0)*(452176574850.0*dt + 141859317600.0*std::pow(1.0*dt, 2) + 27583756200.0*std::pow(1.0*dt, 3) + 3677834160.0*std::pow(1.0*dt, 4) + 350269920.0*std::pow(1.0*dt, 5) + 23950080.0*std::pow(1.0*dt, 6) + 1140480.0*std::pow(1.0*dt, 7) + 34560.0*std::pow(1.0*dt, 8) + 512.0*std::pow(1.0*dt, 9) + 678264862275.0) + 1.0*(1.0*dt*x2*y2 + 1.0*z2)*(301451049900.0*dt - 94572878400.0*std::pow(1.0*dt, 2) + 18389170800.0*std::pow(1.0*dt, 3) - 2451889440.0*std::pow(1.0*dt, 4) + 233513280.0*std::pow(1.0*dt, 5) - 15966720.0*std::pow(1.0*dt, 6) + 760320.0*std::pow(1.0*dt, 7) - 23040.0*std::pow(1.0*dt, 8) + 341.333333333333*std::pow(1.0*dt, 9) - 452176574850.0)*(904353149700.0*dt + 567437270400.0*std::pow(1.0*dt, 2) + 220670049600.0*std::pow(1.0*dt, 3) + 58845346560.0*std::pow(1.0*dt, 4) + 11208637440.0*std::pow(1.0*dt, 5) + 1532805120.0*std::pow(1.0*dt, 6) + 145981440.0*std::pow(1.0*dt, 7) + 8847360.0*std::pow(1.0*dt, 8) + 262144.0*std::pow(1.0*dt, 9) + 678264862275.0))*std::pow(452176574850.0*dt + 141859317600.0*std::pow(1.0*dt, 2) + 27583756200.0*std::pow(1.0*dt, 3) + 3677834160.0*std::pow(1.0*dt, 4) + 350269920.0*std::pow(1.0*dt, 5) + 23950080.0*std::pow(1.0*dt, 6) + 1140480.0*std::pow(1.0*dt, 7) + 34560.0*std::pow(1.0*dt, 8) + 512.0*std::pow(1.0*dt, 9) + 678264862275.0, -1)*std::pow(904353149700.0*dt + 567437270400.0*std::pow(1.0*dt, 2) + 220670049600.0*std::pow(1.0*dt, 3) + 58845346560.0*std::pow(1.0*dt, 4) + 11208637440.0*std::pow(1.0*dt, 5) + 1532805120.0*std::pow(1.0*dt, 6) + 145981440.0*std::pow(1.0*dt, 7) + 8847360.0*std::pow(1.0*dt, 8) + 262144.0*std::pow(1.0*dt, 9) + 678264862275.0, -1);
    //---
    xn = xtmp;
    yn = ytmp;
    zn = ztmp;

```python

```