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

Percentage Accurate: 84.4% → 97.0%
Time: 12.5s
Alternatives: 10
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 10 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: 84.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: 97.0% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_1 := x - y \cdot z\\
t_2 := t - z \cdot a\\
t_3 := \frac{t\_1}{t\_2}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;y \cdot \left(\frac{z}{z \cdot a - t} + \frac{x}{y \cdot t\_2}\right)\\

\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-324}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{\frac{t\_1}{z}}{\frac{t}{z} - a}\\

\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\

\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))) < -inf.0

    1. Initial program 62.4%

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

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

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

      \[\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)} \]

    if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -4.94066e-324 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0

    1. Initial program 98.2%

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

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

    1. Initial program 62.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{z \cdot \left(\frac{t}{z} - a\right)} - \frac{y \cdot z}{z \cdot \left(\frac{t}{z} - a\right)}} \]
    7. Applied egg-rr62.6%

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

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

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

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

    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}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification98.6%

    \[\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^{-324}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq 0:\\ \;\;\;\;\frac{\frac{x - y \cdot z}{z}}{\frac{t}{z} - a}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq \infty:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 51.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+150}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -3.45 \cdot 10^{+28}:\\ \;\;\;\;y \cdot \frac{-z}{t}\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{-141}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{a \cdot \left(-z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.9e+150)
   (/ y a)
   (if (<= z -3.45e+28)
     (* y (/ (- z) t))
     (if (<= z 4.1e-141)
       (/ x t)
       (if (<= z 1.35e-46) (/ x (* a (- z))) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.9e+150) {
		tmp = y / a;
	} else if (z <= -3.45e+28) {
		tmp = y * (-z / t);
	} else if (z <= 4.1e-141) {
		tmp = x / t;
	} else if (z <= 1.35e-46) {
		tmp = x / (a * -z);
	} 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 <= (-1.9d+150)) then
        tmp = y / a
    else if (z <= (-3.45d+28)) then
        tmp = y * (-z / t)
    else if (z <= 4.1d-141) then
        tmp = x / t
    else if (z <= 1.35d-46) then
        tmp = x / (a * -z)
    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 <= -1.9e+150) {
		tmp = y / a;
	} else if (z <= -3.45e+28) {
		tmp = y * (-z / t);
	} else if (z <= 4.1e-141) {
		tmp = x / t;
	} else if (z <= 1.35e-46) {
		tmp = x / (a * -z);
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.9e+150:
		tmp = y / a
	elif z <= -3.45e+28:
		tmp = y * (-z / t)
	elif z <= 4.1e-141:
		tmp = x / t
	elif z <= 1.35e-46:
		tmp = x / (a * -z)
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.9e+150)
		tmp = Float64(y / a);
	elseif (z <= -3.45e+28)
		tmp = Float64(y * Float64(Float64(-z) / t));
	elseif (z <= 4.1e-141)
		tmp = Float64(x / t);
	elseif (z <= 1.35e-46)
		tmp = Float64(x / Float64(a * Float64(-z)));
	else
		tmp = Float64(y / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.9e+150)
		tmp = y / a;
	elseif (z <= -3.45e+28)
		tmp = y * (-z / t);
	elseif (z <= 4.1e-141)
		tmp = x / t;
	elseif (z <= 1.35e-46)
		tmp = x / (a * -z);
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e+150], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.45e+28], N[(y * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.1e-141], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.35e-46], N[(x / N[(a * (-z)), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+150}:\\
\;\;\;\;\frac{y}{a}\\

\mathbf{elif}\;z \leq -3.45 \cdot 10^{+28}:\\
\;\;\;\;y \cdot \frac{-z}{t}\\

\mathbf{elif}\;z \leq 4.1 \cdot 10^{-141}:\\
\;\;\;\;\frac{x}{t}\\

\mathbf{elif}\;z \leq 1.35 \cdot 10^{-46}:\\
\;\;\;\;\frac{x}{a \cdot \left(-z\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.89999999999999995e150 or 1.35e-46 < z

    1. Initial program 71.0%

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

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

      \[\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 -1.89999999999999995e150 < z < -3.45e28

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

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

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

      \[\leadsto \color{blue}{\frac{x - z \cdot y}{t}} \]
    8. Taylor expanded in x around -inf 57.0%

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

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

        \[\leadsto \color{blue}{\left(-x\right)} \cdot \left(\frac{y \cdot z}{t \cdot x} - \frac{1}{t}\right) \]
      3. associate-/l*56.5%

        \[\leadsto \left(-x\right) \cdot \left(\color{blue}{y \cdot \frac{z}{t \cdot x}} - \frac{1}{t}\right) \]
      4. *-commutative56.5%

        \[\leadsto \left(-x\right) \cdot \left(y \cdot \frac{z}{\color{blue}{x \cdot t}} - \frac{1}{t}\right) \]
    10. Simplified56.5%

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

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

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

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

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

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

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

    if -3.45e28 < z < 4.10000000000000002e-141

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

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

    if 4.10000000000000002e-141 < z < 1.35e-46

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

      \[\leadsto \frac{\color{blue}{x}}{t - z \cdot a} \]
    6. Taylor expanded in t around 0 46.3%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{a \cdot z}} \]
      2. mul-1-neg46.3%

        \[\leadsto \frac{\color{blue}{-x}}{a \cdot z} \]
      3. *-commutative46.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+150}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -3.45 \cdot 10^{+28}:\\ \;\;\;\;y \cdot \frac{-z}{t}\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{-141}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{a \cdot \left(-z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 72.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{a - \frac{t}{z}}\\ \mathbf{if}\;z \leq -3.1 \cdot 10^{+60}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-122}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-54}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ y (- a (/ t z)))))
   (if (<= z -3.1e+60)
     t_1
     (if (<= z -2.2e-122)
       (/ (- x (* y z)) t)
       (if (<= z 2.2e-54) (/ x (- t (* z a))) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y / (a - (t / z));
	double tmp;
	if (z <= -3.1e+60) {
		tmp = t_1;
	} else if (z <= -2.2e-122) {
		tmp = (x - (y * z)) / t;
	} else if (z <= 2.2e-54) {
		tmp = x / (t - (z * a));
	} else {
		tmp = t_1;
	}
	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 = y / (a - (t / z))
    if (z <= (-3.1d+60)) then
        tmp = t_1
    else if (z <= (-2.2d-122)) then
        tmp = (x - (y * z)) / t
    else if (z <= 2.2d-54) then
        tmp = x / (t - (z * a))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y / (a - (t / z));
	double tmp;
	if (z <= -3.1e+60) {
		tmp = t_1;
	} else if (z <= -2.2e-122) {
		tmp = (x - (y * z)) / t;
	} else if (z <= 2.2e-54) {
		tmp = x / (t - (z * a));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y / (a - (t / z))
	tmp = 0
	if z <= -3.1e+60:
		tmp = t_1
	elif z <= -2.2e-122:
		tmp = (x - (y * z)) / t
	elif z <= 2.2e-54:
		tmp = x / (t - (z * a))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y / Float64(a - Float64(t / z)))
	tmp = 0.0
	if (z <= -3.1e+60)
		tmp = t_1;
	elseif (z <= -2.2e-122)
		tmp = Float64(Float64(x - Float64(y * z)) / t);
	elseif (z <= 2.2e-54)
		tmp = Float64(x / Float64(t - Float64(z * a)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y / (a - (t / z));
	tmp = 0.0;
	if (z <= -3.1e+60)
		tmp = t_1;
	elseif (z <= -2.2e-122)
		tmp = (x - (y * z)) / t;
	elseif (z <= 2.2e-54)
		tmp = x / (t - (z * a));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.1e+60], t$95$1, If[LessEqual[z, -2.2e-122], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 2.2e-54], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y}{a - \frac{t}{z}}\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -2.2 \cdot 10^{-122}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\

\mathbf{elif}\;z \leq 2.2 \cdot 10^{-54}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.1000000000000001e60 or 2.2e-54 < z

    1. Initial program 73.1%

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

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

      \[\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 \frac{x - y \cdot z}{\color{blue}{z \cdot \left(\frac{t}{z} - a\right)}} \]
    6. Taylor expanded in x around 0 78.7%

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

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

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

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

    if -3.1000000000000001e60 < z < -2.2e-122

    1. Initial program 100.0%

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

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

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

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

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

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

    if -2.2e-122 < z < 2.2e-54

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+60}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-122}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-54}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 90.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+176}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+114}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -7e+176)
   (/ (- y (/ x z)) a)
   (if (<= z 3.9e+114) (/ (- x (* y z)) (- t (* z a))) (/ y (- a (/ t z))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -7e+176) {
		tmp = (y - (x / z)) / a;
	} else if (z <= 3.9e+114) {
		tmp = (x - (y * z)) / (t - (z * a));
	} else {
		tmp = y / (a - (t / z));
	}
	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 <= (-7d+176)) then
        tmp = (y - (x / z)) / a
    else if (z <= 3.9d+114) then
        tmp = (x - (y * z)) / (t - (z * a))
    else
        tmp = y / (a - (t / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -7e+176) {
		tmp = (y - (x / z)) / a;
	} else if (z <= 3.9e+114) {
		tmp = (x - (y * z)) / (t - (z * a));
	} else {
		tmp = y / (a - (t / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -7e+176:
		tmp = (y - (x / z)) / a
	elif z <= 3.9e+114:
		tmp = (x - (y * z)) / (t - (z * a))
	else:
		tmp = y / (a - (t / z))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -7e+176)
		tmp = Float64(Float64(y - Float64(x / z)) / a);
	elseif (z <= 3.9e+114)
		tmp = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a)));
	else
		tmp = Float64(y / Float64(a - Float64(t / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -7e+176)
		tmp = (y - (x / z)) / a;
	elseif (z <= 3.9e+114)
		tmp = (x - (y * z)) / (t - (z * a));
	else
		tmp = y / (a - (t / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7e+176], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 3.9e+114], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+176}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\

\mathbf{elif}\;z \leq 3.9 \cdot 10^{+114}:\\
\;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.00000000000000005e176

    1. Initial program 44.3%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{z \cdot \left(\frac{t}{z} - a\right)} - \frac{y \cdot z}{z \cdot \left(\frac{t}{z} - a\right)}} \]
    7. Applied egg-rr44.3%

      \[\leadsto \color{blue}{\frac{x}{z \cdot \left(\frac{t}{z} - a\right)} - \frac{y \cdot z}{z \cdot \left(\frac{t}{z} - a\right)}} \]
    8. Step-by-step derivation
      1. div-sub44.3%

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x - y \cdot z}{a \cdot z}} \]
      2. sub-neg42.9%

        \[\leadsto -\frac{\color{blue}{x + \left(-y \cdot z\right)}}{a \cdot z} \]
      3. remove-double-neg42.9%

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

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

        \[\leadsto -\frac{-\color{blue}{\left(y \cdot z + \left(-x\right)\right)}}{a \cdot z} \]
      6. sub-neg42.9%

        \[\leadsto -\frac{-\color{blue}{\left(y \cdot z - x\right)}}{a \cdot z} \]
      7. *-commutative42.9%

        \[\leadsto -\frac{-\left(y \cdot z - x\right)}{\color{blue}{z \cdot a}} \]
      8. distribute-frac-neg42.9%

        \[\leadsto -\color{blue}{\left(-\frac{y \cdot z - x}{z \cdot a}\right)} \]
      9. remove-double-neg42.9%

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

        \[\leadsto \color{blue}{\frac{\frac{y \cdot z - x}{z}}{a}} \]
      11. div-sub71.0%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot z}{z} - \frac{x}{z}}}{a} \]
      12. associate-/l*98.6%

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{z}} - \frac{x}{z}}{a} \]
      13. *-inverses98.6%

        \[\leadsto \frac{y \cdot \color{blue}{1} - \frac{x}{z}}{a} \]
      14. *-rgt-identity98.6%

        \[\leadsto \frac{\color{blue}{y} - \frac{x}{z}}{a} \]
    12. Simplified98.6%

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

    if -7.00000000000000005e176 < z < 3.9000000000000001e114

    1. Initial program 97.8%

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

    if 3.9000000000000001e114 < z

    1. Initial program 61.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+176}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+114}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 50.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+150}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{+29}:\\ \;\;\;\;y \cdot \frac{-z}{t}\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{-141}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.9e+150)
   (/ y a)
   (if (<= z -3.3e+29)
     (* y (/ (- z) t))
     (if (<= z 4.1e-141) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.9e+150) {
		tmp = y / a;
	} else if (z <= -3.3e+29) {
		tmp = y * (-z / t);
	} else if (z <= 4.1e-141) {
		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 <= (-1.9d+150)) then
        tmp = y / a
    else if (z <= (-3.3d+29)) then
        tmp = y * (-z / t)
    else if (z <= 4.1d-141) 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 <= -1.9e+150) {
		tmp = y / a;
	} else if (z <= -3.3e+29) {
		tmp = y * (-z / t);
	} else if (z <= 4.1e-141) {
		tmp = x / t;
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.9e+150:
		tmp = y / a
	elif z <= -3.3e+29:
		tmp = y * (-z / t)
	elif z <= 4.1e-141:
		tmp = x / t
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.9e+150)
		tmp = Float64(y / a);
	elseif (z <= -3.3e+29)
		tmp = Float64(y * Float64(Float64(-z) / t));
	elseif (z <= 4.1e-141)
		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 <= -1.9e+150)
		tmp = y / a;
	elseif (z <= -3.3e+29)
		tmp = y * (-z / t);
	elseif (z <= 4.1e-141)
		tmp = x / t;
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e+150], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.3e+29], N[(y * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.1e-141], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+150}:\\
\;\;\;\;\frac{y}{a}\\

\mathbf{elif}\;z \leq -3.3 \cdot 10^{+29}:\\
\;\;\;\;y \cdot \frac{-z}{t}\\

\mathbf{elif}\;z \leq 4.1 \cdot 10^{-141}:\\
\;\;\;\;\frac{x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.89999999999999995e150 or 4.10000000000000002e-141 < z

    1. Initial program 76.9%

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

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

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

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

    if -1.89999999999999995e150 < z < -3.29999999999999984e29

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

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

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

      \[\leadsto \color{blue}{\frac{x - z \cdot y}{t}} \]
    8. Taylor expanded in x around -inf 57.0%

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

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

        \[\leadsto \color{blue}{\left(-x\right)} \cdot \left(\frac{y \cdot z}{t \cdot x} - \frac{1}{t}\right) \]
      3. associate-/l*56.5%

        \[\leadsto \left(-x\right) \cdot \left(\color{blue}{y \cdot \frac{z}{t \cdot x}} - \frac{1}{t}\right) \]
      4. *-commutative56.5%

        \[\leadsto \left(-x\right) \cdot \left(y \cdot \frac{z}{\color{blue}{x \cdot t}} - \frac{1}{t}\right) \]
    10. Simplified56.5%

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

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

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

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

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

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

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

    if -3.29999999999999984e29 < z < 4.10000000000000002e-141

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+150}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{+29}:\\ \;\;\;\;y \cdot \frac{-z}{t}\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{-141}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 68.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+19} \lor \neg \left(t \leq 5.2 \cdot 10^{+127}\right):\\
\;\;\;\;\frac{x - y \cdot z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.5e19 or 5.2000000000000004e127 < t

    1. Initial program 84.2%

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

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

      \[\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}} \]
    6. Step-by-step derivation
      1. *-commutative79.2%

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

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

    if -2.5e19 < t < 5.2000000000000004e127

    1. Initial program 88.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{z \cdot \left(\frac{t}{z} - a\right)} - \frac{y \cdot z}{z \cdot \left(\frac{t}{z} - a\right)}} \]
    7. Applied egg-rr86.2%

      \[\leadsto \color{blue}{\frac{x}{z \cdot \left(\frac{t}{z} - a\right)} - \frac{y \cdot z}{z \cdot \left(\frac{t}{z} - a\right)}} \]
    8. Step-by-step derivation
      1. div-sub87.5%

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x - y \cdot z}{a \cdot z}} \]
      2. sub-neg63.5%

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

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

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

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

        \[\leadsto -\frac{-\color{blue}{\left(y \cdot z - x\right)}}{a \cdot z} \]
      7. *-commutative63.5%

        \[\leadsto -\frac{-\left(y \cdot z - x\right)}{\color{blue}{z \cdot a}} \]
      8. distribute-frac-neg63.5%

        \[\leadsto -\color{blue}{\left(-\frac{y \cdot z - x}{z \cdot a}\right)} \]
      9. remove-double-neg63.5%

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

        \[\leadsto \color{blue}{\frac{\frac{y \cdot z - x}{z}}{a}} \]
      11. div-sub64.4%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot z}{z} - \frac{x}{z}}}{a} \]
      12. associate-/l*70.5%

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{z}} - \frac{x}{z}}{a} \]
      13. *-inverses70.5%

        \[\leadsto \frac{y \cdot \color{blue}{1} - \frac{x}{z}}{a} \]
      14. *-rgt-identity70.5%

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

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

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

Alternative 7: 63.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+118} \lor \neg \left(z \leq 5.5 \cdot 10^{+67}\right):\\
\;\;\;\;\frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.8e118 or 5.49999999999999968e67 < z

    1. Initial program 64.0%

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

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

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

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

    if -4.8e118 < z < 5.49999999999999968e67

    1. Initial program 98.6%

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

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

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

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

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

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

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

Alternative 8: 64.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.72 \cdot 10^{+69} \lor \neg \left(z \leq 4.8 \cdot 10^{-25}\right):\\
\;\;\;\;\frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.72e69 or 4.80000000000000018e-25 < z

    1. Initial program 71.3%

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

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

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

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

    if -1.72e69 < z < 4.80000000000000018e-25

    1. Initial program 99.2%

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

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

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

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

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

Alternative 9: 53.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+27} \lor \neg \left(z \leq 4.1 \cdot 10^{-141}\right):\\ \;\;\;\;\frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= z -5.5e+27) (not (<= z 4.1e-141))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -5.5e+27) || !(z <= 4.1e-141)) {
		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 <= (-5.5d+27)) .or. (.not. (z <= 4.1d-141))) 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 <= -5.5e+27) || !(z <= 4.1e-141)) {
		tmp = y / a;
	} else {
		tmp = x / t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -5.5e+27) or not (z <= 4.1e-141):
		tmp = y / a
	else:
		tmp = x / t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -5.5e+27) || !(z <= 4.1e-141))
		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 <= -5.5e+27) || ~((z <= 4.1e-141)))
		tmp = y / a;
	else
		tmp = x / t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.5e+27], N[Not[LessEqual[z, 4.1e-141]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+27} \lor \neg \left(z \leq 4.1 \cdot 10^{-141}\right):\\
\;\;\;\;\frac{y}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.49999999999999966e27 or 4.10000000000000002e-141 < z

    1. Initial program 78.2%

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

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

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

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

    if -5.49999999999999966e27 < z < 4.10000000000000002e-141

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

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

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

Alternative 10: 35.2% 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 87.0%

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

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

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

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

Developer Target 1: 97.2% 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 2024148 
(FPCore (x y z t a)
  :name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< z -32113435955957344) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 4392440296622287/125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* (- x (* y z)) (/ 1 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))))))

  (/ (- x (* y z)) (- t (* a z))))