Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A

Percentage Accurate: 85.2% → 94.1%
Time: 12.9s
Alternatives: 12
Speedup: 0.5×

Specification

?
\[\begin{array}{l} \\ \frac{x - y \cdot z}{t - a \cdot z} \end{array} \]
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
	return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
	return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a):
	return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a)
	return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z)))
end
function tmp = code(x, y, z, t, a)
	tmp = (x - (y * z)) / (t - (a * z));
end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 12 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 85.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x - y \cdot z}{t - a \cdot z} \end{array} \]
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
	return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
	return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a):
	return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a)
	return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z)))
end
function tmp = code(x, y, z, t, a)
	tmp = (x - (y * z)) / (t - (a * z));
end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}

Alternative 1: 94.1% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t - z \cdot a\\ t_2 := \frac{x - y \cdot z}{t\_1}\\ \mathbf{if}\;t\_2 \leq -4 \cdot 10^{-303}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(y, -z, x\right)}{a}}{-z}\\ \mathbf{elif}\;t\_2 \leq 10^{+305}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;y \cdot \left(\frac{z}{z \cdot a - t} + \frac{x}{y \cdot t\_1}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- t (* z a))) (t_2 (/ (- x (* y z)) t_1)))
   (if (<= t_2 -4e-303)
     t_2
     (if (<= t_2 0.0)
       (/ (/ (fma y (- z) x) a) (- z))
       (if (<= t_2 1e+305)
         t_2
         (if (<= t_2 INFINITY)
           (* y (+ (/ z (- (* z a) t)) (/ x (* y t_1))))
           (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t - (z * a);
	double t_2 = (x - (y * z)) / t_1;
	double tmp;
	if (t_2 <= -4e-303) {
		tmp = t_2;
	} else if (t_2 <= 0.0) {
		tmp = (fma(y, -z, x) / a) / -z;
	} else if (t_2 <= 1e+305) {
		tmp = t_2;
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = y * ((z / ((z * a) - t)) + (x / (y * t_1)));
	} else {
		tmp = y / a;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(t - Float64(z * a))
	t_2 = Float64(Float64(x - Float64(y * z)) / t_1)
	tmp = 0.0
	if (t_2 <= -4e-303)
		tmp = t_2;
	elseif (t_2 <= 0.0)
		tmp = Float64(Float64(fma(y, Float64(-z), x) / a) / Float64(-z));
	elseif (t_2 <= 1e+305)
		tmp = t_2;
	elseif (t_2 <= Inf)
		tmp = Float64(y * Float64(Float64(z / Float64(Float64(z * a) - t)) + Float64(x / Float64(y * t_1))));
	else
		tmp = Float64(y / a);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-303], t$95$2, If[LessEqual[t$95$2, 0.0], N[(N[(N[(y * (-z) + x), $MachinePrecision] / a), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[t$95$2, 1e+305], t$95$2, If[LessEqual[t$95$2, Infinity], N[(y * N[(N[(z / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(x / N[(y * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x - y \cdot z}{t\_1}\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-303}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(y, -z, x\right)}{a}}{-z}\\

\mathbf{elif}\;t\_2 \leq 10^{+305}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;y \cdot \left(\frac{z}{z \cdot a - t} + \frac{x}{y \cdot t\_1}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -3.99999999999999972e-303 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 9.9999999999999994e304

    1. Initial program 98.7%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Add Preprocessing

    if -3.99999999999999972e-303 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0

    1. Initial program 59.2%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative59.2%

        \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
    3. Simplified59.2%

      \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 32.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{x - y \cdot z}{a \cdot z}} \]
    6. Step-by-step derivation
      1. mul-1-neg32.0%

        \[\leadsto \color{blue}{-\frac{x - y \cdot z}{a \cdot z}} \]
      2. associate-/r*75.0%

        \[\leadsto -\color{blue}{\frac{\frac{x - y \cdot z}{a}}{z}} \]
      3. sub-neg75.0%

        \[\leadsto -\frac{\frac{\color{blue}{x + \left(-y \cdot z\right)}}{a}}{z} \]
      4. distribute-rgt-neg-out75.0%

        \[\leadsto -\frac{\frac{x + \color{blue}{y \cdot \left(-z\right)}}{a}}{z} \]
      5. +-commutative75.0%

        \[\leadsto -\frac{\frac{\color{blue}{y \cdot \left(-z\right) + x}}{a}}{z} \]
      6. fma-define75.0%

        \[\leadsto -\frac{\frac{\color{blue}{\mathsf{fma}\left(y, -z, x\right)}}{a}}{z} \]
    7. Simplified75.0%

      \[\leadsto \color{blue}{-\frac{\frac{\mathsf{fma}\left(y, -z, x\right)}{a}}{z}} \]

    if 9.9999999999999994e304 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0

    1. Initial program 57.6%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative57.6%

        \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
    3. Simplified57.6%

      \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 99.7%

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \frac{z}{t - a \cdot z} + \frac{x}{y \cdot \left(t - a \cdot z\right)}\right)} \]
    6. Step-by-step derivation
      1. Simplified99.7%

        \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z \cdot a - t} + \frac{x}{y \cdot \left(t - z \cdot a\right)}\right)} \]

      if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z)))

      1. Initial program 0.0%

        \[\frac{x - y \cdot z}{t - a \cdot z} \]
      2. Step-by-step derivation
        1. *-commutative0.0%

          \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
      3. Simplified0.0%

        \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
      4. Add Preprocessing
      5. Taylor expanded in z around inf 100.0%

        \[\leadsto \color{blue}{\frac{y}{a}} \]
    7. Recombined 4 regimes into one program.
    8. Final simplification95.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y \cdot z}{t - z \cdot a} \leq -4 \cdot 10^{-303}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq 0:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(y, -z, x\right)}{a}}{-z}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq 10^{+305}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq \infty:\\ \;\;\;\;y \cdot \left(\frac{z}{z \cdot a - t} + \frac{x}{y \cdot \left(t - z \cdot a\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
    9. Add Preprocessing

    Alternative 2: 93.5% accurate, 0.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := t - z \cdot a\\ t_2 := \frac{x - y \cdot z}{t\_1}\\ \mathbf{if}\;t\_2 \leq -4 \cdot 10^{-303}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;t\_2 \leq 10^{+305}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;y \cdot \left(\frac{z}{z \cdot a - t} + \frac{x}{y \cdot t\_1}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (let* ((t_1 (- t (* z a))) (t_2 (/ (- x (* y z)) t_1)))
       (if (<= t_2 -4e-303)
         t_2
         (if (<= t_2 0.0)
           (/ (- y (/ x z)) a)
           (if (<= t_2 1e+305)
             t_2
             (if (<= t_2 INFINITY)
               (* y (+ (/ z (- (* z a) t)) (/ x (* y t_1))))
               (/ y a)))))))
    double code(double x, double y, double z, double t, double a) {
    	double t_1 = t - (z * a);
    	double t_2 = (x - (y * z)) / t_1;
    	double tmp;
    	if (t_2 <= -4e-303) {
    		tmp = t_2;
    	} else if (t_2 <= 0.0) {
    		tmp = (y - (x / z)) / a;
    	} else if (t_2 <= 1e+305) {
    		tmp = t_2;
    	} else if (t_2 <= ((double) INFINITY)) {
    		tmp = y * ((z / ((z * a) - t)) + (x / (y * t_1)));
    	} else {
    		tmp = y / a;
    	}
    	return tmp;
    }
    
    public static double code(double x, double y, double z, double t, double a) {
    	double t_1 = t - (z * a);
    	double t_2 = (x - (y * z)) / t_1;
    	double tmp;
    	if (t_2 <= -4e-303) {
    		tmp = t_2;
    	} else if (t_2 <= 0.0) {
    		tmp = (y - (x / z)) / a;
    	} else if (t_2 <= 1e+305) {
    		tmp = t_2;
    	} else if (t_2 <= Double.POSITIVE_INFINITY) {
    		tmp = y * ((z / ((z * a) - t)) + (x / (y * t_1)));
    	} else {
    		tmp = y / a;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	t_1 = t - (z * a)
    	t_2 = (x - (y * z)) / t_1
    	tmp = 0
    	if t_2 <= -4e-303:
    		tmp = t_2
    	elif t_2 <= 0.0:
    		tmp = (y - (x / z)) / a
    	elif t_2 <= 1e+305:
    		tmp = t_2
    	elif t_2 <= math.inf:
    		tmp = y * ((z / ((z * a) - t)) + (x / (y * t_1)))
    	else:
    		tmp = y / a
    	return tmp
    
    function code(x, y, z, t, a)
    	t_1 = Float64(t - Float64(z * a))
    	t_2 = Float64(Float64(x - Float64(y * z)) / t_1)
    	tmp = 0.0
    	if (t_2 <= -4e-303)
    		tmp = t_2;
    	elseif (t_2 <= 0.0)
    		tmp = Float64(Float64(y - Float64(x / z)) / a);
    	elseif (t_2 <= 1e+305)
    		tmp = t_2;
    	elseif (t_2 <= Inf)
    		tmp = Float64(y * Float64(Float64(z / Float64(Float64(z * a) - t)) + Float64(x / Float64(y * t_1))));
    	else
    		tmp = Float64(y / a);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a)
    	t_1 = t - (z * a);
    	t_2 = (x - (y * z)) / t_1;
    	tmp = 0.0;
    	if (t_2 <= -4e-303)
    		tmp = t_2;
    	elseif (t_2 <= 0.0)
    		tmp = (y - (x / z)) / a;
    	elseif (t_2 <= 1e+305)
    		tmp = t_2;
    	elseif (t_2 <= Inf)
    		tmp = y * ((z / ((z * a) - t)) + (x / (y * t_1)));
    	else
    		tmp = y / a;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-303], t$95$2, If[LessEqual[t$95$2, 0.0], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$2, 1e+305], t$95$2, If[LessEqual[t$95$2, Infinity], N[(y * N[(N[(z / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(x / N[(y * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := t - z \cdot a\\
    t_2 := \frac{x - y \cdot z}{t\_1}\\
    \mathbf{if}\;t\_2 \leq -4 \cdot 10^{-303}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;t\_2 \leq 0:\\
    \;\;\;\;\frac{y - \frac{x}{z}}{a}\\
    
    \mathbf{elif}\;t\_2 \leq 10^{+305}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;t\_2 \leq \infty:\\
    \;\;\;\;y \cdot \left(\frac{z}{z \cdot a - t} + \frac{x}{y \cdot t\_1}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{y}{a}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -3.99999999999999972e-303 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 9.9999999999999994e304

      1. Initial program 98.7%

        \[\frac{x - y \cdot z}{t - a \cdot z} \]
      2. Add Preprocessing

      if -3.99999999999999972e-303 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0

      1. Initial program 59.2%

        \[\frac{x - y \cdot z}{t - a \cdot z} \]
      2. Step-by-step derivation
        1. *-commutative59.2%

          \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
      3. Simplified59.2%

        \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
      4. Add Preprocessing
      5. Taylor expanded in z around inf 59.2%

        \[\leadsto \frac{\color{blue}{z \cdot \left(\frac{x}{z} - y\right)}}{t - z \cdot a} \]
      6. Taylor expanded in t around 0 72.7%

        \[\leadsto \color{blue}{-1 \cdot \frac{\frac{x}{z} - y}{a}} \]
      7. Step-by-step derivation
        1. mul-1-neg72.7%

          \[\leadsto \color{blue}{-\frac{\frac{x}{z} - y}{a}} \]
        2. distribute-neg-frac272.7%

          \[\leadsto \color{blue}{\frac{\frac{x}{z} - y}{-a}} \]
      8. Simplified72.7%

        \[\leadsto \color{blue}{\frac{\frac{x}{z} - y}{-a}} \]

      if 9.9999999999999994e304 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0

      1. Initial program 57.6%

        \[\frac{x - y \cdot z}{t - a \cdot z} \]
      2. Step-by-step derivation
        1. *-commutative57.6%

          \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
      3. Simplified57.6%

        \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
      4. Add Preprocessing
      5. Taylor expanded in y around inf 99.7%

        \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \frac{z}{t - a \cdot z} + \frac{x}{y \cdot \left(t - a \cdot z\right)}\right)} \]
      6. Step-by-step derivation
        1. Simplified99.7%

          \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z \cdot a - t} + \frac{x}{y \cdot \left(t - z \cdot a\right)}\right)} \]

        if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z)))

        1. Initial program 0.0%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative0.0%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified0.0%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in z around inf 100.0%

          \[\leadsto \color{blue}{\frac{y}{a}} \]
      7. Recombined 4 regimes into one program.
      8. Final simplification94.9%

        \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y \cdot z}{t - z \cdot a} \leq -4 \cdot 10^{-303}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq 0:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq 10^{+305}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq \infty:\\ \;\;\;\;y \cdot \left(\frac{z}{z \cdot a - t} + \frac{x}{y \cdot \left(t - z \cdot a\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
      9. Add Preprocessing

      Alternative 3: 62.9% accurate, 0.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{t - z \cdot a}\\ \mathbf{if}\;z \leq -3.7 \cdot 10^{+139}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+53}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+110}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{+133}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+197}:\\ \;\;\;\;y \cdot \frac{z}{-t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (let* ((t_1 (/ x (- t (* z a)))))
         (if (<= z -3.7e+139)
           (/ y a)
           (if (<= z 9.5e+53)
             t_1
             (if (<= z 7e+110)
               (/ y a)
               (if (<= z 1.65e+133)
                 t_1
                 (if (<= z 2.05e+197) (* y (/ z (- t))) (/ y a))))))))
      double code(double x, double y, double z, double t, double a) {
      	double t_1 = x / (t - (z * a));
      	double tmp;
      	if (z <= -3.7e+139) {
      		tmp = y / a;
      	} else if (z <= 9.5e+53) {
      		tmp = t_1;
      	} else if (z <= 7e+110) {
      		tmp = y / a;
      	} else if (z <= 1.65e+133) {
      		tmp = t_1;
      	} else if (z <= 2.05e+197) {
      		tmp = y * (z / -t);
      	} else {
      		tmp = y / a;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t, a)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8) :: t_1
          real(8) :: tmp
          t_1 = x / (t - (z * a))
          if (z <= (-3.7d+139)) then
              tmp = y / a
          else if (z <= 9.5d+53) then
              tmp = t_1
          else if (z <= 7d+110) then
              tmp = y / a
          else if (z <= 1.65d+133) then
              tmp = t_1
          else if (z <= 2.05d+197) then
              tmp = y * (z / -t)
          else
              tmp = y / a
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a) {
      	double t_1 = x / (t - (z * a));
      	double tmp;
      	if (z <= -3.7e+139) {
      		tmp = y / a;
      	} else if (z <= 9.5e+53) {
      		tmp = t_1;
      	} else if (z <= 7e+110) {
      		tmp = y / a;
      	} else if (z <= 1.65e+133) {
      		tmp = t_1;
      	} else if (z <= 2.05e+197) {
      		tmp = y * (z / -t);
      	} else {
      		tmp = y / a;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	t_1 = x / (t - (z * a))
      	tmp = 0
      	if z <= -3.7e+139:
      		tmp = y / a
      	elif z <= 9.5e+53:
      		tmp = t_1
      	elif z <= 7e+110:
      		tmp = y / a
      	elif z <= 1.65e+133:
      		tmp = t_1
      	elif z <= 2.05e+197:
      		tmp = y * (z / -t)
      	else:
      		tmp = y / a
      	return tmp
      
      function code(x, y, z, t, a)
      	t_1 = Float64(x / Float64(t - Float64(z * a)))
      	tmp = 0.0
      	if (z <= -3.7e+139)
      		tmp = Float64(y / a);
      	elseif (z <= 9.5e+53)
      		tmp = t_1;
      	elseif (z <= 7e+110)
      		tmp = Float64(y / a);
      	elseif (z <= 1.65e+133)
      		tmp = t_1;
      	elseif (z <= 2.05e+197)
      		tmp = Float64(y * Float64(z / Float64(-t)));
      	else
      		tmp = Float64(y / a);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	t_1 = x / (t - (z * a));
      	tmp = 0.0;
      	if (z <= -3.7e+139)
      		tmp = y / a;
      	elseif (z <= 9.5e+53)
      		tmp = t_1;
      	elseif (z <= 7e+110)
      		tmp = y / a;
      	elseif (z <= 1.65e+133)
      		tmp = t_1;
      	elseif (z <= 2.05e+197)
      		tmp = y * (z / -t);
      	else
      		tmp = y / a;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e+139], N[(y / a), $MachinePrecision], If[LessEqual[z, 9.5e+53], t$95$1, If[LessEqual[z, 7e+110], N[(y / a), $MachinePrecision], If[LessEqual[z, 1.65e+133], t$95$1, If[LessEqual[z, 2.05e+197], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \frac{x}{t - z \cdot a}\\
      \mathbf{if}\;z \leq -3.7 \cdot 10^{+139}:\\
      \;\;\;\;\frac{y}{a}\\
      
      \mathbf{elif}\;z \leq 9.5 \cdot 10^{+53}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 7 \cdot 10^{+110}:\\
      \;\;\;\;\frac{y}{a}\\
      
      \mathbf{elif}\;z \leq 1.65 \cdot 10^{+133}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 2.05 \cdot 10^{+197}:\\
      \;\;\;\;y \cdot \frac{z}{-t}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{y}{a}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if z < -3.69999999999999992e139 or 9.5000000000000006e53 < z < 6.9999999999999998e110 or 2.05000000000000015e197 < z

        1. Initial program 65.2%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative65.2%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified65.2%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in z around inf 73.1%

          \[\leadsto \color{blue}{\frac{y}{a}} \]

        if -3.69999999999999992e139 < z < 9.5000000000000006e53 or 6.9999999999999998e110 < z < 1.65e133

        1. Initial program 95.4%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative95.4%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified95.4%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in x around inf 67.0%

          \[\leadsto \color{blue}{\frac{x}{t - a \cdot z}} \]
        6. Step-by-step derivation
          1. *-commutative67.0%

            \[\leadsto \frac{x}{t - \color{blue}{z \cdot a}} \]
        7. Simplified67.0%

          \[\leadsto \color{blue}{\frac{x}{t - z \cdot a}} \]

        if 1.65e133 < z < 2.05000000000000015e197

        1. Initial program 63.7%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative63.7%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified63.7%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in x around 0 56.1%

          \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t - a \cdot z}} \]
        6. Step-by-step derivation
          1. mul-1-neg56.1%

            \[\leadsto \color{blue}{-\frac{y \cdot z}{t - a \cdot z}} \]
          2. associate-/l*63.3%

            \[\leadsto -\color{blue}{y \cdot \frac{z}{t - a \cdot z}} \]
          3. distribute-rgt-neg-in63.3%

            \[\leadsto \color{blue}{y \cdot \left(-\frac{z}{t - a \cdot z}\right)} \]
          4. distribute-neg-frac263.3%

            \[\leadsto y \cdot \color{blue}{\frac{z}{-\left(t - a \cdot z\right)}} \]
          5. cancel-sign-sub-inv63.3%

            \[\leadsto y \cdot \frac{z}{-\color{blue}{\left(t + \left(-a\right) \cdot z\right)}} \]
          6. *-commutative63.3%

            \[\leadsto y \cdot \frac{z}{-\left(t + \color{blue}{z \cdot \left(-a\right)}\right)} \]
          7. +-commutative63.3%

            \[\leadsto y \cdot \frac{z}{-\color{blue}{\left(z \cdot \left(-a\right) + t\right)}} \]
          8. distribute-rgt-neg-out63.3%

            \[\leadsto y \cdot \frac{z}{-\left(\color{blue}{\left(-z \cdot a\right)} + t\right)} \]
          9. distribute-lft-neg-in63.3%

            \[\leadsto y \cdot \frac{z}{-\left(\color{blue}{\left(-z\right) \cdot a} + t\right)} \]
          10. *-commutative63.3%

            \[\leadsto y \cdot \frac{z}{-\left(\color{blue}{a \cdot \left(-z\right)} + t\right)} \]
          11. fma-undefine63.3%

            \[\leadsto y \cdot \frac{z}{-\color{blue}{\mathsf{fma}\left(a, -z, t\right)}} \]
          12. neg-sub063.3%

            \[\leadsto y \cdot \frac{z}{\color{blue}{0 - \mathsf{fma}\left(a, -z, t\right)}} \]
          13. fma-undefine63.3%

            \[\leadsto y \cdot \frac{z}{0 - \color{blue}{\left(a \cdot \left(-z\right) + t\right)}} \]
          14. distribute-rgt-neg-in63.3%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{\left(-a \cdot z\right)} + t\right)} \]
          15. mul-1-neg63.3%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{-1 \cdot \left(a \cdot z\right)} + t\right)} \]
          16. associate-*r*63.3%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{\left(-1 \cdot a\right) \cdot z} + t\right)} \]
          17. neg-mul-163.3%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{\left(-a\right)} \cdot z + t\right)} \]
          18. *-commutative63.3%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{z \cdot \left(-a\right)} + t\right)} \]
          19. associate--r+63.3%

            \[\leadsto y \cdot \frac{z}{\color{blue}{\left(0 - z \cdot \left(-a\right)\right) - t}} \]
          20. neg-sub063.3%

            \[\leadsto y \cdot \frac{z}{\color{blue}{\left(-z \cdot \left(-a\right)\right)} - t} \]
          21. distribute-rgt-neg-out63.3%

            \[\leadsto y \cdot \frac{z}{\left(-\color{blue}{\left(-z \cdot a\right)}\right) - t} \]
          22. remove-double-neg63.3%

            \[\leadsto y \cdot \frac{z}{\color{blue}{z \cdot a} - t} \]
        7. Simplified63.3%

          \[\leadsto \color{blue}{y \cdot \frac{z}{z \cdot a - t}} \]
        8. Taylor expanded in z around 0 55.1%

          \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \frac{z}{t}\right)} \]
        9. Step-by-step derivation
          1. associate-*r/55.1%

            \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot z}{t}} \]
          2. mul-1-neg55.1%

            \[\leadsto y \cdot \frac{\color{blue}{-z}}{t} \]
        10. Simplified55.1%

          \[\leadsto y \cdot \color{blue}{\frac{-z}{t}} \]
      3. Recombined 3 regimes into one program.
      4. Final simplification68.1%

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+139}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+53}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+110}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{+133}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+197}:\\ \;\;\;\;y \cdot \frac{z}{-t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 4: 53.0% accurate, 0.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+139}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{-54}:\\ \;\;\;\;\left(-z\right) \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-103}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-49}:\\ \;\;\;\;\frac{y \cdot z}{-t}\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+29}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (if (<= z -3.8e+139)
         (/ y a)
         (if (<= z -1.65e-54)
           (* (- z) (/ y t))
           (if (<= z 1.7e-103)
             (/ x t)
             (if (<= z 1.55e-49)
               (/ (* y z) (- t))
               (if (<= z 2.3e+29) (/ x t) (/ y a)))))))
      double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (z <= -3.8e+139) {
      		tmp = y / a;
      	} else if (z <= -1.65e-54) {
      		tmp = -z * (y / t);
      	} else if (z <= 1.7e-103) {
      		tmp = x / t;
      	} else if (z <= 1.55e-49) {
      		tmp = (y * z) / -t;
      	} else if (z <= 2.3e+29) {
      		tmp = x / t;
      	} else {
      		tmp = y / a;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t, a)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8) :: tmp
          if (z <= (-3.8d+139)) then
              tmp = y / a
          else if (z <= (-1.65d-54)) then
              tmp = -z * (y / t)
          else if (z <= 1.7d-103) then
              tmp = x / t
          else if (z <= 1.55d-49) then
              tmp = (y * z) / -t
          else if (z <= 2.3d+29) then
              tmp = x / t
          else
              tmp = y / a
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (z <= -3.8e+139) {
      		tmp = y / a;
      	} else if (z <= -1.65e-54) {
      		tmp = -z * (y / t);
      	} else if (z <= 1.7e-103) {
      		tmp = x / t;
      	} else if (z <= 1.55e-49) {
      		tmp = (y * z) / -t;
      	} else if (z <= 2.3e+29) {
      		tmp = x / t;
      	} else {
      		tmp = y / a;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	tmp = 0
      	if z <= -3.8e+139:
      		tmp = y / a
      	elif z <= -1.65e-54:
      		tmp = -z * (y / t)
      	elif z <= 1.7e-103:
      		tmp = x / t
      	elif z <= 1.55e-49:
      		tmp = (y * z) / -t
      	elif z <= 2.3e+29:
      		tmp = x / t
      	else:
      		tmp = y / a
      	return tmp
      
      function code(x, y, z, t, a)
      	tmp = 0.0
      	if (z <= -3.8e+139)
      		tmp = Float64(y / a);
      	elseif (z <= -1.65e-54)
      		tmp = Float64(Float64(-z) * Float64(y / t));
      	elseif (z <= 1.7e-103)
      		tmp = Float64(x / t);
      	elseif (z <= 1.55e-49)
      		tmp = Float64(Float64(y * z) / Float64(-t));
      	elseif (z <= 2.3e+29)
      		tmp = Float64(x / t);
      	else
      		tmp = Float64(y / a);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	tmp = 0.0;
      	if (z <= -3.8e+139)
      		tmp = y / a;
      	elseif (z <= -1.65e-54)
      		tmp = -z * (y / t);
      	elseif (z <= 1.7e-103)
      		tmp = x / t;
      	elseif (z <= 1.55e-49)
      		tmp = (y * z) / -t;
      	elseif (z <= 2.3e+29)
      		tmp = x / t;
      	else
      		tmp = y / a;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.8e+139], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.65e-54], N[((-z) * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e-103], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.55e-49], N[(N[(y * z), $MachinePrecision] / (-t)), $MachinePrecision], If[LessEqual[z, 2.3e+29], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -3.8 \cdot 10^{+139}:\\
      \;\;\;\;\frac{y}{a}\\
      
      \mathbf{elif}\;z \leq -1.65 \cdot 10^{-54}:\\
      \;\;\;\;\left(-z\right) \cdot \frac{y}{t}\\
      
      \mathbf{elif}\;z \leq 1.7 \cdot 10^{-103}:\\
      \;\;\;\;\frac{x}{t}\\
      
      \mathbf{elif}\;z \leq 1.55 \cdot 10^{-49}:\\
      \;\;\;\;\frac{y \cdot z}{-t}\\
      
      \mathbf{elif}\;z \leq 2.3 \cdot 10^{+29}:\\
      \;\;\;\;\frac{x}{t}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{y}{a}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if z < -3.79999999999999999e139 or 2.3000000000000001e29 < z

        1. Initial program 67.3%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative67.3%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified67.3%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in z around inf 62.9%

          \[\leadsto \color{blue}{\frac{y}{a}} \]

        if -3.79999999999999999e139 < z < -1.64999999999999996e-54

        1. Initial program 86.2%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative86.2%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified86.2%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in x around 0 46.2%

          \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t - a \cdot z}} \]
        6. Step-by-step derivation
          1. mul-1-neg46.2%

            \[\leadsto \color{blue}{-\frac{y \cdot z}{t - a \cdot z}} \]
          2. associate-/l*54.0%

            \[\leadsto -\color{blue}{y \cdot \frac{z}{t - a \cdot z}} \]
          3. distribute-rgt-neg-in54.0%

            \[\leadsto \color{blue}{y \cdot \left(-\frac{z}{t - a \cdot z}\right)} \]
          4. distribute-neg-frac254.0%

            \[\leadsto y \cdot \color{blue}{\frac{z}{-\left(t - a \cdot z\right)}} \]
          5. cancel-sign-sub-inv54.0%

            \[\leadsto y \cdot \frac{z}{-\color{blue}{\left(t + \left(-a\right) \cdot z\right)}} \]
          6. *-commutative54.0%

            \[\leadsto y \cdot \frac{z}{-\left(t + \color{blue}{z \cdot \left(-a\right)}\right)} \]
          7. +-commutative54.0%

            \[\leadsto y \cdot \frac{z}{-\color{blue}{\left(z \cdot \left(-a\right) + t\right)}} \]
          8. distribute-rgt-neg-out54.0%

            \[\leadsto y \cdot \frac{z}{-\left(\color{blue}{\left(-z \cdot a\right)} + t\right)} \]
          9. distribute-lft-neg-in54.0%

            \[\leadsto y \cdot \frac{z}{-\left(\color{blue}{\left(-z\right) \cdot a} + t\right)} \]
          10. *-commutative54.0%

            \[\leadsto y \cdot \frac{z}{-\left(\color{blue}{a \cdot \left(-z\right)} + t\right)} \]
          11. fma-undefine54.0%

            \[\leadsto y \cdot \frac{z}{-\color{blue}{\mathsf{fma}\left(a, -z, t\right)}} \]
          12. neg-sub054.0%

            \[\leadsto y \cdot \frac{z}{\color{blue}{0 - \mathsf{fma}\left(a, -z, t\right)}} \]
          13. fma-undefine54.0%

            \[\leadsto y \cdot \frac{z}{0 - \color{blue}{\left(a \cdot \left(-z\right) + t\right)}} \]
          14. distribute-rgt-neg-in54.0%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{\left(-a \cdot z\right)} + t\right)} \]
          15. mul-1-neg54.0%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{-1 \cdot \left(a \cdot z\right)} + t\right)} \]
          16. associate-*r*54.0%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{\left(-1 \cdot a\right) \cdot z} + t\right)} \]
          17. neg-mul-154.0%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{\left(-a\right)} \cdot z + t\right)} \]
          18. *-commutative54.0%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{z \cdot \left(-a\right)} + t\right)} \]
          19. associate--r+54.0%

            \[\leadsto y \cdot \frac{z}{\color{blue}{\left(0 - z \cdot \left(-a\right)\right) - t}} \]
          20. neg-sub054.0%

            \[\leadsto y \cdot \frac{z}{\color{blue}{\left(-z \cdot \left(-a\right)\right)} - t} \]
          21. distribute-rgt-neg-out54.0%

            \[\leadsto y \cdot \frac{z}{\left(-\color{blue}{\left(-z \cdot a\right)}\right) - t} \]
          22. remove-double-neg54.0%

            \[\leadsto y \cdot \frac{z}{\color{blue}{z \cdot a} - t} \]
        7. Simplified54.0%

          \[\leadsto \color{blue}{y \cdot \frac{z}{z \cdot a - t}} \]
        8. Taylor expanded in z around 0 34.2%

          \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t}} \]
        9. Step-by-step derivation
          1. associate-*r/34.2%

            \[\leadsto \color{blue}{\frac{-1 \cdot \left(y \cdot z\right)}{t}} \]
          2. associate-*r*34.2%

            \[\leadsto \frac{\color{blue}{\left(-1 \cdot y\right) \cdot z}}{t} \]
          3. mul-1-neg34.2%

            \[\leadsto \frac{\color{blue}{\left(-y\right)} \cdot z}{t} \]
        10. Simplified34.2%

          \[\leadsto \color{blue}{\frac{\left(-y\right) \cdot z}{t}} \]
        11. Taylor expanded in y around 0 34.2%

          \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t}} \]
        12. Step-by-step derivation
          1. mul-1-neg34.2%

            \[\leadsto \color{blue}{-\frac{y \cdot z}{t}} \]
          2. *-commutative34.2%

            \[\leadsto -\frac{\color{blue}{z \cdot y}}{t} \]
          3. associate-*r/42.0%

            \[\leadsto -\color{blue}{z \cdot \frac{y}{t}} \]
          4. *-commutative42.0%

            \[\leadsto -\color{blue}{\frac{y}{t} \cdot z} \]
          5. distribute-rgt-neg-in42.0%

            \[\leadsto \color{blue}{\frac{y}{t} \cdot \left(-z\right)} \]
        13. Simplified42.0%

          \[\leadsto \color{blue}{\frac{y}{t} \cdot \left(-z\right)} \]

        if -1.64999999999999996e-54 < z < 1.70000000000000001e-103 or 1.55e-49 < z < 2.3000000000000001e29

        1. Initial program 99.8%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative99.8%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified99.8%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in z around 0 64.1%

          \[\leadsto \color{blue}{\frac{x}{t}} \]

        if 1.70000000000000001e-103 < z < 1.55e-49

        1. Initial program 99.4%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative99.4%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified99.4%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in x around 0 65.3%

          \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t - a \cdot z}} \]
        6. Step-by-step derivation
          1. mul-1-neg65.3%

            \[\leadsto \color{blue}{-\frac{y \cdot z}{t - a \cdot z}} \]
          2. associate-/l*56.1%

            \[\leadsto -\color{blue}{y \cdot \frac{z}{t - a \cdot z}} \]
          3. distribute-rgt-neg-in56.1%

            \[\leadsto \color{blue}{y \cdot \left(-\frac{z}{t - a \cdot z}\right)} \]
          4. distribute-neg-frac256.1%

            \[\leadsto y \cdot \color{blue}{\frac{z}{-\left(t - a \cdot z\right)}} \]
          5. cancel-sign-sub-inv56.1%

            \[\leadsto y \cdot \frac{z}{-\color{blue}{\left(t + \left(-a\right) \cdot z\right)}} \]
          6. *-commutative56.1%

            \[\leadsto y \cdot \frac{z}{-\left(t + \color{blue}{z \cdot \left(-a\right)}\right)} \]
          7. +-commutative56.1%

            \[\leadsto y \cdot \frac{z}{-\color{blue}{\left(z \cdot \left(-a\right) + t\right)}} \]
          8. distribute-rgt-neg-out56.1%

            \[\leadsto y \cdot \frac{z}{-\left(\color{blue}{\left(-z \cdot a\right)} + t\right)} \]
          9. distribute-lft-neg-in56.1%

            \[\leadsto y \cdot \frac{z}{-\left(\color{blue}{\left(-z\right) \cdot a} + t\right)} \]
          10. *-commutative56.1%

            \[\leadsto y \cdot \frac{z}{-\left(\color{blue}{a \cdot \left(-z\right)} + t\right)} \]
          11. fma-undefine56.1%

            \[\leadsto y \cdot \frac{z}{-\color{blue}{\mathsf{fma}\left(a, -z, t\right)}} \]
          12. neg-sub056.1%

            \[\leadsto y \cdot \frac{z}{\color{blue}{0 - \mathsf{fma}\left(a, -z, t\right)}} \]
          13. fma-undefine56.1%

            \[\leadsto y \cdot \frac{z}{0 - \color{blue}{\left(a \cdot \left(-z\right) + t\right)}} \]
          14. distribute-rgt-neg-in56.1%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{\left(-a \cdot z\right)} + t\right)} \]
          15. mul-1-neg56.1%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{-1 \cdot \left(a \cdot z\right)} + t\right)} \]
          16. associate-*r*56.1%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{\left(-1 \cdot a\right) \cdot z} + t\right)} \]
          17. neg-mul-156.1%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{\left(-a\right)} \cdot z + t\right)} \]
          18. *-commutative56.1%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{z \cdot \left(-a\right)} + t\right)} \]
          19. associate--r+56.1%

            \[\leadsto y \cdot \frac{z}{\color{blue}{\left(0 - z \cdot \left(-a\right)\right) - t}} \]
          20. neg-sub056.1%

            \[\leadsto y \cdot \frac{z}{\color{blue}{\left(-z \cdot \left(-a\right)\right)} - t} \]
          21. distribute-rgt-neg-out56.1%

            \[\leadsto y \cdot \frac{z}{\left(-\color{blue}{\left(-z \cdot a\right)}\right) - t} \]
          22. remove-double-neg56.1%

            \[\leadsto y \cdot \frac{z}{\color{blue}{z \cdot a} - t} \]
        7. Simplified56.1%

          \[\leadsto \color{blue}{y \cdot \frac{z}{z \cdot a - t}} \]
        8. Taylor expanded in z around 0 58.4%

          \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t}} \]
        9. Step-by-step derivation
          1. associate-*r/58.4%

            \[\leadsto \color{blue}{\frac{-1 \cdot \left(y \cdot z\right)}{t}} \]
          2. associate-*r*58.4%

            \[\leadsto \frac{\color{blue}{\left(-1 \cdot y\right) \cdot z}}{t} \]
          3. mul-1-neg58.4%

            \[\leadsto \frac{\color{blue}{\left(-y\right)} \cdot z}{t} \]
        10. Simplified58.4%

          \[\leadsto \color{blue}{\frac{\left(-y\right) \cdot z}{t}} \]
      3. Recombined 4 regimes into one program.
      4. Final simplification59.2%

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+139}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{-54}:\\ \;\;\;\;\left(-z\right) \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-103}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-49}:\\ \;\;\;\;\frac{y \cdot z}{-t}\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+29}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 5: 52.8% accurate, 0.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+139}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-55}:\\ \;\;\;\;z \cdot \frac{-y}{t}\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-111}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-34}:\\ \;\;\;\;\frac{\frac{x}{a}}{-z}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+38}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (if (<= z -3.7e+139)
         (/ y a)
         (if (<= z -1.3e-55)
           (* z (/ (- y) t))
           (if (<= z 2.3e-111)
             (/ x t)
             (if (<= z 1.15e-34)
               (/ (/ x a) (- z))
               (if (<= z 6e+38) (/ x t) (/ y a)))))))
      double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (z <= -3.7e+139) {
      		tmp = y / a;
      	} else if (z <= -1.3e-55) {
      		tmp = z * (-y / t);
      	} else if (z <= 2.3e-111) {
      		tmp = x / t;
      	} else if (z <= 1.15e-34) {
      		tmp = (x / a) / -z;
      	} else if (z <= 6e+38) {
      		tmp = x / t;
      	} else {
      		tmp = y / a;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t, a)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8) :: tmp
          if (z <= (-3.7d+139)) then
              tmp = y / a
          else if (z <= (-1.3d-55)) then
              tmp = z * (-y / t)
          else if (z <= 2.3d-111) then
              tmp = x / t
          else if (z <= 1.15d-34) then
              tmp = (x / a) / -z
          else if (z <= 6d+38) then
              tmp = x / t
          else
              tmp = y / a
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (z <= -3.7e+139) {
      		tmp = y / a;
      	} else if (z <= -1.3e-55) {
      		tmp = z * (-y / t);
      	} else if (z <= 2.3e-111) {
      		tmp = x / t;
      	} else if (z <= 1.15e-34) {
      		tmp = (x / a) / -z;
      	} else if (z <= 6e+38) {
      		tmp = x / t;
      	} else {
      		tmp = y / a;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	tmp = 0
      	if z <= -3.7e+139:
      		tmp = y / a
      	elif z <= -1.3e-55:
      		tmp = z * (-y / t)
      	elif z <= 2.3e-111:
      		tmp = x / t
      	elif z <= 1.15e-34:
      		tmp = (x / a) / -z
      	elif z <= 6e+38:
      		tmp = x / t
      	else:
      		tmp = y / a
      	return tmp
      
      function code(x, y, z, t, a)
      	tmp = 0.0
      	if (z <= -3.7e+139)
      		tmp = Float64(y / a);
      	elseif (z <= -1.3e-55)
      		tmp = Float64(z * Float64(Float64(-y) / t));
      	elseif (z <= 2.3e-111)
      		tmp = Float64(x / t);
      	elseif (z <= 1.15e-34)
      		tmp = Float64(Float64(x / a) / Float64(-z));
      	elseif (z <= 6e+38)
      		tmp = Float64(x / t);
      	else
      		tmp = Float64(y / a);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	tmp = 0.0;
      	if (z <= -3.7e+139)
      		tmp = y / a;
      	elseif (z <= -1.3e-55)
      		tmp = z * (-y / t);
      	elseif (z <= 2.3e-111)
      		tmp = x / t;
      	elseif (z <= 1.15e-34)
      		tmp = (x / a) / -z;
      	elseif (z <= 6e+38)
      		tmp = x / t;
      	else
      		tmp = y / a;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.7e+139], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.3e-55], N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e-111], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.15e-34], N[(N[(x / a), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[z, 6e+38], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -3.7 \cdot 10^{+139}:\\
      \;\;\;\;\frac{y}{a}\\
      
      \mathbf{elif}\;z \leq -1.3 \cdot 10^{-55}:\\
      \;\;\;\;z \cdot \frac{-y}{t}\\
      
      \mathbf{elif}\;z \leq 2.3 \cdot 10^{-111}:\\
      \;\;\;\;\frac{x}{t}\\
      
      \mathbf{elif}\;z \leq 1.15 \cdot 10^{-34}:\\
      \;\;\;\;\frac{\frac{x}{a}}{-z}\\
      
      \mathbf{elif}\;z \leq 6 \cdot 10^{+38}:\\
      \;\;\;\;\frac{x}{t}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{y}{a}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if z < -3.69999999999999992e139 or 6.0000000000000002e38 < z

        1. Initial program 67.3%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative67.3%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified67.3%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in z around inf 62.9%

          \[\leadsto \color{blue}{\frac{y}{a}} \]

        if -3.69999999999999992e139 < z < -1.2999999999999999e-55

        1. Initial program 86.2%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative86.2%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified86.2%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in x around 0 46.2%

          \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t - a \cdot z}} \]
        6. Step-by-step derivation
          1. mul-1-neg46.2%

            \[\leadsto \color{blue}{-\frac{y \cdot z}{t - a \cdot z}} \]
          2. associate-/l*54.0%

            \[\leadsto -\color{blue}{y \cdot \frac{z}{t - a \cdot z}} \]
          3. distribute-rgt-neg-in54.0%

            \[\leadsto \color{blue}{y \cdot \left(-\frac{z}{t - a \cdot z}\right)} \]
          4. distribute-neg-frac254.0%

            \[\leadsto y \cdot \color{blue}{\frac{z}{-\left(t - a \cdot z\right)}} \]
          5. cancel-sign-sub-inv54.0%

            \[\leadsto y \cdot \frac{z}{-\color{blue}{\left(t + \left(-a\right) \cdot z\right)}} \]
          6. *-commutative54.0%

            \[\leadsto y \cdot \frac{z}{-\left(t + \color{blue}{z \cdot \left(-a\right)}\right)} \]
          7. +-commutative54.0%

            \[\leadsto y \cdot \frac{z}{-\color{blue}{\left(z \cdot \left(-a\right) + t\right)}} \]
          8. distribute-rgt-neg-out54.0%

            \[\leadsto y \cdot \frac{z}{-\left(\color{blue}{\left(-z \cdot a\right)} + t\right)} \]
          9. distribute-lft-neg-in54.0%

            \[\leadsto y \cdot \frac{z}{-\left(\color{blue}{\left(-z\right) \cdot a} + t\right)} \]
          10. *-commutative54.0%

            \[\leadsto y \cdot \frac{z}{-\left(\color{blue}{a \cdot \left(-z\right)} + t\right)} \]
          11. fma-undefine54.0%

            \[\leadsto y \cdot \frac{z}{-\color{blue}{\mathsf{fma}\left(a, -z, t\right)}} \]
          12. neg-sub054.0%

            \[\leadsto y \cdot \frac{z}{\color{blue}{0 - \mathsf{fma}\left(a, -z, t\right)}} \]
          13. fma-undefine54.0%

            \[\leadsto y \cdot \frac{z}{0 - \color{blue}{\left(a \cdot \left(-z\right) + t\right)}} \]
          14. distribute-rgt-neg-in54.0%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{\left(-a \cdot z\right)} + t\right)} \]
          15. mul-1-neg54.0%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{-1 \cdot \left(a \cdot z\right)} + t\right)} \]
          16. associate-*r*54.0%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{\left(-1 \cdot a\right) \cdot z} + t\right)} \]
          17. neg-mul-154.0%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{\left(-a\right)} \cdot z + t\right)} \]
          18. *-commutative54.0%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{z \cdot \left(-a\right)} + t\right)} \]
          19. associate--r+54.0%

            \[\leadsto y \cdot \frac{z}{\color{blue}{\left(0 - z \cdot \left(-a\right)\right) - t}} \]
          20. neg-sub054.0%

            \[\leadsto y \cdot \frac{z}{\color{blue}{\left(-z \cdot \left(-a\right)\right)} - t} \]
          21. distribute-rgt-neg-out54.0%

            \[\leadsto y \cdot \frac{z}{\left(-\color{blue}{\left(-z \cdot a\right)}\right) - t} \]
          22. remove-double-neg54.0%

            \[\leadsto y \cdot \frac{z}{\color{blue}{z \cdot a} - t} \]
        7. Simplified54.0%

          \[\leadsto \color{blue}{y \cdot \frac{z}{z \cdot a - t}} \]
        8. Taylor expanded in z around 0 34.2%

          \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t}} \]
        9. Step-by-step derivation
          1. associate-*r/34.2%

            \[\leadsto \color{blue}{\frac{-1 \cdot \left(y \cdot z\right)}{t}} \]
          2. associate-*r*34.2%

            \[\leadsto \frac{\color{blue}{\left(-1 \cdot y\right) \cdot z}}{t} \]
          3. mul-1-neg34.2%

            \[\leadsto \frac{\color{blue}{\left(-y\right)} \cdot z}{t} \]
        10. Simplified34.2%

          \[\leadsto \color{blue}{\frac{\left(-y\right) \cdot z}{t}} \]
        11. Taylor expanded in y around 0 34.2%

          \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t}} \]
        12. Step-by-step derivation
          1. mul-1-neg34.2%

            \[\leadsto \color{blue}{-\frac{y \cdot z}{t}} \]
          2. *-commutative34.2%

            \[\leadsto -\frac{\color{blue}{z \cdot y}}{t} \]
          3. associate-*r/42.0%

            \[\leadsto -\color{blue}{z \cdot \frac{y}{t}} \]
          4. *-commutative42.0%

            \[\leadsto -\color{blue}{\frac{y}{t} \cdot z} \]
          5. distribute-rgt-neg-in42.0%

            \[\leadsto \color{blue}{\frac{y}{t} \cdot \left(-z\right)} \]
        13. Simplified42.0%

          \[\leadsto \color{blue}{\frac{y}{t} \cdot \left(-z\right)} \]

        if -1.2999999999999999e-55 < z < 2.3e-111 or 1.15000000000000006e-34 < z < 6.0000000000000002e38

        1. Initial program 99.9%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative99.9%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified99.9%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in z around 0 66.0%

          \[\leadsto \color{blue}{\frac{x}{t}} \]

        if 2.3e-111 < z < 1.15000000000000006e-34

        1. Initial program 99.4%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative99.4%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified99.4%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in t around 0 56.2%

          \[\leadsto \color{blue}{-1 \cdot \frac{x - y \cdot z}{a \cdot z}} \]
        6. Step-by-step derivation
          1. mul-1-neg56.2%

            \[\leadsto \color{blue}{-\frac{x - y \cdot z}{a \cdot z}} \]
          2. associate-/r*56.3%

            \[\leadsto -\color{blue}{\frac{\frac{x - y \cdot z}{a}}{z}} \]
          3. sub-neg56.3%

            \[\leadsto -\frac{\frac{\color{blue}{x + \left(-y \cdot z\right)}}{a}}{z} \]
          4. distribute-rgt-neg-out56.3%

            \[\leadsto -\frac{\frac{x + \color{blue}{y \cdot \left(-z\right)}}{a}}{z} \]
          5. +-commutative56.3%

            \[\leadsto -\frac{\frac{\color{blue}{y \cdot \left(-z\right) + x}}{a}}{z} \]
          6. fma-define56.3%

            \[\leadsto -\frac{\frac{\color{blue}{\mathsf{fma}\left(y, -z, x\right)}}{a}}{z} \]
        7. Simplified56.3%

          \[\leadsto \color{blue}{-\frac{\frac{\mathsf{fma}\left(y, -z, x\right)}{a}}{z}} \]
        8. Taylor expanded in y around 0 51.2%

          \[\leadsto -\frac{\color{blue}{\frac{x}{a}}}{z} \]
      3. Recombined 4 regimes into one program.
      4. Final simplification59.2%

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+139}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-55}:\\ \;\;\;\;z \cdot \frac{-y}{t}\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-111}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-34}:\\ \;\;\;\;\frac{\frac{x}{a}}{-z}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+38}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 6: 52.7% accurate, 0.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+139}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-55}:\\ \;\;\;\;y \cdot \frac{z}{-t}\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-112}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-34}:\\ \;\;\;\;\frac{\frac{x}{a}}{-z}\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+29}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (if (<= z -3.7e+139)
         (/ y a)
         (if (<= z -5.2e-55)
           (* y (/ z (- t)))
           (if (<= z 9.5e-112)
             (/ x t)
             (if (<= z 8.8e-34)
               (/ (/ x a) (- z))
               (if (<= z 2.4e+29) (/ x t) (/ y a)))))))
      double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (z <= -3.7e+139) {
      		tmp = y / a;
      	} else if (z <= -5.2e-55) {
      		tmp = y * (z / -t);
      	} else if (z <= 9.5e-112) {
      		tmp = x / t;
      	} else if (z <= 8.8e-34) {
      		tmp = (x / a) / -z;
      	} else if (z <= 2.4e+29) {
      		tmp = x / t;
      	} else {
      		tmp = y / a;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t, a)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8) :: tmp
          if (z <= (-3.7d+139)) then
              tmp = y / a
          else if (z <= (-5.2d-55)) then
              tmp = y * (z / -t)
          else if (z <= 9.5d-112) then
              tmp = x / t
          else if (z <= 8.8d-34) then
              tmp = (x / a) / -z
          else if (z <= 2.4d+29) then
              tmp = x / t
          else
              tmp = y / a
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (z <= -3.7e+139) {
      		tmp = y / a;
      	} else if (z <= -5.2e-55) {
      		tmp = y * (z / -t);
      	} else if (z <= 9.5e-112) {
      		tmp = x / t;
      	} else if (z <= 8.8e-34) {
      		tmp = (x / a) / -z;
      	} else if (z <= 2.4e+29) {
      		tmp = x / t;
      	} else {
      		tmp = y / a;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	tmp = 0
      	if z <= -3.7e+139:
      		tmp = y / a
      	elif z <= -5.2e-55:
      		tmp = y * (z / -t)
      	elif z <= 9.5e-112:
      		tmp = x / t
      	elif z <= 8.8e-34:
      		tmp = (x / a) / -z
      	elif z <= 2.4e+29:
      		tmp = x / t
      	else:
      		tmp = y / a
      	return tmp
      
      function code(x, y, z, t, a)
      	tmp = 0.0
      	if (z <= -3.7e+139)
      		tmp = Float64(y / a);
      	elseif (z <= -5.2e-55)
      		tmp = Float64(y * Float64(z / Float64(-t)));
      	elseif (z <= 9.5e-112)
      		tmp = Float64(x / t);
      	elseif (z <= 8.8e-34)
      		tmp = Float64(Float64(x / a) / Float64(-z));
      	elseif (z <= 2.4e+29)
      		tmp = Float64(x / t);
      	else
      		tmp = Float64(y / a);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	tmp = 0.0;
      	if (z <= -3.7e+139)
      		tmp = y / a;
      	elseif (z <= -5.2e-55)
      		tmp = y * (z / -t);
      	elseif (z <= 9.5e-112)
      		tmp = x / t;
      	elseif (z <= 8.8e-34)
      		tmp = (x / a) / -z;
      	elseif (z <= 2.4e+29)
      		tmp = x / t;
      	else
      		tmp = y / a;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.7e+139], N[(y / a), $MachinePrecision], If[LessEqual[z, -5.2e-55], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-112], N[(x / t), $MachinePrecision], If[LessEqual[z, 8.8e-34], N[(N[(x / a), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[z, 2.4e+29], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -3.7 \cdot 10^{+139}:\\
      \;\;\;\;\frac{y}{a}\\
      
      \mathbf{elif}\;z \leq -5.2 \cdot 10^{-55}:\\
      \;\;\;\;y \cdot \frac{z}{-t}\\
      
      \mathbf{elif}\;z \leq 9.5 \cdot 10^{-112}:\\
      \;\;\;\;\frac{x}{t}\\
      
      \mathbf{elif}\;z \leq 8.8 \cdot 10^{-34}:\\
      \;\;\;\;\frac{\frac{x}{a}}{-z}\\
      
      \mathbf{elif}\;z \leq 2.4 \cdot 10^{+29}:\\
      \;\;\;\;\frac{x}{t}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{y}{a}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if z < -3.69999999999999992e139 or 2.4000000000000001e29 < z

        1. Initial program 67.3%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative67.3%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified67.3%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in z around inf 62.9%

          \[\leadsto \color{blue}{\frac{y}{a}} \]

        if -3.69999999999999992e139 < z < -5.1999999999999998e-55

        1. Initial program 86.2%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative86.2%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified86.2%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in x around 0 46.2%

          \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t - a \cdot z}} \]
        6. Step-by-step derivation
          1. mul-1-neg46.2%

            \[\leadsto \color{blue}{-\frac{y \cdot z}{t - a \cdot z}} \]
          2. associate-/l*54.0%

            \[\leadsto -\color{blue}{y \cdot \frac{z}{t - a \cdot z}} \]
          3. distribute-rgt-neg-in54.0%

            \[\leadsto \color{blue}{y \cdot \left(-\frac{z}{t - a \cdot z}\right)} \]
          4. distribute-neg-frac254.0%

            \[\leadsto y \cdot \color{blue}{\frac{z}{-\left(t - a \cdot z\right)}} \]
          5. cancel-sign-sub-inv54.0%

            \[\leadsto y \cdot \frac{z}{-\color{blue}{\left(t + \left(-a\right) \cdot z\right)}} \]
          6. *-commutative54.0%

            \[\leadsto y \cdot \frac{z}{-\left(t + \color{blue}{z \cdot \left(-a\right)}\right)} \]
          7. +-commutative54.0%

            \[\leadsto y \cdot \frac{z}{-\color{blue}{\left(z \cdot \left(-a\right) + t\right)}} \]
          8. distribute-rgt-neg-out54.0%

            \[\leadsto y \cdot \frac{z}{-\left(\color{blue}{\left(-z \cdot a\right)} + t\right)} \]
          9. distribute-lft-neg-in54.0%

            \[\leadsto y \cdot \frac{z}{-\left(\color{blue}{\left(-z\right) \cdot a} + t\right)} \]
          10. *-commutative54.0%

            \[\leadsto y \cdot \frac{z}{-\left(\color{blue}{a \cdot \left(-z\right)} + t\right)} \]
          11. fma-undefine54.0%

            \[\leadsto y \cdot \frac{z}{-\color{blue}{\mathsf{fma}\left(a, -z, t\right)}} \]
          12. neg-sub054.0%

            \[\leadsto y \cdot \frac{z}{\color{blue}{0 - \mathsf{fma}\left(a, -z, t\right)}} \]
          13. fma-undefine54.0%

            \[\leadsto y \cdot \frac{z}{0 - \color{blue}{\left(a \cdot \left(-z\right) + t\right)}} \]
          14. distribute-rgt-neg-in54.0%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{\left(-a \cdot z\right)} + t\right)} \]
          15. mul-1-neg54.0%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{-1 \cdot \left(a \cdot z\right)} + t\right)} \]
          16. associate-*r*54.0%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{\left(-1 \cdot a\right) \cdot z} + t\right)} \]
          17. neg-mul-154.0%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{\left(-a\right)} \cdot z + t\right)} \]
          18. *-commutative54.0%

            \[\leadsto y \cdot \frac{z}{0 - \left(\color{blue}{z \cdot \left(-a\right)} + t\right)} \]
          19. associate--r+54.0%

            \[\leadsto y \cdot \frac{z}{\color{blue}{\left(0 - z \cdot \left(-a\right)\right) - t}} \]
          20. neg-sub054.0%

            \[\leadsto y \cdot \frac{z}{\color{blue}{\left(-z \cdot \left(-a\right)\right)} - t} \]
          21. distribute-rgt-neg-out54.0%

            \[\leadsto y \cdot \frac{z}{\left(-\color{blue}{\left(-z \cdot a\right)}\right) - t} \]
          22. remove-double-neg54.0%

            \[\leadsto y \cdot \frac{z}{\color{blue}{z \cdot a} - t} \]
        7. Simplified54.0%

          \[\leadsto \color{blue}{y \cdot \frac{z}{z \cdot a - t}} \]
        8. Taylor expanded in z around 0 40.0%

          \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \frac{z}{t}\right)} \]
        9. Step-by-step derivation
          1. associate-*r/40.0%

            \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot z}{t}} \]
          2. mul-1-neg40.0%

            \[\leadsto y \cdot \frac{\color{blue}{-z}}{t} \]
        10. Simplified40.0%

          \[\leadsto y \cdot \color{blue}{\frac{-z}{t}} \]

        if -5.1999999999999998e-55 < z < 9.50000000000000056e-112 or 8.7999999999999995e-34 < z < 2.4000000000000001e29

        1. Initial program 99.9%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative99.9%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified99.9%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in z around 0 66.0%

          \[\leadsto \color{blue}{\frac{x}{t}} \]

        if 9.50000000000000056e-112 < z < 8.7999999999999995e-34

        1. Initial program 99.4%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative99.4%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified99.4%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in t around 0 56.2%

          \[\leadsto \color{blue}{-1 \cdot \frac{x - y \cdot z}{a \cdot z}} \]
        6. Step-by-step derivation
          1. mul-1-neg56.2%

            \[\leadsto \color{blue}{-\frac{x - y \cdot z}{a \cdot z}} \]
          2. associate-/r*56.3%

            \[\leadsto -\color{blue}{\frac{\frac{x - y \cdot z}{a}}{z}} \]
          3. sub-neg56.3%

            \[\leadsto -\frac{\frac{\color{blue}{x + \left(-y \cdot z\right)}}{a}}{z} \]
          4. distribute-rgt-neg-out56.3%

            \[\leadsto -\frac{\frac{x + \color{blue}{y \cdot \left(-z\right)}}{a}}{z} \]
          5. +-commutative56.3%

            \[\leadsto -\frac{\frac{\color{blue}{y \cdot \left(-z\right) + x}}{a}}{z} \]
          6. fma-define56.3%

            \[\leadsto -\frac{\frac{\color{blue}{\mathsf{fma}\left(y, -z, x\right)}}{a}}{z} \]
        7. Simplified56.3%

          \[\leadsto \color{blue}{-\frac{\frac{\mathsf{fma}\left(y, -z, x\right)}{a}}{z}} \]
        8. Taylor expanded in y around 0 51.2%

          \[\leadsto -\frac{\color{blue}{\frac{x}{a}}}{z} \]
      3. Recombined 4 regimes into one program.
      4. Final simplification58.8%

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+139}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-55}:\\ \;\;\;\;y \cdot \frac{z}{-t}\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-112}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-34}:\\ \;\;\;\;\frac{\frac{x}{a}}{-z}\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+29}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 7: 61.6% accurate, 0.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.55 \cdot 10^{+47}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq 5.4 \cdot 10^{-36}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;a \leq 3 \cdot 10^{+101} \lor \neg \left(a \leq 1.2 \cdot 10^{+160}\right):\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (if (<= a -1.55e+47)
         (/ y a)
         (if (<= a 5.4e-36)
           (/ (- x (* y z)) t)
           (if (or (<= a 3e+101) (not (<= a 1.2e+160)))
             (/ x (- t (* z a)))
             (/ y a)))))
      double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (a <= -1.55e+47) {
      		tmp = y / a;
      	} else if (a <= 5.4e-36) {
      		tmp = (x - (y * z)) / t;
      	} else if ((a <= 3e+101) || !(a <= 1.2e+160)) {
      		tmp = x / (t - (z * a));
      	} else {
      		tmp = y / a;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t, a)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8) :: tmp
          if (a <= (-1.55d+47)) then
              tmp = y / a
          else if (a <= 5.4d-36) then
              tmp = (x - (y * z)) / t
          else if ((a <= 3d+101) .or. (.not. (a <= 1.2d+160))) then
              tmp = x / (t - (z * a))
          else
              tmp = y / a
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (a <= -1.55e+47) {
      		tmp = y / a;
      	} else if (a <= 5.4e-36) {
      		tmp = (x - (y * z)) / t;
      	} else if ((a <= 3e+101) || !(a <= 1.2e+160)) {
      		tmp = x / (t - (z * a));
      	} else {
      		tmp = y / a;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	tmp = 0
      	if a <= -1.55e+47:
      		tmp = y / a
      	elif a <= 5.4e-36:
      		tmp = (x - (y * z)) / t
      	elif (a <= 3e+101) or not (a <= 1.2e+160):
      		tmp = x / (t - (z * a))
      	else:
      		tmp = y / a
      	return tmp
      
      function code(x, y, z, t, a)
      	tmp = 0.0
      	if (a <= -1.55e+47)
      		tmp = Float64(y / a);
      	elseif (a <= 5.4e-36)
      		tmp = Float64(Float64(x - Float64(y * z)) / t);
      	elseif ((a <= 3e+101) || !(a <= 1.2e+160))
      		tmp = Float64(x / Float64(t - Float64(z * a)));
      	else
      		tmp = Float64(y / a);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	tmp = 0.0;
      	if (a <= -1.55e+47)
      		tmp = y / a;
      	elseif (a <= 5.4e-36)
      		tmp = (x - (y * z)) / t;
      	elseif ((a <= 3e+101) || ~((a <= 1.2e+160)))
      		tmp = x / (t - (z * a));
      	else
      		tmp = y / a;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.55e+47], N[(y / a), $MachinePrecision], If[LessEqual[a, 5.4e-36], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[a, 3e+101], N[Not[LessEqual[a, 1.2e+160]], $MachinePrecision]], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;a \leq -1.55 \cdot 10^{+47}:\\
      \;\;\;\;\frac{y}{a}\\
      
      \mathbf{elif}\;a \leq 5.4 \cdot 10^{-36}:\\
      \;\;\;\;\frac{x - y \cdot z}{t}\\
      
      \mathbf{elif}\;a \leq 3 \cdot 10^{+101} \lor \neg \left(a \leq 1.2 \cdot 10^{+160}\right):\\
      \;\;\;\;\frac{x}{t - z \cdot a}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{y}{a}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if a < -1.55e47 or 2.99999999999999993e101 < a < 1.2000000000000001e160

        1. Initial program 68.0%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative68.0%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified68.0%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in z around inf 59.8%

          \[\leadsto \color{blue}{\frac{y}{a}} \]

        if -1.55e47 < a < 5.40000000000000015e-36

        1. Initial program 94.2%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative94.2%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified94.2%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in t around inf 76.2%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t}} \]

        if 5.40000000000000015e-36 < a < 2.99999999999999993e101 or 1.2000000000000001e160 < a

        1. Initial program 84.3%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative84.3%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified84.3%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in x around inf 63.9%

          \[\leadsto \color{blue}{\frac{x}{t - a \cdot z}} \]
        6. Step-by-step derivation
          1. *-commutative63.9%

            \[\leadsto \frac{x}{t - \color{blue}{z \cdot a}} \]
        7. Simplified63.9%

          \[\leadsto \color{blue}{\frac{x}{t - z \cdot a}} \]
      3. Recombined 3 regimes into one program.
      4. Final simplification69.2%

        \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.55 \cdot 10^{+47}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq 5.4 \cdot 10^{-36}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;a \leq 3 \cdot 10^{+101} \lor \neg \left(a \leq 1.2 \cdot 10^{+160}\right):\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 8: 51.9% accurate, 0.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+139}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{-111}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-35}:\\ \;\;\;\;\frac{\frac{x}{a}}{-z}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+35}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (if (<= z -3.7e+139)
         (/ y a)
         (if (<= z 5.2e-111)
           (/ x t)
           (if (<= z 8e-35)
             (/ (/ x a) (- z))
             (if (<= z 1.25e+35) (/ x t) (/ y a))))))
      double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (z <= -3.7e+139) {
      		tmp = y / a;
      	} else if (z <= 5.2e-111) {
      		tmp = x / t;
      	} else if (z <= 8e-35) {
      		tmp = (x / a) / -z;
      	} else if (z <= 1.25e+35) {
      		tmp = x / t;
      	} else {
      		tmp = y / a;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t, a)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8) :: tmp
          if (z <= (-3.7d+139)) then
              tmp = y / a
          else if (z <= 5.2d-111) then
              tmp = x / t
          else if (z <= 8d-35) then
              tmp = (x / a) / -z
          else if (z <= 1.25d+35) then
              tmp = x / t
          else
              tmp = y / a
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (z <= -3.7e+139) {
      		tmp = y / a;
      	} else if (z <= 5.2e-111) {
      		tmp = x / t;
      	} else if (z <= 8e-35) {
      		tmp = (x / a) / -z;
      	} else if (z <= 1.25e+35) {
      		tmp = x / t;
      	} else {
      		tmp = y / a;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	tmp = 0
      	if z <= -3.7e+139:
      		tmp = y / a
      	elif z <= 5.2e-111:
      		tmp = x / t
      	elif z <= 8e-35:
      		tmp = (x / a) / -z
      	elif z <= 1.25e+35:
      		tmp = x / t
      	else:
      		tmp = y / a
      	return tmp
      
      function code(x, y, z, t, a)
      	tmp = 0.0
      	if (z <= -3.7e+139)
      		tmp = Float64(y / a);
      	elseif (z <= 5.2e-111)
      		tmp = Float64(x / t);
      	elseif (z <= 8e-35)
      		tmp = Float64(Float64(x / a) / Float64(-z));
      	elseif (z <= 1.25e+35)
      		tmp = Float64(x / t);
      	else
      		tmp = Float64(y / a);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	tmp = 0.0;
      	if (z <= -3.7e+139)
      		tmp = y / a;
      	elseif (z <= 5.2e-111)
      		tmp = x / t;
      	elseif (z <= 8e-35)
      		tmp = (x / a) / -z;
      	elseif (z <= 1.25e+35)
      		tmp = x / t;
      	else
      		tmp = y / a;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.7e+139], N[(y / a), $MachinePrecision], If[LessEqual[z, 5.2e-111], N[(x / t), $MachinePrecision], If[LessEqual[z, 8e-35], N[(N[(x / a), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[z, 1.25e+35], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -3.7 \cdot 10^{+139}:\\
      \;\;\;\;\frac{y}{a}\\
      
      \mathbf{elif}\;z \leq 5.2 \cdot 10^{-111}:\\
      \;\;\;\;\frac{x}{t}\\
      
      \mathbf{elif}\;z \leq 8 \cdot 10^{-35}:\\
      \;\;\;\;\frac{\frac{x}{a}}{-z}\\
      
      \mathbf{elif}\;z \leq 1.25 \cdot 10^{+35}:\\
      \;\;\;\;\frac{x}{t}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{y}{a}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if z < -3.69999999999999992e139 or 1.25000000000000005e35 < z

        1. Initial program 67.3%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative67.3%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified67.3%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in z around inf 62.9%

          \[\leadsto \color{blue}{\frac{y}{a}} \]

        if -3.69999999999999992e139 < z < 5.19999999999999965e-111 or 8.00000000000000006e-35 < z < 1.25000000000000005e35

        1. Initial program 95.2%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative95.2%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified95.2%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in z around 0 52.1%

          \[\leadsto \color{blue}{\frac{x}{t}} \]

        if 5.19999999999999965e-111 < z < 8.00000000000000006e-35

        1. Initial program 99.4%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative99.4%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified99.4%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in t around 0 56.2%

          \[\leadsto \color{blue}{-1 \cdot \frac{x - y \cdot z}{a \cdot z}} \]
        6. Step-by-step derivation
          1. mul-1-neg56.2%

            \[\leadsto \color{blue}{-\frac{x - y \cdot z}{a \cdot z}} \]
          2. associate-/r*56.3%

            \[\leadsto -\color{blue}{\frac{\frac{x - y \cdot z}{a}}{z}} \]
          3. sub-neg56.3%

            \[\leadsto -\frac{\frac{\color{blue}{x + \left(-y \cdot z\right)}}{a}}{z} \]
          4. distribute-rgt-neg-out56.3%

            \[\leadsto -\frac{\frac{x + \color{blue}{y \cdot \left(-z\right)}}{a}}{z} \]
          5. +-commutative56.3%

            \[\leadsto -\frac{\frac{\color{blue}{y \cdot \left(-z\right) + x}}{a}}{z} \]
          6. fma-define56.3%

            \[\leadsto -\frac{\frac{\color{blue}{\mathsf{fma}\left(y, -z, x\right)}}{a}}{z} \]
        7. Simplified56.3%

          \[\leadsto \color{blue}{-\frac{\frac{\mathsf{fma}\left(y, -z, x\right)}{a}}{z}} \]
        8. Taylor expanded in y around 0 51.2%

          \[\leadsto -\frac{\color{blue}{\frac{x}{a}}}{z} \]
      3. Recombined 3 regimes into one program.
      4. Final simplification56.0%

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+139}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{-111}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-35}:\\ \;\;\;\;\frac{\frac{x}{a}}{-z}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+35}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 9: 90.4% accurate, 0.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{+164} \lor \neg \left(z \leq 2.3 \cdot 10^{+195}\right):\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (if (or (<= z -7.2e+164) (not (<= z 2.3e+195)))
         (/ (- y (/ x z)) a)
         (/ (- x (* y z)) (- t (* z a)))))
      double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if ((z <= -7.2e+164) || !(z <= 2.3e+195)) {
      		tmp = (y - (x / z)) / a;
      	} else {
      		tmp = (x - (y * z)) / (t - (z * a));
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t, a)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8) :: tmp
          if ((z <= (-7.2d+164)) .or. (.not. (z <= 2.3d+195))) then
              tmp = (y - (x / z)) / a
          else
              tmp = (x - (y * z)) / (t - (z * a))
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if ((z <= -7.2e+164) || !(z <= 2.3e+195)) {
      		tmp = (y - (x / z)) / a;
      	} else {
      		tmp = (x - (y * z)) / (t - (z * a));
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	tmp = 0
      	if (z <= -7.2e+164) or not (z <= 2.3e+195):
      		tmp = (y - (x / z)) / a
      	else:
      		tmp = (x - (y * z)) / (t - (z * a))
      	return tmp
      
      function code(x, y, z, t, a)
      	tmp = 0.0
      	if ((z <= -7.2e+164) || !(z <= 2.3e+195))
      		tmp = Float64(Float64(y - Float64(x / z)) / a);
      	else
      		tmp = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	tmp = 0.0;
      	if ((z <= -7.2e+164) || ~((z <= 2.3e+195)))
      		tmp = (y - (x / z)) / a;
      	else
      		tmp = (x - (y * z)) / (t - (z * a));
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.2e+164], N[Not[LessEqual[z, 2.3e+195]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -7.2 \cdot 10^{+164} \lor \neg \left(z \leq 2.3 \cdot 10^{+195}\right):\\
      \;\;\;\;\frac{y - \frac{x}{z}}{a}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -7.19999999999999981e164 or 2.3000000000000001e195 < z

        1. Initial program 58.2%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative58.2%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified58.2%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in z around inf 58.2%

          \[\leadsto \frac{\color{blue}{z \cdot \left(\frac{x}{z} - y\right)}}{t - z \cdot a} \]
        6. Taylor expanded in t around 0 85.5%

          \[\leadsto \color{blue}{-1 \cdot \frac{\frac{x}{z} - y}{a}} \]
        7. Step-by-step derivation
          1. mul-1-neg85.5%

            \[\leadsto \color{blue}{-\frac{\frac{x}{z} - y}{a}} \]
          2. distribute-neg-frac285.5%

            \[\leadsto \color{blue}{\frac{\frac{x}{z} - y}{-a}} \]
        8. Simplified85.5%

          \[\leadsto \color{blue}{\frac{\frac{x}{z} - y}{-a}} \]

        if -7.19999999999999981e164 < z < 2.3000000000000001e195

        1. Initial program 92.4%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Add Preprocessing
      3. Recombined 2 regimes into one program.
      4. Final simplification90.9%

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{+164} \lor \neg \left(z \leq 2.3 \cdot 10^{+195}\right):\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 10: 69.6% accurate, 0.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -3.8 \cdot 10^{+46} \lor \neg \left(a \leq 7 \cdot 10^{-11}\right):\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (if (or (<= a -3.8e+46) (not (<= a 7e-11)))
         (/ (- y (/ x z)) a)
         (/ (- x (* y z)) t)))
      double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if ((a <= -3.8e+46) || !(a <= 7e-11)) {
      		tmp = (y - (x / z)) / a;
      	} else {
      		tmp = (x - (y * z)) / t;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t, a)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8) :: tmp
          if ((a <= (-3.8d+46)) .or. (.not. (a <= 7d-11))) then
              tmp = (y - (x / z)) / a
          else
              tmp = (x - (y * z)) / t
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if ((a <= -3.8e+46) || !(a <= 7e-11)) {
      		tmp = (y - (x / z)) / a;
      	} else {
      		tmp = (x - (y * z)) / t;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	tmp = 0
      	if (a <= -3.8e+46) or not (a <= 7e-11):
      		tmp = (y - (x / z)) / a
      	else:
      		tmp = (x - (y * z)) / t
      	return tmp
      
      function code(x, y, z, t, a)
      	tmp = 0.0
      	if ((a <= -3.8e+46) || !(a <= 7e-11))
      		tmp = Float64(Float64(y - Float64(x / z)) / a);
      	else
      		tmp = Float64(Float64(x - Float64(y * z)) / t);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	tmp = 0.0;
      	if ((a <= -3.8e+46) || ~((a <= 7e-11)))
      		tmp = (y - (x / z)) / a;
      	else
      		tmp = (x - (y * z)) / t;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.8e+46], N[Not[LessEqual[a, 7e-11]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;a \leq -3.8 \cdot 10^{+46} \lor \neg \left(a \leq 7 \cdot 10^{-11}\right):\\
      \;\;\;\;\frac{y - \frac{x}{z}}{a}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x - y \cdot z}{t}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if a < -3.7999999999999999e46 or 7.00000000000000038e-11 < a

        1. Initial program 74.9%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative74.9%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified74.9%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in z around inf 69.2%

          \[\leadsto \frac{\color{blue}{z \cdot \left(\frac{x}{z} - y\right)}}{t - z \cdot a} \]
        6. Taylor expanded in t around 0 78.2%

          \[\leadsto \color{blue}{-1 \cdot \frac{\frac{x}{z} - y}{a}} \]
        7. Step-by-step derivation
          1. mul-1-neg78.2%

            \[\leadsto \color{blue}{-\frac{\frac{x}{z} - y}{a}} \]
          2. distribute-neg-frac278.2%

            \[\leadsto \color{blue}{\frac{\frac{x}{z} - y}{-a}} \]
        8. Simplified78.2%

          \[\leadsto \color{blue}{\frac{\frac{x}{z} - y}{-a}} \]

        if -3.7999999999999999e46 < a < 7.00000000000000038e-11

        1. Initial program 93.8%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative93.8%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified93.8%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in t around inf 75.7%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t}} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification76.8%

        \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.8 \cdot 10^{+46} \lor \neg \left(a \leq 7 \cdot 10^{-11}\right):\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 11: 52.6% accurate, 0.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+139} \lor \neg \left(z \leq 1.1 \cdot 10^{+30}\right):\\ \;\;\;\;\frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t}\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (if (or (<= z -3.7e+139) (not (<= z 1.1e+30))) (/ y a) (/ x t)))
      double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if ((z <= -3.7e+139) || !(z <= 1.1e+30)) {
      		tmp = y / a;
      	} else {
      		tmp = x / t;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t, a)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8) :: tmp
          if ((z <= (-3.7d+139)) .or. (.not. (z <= 1.1d+30))) then
              tmp = y / a
          else
              tmp = x / t
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if ((z <= -3.7e+139) || !(z <= 1.1e+30)) {
      		tmp = y / a;
      	} else {
      		tmp = x / t;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	tmp = 0
      	if (z <= -3.7e+139) or not (z <= 1.1e+30):
      		tmp = y / a
      	else:
      		tmp = x / t
      	return tmp
      
      function code(x, y, z, t, a)
      	tmp = 0.0
      	if ((z <= -3.7e+139) || !(z <= 1.1e+30))
      		tmp = Float64(y / a);
      	else
      		tmp = Float64(x / t);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	tmp = 0.0;
      	if ((z <= -3.7e+139) || ~((z <= 1.1e+30)))
      		tmp = y / a;
      	else
      		tmp = x / t;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.7e+139], N[Not[LessEqual[z, 1.1e+30]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -3.7 \cdot 10^{+139} \lor \neg \left(z \leq 1.1 \cdot 10^{+30}\right):\\
      \;\;\;\;\frac{y}{a}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x}{t}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -3.69999999999999992e139 or 1.1e30 < z

        1. Initial program 67.3%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative67.3%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified67.3%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in z around inf 62.9%

          \[\leadsto \color{blue}{\frac{y}{a}} \]

        if -3.69999999999999992e139 < z < 1.1e30

        1. Initial program 95.7%

          \[\frac{x - y \cdot z}{t - a \cdot z} \]
        2. Step-by-step derivation
          1. *-commutative95.7%

            \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
        3. Simplified95.7%

          \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
        4. Add Preprocessing
        5. Taylor expanded in z around 0 49.1%

          \[\leadsto \color{blue}{\frac{x}{t}} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification54.1%

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+139} \lor \neg \left(z \leq 1.1 \cdot 10^{+30}\right):\\ \;\;\;\;\frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 12: 35.1% accurate, 3.7× speedup?

      \[\begin{array}{l} \\ \frac{x}{t} \end{array} \]
      (FPCore (x y z t a) :precision binary64 (/ x t))
      double code(double x, double y, double z, double t, double a) {
      	return x / t;
      }
      
      real(8) function code(x, y, z, t, a)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          code = x / t
      end function
      
      public static double code(double x, double y, double z, double t, double a) {
      	return x / t;
      }
      
      def code(x, y, z, t, a):
      	return x / t
      
      function code(x, y, z, t, a)
      	return Float64(x / t)
      end
      
      function tmp = code(x, y, z, t, a)
      	tmp = x / t;
      end
      
      code[x_, y_, z_, t_, a_] := N[(x / t), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \frac{x}{t}
      \end{array}
      
      Derivation
      1. Initial program 85.3%

        \[\frac{x - y \cdot z}{t - a \cdot z} \]
      2. Step-by-step derivation
        1. *-commutative85.3%

          \[\leadsto \frac{x - y \cdot z}{t - \color{blue}{z \cdot a}} \]
      3. Simplified85.3%

        \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
      4. Add Preprocessing
      5. Taylor expanded in z around 0 35.0%

        \[\leadsto \color{blue}{\frac{x}{t}} \]
      6. Add Preprocessing

      Developer target: 97.3% accurate, 0.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := t - a \cdot z\\ t_2 := \frac{x}{t\_1} - \frac{y}{\frac{t}{z} - a}\\ \mathbf{if}\;z < -32113435955957344:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\ \;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (let* ((t_1 (- t (* a z))) (t_2 (- (/ x t_1) (/ y (- (/ t z) a)))))
         (if (< z -32113435955957344.0)
           t_2
           (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 t_1)) t_2))))
      double code(double x, double y, double z, double t, double a) {
      	double t_1 = t - (a * z);
      	double t_2 = (x / t_1) - (y / ((t / z) - a));
      	double tmp;
      	if (z < -32113435955957344.0) {
      		tmp = t_2;
      	} else if (z < 3.5139522372978296e-86) {
      		tmp = (x - (y * z)) * (1.0 / t_1);
      	} else {
      		tmp = t_2;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t, a)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8) :: t_1
          real(8) :: t_2
          real(8) :: tmp
          t_1 = t - (a * z)
          t_2 = (x / t_1) - (y / ((t / z) - a))
          if (z < (-32113435955957344.0d0)) then
              tmp = t_2
          else if (z < 3.5139522372978296d-86) then
              tmp = (x - (y * z)) * (1.0d0 / t_1)
          else
              tmp = t_2
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a) {
      	double t_1 = t - (a * z);
      	double t_2 = (x / t_1) - (y / ((t / z) - a));
      	double tmp;
      	if (z < -32113435955957344.0) {
      		tmp = t_2;
      	} else if (z < 3.5139522372978296e-86) {
      		tmp = (x - (y * z)) * (1.0 / t_1);
      	} else {
      		tmp = t_2;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	t_1 = t - (a * z)
      	t_2 = (x / t_1) - (y / ((t / z) - a))
      	tmp = 0
      	if z < -32113435955957344.0:
      		tmp = t_2
      	elif z < 3.5139522372978296e-86:
      		tmp = (x - (y * z)) * (1.0 / t_1)
      	else:
      		tmp = t_2
      	return tmp
      
      function code(x, y, z, t, a)
      	t_1 = Float64(t - Float64(a * z))
      	t_2 = Float64(Float64(x / t_1) - Float64(y / Float64(Float64(t / z) - a)))
      	tmp = 0.0
      	if (z < -32113435955957344.0)
      		tmp = t_2;
      	elseif (z < 3.5139522372978296e-86)
      		tmp = Float64(Float64(x - Float64(y * z)) * Float64(1.0 / t_1));
      	else
      		tmp = t_2;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	t_1 = t - (a * z);
      	t_2 = (x / t_1) - (y / ((t / z) - a));
      	tmp = 0.0;
      	if (z < -32113435955957344.0)
      		tmp = t_2;
      	elseif (z < 3.5139522372978296e-86)
      		tmp = (x - (y * z)) * (1.0 / t_1);
      	else
      		tmp = t_2;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t$95$1), $MachinePrecision] - N[(y / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -32113435955957344.0], t$95$2, If[Less[z, 3.5139522372978296e-86], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := t - a \cdot z\\
      t_2 := \frac{x}{t\_1} - \frac{y}{\frac{t}{z} - a}\\
      \mathbf{if}\;z < -32113435955957344:\\
      \;\;\;\;t\_2\\
      
      \mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\
      \;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t\_1}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_2\\
      
      
      \end{array}
      \end{array}
      

      Reproduce

      ?
      herbie shell --seed 2024101 
      (FPCore (x y z t a)
        :name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
        :precision binary64
      
        :alt
        (if (< z -32113435955957344.0) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a)))))
      
        (/ (- x (* y z)) (- t (* a z))))