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

Percentage Accurate: 85.5% → 90.7%
Time: 13.0s
Alternatives: 11
Speedup: 0.7×

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: 85.5% 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: 90.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+108} \lor \neg \left(z \leq 9.8 \cdot 10^{+175}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.1999999999999996e108 or 9.80000000000000002e175 < z

    1. Initial program 60.3%

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

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

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

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

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

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

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

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

    if -9.1999999999999996e108 < z < 9.80000000000000002e175

    1. Initial program 97.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.2 \cdot 10^{+108} \lor \neg \left(z \leq 9.8 \cdot 10^{+175}\right):\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\ \end{array} \]

Alternative 2: 52.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+73}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-82}:\\ \;\;\;\;\frac{\frac{-x}{a}}{z}\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-199}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 3.05 \cdot 10^{-167}:\\ \;\;\;\;\frac{z \cdot \left(-y\right)}{t}\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-122}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 7.7 \cdot 10^{-66}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{elif}\;z \leq 2.45 \cdot 10^{+33}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -7e+73)
   (/ y a)
   (if (<= z -7e-82)
     (/ (/ (- x) a) z)
     (if (<= z 8e-199)
       (/ x t)
       (if (<= z 3.05e-167)
         (/ (* z (- y)) t)
         (if (<= z 3.7e-122)
           (/ x t)
           (if (<= z 7.7e-66)
             (/ (- x) (* z a))
             (if (<= z 2.45e+33) (/ x t) (/ y a)))))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -7e+73) {
		tmp = y / a;
	} else if (z <= -7e-82) {
		tmp = (-x / a) / z;
	} else if (z <= 8e-199) {
		tmp = x / t;
	} else if (z <= 3.05e-167) {
		tmp = (z * -y) / t;
	} else if (z <= 3.7e-122) {
		tmp = x / t;
	} else if (z <= 7.7e-66) {
		tmp = -x / (z * a);
	} else if (z <= 2.45e+33) {
		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 <= (-7d+73)) then
        tmp = y / a
    else if (z <= (-7d-82)) then
        tmp = (-x / a) / z
    else if (z <= 8d-199) then
        tmp = x / t
    else if (z <= 3.05d-167) then
        tmp = (z * -y) / t
    else if (z <= 3.7d-122) then
        tmp = x / t
    else if (z <= 7.7d-66) then
        tmp = -x / (z * a)
    else if (z <= 2.45d+33) 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 <= -7e+73) {
		tmp = y / a;
	} else if (z <= -7e-82) {
		tmp = (-x / a) / z;
	} else if (z <= 8e-199) {
		tmp = x / t;
	} else if (z <= 3.05e-167) {
		tmp = (z * -y) / t;
	} else if (z <= 3.7e-122) {
		tmp = x / t;
	} else if (z <= 7.7e-66) {
		tmp = -x / (z * a);
	} else if (z <= 2.45e+33) {
		tmp = x / t;
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -7e+73:
		tmp = y / a
	elif z <= -7e-82:
		tmp = (-x / a) / z
	elif z <= 8e-199:
		tmp = x / t
	elif z <= 3.05e-167:
		tmp = (z * -y) / t
	elif z <= 3.7e-122:
		tmp = x / t
	elif z <= 7.7e-66:
		tmp = -x / (z * a)
	elif z <= 2.45e+33:
		tmp = x / t
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -7e+73)
		tmp = Float64(y / a);
	elseif (z <= -7e-82)
		tmp = Float64(Float64(Float64(-x) / a) / z);
	elseif (z <= 8e-199)
		tmp = Float64(x / t);
	elseif (z <= 3.05e-167)
		tmp = Float64(Float64(z * Float64(-y)) / t);
	elseif (z <= 3.7e-122)
		tmp = Float64(x / t);
	elseif (z <= 7.7e-66)
		tmp = Float64(Float64(-x) / Float64(z * a));
	elseif (z <= 2.45e+33)
		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 <= -7e+73)
		tmp = y / a;
	elseif (z <= -7e-82)
		tmp = (-x / a) / z;
	elseif (z <= 8e-199)
		tmp = x / t;
	elseif (z <= 3.05e-167)
		tmp = (z * -y) / t;
	elseif (z <= 3.7e-122)
		tmp = x / t;
	elseif (z <= 7.7e-66)
		tmp = -x / (z * a);
	elseif (z <= 2.45e+33)
		tmp = x / t;
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7e+73], N[(y / a), $MachinePrecision], If[LessEqual[z, -7e-82], N[(N[((-x) / a), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 8e-199], N[(x / t), $MachinePrecision], If[LessEqual[z, 3.05e-167], N[(N[(z * (-y)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3.7e-122], N[(x / t), $MachinePrecision], If[LessEqual[z, 7.7e-66], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.45e+33], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq 3.05 \cdot 10^{-167}:\\
\;\;\;\;\frac{z \cdot \left(-y\right)}{t}\\

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

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

\mathbf{elif}\;z \leq 2.45 \cdot 10^{+33}:\\
\;\;\;\;\frac{x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -7.00000000000000004e73 or 2.45000000000000007e33 < z

    1. Initial program 72.7%

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

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

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

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

    if -7.00000000000000004e73 < z < -6.9999999999999997e-82

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{-x}{z}}{a}} \]
      5. neg-mul-148.4%

        \[\leadsto \frac{\frac{\color{blue}{-1 \cdot x}}{z}}{a} \]
      6. associate-*r/48.4%

        \[\leadsto \frac{\color{blue}{-1 \cdot \frac{x}{z}}}{a} \]
      7. mul-1-neg48.4%

        \[\leadsto \frac{\color{blue}{-\frac{x}{z}}}{a} \]
    9. Simplified48.4%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-\frac{x}{a}}{z}} \]
    12. Simplified51.2%

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

    if -6.9999999999999997e-82 < z < 7.99999999999999986e-199 or 3.0499999999999999e-167 < z < 3.6999999999999997e-122 or 7.7000000000000001e-66 < z < 2.45000000000000007e33

    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. Taylor expanded in z around 0 58.3%

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

    if 7.99999999999999986e-199 < z < 3.0499999999999999e-167

    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. Taylor expanded in t around inf 54.9%

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(-y\right)} \cdot z}{t} \]
    7. Simplified49.5%

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

    if 3.6999999999999997e-122 < z < 7.7000000000000001e-66

    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. Taylor expanded in x around inf 62.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+73}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-82}:\\ \;\;\;\;\frac{\frac{-x}{a}}{z}\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-199}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 3.05 \cdot 10^{-167}:\\ \;\;\;\;\frac{z \cdot \left(-y\right)}{t}\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-122}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 7.7 \cdot 10^{-66}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{elif}\;z \leq 2.45 \cdot 10^{+33}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]

Alternative 3: 70.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+53} \lor \neg \left(t \leq -44000 \lor \neg \left(t \leq -3.3 \cdot 10^{-32}\right) \land t \leq 75000000000000\right):\\
\;\;\;\;\frac{x}{t} - z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.8e53 or -44000 < t < -3.30000000000000025e-32 or 7.5e13 < t

    1. Initial program 88.8%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t} + \frac{x}{t}} \]
    6. Step-by-step derivation
      1. +-commutative80.2%

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{t} - \frac{y}{\frac{t}{z}}} \]
    8. Step-by-step derivation
      1. associate-/r/82.0%

        \[\leadsto \frac{x}{t} - \color{blue}{\frac{y}{t} \cdot z} \]
    9. Applied egg-rr82.0%

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

    if -1.8e53 < t < -44000 or -3.30000000000000025e-32 < t < 7.5e13

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{+53} \lor \neg \left(t \leq -44000 \lor \neg \left(t \leq -3.3 \cdot 10^{-32}\right) \land t \leq 75000000000000\right):\\ \;\;\;\;\frac{x}{t} - z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \end{array} \]

Alternative 4: 70.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{t} - z \cdot \frac{y}{t}\\ \mathbf{if}\;t \leq -6.8 \cdot 10^{+49}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -1650000:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;t \leq -2.25 \cdot 10^{-32} \lor \neg \left(t \leq 8 \cdot 10^{+17}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- (/ x t) (* z (/ y t)))))
   (if (<= t -6.8e+49)
     t_1
     (if (<= t -1650000.0)
       (/ (- y (/ x z)) a)
       (if (or (<= t -2.25e-32) (not (<= t 8e+17)))
         t_1
         (- (/ y a) (/ x (* z a))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (x / t) - (z * (y / t));
	double tmp;
	if (t <= -6.8e+49) {
		tmp = t_1;
	} else if (t <= -1650000.0) {
		tmp = (y - (x / z)) / a;
	} else if ((t <= -2.25e-32) || !(t <= 8e+17)) {
		tmp = t_1;
	} else {
		tmp = (y / a) - (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) :: t_1
    real(8) :: tmp
    t_1 = (x / t) - (z * (y / t))
    if (t <= (-6.8d+49)) then
        tmp = t_1
    else if (t <= (-1650000.0d0)) then
        tmp = (y - (x / z)) / a
    else if ((t <= (-2.25d-32)) .or. (.not. (t <= 8d+17))) then
        tmp = t_1
    else
        tmp = (y / a) - (x / (z * a))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (x / t) - (z * (y / t));
	double tmp;
	if (t <= -6.8e+49) {
		tmp = t_1;
	} else if (t <= -1650000.0) {
		tmp = (y - (x / z)) / a;
	} else if ((t <= -2.25e-32) || !(t <= 8e+17)) {
		tmp = t_1;
	} else {
		tmp = (y / a) - (x / (z * a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (x / t) - (z * (y / t))
	tmp = 0
	if t <= -6.8e+49:
		tmp = t_1
	elif t <= -1650000.0:
		tmp = (y - (x / z)) / a
	elif (t <= -2.25e-32) or not (t <= 8e+17):
		tmp = t_1
	else:
		tmp = (y / a) - (x / (z * a))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(x / t) - Float64(z * Float64(y / t)))
	tmp = 0.0
	if (t <= -6.8e+49)
		tmp = t_1;
	elseif (t <= -1650000.0)
		tmp = Float64(Float64(y - Float64(x / z)) / a);
	elseif ((t <= -2.25e-32) || !(t <= 8e+17))
		tmp = t_1;
	else
		tmp = Float64(Float64(y / a) - Float64(x / Float64(z * a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (x / t) - (z * (y / t));
	tmp = 0.0;
	if (t <= -6.8e+49)
		tmp = t_1;
	elseif (t <= -1650000.0)
		tmp = (y - (x / z)) / a;
	elseif ((t <= -2.25e-32) || ~((t <= 8e+17)))
		tmp = t_1;
	else
		tmp = (y / a) - (x / (z * a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.8e+49], t$95$1, If[LessEqual[t, -1650000.0], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[Or[LessEqual[t, -2.25e-32], N[Not[LessEqual[t, 8e+17]], $MachinePrecision]], t$95$1, N[(N[(y / a), $MachinePrecision] - N[(x / N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{t} - z \cdot \frac{y}{t}\\
\mathbf{if}\;t \leq -6.8 \cdot 10^{+49}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq -2.25 \cdot 10^{-32} \lor \neg \left(t \leq 8 \cdot 10^{+17}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.8000000000000001e49 or -1.65e6 < t < -2.25000000000000002e-32 or 8e17 < t

    1. Initial program 88.8%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t} + \frac{x}{t}} \]
    6. Step-by-step derivation
      1. +-commutative80.2%

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{t} - \frac{y}{\frac{t}{z}}} \]
    8. Step-by-step derivation
      1. associate-/r/82.0%

        \[\leadsto \frac{x}{t} - \color{blue}{\frac{y}{t} \cdot z} \]
    9. Applied egg-rr82.0%

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

    if -6.8000000000000001e49 < t < -1.65e6

    1. Initial program 77.8%

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

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

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

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

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

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

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

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

    if -2.25000000000000002e-32 < t < 8e17

    1. Initial program 91.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{a} - \frac{x}{\color{blue}{z \cdot a}} \]
    7. Simplified76.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.8 \cdot 10^{+49}:\\ \;\;\;\;\frac{x}{t} - z \cdot \frac{y}{t}\\ \mathbf{elif}\;t \leq -1650000:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;t \leq -2.25 \cdot 10^{-32} \lor \neg \left(t \leq 8 \cdot 10^{+17}\right):\\ \;\;\;\;\frac{x}{t} - z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a}\\ \end{array} \]

Alternative 5: 69.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{+49} \lor \neg \left(t \leq -48000000 \lor \neg \left(t \leq -2.4 \cdot 10^{-32}\right) \land t \leq 8 \cdot 10^{+15}\right):\\
\;\;\;\;\frac{x - z \cdot y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.4999999999999996e49 or -4.8e7 < t < -2.4000000000000001e-32 or 8e15 < t

    1. Initial program 88.8%

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

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

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

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

    if -8.4999999999999996e49 < t < -4.8e7 or -2.4000000000000001e-32 < t < 8e15

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{+49} \lor \neg \left(t \leq -48000000 \lor \neg \left(t \leq -2.4 \cdot 10^{-32}\right) \land t \leq 8 \cdot 10^{+15}\right):\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \end{array} \]

Alternative 6: 53.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-x}{z \cdot a}\\ \mathbf{if}\;z \leq -5.8 \cdot 10^{+72}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-82}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-120}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-66}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.45 \cdot 10^{+33}:\\ \;\;\;\;\frac{x}{t}\\ \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 -5.8e+72)
     (/ y a)
     (if (<= z -1.6e-82)
       t_1
       (if (<= z 3e-120)
         (/ x t)
         (if (<= z 5e-66) t_1 (if (<= z 2.45e+33) (/ x t) (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = -x / (z * a);
	double tmp;
	if (z <= -5.8e+72) {
		tmp = y / a;
	} else if (z <= -1.6e-82) {
		tmp = t_1;
	} else if (z <= 3e-120) {
		tmp = x / t;
	} else if (z <= 5e-66) {
		tmp = t_1;
	} else if (z <= 2.45e+33) {
		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) :: t_1
    real(8) :: tmp
    t_1 = -x / (z * a)
    if (z <= (-5.8d+72)) then
        tmp = y / a
    else if (z <= (-1.6d-82)) then
        tmp = t_1
    else if (z <= 3d-120) then
        tmp = x / t
    else if (z <= 5d-66) then
        tmp = t_1
    else if (z <= 2.45d+33) 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 t_1 = -x / (z * a);
	double tmp;
	if (z <= -5.8e+72) {
		tmp = y / a;
	} else if (z <= -1.6e-82) {
		tmp = t_1;
	} else if (z <= 3e-120) {
		tmp = x / t;
	} else if (z <= 5e-66) {
		tmp = t_1;
	} else if (z <= 2.45e+33) {
		tmp = x / t;
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = -x / (z * a)
	tmp = 0
	if z <= -5.8e+72:
		tmp = y / a
	elif z <= -1.6e-82:
		tmp = t_1
	elif z <= 3e-120:
		tmp = x / t
	elif z <= 5e-66:
		tmp = t_1
	elif z <= 2.45e+33:
		tmp = x / t
	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 <= -5.8e+72)
		tmp = Float64(y / a);
	elseif (z <= -1.6e-82)
		tmp = t_1;
	elseif (z <= 3e-120)
		tmp = Float64(x / t);
	elseif (z <= 5e-66)
		tmp = t_1;
	elseif (z <= 2.45e+33)
		tmp = Float64(x / t);
	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 <= -5.8e+72)
		tmp = y / a;
	elseif (z <= -1.6e-82)
		tmp = t_1;
	elseif (z <= 3e-120)
		tmp = x / t;
	elseif (z <= 5e-66)
		tmp = t_1;
	elseif (z <= 2.45e+33)
		tmp = x / t;
	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, -5.8e+72], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.6e-82], t$95$1, If[LessEqual[z, 3e-120], N[(x / t), $MachinePrecision], If[LessEqual[z, 5e-66], t$95$1, If[LessEqual[z, 2.45e+33], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.6 \cdot 10^{-82}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 5 \cdot 10^{-66}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 2.45 \cdot 10^{+33}:\\
\;\;\;\;\frac{x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.80000000000000034e72 or 2.45000000000000007e33 < z

    1. Initial program 72.7%

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

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

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

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

    if -5.80000000000000034e72 < z < -1.6000000000000001e-82 or 3.00000000000000011e-120 < z < 4.99999999999999962e-66

    1. Initial program 97.6%

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

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

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

      \[\leadsto \color{blue}{\frac{x}{t - a \cdot z}} \]
    5. Step-by-step derivation
      1. *-commutative62.8%

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

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

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

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

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

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

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

    if -1.6000000000000001e-82 < z < 3.00000000000000011e-120 or 4.99999999999999962e-66 < z < 2.45000000000000007e33

    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. Taylor expanded in z around 0 53.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+72}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-82}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-120}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-66}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{elif}\;z \leq 2.45 \cdot 10^{+33}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]

Alternative 7: 53.1% accurate, 0.8× speedup?

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

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

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

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

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

\mathbf{elif}\;z \leq 6.8 \cdot 10^{+33}:\\
\;\;\;\;\frac{x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.20000000000000003e80 or 6.7999999999999999e33 < z

    1. Initial program 72.7%

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

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

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

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

    if -8.20000000000000003e80 < z < -1.9000000000000001e-82

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{-x}{z}}{a}} \]
      5. neg-mul-148.4%

        \[\leadsto \frac{\frac{\color{blue}{-1 \cdot x}}{z}}{a} \]
      6. associate-*r/48.4%

        \[\leadsto \frac{\color{blue}{-1 \cdot \frac{x}{z}}}{a} \]
      7. mul-1-neg48.4%

        \[\leadsto \frac{\color{blue}{-\frac{x}{z}}}{a} \]
    9. Simplified48.4%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-\frac{x}{a}}{z}} \]
    12. Simplified51.2%

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

    if -1.9000000000000001e-82 < z < 4.2000000000000001e-120 or 2.54999999999999992e-64 < z < 6.7999999999999999e33

    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. Taylor expanded in z around 0 53.9%

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

    if 4.2000000000000001e-120 < z < 2.54999999999999992e-64

    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. Taylor expanded in x around inf 62.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+80}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-82}:\\ \;\;\;\;\frac{\frac{-x}{a}}{z}\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-120}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 2.55 \cdot 10^{-64}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+33}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]

Alternative 8: 62.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x - z \cdot y}{t}\\ \mathbf{if}\;y \leq -4.6 \cdot 10^{+142}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.3 \cdot 10^{+109}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;y \leq 6.3 \cdot 10^{-21}:\\ \;\;\;\;\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 (/ (- x (* z y)) t)))
   (if (<= y -4.6e+142)
     t_1
     (if (<= y -3.3e+109)
       (/ y a)
       (if (<= y 6.3e-21) (/ x (- t (* z a))) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (x - (z * y)) / t;
	double tmp;
	if (y <= -4.6e+142) {
		tmp = t_1;
	} else if (y <= -3.3e+109) {
		tmp = y / a;
	} else if (y <= 6.3e-21) {
		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 = (x - (z * y)) / t
    if (y <= (-4.6d+142)) then
        tmp = t_1
    else if (y <= (-3.3d+109)) then
        tmp = y / a
    else if (y <= 6.3d-21) 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 = (x - (z * y)) / t;
	double tmp;
	if (y <= -4.6e+142) {
		tmp = t_1;
	} else if (y <= -3.3e+109) {
		tmp = y / a;
	} else if (y <= 6.3e-21) {
		tmp = x / (t - (z * a));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (x - (z * y)) / t
	tmp = 0
	if y <= -4.6e+142:
		tmp = t_1
	elif y <= -3.3e+109:
		tmp = y / a
	elif y <= 6.3e-21:
		tmp = x / (t - (z * a))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(x - Float64(z * y)) / t)
	tmp = 0.0
	if (y <= -4.6e+142)
		tmp = t_1;
	elseif (y <= -3.3e+109)
		tmp = Float64(y / a);
	elseif (y <= 6.3e-21)
		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 = (x - (z * y)) / t;
	tmp = 0.0;
	if (y <= -4.6e+142)
		tmp = t_1;
	elseif (y <= -3.3e+109)
		tmp = y / a;
	elseif (y <= 6.3e-21)
		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[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[y, -4.6e+142], t$95$1, If[LessEqual[y, -3.3e+109], N[(y / a), $MachinePrecision], If[LessEqual[y, 6.3e-21], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x - z \cdot y}{t}\\
\mathbf{if}\;y \leq -4.6 \cdot 10^{+142}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -3.3 \cdot 10^{+109}:\\
\;\;\;\;\frac{y}{a}\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.60000000000000004e142 or 6.3e-21 < y

    1. Initial program 86.8%

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

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

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

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

    if -4.60000000000000004e142 < y < -3.2999999999999999e109

    1. Initial program 50.4%

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

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

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

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

    if -3.2999999999999999e109 < y < 6.3e-21

    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. Taylor expanded in x around inf 73.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.6 \cdot 10^{+142}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;y \leq -3.3 \cdot 10^{+109}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;y \leq 6.3 \cdot 10^{-21}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \end{array} \]

Alternative 9: 65.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+82} \lor \neg \left(z \leq 1.08 \cdot 10^{+43}\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.2e+82) (not (<= z 1.08e+43))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -1.2e+82) || !(z <= 1.08e+43)) {
		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.2d+82)) .or. (.not. (z <= 1.08d+43))) 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.2e+82) || !(z <= 1.08e+43)) {
		tmp = y / a;
	} else {
		tmp = x / (t - (z * a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -1.2e+82) or not (z <= 1.08e+43):
		tmp = y / a
	else:
		tmp = x / (t - (z * a))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -1.2e+82) || !(z <= 1.08e+43))
		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.2e+82) || ~((z <= 1.08e+43)))
		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.2e+82], N[Not[LessEqual[z, 1.08e+43]], $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.2 \cdot 10^{+82} \lor \neg \left(z \leq 1.08 \cdot 10^{+43}\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.19999999999999999e82 or 1.08e43 < z

    1. Initial program 72.4%

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

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

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

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

    if -1.19999999999999999e82 < z < 1.08e43

    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. Taylor expanded in x around inf 67.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+82} \lor \neg \left(z \leq 1.08 \cdot 10^{+43}\right):\\ \;\;\;\;\frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \end{array} \]

Alternative 10: 54.9% accurate, 1.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.8e9 or 4.49999999999999997e36 < z

    1. Initial program 75.4%

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

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

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

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

    if -2.8e9 < z < 4.49999999999999997e36

    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. Taylor expanded in z around 0 48.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2800000000 \lor \neg \left(z \leq 4.5 \cdot 10^{+36}\right):\\ \;\;\;\;\frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t}\\ \end{array} \]

Alternative 11: 35.8% accurate, 3.7× speedup?

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

\\
\frac{x}{t}
\end{array}
Derivation
  1. Initial program 89.7%

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

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

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

    \[\leadsto \color{blue}{\frac{x}{t}} \]
  5. Final simplification32.2%

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

Developer target: 97.4% accurate, 0.6× 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 2023320 
(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))))