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

Percentage Accurate: 85.4% → 94.5%
Time: 13.2s
Alternatives: 9
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 9 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.4% 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.5% accurate, 0.2× 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 -\infty:\\ \;\;\;\;y \cdot \left(\frac{z}{z \cdot a - t} + \frac{x}{y \cdot t\_1}\right)\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-319} \lor \neg \left(t\_2 \leq 10^{-282}\right) \land t\_2 \leq 2 \cdot 10^{+255}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \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 (- INFINITY))
     (* y (+ (/ z (- (* z a) t)) (/ x (* y t_1))))
     (if (or (<= t_2 -5e-319) (and (not (<= t_2 1e-282)) (<= t_2 2e+255)))
       t_2
       (/ y (- a (/ t z)))))))
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 <= -((double) INFINITY)) {
		tmp = y * ((z / ((z * a) - t)) + (x / (y * t_1)));
	} else if ((t_2 <= -5e-319) || (!(t_2 <= 1e-282) && (t_2 <= 2e+255))) {
		tmp = t_2;
	} else {
		tmp = y / (a - (t / z));
	}
	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 <= -Double.POSITIVE_INFINITY) {
		tmp = y * ((z / ((z * a) - t)) + (x / (y * t_1)));
	} else if ((t_2 <= -5e-319) || (!(t_2 <= 1e-282) && (t_2 <= 2e+255))) {
		tmp = t_2;
	} else {
		tmp = y / (a - (t / z));
	}
	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 <= -math.inf:
		tmp = y * ((z / ((z * a) - t)) + (x / (y * t_1)))
	elif (t_2 <= -5e-319) or (not (t_2 <= 1e-282) and (t_2 <= 2e+255)):
		tmp = t_2
	else:
		tmp = y / (a - (t / z))
	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 <= Float64(-Inf))
		tmp = Float64(y * Float64(Float64(z / Float64(Float64(z * a) - t)) + Float64(x / Float64(y * t_1))));
	elseif ((t_2 <= -5e-319) || (!(t_2 <= 1e-282) && (t_2 <= 2e+255)))
		tmp = t_2;
	else
		tmp = Float64(y / Float64(a - Float64(t / z)));
	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 <= -Inf)
		tmp = y * ((z / ((z * a) - t)) + (x / (y * t_1)));
	elseif ((t_2 <= -5e-319) || (~((t_2 <= 1e-282)) && (t_2 <= 2e+255)))
		tmp = t_2;
	else
		tmp = y / (a - (t / z));
	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, (-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], If[Or[LessEqual[t$95$2, -5e-319], And[N[Not[LessEqual[t$95$2, 1e-282]], $MachinePrecision], LessEqual[t$95$2, 2e+255]]], t$95$2, N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $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 -\infty:\\
\;\;\;\;y \cdot \left(\frac{z}{z \cdot a - t} + \frac{x}{y \cdot t\_1}\right)\\

\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-319} \lor \neg \left(t\_2 \leq 10^{-282}\right) \land t\_2 \leq 2 \cdot 10^{+255}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0

    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 y around inf 99.8%

      \[\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.8%

        \[\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))) < -4.9999937e-319 or 1e-282 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 1.99999999999999998e255

      1. Initial program 99.7%

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

      if -4.9999937e-319 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 1e-282 or 1.99999999999999998e255 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z)))

      1. Initial program 54.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{\frac{t}{z} - a}} \]
    7. Recombined 3 regimes into one program.
    8. Final simplification97.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\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{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq -5 \cdot 10^{-319} \lor \neg \left(\frac{x - y \cdot z}{t - z \cdot a} \leq 10^{-282}\right) \land \frac{x - y \cdot z}{t - z \cdot a} \leq 2 \cdot 10^{+255}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \end{array} \]
    9. Add Preprocessing

    Alternative 2: 65.0% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{t - z \cdot a}\\ t_2 := \frac{x - y \cdot z}{t}\\ \mathbf{if}\;z \leq -2.45 \cdot 10^{+20}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-305}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{-212}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.95 \cdot 10^{-65}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 196000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+101}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (let* ((t_1 (/ x (- t (* z a)))) (t_2 (/ (- x (* y z)) t)))
       (if (<= z -2.45e+20)
         (/ y a)
         (if (<= z -2e-305)
           t_2
           (if (<= z 1.5e-212)
             t_1
             (if (<= z 2.95e-65)
               t_2
               (if (<= z 196000000000.0)
                 t_1
                 (if (<= z 2.3e+101) t_2 (/ y a)))))))))
    double code(double x, double y, double z, double t, double a) {
    	double t_1 = x / (t - (z * a));
    	double t_2 = (x - (y * z)) / t;
    	double tmp;
    	if (z <= -2.45e+20) {
    		tmp = y / a;
    	} else if (z <= -2e-305) {
    		tmp = t_2;
    	} else if (z <= 1.5e-212) {
    		tmp = t_1;
    	} else if (z <= 2.95e-65) {
    		tmp = t_2;
    	} else if (z <= 196000000000.0) {
    		tmp = t_1;
    	} else if (z <= 2.3e+101) {
    		tmp = t_2;
    	} 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) :: t_2
        real(8) :: tmp
        t_1 = x / (t - (z * a))
        t_2 = (x - (y * z)) / t
        if (z <= (-2.45d+20)) then
            tmp = y / a
        else if (z <= (-2d-305)) then
            tmp = t_2
        else if (z <= 1.5d-212) then
            tmp = t_1
        else if (z <= 2.95d-65) then
            tmp = t_2
        else if (z <= 196000000000.0d0) then
            tmp = t_1
        else if (z <= 2.3d+101) then
            tmp = t_2
        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 t_2 = (x - (y * z)) / t;
    	double tmp;
    	if (z <= -2.45e+20) {
    		tmp = y / a;
    	} else if (z <= -2e-305) {
    		tmp = t_2;
    	} else if (z <= 1.5e-212) {
    		tmp = t_1;
    	} else if (z <= 2.95e-65) {
    		tmp = t_2;
    	} else if (z <= 196000000000.0) {
    		tmp = t_1;
    	} else if (z <= 2.3e+101) {
    		tmp = t_2;
    	} else {
    		tmp = y / a;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	t_1 = x / (t - (z * a))
    	t_2 = (x - (y * z)) / t
    	tmp = 0
    	if z <= -2.45e+20:
    		tmp = y / a
    	elif z <= -2e-305:
    		tmp = t_2
    	elif z <= 1.5e-212:
    		tmp = t_1
    	elif z <= 2.95e-65:
    		tmp = t_2
    	elif z <= 196000000000.0:
    		tmp = t_1
    	elif z <= 2.3e+101:
    		tmp = t_2
    	else:
    		tmp = y / a
    	return tmp
    
    function code(x, y, z, t, a)
    	t_1 = Float64(x / Float64(t - Float64(z * a)))
    	t_2 = Float64(Float64(x - Float64(y * z)) / t)
    	tmp = 0.0
    	if (z <= -2.45e+20)
    		tmp = Float64(y / a);
    	elseif (z <= -2e-305)
    		tmp = t_2;
    	elseif (z <= 1.5e-212)
    		tmp = t_1;
    	elseif (z <= 2.95e-65)
    		tmp = t_2;
    	elseif (z <= 196000000000.0)
    		tmp = t_1;
    	elseif (z <= 2.3e+101)
    		tmp = t_2;
    	else
    		tmp = Float64(y / a);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a)
    	t_1 = x / (t - (z * a));
    	t_2 = (x - (y * z)) / t;
    	tmp = 0.0;
    	if (z <= -2.45e+20)
    		tmp = y / a;
    	elseif (z <= -2e-305)
    		tmp = t_2;
    	elseif (z <= 1.5e-212)
    		tmp = t_1;
    	elseif (z <= 2.95e-65)
    		tmp = t_2;
    	elseif (z <= 196000000000.0)
    		tmp = t_1;
    	elseif (z <= 2.3e+101)
    		tmp = t_2;
    	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]}, Block[{t$95$2 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[z, -2.45e+20], N[(y / a), $MachinePrecision], If[LessEqual[z, -2e-305], t$95$2, If[LessEqual[z, 1.5e-212], t$95$1, If[LessEqual[z, 2.95e-65], t$95$2, If[LessEqual[z, 196000000000.0], t$95$1, If[LessEqual[z, 2.3e+101], t$95$2, N[(y / a), $MachinePrecision]]]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \frac{x}{t - z \cdot a}\\
    t_2 := \frac{x - y \cdot z}{t}\\
    \mathbf{if}\;z \leq -2.45 \cdot 10^{+20}:\\
    \;\;\;\;\frac{y}{a}\\
    
    \mathbf{elif}\;z \leq -2 \cdot 10^{-305}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;z \leq 1.5 \cdot 10^{-212}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 2.95 \cdot 10^{-65}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;z \leq 196000000000:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 2.3 \cdot 10^{+101}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{y}{a}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -2.45e20 or 2.3000000000000001e101 < z

      1. Initial program 68.3%

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

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

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

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

      if -2.45e20 < z < -1.99999999999999999e-305 or 1.5000000000000001e-212 < z < 2.94999999999999989e-65 or 1.96e11 < z < 2.3000000000000001e101

      1. Initial program 97.3%

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

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

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

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

      if -1.99999999999999999e-305 < z < 1.5000000000000001e-212 or 2.94999999999999989e-65 < z < 1.96e11

      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 x around inf 91.7%

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.45 \cdot 10^{+20}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-305}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{-212}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 2.95 \cdot 10^{-65}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 196000000000:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+101}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 3: 72.8% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x - y \cdot z}{t}\\ t_2 := \frac{y}{a - \frac{t}{z}}\\ \mathbf{if}\;z \leq -2.9 \cdot 10^{+20}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-310}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-212}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 8600000000000:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (let* ((t_1 (/ (- x (* y z)) t)) (t_2 (/ y (- a (/ t z)))))
       (if (<= z -2.9e+20)
         t_2
         (if (<= z -1e-310)
           t_1
           (if (<= z 1.2e-212)
             (/ x (- t (* z a)))
             (if (<= z 1.55e-17)
               t_1
               (if (<= z 8600000000000.0) (/ (- y (/ x z)) a) t_2)))))))
    double code(double x, double y, double z, double t, double a) {
    	double t_1 = (x - (y * z)) / t;
    	double t_2 = y / (a - (t / z));
    	double tmp;
    	if (z <= -2.9e+20) {
    		tmp = t_2;
    	} else if (z <= -1e-310) {
    		tmp = t_1;
    	} else if (z <= 1.2e-212) {
    		tmp = x / (t - (z * a));
    	} else if (z <= 1.55e-17) {
    		tmp = t_1;
    	} else if (z <= 8600000000000.0) {
    		tmp = (y - (x / z)) / a;
    	} 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 = (x - (y * z)) / t
        t_2 = y / (a - (t / z))
        if (z <= (-2.9d+20)) then
            tmp = t_2
        else if (z <= (-1d-310)) then
            tmp = t_1
        else if (z <= 1.2d-212) then
            tmp = x / (t - (z * a))
        else if (z <= 1.55d-17) then
            tmp = t_1
        else if (z <= 8600000000000.0d0) then
            tmp = (y - (x / z)) / a
        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 = (x - (y * z)) / t;
    	double t_2 = y / (a - (t / z));
    	double tmp;
    	if (z <= -2.9e+20) {
    		tmp = t_2;
    	} else if (z <= -1e-310) {
    		tmp = t_1;
    	} else if (z <= 1.2e-212) {
    		tmp = x / (t - (z * a));
    	} else if (z <= 1.55e-17) {
    		tmp = t_1;
    	} else if (z <= 8600000000000.0) {
    		tmp = (y - (x / z)) / a;
    	} else {
    		tmp = t_2;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	t_1 = (x - (y * z)) / t
    	t_2 = y / (a - (t / z))
    	tmp = 0
    	if z <= -2.9e+20:
    		tmp = t_2
    	elif z <= -1e-310:
    		tmp = t_1
    	elif z <= 1.2e-212:
    		tmp = x / (t - (z * a))
    	elif z <= 1.55e-17:
    		tmp = t_1
    	elif z <= 8600000000000.0:
    		tmp = (y - (x / z)) / a
    	else:
    		tmp = t_2
    	return tmp
    
    function code(x, y, z, t, a)
    	t_1 = Float64(Float64(x - Float64(y * z)) / t)
    	t_2 = Float64(y / Float64(a - Float64(t / z)))
    	tmp = 0.0
    	if (z <= -2.9e+20)
    		tmp = t_2;
    	elseif (z <= -1e-310)
    		tmp = t_1;
    	elseif (z <= 1.2e-212)
    		tmp = Float64(x / Float64(t - Float64(z * a)));
    	elseif (z <= 1.55e-17)
    		tmp = t_1;
    	elseif (z <= 8600000000000.0)
    		tmp = Float64(Float64(y - Float64(x / z)) / a);
    	else
    		tmp = t_2;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a)
    	t_1 = (x - (y * z)) / t;
    	t_2 = y / (a - (t / z));
    	tmp = 0.0;
    	if (z <= -2.9e+20)
    		tmp = t_2;
    	elseif (z <= -1e-310)
    		tmp = t_1;
    	elseif (z <= 1.2e-212)
    		tmp = x / (t - (z * a));
    	elseif (z <= 1.55e-17)
    		tmp = t_1;
    	elseif (z <= 8600000000000.0)
    		tmp = (y - (x / z)) / a;
    	else
    		tmp = t_2;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e+20], t$95$2, If[LessEqual[z, -1e-310], t$95$1, If[LessEqual[z, 1.2e-212], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e-17], t$95$1, If[LessEqual[z, 8600000000000.0], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], t$95$2]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \frac{x - y \cdot z}{t}\\
    t_2 := \frac{y}{a - \frac{t}{z}}\\
    \mathbf{if}\;z \leq -2.9 \cdot 10^{+20}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;z \leq -1 \cdot 10^{-310}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 1.2 \cdot 10^{-212}:\\
    \;\;\;\;\frac{x}{t - z \cdot a}\\
    
    \mathbf{elif}\;z \leq 1.55 \cdot 10^{-17}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 8600000000000:\\
    \;\;\;\;\frac{y - \frac{x}{z}}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_2\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if z < -2.9e20 or 8.6e12 < z

      1. Initial program 70.9%

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

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

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

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

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

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

          \[\leadsto \frac{\color{blue}{-y}}{\frac{t}{z} - a} \]
      8. Simplified81.6%

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

      if -2.9e20 < z < -9.999999999999969e-311 or 1.19999999999999995e-212 < z < 1.5499999999999999e-17

      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 t around inf 83.8%

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

      if -9.999999999999969e-311 < z < 1.19999999999999995e-212

      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 x around inf 99.9%

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

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

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

      if 1.5499999999999999e-17 < z < 8.6e12

      1. Initial program 99.6%

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t - a \cdot z} + \frac{x}{t - a \cdot z}} \]
      6. Taylor expanded in a around inf 99.8%

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

          \[\leadsto \frac{y + \color{blue}{\left(-\frac{x}{z}\right)}}{a} \]
        2. unsub-neg99.8%

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+20}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-212}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-17}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 8600000000000:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 4: 65.1% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{t - z \cdot a}\\ \mathbf{if}\;z \leq -1.42 \cdot 10^{+20}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 15000000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+71}:\\ \;\;\;\;\frac{y}{\frac{t}{-z}}\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{+100}:\\ \;\;\;\;t\_1\\ \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 -1.42e+20)
         (/ y a)
         (if (<= z 15000000000000.0)
           t_1
           (if (<= z 9e+71) (/ y (/ t (- z))) (if (<= z 6.4e+100) t_1 (/ 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 <= -1.42e+20) {
    		tmp = y / a;
    	} else if (z <= 15000000000000.0) {
    		tmp = t_1;
    	} else if (z <= 9e+71) {
    		tmp = y / (t / -z);
    	} else if (z <= 6.4e+100) {
    		tmp = t_1;
    	} 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 <= (-1.42d+20)) then
            tmp = y / a
        else if (z <= 15000000000000.0d0) then
            tmp = t_1
        else if (z <= 9d+71) then
            tmp = y / (t / -z)
        else if (z <= 6.4d+100) then
            tmp = t_1
        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 <= -1.42e+20) {
    		tmp = y / a;
    	} else if (z <= 15000000000000.0) {
    		tmp = t_1;
    	} else if (z <= 9e+71) {
    		tmp = y / (t / -z);
    	} else if (z <= 6.4e+100) {
    		tmp = t_1;
    	} else {
    		tmp = y / a;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	t_1 = x / (t - (z * a))
    	tmp = 0
    	if z <= -1.42e+20:
    		tmp = y / a
    	elif z <= 15000000000000.0:
    		tmp = t_1
    	elif z <= 9e+71:
    		tmp = y / (t / -z)
    	elif z <= 6.4e+100:
    		tmp = t_1
    	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 <= -1.42e+20)
    		tmp = Float64(y / a);
    	elseif (z <= 15000000000000.0)
    		tmp = t_1;
    	elseif (z <= 9e+71)
    		tmp = Float64(y / Float64(t / Float64(-z)));
    	elseif (z <= 6.4e+100)
    		tmp = t_1;
    	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 <= -1.42e+20)
    		tmp = y / a;
    	elseif (z <= 15000000000000.0)
    		tmp = t_1;
    	elseif (z <= 9e+71)
    		tmp = y / (t / -z);
    	elseif (z <= 6.4e+100)
    		tmp = t_1;
    	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, -1.42e+20], N[(y / a), $MachinePrecision], If[LessEqual[z, 15000000000000.0], t$95$1, If[LessEqual[z, 9e+71], N[(y / N[(t / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.4e+100], t$95$1, N[(y / a), $MachinePrecision]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \frac{x}{t - z \cdot a}\\
    \mathbf{if}\;z \leq -1.42 \cdot 10^{+20}:\\
    \;\;\;\;\frac{y}{a}\\
    
    \mathbf{elif}\;z \leq 15000000000000:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 9 \cdot 10^{+71}:\\
    \;\;\;\;\frac{y}{\frac{t}{-z}}\\
    
    \mathbf{elif}\;z \leq 6.4 \cdot 10^{+100}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{y}{a}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -1.42e20 or 6.3999999999999998e100 < z

      1. Initial program 68.3%

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

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

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

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

      if -1.42e20 < z < 1.5e13 or 9.00000000000000087e71 < z < 6.3999999999999998e100

      1. Initial program 98.4%

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

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

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

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

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

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

      if 1.5e13 < z < 9.00000000000000087e71

      1. Initial program 92.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{\frac{t}{z} - a}} \]
      9. Taylor expanded in t around inf 56.3%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.42 \cdot 10^{+20}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 15000000000000:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+71}:\\ \;\;\;\;\frac{y}{\frac{t}{-z}}\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{+100}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 5: 65.0% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.8 \cdot 10^{+70}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;a \leq -300000000 \lor \neg \left(a \leq 2.9 \cdot 10^{-105}\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 (<= a -2.8e+70)
       (/ x (- t (* z a)))
       (if (or (<= a -300000000.0) (not (<= a 2.9e-105)))
         (/ (- y (/ x z)) a)
         (/ (- x (* y z)) t))))
    double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if (a <= -2.8e+70) {
    		tmp = x / (t - (z * a));
    	} else if ((a <= -300000000.0) || !(a <= 2.9e-105)) {
    		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 <= (-2.8d+70)) then
            tmp = x / (t - (z * a))
        else if ((a <= (-300000000.0d0)) .or. (.not. (a <= 2.9d-105))) 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 <= -2.8e+70) {
    		tmp = x / (t - (z * a));
    	} else if ((a <= -300000000.0) || !(a <= 2.9e-105)) {
    		tmp = (y - (x / z)) / a;
    	} else {
    		tmp = (x - (y * z)) / t;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	tmp = 0
    	if a <= -2.8e+70:
    		tmp = x / (t - (z * a))
    	elif (a <= -300000000.0) or not (a <= 2.9e-105):
    		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 <= -2.8e+70)
    		tmp = Float64(x / Float64(t - Float64(z * a)));
    	elseif ((a <= -300000000.0) || !(a <= 2.9e-105))
    		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 <= -2.8e+70)
    		tmp = x / (t - (z * a));
    	elseif ((a <= -300000000.0) || ~((a <= 2.9e-105)))
    		tmp = (y - (x / z)) / a;
    	else
    		tmp = (x - (y * z)) / t;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.8e+70], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -300000000.0], N[Not[LessEqual[a, 2.9e-105]], $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 -2.8 \cdot 10^{+70}:\\
    \;\;\;\;\frac{x}{t - z \cdot a}\\
    
    \mathbf{elif}\;a \leq -300000000 \lor \neg \left(a \leq 2.9 \cdot 10^{-105}\right):\\
    \;\;\;\;\frac{y - \frac{x}{z}}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x - y \cdot z}{t}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if a < -2.7999999999999999e70

      1. Initial program 84.5%

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

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

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

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

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

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

      if -2.7999999999999999e70 < a < -3e8 or 2.90000000000000003e-105 < a

      1. Initial program 74.3%

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t - a \cdot z} + \frac{x}{t - a \cdot z}} \]
      6. Taylor expanded in a around inf 74.9%

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

          \[\leadsto \frac{y + \color{blue}{\left(-\frac{x}{z}\right)}}{a} \]
        2. unsub-neg74.9%

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

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

      if -3e8 < a < 2.90000000000000003e-105

      1. Initial program 94.8%

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.8 \cdot 10^{+70}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;a \leq -300000000 \lor \neg \left(a \leq 2.9 \cdot 10^{-105}\right):\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 6: 55.2% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+19}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-51}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+15}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (if (<= z -3.1e+19)
       (/ y a)
       (if (<= z 3.6e-51) (/ x t) (if (<= z 3e+15) (/ (- x) (* z a)) (/ y a)))))
    double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if (z <= -3.1e+19) {
    		tmp = y / a;
    	} else if (z <= 3.6e-51) {
    		tmp = x / t;
    	} else if (z <= 3e+15) {
    		tmp = -x / (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 (z <= (-3.1d+19)) then
            tmp = y / a
        else if (z <= 3.6d-51) then
            tmp = x / t
        else if (z <= 3d+15) then
            tmp = -x / (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 (z <= -3.1e+19) {
    		tmp = y / a;
    	} else if (z <= 3.6e-51) {
    		tmp = x / t;
    	} else if (z <= 3e+15) {
    		tmp = -x / (z * a);
    	} else {
    		tmp = y / a;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	tmp = 0
    	if z <= -3.1e+19:
    		tmp = y / a
    	elif z <= 3.6e-51:
    		tmp = x / t
    	elif z <= 3e+15:
    		tmp = -x / (z * a)
    	else:
    		tmp = y / a
    	return tmp
    
    function code(x, y, z, t, a)
    	tmp = 0.0
    	if (z <= -3.1e+19)
    		tmp = Float64(y / a);
    	elseif (z <= 3.6e-51)
    		tmp = Float64(x / t);
    	elseif (z <= 3e+15)
    		tmp = Float64(Float64(-x) / 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 (z <= -3.1e+19)
    		tmp = y / a;
    	elseif (z <= 3.6e-51)
    		tmp = x / t;
    	elseif (z <= 3e+15)
    		tmp = -x / (z * a);
    	else
    		tmp = y / a;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.1e+19], N[(y / a), $MachinePrecision], If[LessEqual[z, 3.6e-51], N[(x / t), $MachinePrecision], If[LessEqual[z, 3e+15], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -3.1 \cdot 10^{+19}:\\
    \;\;\;\;\frac{y}{a}\\
    
    \mathbf{elif}\;z \leq 3.6 \cdot 10^{-51}:\\
    \;\;\;\;\frac{x}{t}\\
    
    \mathbf{elif}\;z \leq 3 \cdot 10^{+15}:\\
    \;\;\;\;\frac{-x}{z \cdot a}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{y}{a}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -3.1e19 or 3e15 < z

      1. Initial program 70.7%

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

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

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

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

      if -3.1e19 < z < 3.6e-51

      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 60.2%

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

      if 3.6e-51 < z < 3e15

      1. Initial program 99.7%

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

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

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

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

          \[\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}} \]
      8. Taylor expanded in y around 0 67.6%

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

          \[\leadsto -\frac{x}{\color{blue}{z \cdot a}} \]
      10. Simplified67.6%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+19}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-51}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+15}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 7: 91.7% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.82 \cdot 10^{+165} \lor \neg \left(z \leq 8.5 \cdot 10^{+117}\right):\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \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 -1.82e+165) (not (<= z 8.5e+117)))
       (/ y (- a (/ t z)))
       (/ (- x (* y z)) (- t (* z a)))))
    double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if ((z <= -1.82e+165) || !(z <= 8.5e+117)) {
    		tmp = y / (a - (t / z));
    	} 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 <= (-1.82d+165)) .or. (.not. (z <= 8.5d+117))) then
            tmp = y / (a - (t / z))
        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 <= -1.82e+165) || !(z <= 8.5e+117)) {
    		tmp = y / (a - (t / z));
    	} else {
    		tmp = (x - (y * z)) / (t - (z * a));
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	tmp = 0
    	if (z <= -1.82e+165) or not (z <= 8.5e+117):
    		tmp = y / (a - (t / z))
    	else:
    		tmp = (x - (y * z)) / (t - (z * a))
    	return tmp
    
    function code(x, y, z, t, a)
    	tmp = 0.0
    	if ((z <= -1.82e+165) || !(z <= 8.5e+117))
    		tmp = Float64(y / Float64(a - Float64(t / z)));
    	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 <= -1.82e+165) || ~((z <= 8.5e+117)))
    		tmp = y / (a - (t / z));
    	else
    		tmp = (x - (y * z)) / (t - (z * a));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.82e+165], N[Not[LessEqual[z, 8.5e+117]], $MachinePrecision]], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $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 -1.82 \cdot 10^{+165} \lor \neg \left(z \leq 8.5 \cdot 10^{+117}\right):\\
    \;\;\;\;\frac{y}{a - \frac{t}{z}}\\
    
    \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 < -1.82000000000000003e165 or 8.49999999999999966e117 < z

      1. Initial program 61.2%

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

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

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

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

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

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

          \[\leadsto \frac{\color{blue}{-y}}{\frac{t}{z} - a} \]
      8. Simplified88.8%

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

      if -1.82000000000000003e165 < z < 8.49999999999999966e117

      1. Initial program 95.0%

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

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

    Alternative 8: 55.8% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+22} \lor \neg \left(z \leq 1.02 \cdot 10^{-17}\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.2e+22) (not (<= z 1.02e-17))) (/ y a) (/ x t)))
    double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if ((z <= -3.2e+22) || !(z <= 1.02e-17)) {
    		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.2d+22)) .or. (.not. (z <= 1.02d-17))) 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.2e+22) || !(z <= 1.02e-17)) {
    		tmp = y / a;
    	} else {
    		tmp = x / t;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	tmp = 0
    	if (z <= -3.2e+22) or not (z <= 1.02e-17):
    		tmp = y / a
    	else:
    		tmp = x / t
    	return tmp
    
    function code(x, y, z, t, a)
    	tmp = 0.0
    	if ((z <= -3.2e+22) || !(z <= 1.02e-17))
    		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.2e+22) || ~((z <= 1.02e-17)))
    		tmp = y / a;
    	else
    		tmp = x / t;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.2e+22], N[Not[LessEqual[z, 1.02e-17]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -3.2 \cdot 10^{+22} \lor \neg \left(z \leq 1.02 \cdot 10^{-17}\right):\\
    \;\;\;\;\frac{y}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x}{t}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -3.2e22 or 1.01999999999999997e-17 < z

      1. Initial program 72.6%

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

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

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

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

      if -3.2e22 < z < 1.01999999999999997e-17

      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 60.0%

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

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

    Alternative 9: 35.8% 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.2%

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

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

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

      \[\leadsto \color{blue}{\frac{x}{t}} \]
    6. Final simplification34.5%

      \[\leadsto \frac{x}{t} \]
    7. 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 2024059 
    (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))))