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

Percentage Accurate: 84.8% → 91.5%
Time: 14.4s
Alternatives: 11
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 11 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.8% 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: 91.5% accurate, 0.0× 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:\\ \;\;\;\;{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{t_1}}\right)}^{3} - y \cdot \frac{z}{t_1}\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+280}:\\ \;\;\;\;\frac{x}{t_1} - \frac{y \cdot z}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- t (* z a))) (t_2 (/ (- x (* y z)) t_1)))
   (if (<= t_2 (- INFINITY))
     (- (pow (/ (cbrt x) (cbrt t_1)) 3.0) (* y (/ z t_1)))
     (if (<= t_2 5e+280) (- (/ x t_1) (/ (* y z) t_1)) (/ (- y (/ x z)) a)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t - (z * a);
	double t_2 = (x - (y * z)) / t_1;
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = pow((cbrt(x) / cbrt(t_1)), 3.0) - (y * (z / t_1));
	} else if (t_2 <= 5e+280) {
		tmp = (x / t_1) - ((y * z) / t_1);
	} else {
		tmp = (y - (x / z)) / a;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t - (z * a);
	double t_2 = (x - (y * z)) / t_1;
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = Math.pow((Math.cbrt(x) / Math.cbrt(t_1)), 3.0) - (y * (z / t_1));
	} else if (t_2 <= 5e+280) {
		tmp = (x / t_1) - ((y * z) / t_1);
	} else {
		tmp = (y - (x / z)) / a;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(t - Float64(z * a))
	t_2 = Float64(Float64(x - Float64(y * z)) / t_1)
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64((Float64(cbrt(x) / cbrt(t_1)) ^ 3.0) - Float64(y * Float64(z / t_1)));
	elseif (t_2 <= 5e+280)
		tmp = Float64(Float64(x / t_1) - Float64(Float64(y * z) / t_1));
	else
		tmp = Float64(Float64(y - Float64(x / z)) / a);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[Power[N[(N[Power[x, 1/3], $MachinePrecision] / N[Power[t$95$1, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] - N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+280], N[(N[(x / t$95$1), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x - y \cdot z}{t_1}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{t_1}}\right)}^{3} - y \cdot \frac{z}{t_1}\\

\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+280}:\\
\;\;\;\;\frac{x}{t_1} - \frac{y \cdot z}{t_1}\\

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


\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 68.2%

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

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

      \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-sub68.2%

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

        \[\leadsto \color{blue}{\frac{x}{t - z \cdot a} + \left(-\frac{y \cdot z}{t - z \cdot a}\right)} \]
      3. add-cube-cbrt68.2%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}{t - z \cdot a} + \left(-\frac{y \cdot z}{t - z \cdot a}\right) \]
      4. add-cube-cbrt68.2%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{t - z \cdot a} \cdot \sqrt[3]{t - z \cdot a}}, \frac{\sqrt[3]{x}}{\sqrt[3]{t - z \cdot a}}, -\frac{y \cdot z}{t - z \cdot a}\right)} \]
    6. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\sqrt[3]{x}\right)}^{2}}{{\left(\sqrt[3]{\mathsf{fma}\left(a, -z, t\right)}\right)}^{2}}, \frac{\sqrt[3]{x}}{\sqrt[3]{\mathsf{fma}\left(a, -z, t\right)}}, -\frac{y}{\frac{\mathsf{fma}\left(a, -z, t\right)}{z}}\right)} \]
    7. Step-by-step derivation
      1. fma-neg100.0%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{x}\right)}^{2}}{{\left(\sqrt[3]{\mathsf{fma}\left(a, -z, t\right)}\right)}^{2}} \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{\mathsf{fma}\left(a, -z, t\right)}} - \frac{y}{\frac{\mathsf{fma}\left(a, -z, t\right)}{z}}} \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{\frac{\sqrt[3]{x}}{\sqrt[3]{\mathsf{fma}\left(a, -z, t\right)}} \cdot \frac{{\left(\sqrt[3]{x}\right)}^{2}}{{\left(\sqrt[3]{\mathsf{fma}\left(a, -z, t\right)}\right)}^{2}}} - \frac{y}{\frac{\mathsf{fma}\left(a, -z, t\right)}{z}} \]
    8. Simplified99.9%

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

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

    1. Initial program 94.0%

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

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

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

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

    if 5.0000000000000002e280 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z)))

    1. Initial program 32.1%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(x - y \cdot z\right)}}{a \cdot z} \]
      3. *-commutative25.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 51.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.95 \cdot 10^{+127}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -3.85 \cdot 10^{-22}:\\ \;\;\;\;y \cdot \frac{-z}{t}\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-56}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{elif}\;z \leq 19.5:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+94} \lor \neg \left(z \leq 2.3 \cdot 10^{+130}\right) \land z \leq 4.2 \cdot 10^{+185}:\\ \;\;\;\;\frac{\frac{-x}{z}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.95e+127)
   (/ y a)
   (if (<= z -3.85e-22)
     (* y (/ (- z) t))
     (if (<= z -1.95e-56)
       (/ (- x) (* z a))
       (if (<= z 19.5)
         (/ x t)
         (if (or (<= z 2.1e+94) (and (not (<= z 2.3e+130)) (<= z 4.2e+185)))
           (/ (/ (- x) z) a)
           (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.95e+127) {
		tmp = y / a;
	} else if (z <= -3.85e-22) {
		tmp = y * (-z / t);
	} else if (z <= -1.95e-56) {
		tmp = -x / (z * a);
	} else if (z <= 19.5) {
		tmp = x / t;
	} else if ((z <= 2.1e+94) || (!(z <= 2.3e+130) && (z <= 4.2e+185))) {
		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 <= (-1.95d+127)) then
        tmp = y / a
    else if (z <= (-3.85d-22)) then
        tmp = y * (-z / t)
    else if (z <= (-1.95d-56)) then
        tmp = -x / (z * a)
    else if (z <= 19.5d0) then
        tmp = x / t
    else if ((z <= 2.1d+94) .or. (.not. (z <= 2.3d+130)) .and. (z <= 4.2d+185)) 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 <= -1.95e+127) {
		tmp = y / a;
	} else if (z <= -3.85e-22) {
		tmp = y * (-z / t);
	} else if (z <= -1.95e-56) {
		tmp = -x / (z * a);
	} else if (z <= 19.5) {
		tmp = x / t;
	} else if ((z <= 2.1e+94) || (!(z <= 2.3e+130) && (z <= 4.2e+185))) {
		tmp = (-x / z) / a;
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.95e+127:
		tmp = y / a
	elif z <= -3.85e-22:
		tmp = y * (-z / t)
	elif z <= -1.95e-56:
		tmp = -x / (z * a)
	elif z <= 19.5:
		tmp = x / t
	elif (z <= 2.1e+94) or (not (z <= 2.3e+130) and (z <= 4.2e+185)):
		tmp = (-x / z) / a
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.95e+127)
		tmp = Float64(y / a);
	elseif (z <= -3.85e-22)
		tmp = Float64(y * Float64(Float64(-z) / t));
	elseif (z <= -1.95e-56)
		tmp = Float64(Float64(-x) / Float64(z * a));
	elseif (z <= 19.5)
		tmp = Float64(x / t);
	elseif ((z <= 2.1e+94) || (!(z <= 2.3e+130) && (z <= 4.2e+185)))
		tmp = Float64(Float64(Float64(-x) / 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 <= -1.95e+127)
		tmp = y / a;
	elseif (z <= -3.85e-22)
		tmp = y * (-z / t);
	elseif (z <= -1.95e-56)
		tmp = -x / (z * a);
	elseif (z <= 19.5)
		tmp = x / t;
	elseif ((z <= 2.1e+94) || (~((z <= 2.3e+130)) && (z <= 4.2e+185)))
		tmp = (-x / z) / a;
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.95e+127], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.85e-22], N[(y * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.95e-56], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 19.5], N[(x / t), $MachinePrecision], If[Or[LessEqual[z, 2.1e+94], And[N[Not[LessEqual[z, 2.3e+130]], $MachinePrecision], LessEqual[z, 4.2e+185]]], N[(N[((-x) / z), $MachinePrecision] / a), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -3.85 \cdot 10^{-22}:\\
\;\;\;\;y \cdot \frac{-z}{t}\\

\mathbf{elif}\;z \leq -1.95 \cdot 10^{-56}:\\
\;\;\;\;\frac{-x}{z \cdot a}\\

\mathbf{elif}\;z \leq 19.5:\\
\;\;\;\;\frac{x}{t}\\

\mathbf{elif}\;z \leq 2.1 \cdot 10^{+94} \lor \neg \left(z \leq 2.3 \cdot 10^{+130}\right) \land z \leq 4.2 \cdot 10^{+185}:\\
\;\;\;\;\frac{\frac{-x}{z}}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.94999999999999991e127 or 2.09999999999999989e94 < z < 2.30000000000000021e130 or 4.2e185 < z

    1. Initial program 57.6%

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

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

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

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

    if -1.94999999999999991e127 < z < -3.8500000000000001e-22

    1. Initial program 93.7%

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{z}{t} \cdot y} \]
      4. distribute-rgt-neg-in52.4%

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

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

    if -3.8500000000000001e-22 < z < -1.95e-56

    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 0 67.7%

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

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

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

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

      \[\leadsto \frac{x - y \cdot z}{\color{blue}{z \cdot \left(-a\right)}} \]
    8. Taylor expanded in x around inf 54.1%

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

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

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

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

    if -1.95e-56 < z < 19.5

    1. Initial program 99.8%

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

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

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

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

    if 19.5 < z < 2.09999999999999989e94 or 2.30000000000000021e130 < z < 4.2e185

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\left(-x\right) + y \cdot z}{z}}{a}} \]
    8. Taylor expanded in x around inf 52.1%

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

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

        \[\leadsto \frac{\color{blue}{\frac{-x}{z}}}{a} \]
    10. Simplified52.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.95 \cdot 10^{+127}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -3.85 \cdot 10^{-22}:\\ \;\;\;\;y \cdot \frac{-z}{t}\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-56}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{elif}\;z \leq 19.5:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+94} \lor \neg \left(z \leq 2.3 \cdot 10^{+130}\right) \land z \leq 4.2 \cdot 10^{+185}:\\ \;\;\;\;\frac{\frac{-x}{z}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 52.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-x}{z \cdot a}\\ \mathbf{if}\;z \leq -2.1 \cdot 10^{+127}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-17}:\\ \;\;\;\;y \cdot \frac{-z}{t}\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{-56}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 0.00036:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+93}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- x) (* z a))))
   (if (<= z -2.1e+127)
     (/ y a)
     (if (<= z -8.8e-17)
       (* y (/ (- z) t))
       (if (<= z -3.1e-56)
         t_1
         (if (<= z 0.00036) (/ x t) (if (<= z 6e+93) t_1 (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = -x / (z * a);
	double tmp;
	if (z <= -2.1e+127) {
		tmp = y / a;
	} else if (z <= -8.8e-17) {
		tmp = y * (-z / t);
	} else if (z <= -3.1e-56) {
		tmp = t_1;
	} else if (z <= 0.00036) {
		tmp = x / t;
	} else if (z <= 6e+93) {
		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 / (z * a)
    if (z <= (-2.1d+127)) then
        tmp = y / a
    else if (z <= (-8.8d-17)) then
        tmp = y * (-z / t)
    else if (z <= (-3.1d-56)) then
        tmp = t_1
    else if (z <= 0.00036d0) then
        tmp = x / t
    else if (z <= 6d+93) 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 / (z * a);
	double tmp;
	if (z <= -2.1e+127) {
		tmp = y / a;
	} else if (z <= -8.8e-17) {
		tmp = y * (-z / t);
	} else if (z <= -3.1e-56) {
		tmp = t_1;
	} else if (z <= 0.00036) {
		tmp = x / t;
	} else if (z <= 6e+93) {
		tmp = t_1;
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = -x / (z * a)
	tmp = 0
	if z <= -2.1e+127:
		tmp = y / a
	elif z <= -8.8e-17:
		tmp = y * (-z / t)
	elif z <= -3.1e-56:
		tmp = t_1
	elif z <= 0.00036:
		tmp = x / t
	elif z <= 6e+93:
		tmp = t_1
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(-x) / Float64(z * a))
	tmp = 0.0
	if (z <= -2.1e+127)
		tmp = Float64(y / a);
	elseif (z <= -8.8e-17)
		tmp = Float64(y * Float64(Float64(-z) / t));
	elseif (z <= -3.1e-56)
		tmp = t_1;
	elseif (z <= 0.00036)
		tmp = Float64(x / t);
	elseif (z <= 6e+93)
		tmp = t_1;
	else
		tmp = Float64(y / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = -x / (z * a);
	tmp = 0.0;
	if (z <= -2.1e+127)
		tmp = y / a;
	elseif (z <= -8.8e-17)
		tmp = y * (-z / t);
	elseif (z <= -3.1e-56)
		tmp = t_1;
	elseif (z <= 0.00036)
		tmp = x / t;
	elseif (z <= 6e+93)
		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[(z * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+127], N[(y / a), $MachinePrecision], If[LessEqual[z, -8.8e-17], N[(y * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.1e-56], t$95$1, If[LessEqual[z, 0.00036], N[(x / t), $MachinePrecision], If[LessEqual[z, 6e+93], t$95$1, N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{-x}{z \cdot a}\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+127}:\\
\;\;\;\;\frac{y}{a}\\

\mathbf{elif}\;z \leq -8.8 \cdot 10^{-17}:\\
\;\;\;\;y \cdot \frac{-z}{t}\\

\mathbf{elif}\;z \leq -3.1 \cdot 10^{-56}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 0.00036:\\
\;\;\;\;\frac{x}{t}\\

\mathbf{elif}\;z \leq 6 \cdot 10^{+93}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.09999999999999992e127 or 5.99999999999999957e93 < z

    1. Initial program 61.6%

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

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

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

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

    if -2.09999999999999992e127 < z < -8.8e-17

    1. Initial program 93.7%

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{z}{t} \cdot y} \]
      4. distribute-rgt-neg-in52.4%

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

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

    if -8.8e-17 < z < -3.09999999999999987e-56 or 3.60000000000000023e-4 < z < 5.99999999999999957e93

    1. Initial program 91.5%

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

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

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

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

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

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

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

      \[\leadsto \frac{x - y \cdot z}{\color{blue}{z \cdot \left(-a\right)}} \]
    8. Taylor expanded in x around inf 49.4%

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

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

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

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

    if -3.09999999999999987e-56 < z < 3.60000000000000023e-4

    1. Initial program 99.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{+127}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-17}:\\ \;\;\;\;y \cdot \frac{-z}{t}\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{-56}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{elif}\;z \leq 0.00036:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+93}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 68.8% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;t \leq -8.5 \cdot 10^{-9}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\

\mathbf{elif}\;t \leq -2.1 \cdot 10^{-22}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 840000000000:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -8.5e-9

    1. Initial program 86.1%

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

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

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

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

    if -8.5e-9 < t < -2.10000000000000008e-22 or -1.14999999999999999e-44 < t < 8.4e11

    1. Initial program 84.4%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(x - y \cdot z\right)}}{a \cdot z} \]
      3. *-commutative68.8%

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

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

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

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

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

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

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

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

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

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

    if -2.10000000000000008e-22 < t < -1.14999999999999999e-44

    1. Initial program 87.5%

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

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

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

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

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

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

    if 8.4e11 < t

    1. Initial program 86.7%

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

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

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

      \[\leadsto \color{blue}{\frac{x - y \cdot z}{t}} \]
    6. Step-by-step derivation
      1. div-sub78.8%

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

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

        \[\leadsto \frac{x}{t} - \color{blue}{\frac{z}{\frac{t}{y}}} \]
    7. Applied egg-rr83.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{-9}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;t \leq -2.1 \cdot 10^{-22}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;t \leq -1.15 \cdot 10^{-44}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;t \leq 840000000000:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t} - \frac{z}{\frac{t}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 68.7% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\

\mathbf{elif}\;t \leq -7 \cdot 10^{-22}:\\
\;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a}\\

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

\mathbf{elif}\;t \leq 11000000000:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -8.2000000000000006e-9

    1. Initial program 86.1%

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

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

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

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

    if -8.2000000000000006e-9 < t < -7.00000000000000011e-22

    1. Initial program 79.7%

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

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

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

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

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

        \[\leadsto \frac{x - y \cdot z}{\color{blue}{\left(-a\right)} \cdot z} \]
      3. *-commutative75.2%

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

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

        \[\leadsto \color{blue}{\frac{-\left(x - y \cdot z\right)}{-z \cdot \left(-a\right)}} \]
      2. div-inv75.2%

        \[\leadsto \color{blue}{\left(-\left(x - y \cdot z\right)\right) \cdot \frac{1}{-z \cdot \left(-a\right)}} \]
      3. sub-neg75.2%

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

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

        \[\leadsto \left(\left(-x\right) + \left(-\left(-\color{blue}{z \cdot y}\right)\right)\right) \cdot \frac{1}{-z \cdot \left(-a\right)} \]
      6. distribute-lft-neg-in75.2%

        \[\leadsto \left(\left(-x\right) + \left(-\color{blue}{\left(-z\right) \cdot y}\right)\right) \cdot \frac{1}{-z \cdot \left(-a\right)} \]
      7. add-sqr-sqrt0.0%

        \[\leadsto \left(\left(-x\right) + \left(-\color{blue}{\left(\sqrt{-z} \cdot \sqrt{-z}\right)} \cdot y\right)\right) \cdot \frac{1}{-z \cdot \left(-a\right)} \]
      8. sqrt-unprod36.9%

        \[\leadsto \left(\left(-x\right) + \left(-\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} \cdot y\right)\right) \cdot \frac{1}{-z \cdot \left(-a\right)} \]
      9. sqr-neg36.9%

        \[\leadsto \left(\left(-x\right) + \left(-\sqrt{\color{blue}{z \cdot z}} \cdot y\right)\right) \cdot \frac{1}{-z \cdot \left(-a\right)} \]
      10. sqrt-unprod36.9%

        \[\leadsto \left(\left(-x\right) + \left(-\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot y\right)\right) \cdot \frac{1}{-z \cdot \left(-a\right)} \]
      11. add-sqr-sqrt36.9%

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

        \[\leadsto \left(\left(-x\right) + \color{blue}{\left(-z\right) \cdot y}\right) \cdot \frac{1}{-z \cdot \left(-a\right)} \]
      13. add-sqr-sqrt0.0%

        \[\leadsto \left(\left(-x\right) + \color{blue}{\left(\sqrt{-z} \cdot \sqrt{-z}\right)} \cdot y\right) \cdot \frac{1}{-z \cdot \left(-a\right)} \]
      14. sqrt-unprod75.2%

        \[\leadsto \left(\left(-x\right) + \color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} \cdot y\right) \cdot \frac{1}{-z \cdot \left(-a\right)} \]
      15. sqr-neg75.2%

        \[\leadsto \left(\left(-x\right) + \sqrt{\color{blue}{z \cdot z}} \cdot y\right) \cdot \frac{1}{-z \cdot \left(-a\right)} \]
      16. sqrt-unprod74.6%

        \[\leadsto \left(\left(-x\right) + \color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot y\right) \cdot \frac{1}{-z \cdot \left(-a\right)} \]
      17. add-sqr-sqrt75.2%

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

        \[\leadsto \left(\left(-x\right) + z \cdot y\right) \cdot \frac{1}{-\color{blue}{\left(-z \cdot a\right)}} \]
      19. remove-double-neg75.2%

        \[\leadsto \left(\left(-x\right) + z \cdot y\right) \cdot \frac{1}{\color{blue}{z \cdot a}} \]
    9. Applied egg-rr75.2%

      \[\leadsto \color{blue}{\left(\left(-x\right) + z \cdot y\right) \cdot \frac{1}{z \cdot a}} \]
    10. Step-by-step derivation
      1. associate-*r/75.2%

        \[\leadsto \color{blue}{\frac{\left(\left(-x\right) + z \cdot y\right) \cdot 1}{z \cdot a}} \]
      2. *-rgt-identity75.2%

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

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

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

        \[\leadsto \frac{z \cdot y - x}{\color{blue}{a \cdot z}} \]
    11. Simplified75.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{a \cdot z} + \frac{y}{a}} \]
    13. Step-by-step derivation
      1. +-commutative95.2%

        \[\leadsto \color{blue}{\frac{y}{a} + -1 \cdot \frac{x}{a \cdot z}} \]
      2. mul-1-neg95.2%

        \[\leadsto \frac{y}{a} + \color{blue}{\left(-\frac{x}{a \cdot z}\right)} \]
      3. associate-/l/94.9%

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

        \[\leadsto \color{blue}{\frac{y}{a} - \frac{\frac{x}{z}}{a}} \]
      5. associate-/l/95.2%

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

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

    if -7.00000000000000011e-22 < t < -7.49999999999999969e-47

    1. Initial program 87.5%

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

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

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

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

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

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

    if -7.49999999999999969e-47 < t < 1.1e10

    1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{y - \frac{x}{z}}}{a} \]
    10. Simplified81.4%

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

    if 1.1e10 < t

    1. Initial program 86.7%

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

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

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

      \[\leadsto \color{blue}{\frac{x - y \cdot z}{t}} \]
    6. Step-by-step derivation
      1. div-sub78.8%

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

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

        \[\leadsto \frac{x}{t} - \color{blue}{\frac{z}{\frac{t}{y}}} \]
    7. Applied egg-rr83.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;t \leq -7 \cdot 10^{-22}:\\ \;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a}\\ \mathbf{elif}\;t \leq -7.5 \cdot 10^{-47}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;t \leq 11000000000:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t} - \frac{z}{\frac{t}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 67.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y - \frac{x}{z}}{a}\\ t_2 := \frac{x - y \cdot z}{t}\\ \mathbf{if}\;t \leq -8.2 \cdot 10^{-9}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -5.5 \cdot 10^{-21}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -5.1 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;t \leq 12500000000:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- y (/ x z)) a)) (t_2 (/ (- x (* y z)) t)))
   (if (<= t -8.2e-9)
     t_2
     (if (<= t -5.5e-21)
       t_1
       (if (<= t -5.1e-46)
         (/ x (- t (* z a)))
         (if (<= t 12500000000.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y - (x / z)) / a;
	double t_2 = (x - (y * z)) / t;
	double tmp;
	if (t <= -8.2e-9) {
		tmp = t_2;
	} else if (t <= -5.5e-21) {
		tmp = t_1;
	} else if (t <= -5.1e-46) {
		tmp = x / (t - (z * a));
	} else if (t <= 12500000000.0) {
		tmp = 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 = (y - (x / z)) / a
    t_2 = (x - (y * z)) / t
    if (t <= (-8.2d-9)) then
        tmp = t_2
    else if (t <= (-5.5d-21)) then
        tmp = t_1
    else if (t <= (-5.1d-46)) then
        tmp = x / (t - (z * a))
    else if (t <= 12500000000.0d0) then
        tmp = 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 = (y - (x / z)) / a;
	double t_2 = (x - (y * z)) / t;
	double tmp;
	if (t <= -8.2e-9) {
		tmp = t_2;
	} else if (t <= -5.5e-21) {
		tmp = t_1;
	} else if (t <= -5.1e-46) {
		tmp = x / (t - (z * a));
	} else if (t <= 12500000000.0) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y - (x / z)) / a
	t_2 = (x - (y * z)) / t
	tmp = 0
	if t <= -8.2e-9:
		tmp = t_2
	elif t <= -5.5e-21:
		tmp = t_1
	elif t <= -5.1e-46:
		tmp = x / (t - (z * a))
	elif t <= 12500000000.0:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y - Float64(x / z)) / a)
	t_2 = Float64(Float64(x - Float64(y * z)) / t)
	tmp = 0.0
	if (t <= -8.2e-9)
		tmp = t_2;
	elseif (t <= -5.5e-21)
		tmp = t_1;
	elseif (t <= -5.1e-46)
		tmp = Float64(x / Float64(t - Float64(z * a)));
	elseif (t <= 12500000000.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y - (x / z)) / a;
	t_2 = (x - (y * z)) / t;
	tmp = 0.0;
	if (t <= -8.2e-9)
		tmp = t_2;
	elseif (t <= -5.5e-21)
		tmp = t_1;
	elseif (t <= -5.1e-46)
		tmp = x / (t - (z * a));
	elseif (t <= 12500000000.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[t, -8.2e-9], t$95$2, If[LessEqual[t, -5.5e-21], t$95$1, If[LessEqual[t, -5.1e-46], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 12500000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -5.5 \cdot 10^{-21}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 12500000000:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -8.2000000000000006e-9 or 1.25e10 < t

    1. Initial program 86.4%

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

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

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

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

    if -8.2000000000000006e-9 < t < -5.49999999999999977e-21 or -5.0999999999999997e-46 < t < 1.25e10

    1. Initial program 84.4%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(x - y \cdot z\right)}}{a \cdot z} \]
      3. *-commutative68.8%

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

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

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

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

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

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

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

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

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

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

    if -5.49999999999999977e-21 < t < -5.0999999999999997e-46

    1. Initial program 87.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;t \leq -5.5 \cdot 10^{-21}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;t \leq -5.1 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;t \leq 12500000000:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 63.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{+127}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-238}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{+185}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -2.5e+127)
   (/ y a)
   (if (<= z -7.5e-238)
     (/ (- x (* y z)) t)
     (if (<= z 4.2e+185) (/ x (- t (* z a))) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.5e+127) {
		tmp = y / a;
	} else if (z <= -7.5e-238) {
		tmp = (x - (y * z)) / t;
	} else if (z <= 4.2e+185) {
		tmp = x / (t - (z * a));
	} else {
		tmp = y / a;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-2.5d+127)) then
        tmp = y / a
    else if (z <= (-7.5d-238)) then
        tmp = (x - (y * z)) / t
    else if (z <= 4.2d+185) then
        tmp = x / (t - (z * a))
    else
        tmp = y / a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.5e+127) {
		tmp = y / a;
	} else if (z <= -7.5e-238) {
		tmp = (x - (y * z)) / t;
	} else if (z <= 4.2e+185) {
		tmp = x / (t - (z * a));
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -2.5e+127:
		tmp = y / a
	elif z <= -7.5e-238:
		tmp = (x - (y * z)) / t
	elif z <= 4.2e+185:
		tmp = x / (t - (z * a))
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -2.5e+127)
		tmp = Float64(y / a);
	elseif (z <= -7.5e-238)
		tmp = Float64(Float64(x - Float64(y * z)) / t);
	elseif (z <= 4.2e+185)
		tmp = Float64(x / Float64(t - Float64(z * a)));
	else
		tmp = Float64(y / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -2.5e+127)
		tmp = y / a;
	elseif (z <= -7.5e-238)
		tmp = (x - (y * z)) / t;
	elseif (z <= 4.2e+185)
		tmp = x / (t - (z * a));
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.5e+127], N[(y / a), $MachinePrecision], If[LessEqual[z, -7.5e-238], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 4.2e+185], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq 4.2 \cdot 10^{+185}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.5000000000000002e127 or 4.2e185 < z

    1. Initial program 57.9%

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

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

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

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

    if -2.5000000000000002e127 < z < -7.50000000000000061e-238

    1. Initial program 98.2%

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

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

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

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

    if -7.50000000000000061e-238 < z < 4.2e185

    1. Initial program 91.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{+127}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-238}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{+185}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 91.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{+150} \lor \neg \left(z \leq 3.7 \cdot 10^{+105}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.0199999999999999e150 or 3.69999999999999985e105 < z

    1. Initial program 59.4%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(x - y \cdot z\right)}}{a \cdot z} \]
      3. *-commutative47.0%

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

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

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

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

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

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

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

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

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

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

    if -1.0199999999999999e150 < z < 3.69999999999999985e105

    1. Initial program 97.1%

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

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

Alternative 9: 63.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.95 \cdot 10^{+98} \lor \neg \left(z \leq 4.2 \cdot 10^{+185}\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.95e+98) (not (<= z 4.2e+185))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -1.95e+98) || !(z <= 4.2e+185)) {
		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.95d+98)) .or. (.not. (z <= 4.2d+185))) 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.95e+98) || !(z <= 4.2e+185)) {
		tmp = y / a;
	} else {
		tmp = x / (t - (z * a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -1.95e+98) or not (z <= 4.2e+185):
		tmp = y / a
	else:
		tmp = x / (t - (z * a))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -1.95e+98) || !(z <= 4.2e+185))
		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.95e+98) || ~((z <= 4.2e+185)))
		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.95e+98], N[Not[LessEqual[z, 4.2e+185]], $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.95 \cdot 10^{+98} \lor \neg \left(z \leq 4.2 \cdot 10^{+185}\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.95e98 or 4.2e185 < z

    1. Initial program 59.1%

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

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

      \[\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.95e98 < z < 4.2e185

    1. Initial program 93.9%

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

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

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

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

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

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

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

Alternative 10: 53.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.06 \cdot 10^{+104} \lor \neg \left(z \leq 54\right):\\
\;\;\;\;\frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.05999999999999994e104 or 54 < z

    1. Initial program 68.4%

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

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

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

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

    if -1.05999999999999994e104 < z < 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 z around 0 60.2%

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

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

Alternative 11: 34.9% 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.5%

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

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

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

    \[\leadsto \color{blue}{\frac{x}{t}} \]
  6. Final simplification39.4%

    \[\leadsto \frac{x}{t} \]
  7. Add Preprocessing

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

  :herbie-target
  (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))))