- Split input into 3 regimes
if (- (/ (+ x 4) y) (* (/ x y) z)) < -1130508328.6653645
Initial program 0.1
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
Taylor expanded around 0 5.1
\[\leadsto \left|\color{blue}{\left(\frac{x}{y} + 4 \cdot \frac{1}{y}\right) - \frac{x \cdot z}{y}}\right|\]
Simplified0.1
\[\leadsto \left|\color{blue}{\left(\frac{x}{y} + \frac{4}{y}\right) - \frac{z}{\frac{y}{x}}}\right|\]
if -1130508328.6653645 < (- (/ (+ x 4) y) (* (/ x y) z)) < 47917721.40686438
Initial program 3.9
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
Initial simplification0.1
\[\leadsto \left|\frac{4 + x}{y} - \frac{x}{\frac{y}{z}}\right|\]
if 47917721.40686438 < (- (/ (+ x 4) y) (* (/ x y) z))
Initial program 0.1
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
- Using strategy
rm Applied div-inv0.2
\[\leadsto \left|\color{blue}{\left(x + 4\right) \cdot \frac{1}{y}} - \frac{x}{y} \cdot z\right|\]
- Recombined 3 regimes into one program.
Final simplification0.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;\frac{4 + x}{y} - \frac{x}{y} \cdot z \le -1130508328.6653645:\\
\;\;\;\;\left|\left(\frac{x}{y} + \frac{4}{y}\right) - \frac{z}{\frac{y}{x}}\right|\\
\mathbf{elif}\;\frac{4 + x}{y} - \frac{x}{y} \cdot z \le 47917721.40686438:\\
\;\;\;\;\left|\frac{4 + x}{y} - \frac{x}{\frac{y}{z}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{1}{y} \cdot \left(4 + x\right) - \frac{x}{y} \cdot z\right|\\
\end{array}\]