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

Percentage Accurate: 85.5% → 90.3%
Time: 9.8s
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.3% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 39.1%

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{y}{a} + -1 \cdot \frac{x}{a \cdot z}\right)} - -1 \cdot \frac{t \cdot y}{{a}^{2} \cdot z} \]
      2. associate--l+60.6%

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

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

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

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

        \[\leadsto \frac{y}{a} + \left(\frac{-1 \cdot \frac{x}{a}}{z} - \color{blue}{\frac{-1 \cdot \frac{t \cdot y}{{a}^{2}}}{z}}\right) \]
      7. div-sub84.0%

        \[\leadsto \frac{y}{a} + \color{blue}{\frac{-1 \cdot \frac{x}{a} - -1 \cdot \frac{t \cdot y}{{a}^{2}}}{z}} \]
      8. distribute-lft-out--84.0%

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

        \[\leadsto \frac{y}{a} + \color{blue}{-1 \cdot \frac{\frac{x}{a} - \frac{t \cdot y}{{a}^{2}}}{z}} \]
      10. mul-1-neg84.0%

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

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

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

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

    if -1.89999999999999993e207 < z < 7.20000000000000015e155

    1. Initial program 94.8%

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

    if 7.20000000000000015e155 < z

    1. Initial program 56.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{y}{a} + -1 \cdot \frac{x}{a \cdot z}\right)} - -1 \cdot \frac{t \cdot y}{{a}^{2} \cdot z} \]
      2. associate--l+64.2%

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

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

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

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

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

        \[\leadsto \frac{y}{a} + \color{blue}{\frac{-1 \cdot \frac{x}{a} - -1 \cdot \frac{t \cdot y}{{a}^{2}}}{z}} \]
      8. distribute-lft-out--64.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+207}:\\ \;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+155}:\\ \;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \end{array} \]

Alternative 2: 64.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.3 \cdot 10^{+156}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\

\mathbf{elif}\;a \leq -1.05 \cdot 10^{+80} \lor \neg \left(a \leq 6 \cdot 10^{-63}\right) \land \left(a \leq 8.5 \cdot 10^{+62} \lor \neg \left(a \leq 2.25 \cdot 10^{+105}\right)\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.2999999999999998e156

    1. Initial program 81.3%

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

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

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

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

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

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

    if -5.2999999999999998e156 < a < -1.05000000000000001e80 or 5.99999999999999959e-63 < a < 8.4999999999999997e62 or 2.2500000000000001e105 < a

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

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{x}{a \cdot z} + \frac{y}{a}\right) - -1 \cdot \frac{t \cdot y}{{a}^{2} \cdot z}} \]
    5. Step-by-step derivation
      1. +-commutative69.0%

        \[\leadsto \color{blue}{\left(\frac{y}{a} + -1 \cdot \frac{x}{a \cdot z}\right)} - -1 \cdot \frac{t \cdot y}{{a}^{2} \cdot z} \]
      2. associate--l+69.0%

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

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

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

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

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

        \[\leadsto \frac{y}{a} + \color{blue}{\frac{-1 \cdot \frac{x}{a} - -1 \cdot \frac{t \cdot y}{{a}^{2}}}{z}} \]
      8. distribute-lft-out--74.7%

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

        \[\leadsto \frac{y}{a} + \color{blue}{-1 \cdot \frac{\frac{x}{a} - \frac{t \cdot y}{{a}^{2}}}{z}} \]
      10. mul-1-neg74.7%

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

        \[\leadsto \color{blue}{\frac{y}{a} - \frac{\frac{x}{a} - \frac{t \cdot y}{{a}^{2}}}{z}} \]
    6. Simplified79.0%

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

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

    if -1.05000000000000001e80 < a < 5.99999999999999959e-63 or 8.4999999999999997e62 < a < 2.2500000000000001e105

    1. Initial program 97.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.3 \cdot 10^{+156}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;a \leq -1.05 \cdot 10^{+80} \lor \neg \left(a \leq 6 \cdot 10^{-63}\right) \land \left(a \leq 8.5 \cdot 10^{+62} \lor \neg \left(a \leq 2.25 \cdot 10^{+105}\right)\right):\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \end{array} \]

Alternative 3: 61.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{t - z \cdot a}\\ \mathbf{if}\;a \leq -1.38 \cdot 10^{+48}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{-74}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{+109}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{+158}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq 1.65 \cdot 10^{+261}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a} \cdot \frac{-1}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ x (- t (* z a)))))
   (if (<= a -1.38e+48)
     t_1
     (if (<= a 2.8e-74)
       (/ (- x (* z y)) t)
       (if (<= a 1.9e+109)
         t_1
         (if (<= a 4.5e+158)
           (/ y a)
           (if (<= a 1.65e+261) t_1 (* (/ x a) (/ -1.0 z)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x / (t - (z * a));
	double tmp;
	if (a <= -1.38e+48) {
		tmp = t_1;
	} else if (a <= 2.8e-74) {
		tmp = (x - (z * y)) / t;
	} else if (a <= 1.9e+109) {
		tmp = t_1;
	} else if (a <= 4.5e+158) {
		tmp = y / a;
	} else if (a <= 1.65e+261) {
		tmp = t_1;
	} else {
		tmp = (x / a) * (-1.0 / z);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x / (t - (z * a))
    if (a <= (-1.38d+48)) then
        tmp = t_1
    else if (a <= 2.8d-74) then
        tmp = (x - (z * y)) / t
    else if (a <= 1.9d+109) then
        tmp = t_1
    else if (a <= 4.5d+158) then
        tmp = y / a
    else if (a <= 1.65d+261) then
        tmp = t_1
    else
        tmp = (x / a) * ((-1.0d0) / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x / (t - (z * a));
	double tmp;
	if (a <= -1.38e+48) {
		tmp = t_1;
	} else if (a <= 2.8e-74) {
		tmp = (x - (z * y)) / t;
	} else if (a <= 1.9e+109) {
		tmp = t_1;
	} else if (a <= 4.5e+158) {
		tmp = y / a;
	} else if (a <= 1.65e+261) {
		tmp = t_1;
	} else {
		tmp = (x / a) * (-1.0 / z);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x / (t - (z * a))
	tmp = 0
	if a <= -1.38e+48:
		tmp = t_1
	elif a <= 2.8e-74:
		tmp = (x - (z * y)) / t
	elif a <= 1.9e+109:
		tmp = t_1
	elif a <= 4.5e+158:
		tmp = y / a
	elif a <= 1.65e+261:
		tmp = t_1
	else:
		tmp = (x / a) * (-1.0 / z)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x / Float64(t - Float64(z * a)))
	tmp = 0.0
	if (a <= -1.38e+48)
		tmp = t_1;
	elseif (a <= 2.8e-74)
		tmp = Float64(Float64(x - Float64(z * y)) / t);
	elseif (a <= 1.9e+109)
		tmp = t_1;
	elseif (a <= 4.5e+158)
		tmp = Float64(y / a);
	elseif (a <= 1.65e+261)
		tmp = t_1;
	else
		tmp = Float64(Float64(x / a) * Float64(-1.0 / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x / (t - (z * a));
	tmp = 0.0;
	if (a <= -1.38e+48)
		tmp = t_1;
	elseif (a <= 2.8e-74)
		tmp = (x - (z * y)) / t;
	elseif (a <= 1.9e+109)
		tmp = t_1;
	elseif (a <= 4.5e+158)
		tmp = y / a;
	elseif (a <= 1.65e+261)
		tmp = t_1;
	else
		tmp = (x / a) * (-1.0 / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.38e+48], t$95$1, If[LessEqual[a, 2.8e-74], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[a, 1.9e+109], t$95$1, If[LessEqual[a, 4.5e+158], N[(y / a), $MachinePrecision], If[LessEqual[a, 1.65e+261], t$95$1, N[(N[(x / a), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
\mathbf{if}\;a \leq -1.38 \cdot 10^{+48}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \leq 1.9 \cdot 10^{+109}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 4.5 \cdot 10^{+158}:\\
\;\;\;\;\frac{y}{a}\\

\mathbf{elif}\;a \leq 1.65 \cdot 10^{+261}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.3800000000000001e48 or 2.79999999999999988e-74 < a < 1.90000000000000019e109 or 4.50000000000000046e158 < a < 1.65e261

    1. Initial program 80.9%

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

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

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

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

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

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

    if -1.3800000000000001e48 < a < 2.79999999999999988e-74

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

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

    if 1.90000000000000019e109 < a < 4.50000000000000046e158

    1. Initial program 56.1%

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

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

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

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

    if 1.65e261 < a

    1. Initial program 62.5%

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{y}{a} + -1 \cdot \frac{x}{a \cdot z}\right)} - -1 \cdot \frac{t \cdot y}{{a}^{2} \cdot z} \]
      2. associate--l+71.7%

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

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

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

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

        \[\leadsto \frac{y}{a} + \left(\frac{-1 \cdot \frac{x}{a}}{z} - \color{blue}{\frac{-1 \cdot \frac{t \cdot y}{{a}^{2}}}{z}}\right) \]
      7. div-sub99.8%

        \[\leadsto \frac{y}{a} + \color{blue}{\frac{-1 \cdot \frac{x}{a} - -1 \cdot \frac{t \cdot y}{{a}^{2}}}{z}} \]
      8. distribute-lft-out--99.8%

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

        \[\leadsto \frac{y}{a} + \color{blue}{-1 \cdot \frac{\frac{x}{a} - \frac{t \cdot y}{{a}^{2}}}{z}} \]
      10. mul-1-neg99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-1 \cdot x}}{z \cdot a} \]
      2. times-frac81.8%

        \[\leadsto \color{blue}{\frac{-1}{z} \cdot \frac{x}{a}} \]
    11. Applied egg-rr81.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.38 \cdot 10^{+48}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{-74}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{+109}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{+158}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq 1.65 \cdot 10^{+261}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a} \cdot \frac{-1}{z}\\ \end{array} \]

Alternative 4: 64.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y - \frac{x}{z}}{a}\\ t_2 := \frac{x - z \cdot y}{t}\\ \mathbf{if}\;a \leq -8.8 \cdot 10^{+157}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;a \leq -8 \cdot 10^{+78}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-63}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{+62}:\\ \;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a}\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{+105}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- y (/ x z)) a)) (t_2 (/ (- x (* z y)) t)))
   (if (<= a -8.8e+157)
     (/ x (- t (* z a)))
     (if (<= a -8e+78)
       t_1
       (if (<= a 6e-63)
         t_2
         (if (<= a 2.5e+62)
           (- (/ y a) (/ x (* z a)))
           (if (<= a 2.8e+105) t_2 t_1)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y - (x / z)) / a;
	double t_2 = (x - (z * y)) / t;
	double tmp;
	if (a <= -8.8e+157) {
		tmp = x / (t - (z * a));
	} else if (a <= -8e+78) {
		tmp = t_1;
	} else if (a <= 6e-63) {
		tmp = t_2;
	} else if (a <= 2.5e+62) {
		tmp = (y / a) - (x / (z * a));
	} else if (a <= 2.8e+105) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = (y - (x / z)) / a
    t_2 = (x - (z * y)) / t
    if (a <= (-8.8d+157)) then
        tmp = x / (t - (z * a))
    else if (a <= (-8d+78)) then
        tmp = t_1
    else if (a <= 6d-63) then
        tmp = t_2
    else if (a <= 2.5d+62) then
        tmp = (y / a) - (x / (z * a))
    else if (a <= 2.8d+105) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y - (x / z)) / a;
	double t_2 = (x - (z * y)) / t;
	double tmp;
	if (a <= -8.8e+157) {
		tmp = x / (t - (z * a));
	} else if (a <= -8e+78) {
		tmp = t_1;
	} else if (a <= 6e-63) {
		tmp = t_2;
	} else if (a <= 2.5e+62) {
		tmp = (y / a) - (x / (z * a));
	} else if (a <= 2.8e+105) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y - (x / z)) / a
	t_2 = (x - (z * y)) / t
	tmp = 0
	if a <= -8.8e+157:
		tmp = x / (t - (z * a))
	elif a <= -8e+78:
		tmp = t_1
	elif a <= 6e-63:
		tmp = t_2
	elif a <= 2.5e+62:
		tmp = (y / a) - (x / (z * a))
	elif a <= 2.8e+105:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y - Float64(x / z)) / a)
	t_2 = Float64(Float64(x - Float64(z * y)) / t)
	tmp = 0.0
	if (a <= -8.8e+157)
		tmp = Float64(x / Float64(t - Float64(z * a)));
	elseif (a <= -8e+78)
		tmp = t_1;
	elseif (a <= 6e-63)
		tmp = t_2;
	elseif (a <= 2.5e+62)
		tmp = Float64(Float64(y / a) - Float64(x / Float64(z * a)));
	elseif (a <= 2.8e+105)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y - (x / z)) / a;
	t_2 = (x - (z * y)) / t;
	tmp = 0.0;
	if (a <= -8.8e+157)
		tmp = x / (t - (z * a));
	elseif (a <= -8e+78)
		tmp = t_1;
	elseif (a <= 6e-63)
		tmp = t_2;
	elseif (a <= 2.5e+62)
		tmp = (y / a) - (x / (z * a));
	elseif (a <= 2.8e+105)
		tmp = t_2;
	else
		tmp = t_1;
	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[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[a, -8.8e+157], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -8e+78], t$95$1, If[LessEqual[a, 6e-63], t$95$2, If[LessEqual[a, 2.5e+62], N[(N[(y / a), $MachinePrecision] - N[(x / N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.8e+105], t$95$2, t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -8 \cdot 10^{+78}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 6 \cdot 10^{-63}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 2.5 \cdot 10^{+62}:\\
\;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a}\\

\mathbf{elif}\;a \leq 2.8 \cdot 10^{+105}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -8.8000000000000005e157

    1. Initial program 81.3%

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

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

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

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

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

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

    if -8.8000000000000005e157 < a < -8.00000000000000007e78 or 2.8000000000000001e105 < a

    1. Initial program 72.0%

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{y}{a} + -1 \cdot \frac{x}{a \cdot z}\right)} - -1 \cdot \frac{t \cdot y}{{a}^{2} \cdot z} \]
      2. associate--l+68.2%

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

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

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

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

        \[\leadsto \frac{y}{a} + \left(\frac{-1 \cdot \frac{x}{a}}{z} - \color{blue}{\frac{-1 \cdot \frac{t \cdot y}{{a}^{2}}}{z}}\right) \]
      7. div-sub77.9%

        \[\leadsto \frac{y}{a} + \color{blue}{\frac{-1 \cdot \frac{x}{a} - -1 \cdot \frac{t \cdot y}{{a}^{2}}}{z}} \]
      8. distribute-lft-out--77.9%

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

        \[\leadsto \frac{y}{a} + \color{blue}{-1 \cdot \frac{\frac{x}{a} - \frac{t \cdot y}{{a}^{2}}}{z}} \]
      10. mul-1-neg77.9%

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

        \[\leadsto \color{blue}{\frac{y}{a} - \frac{\frac{x}{a} - \frac{t \cdot y}{{a}^{2}}}{z}} \]
    6. Simplified82.5%

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

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

    if -8.00000000000000007e78 < a < 5.99999999999999959e-63 or 2.50000000000000014e62 < a < 2.8000000000000001e105

    1. Initial program 97.2%

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

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

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

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

    if 5.99999999999999959e-63 < a < 2.50000000000000014e62

    1. Initial program 73.3%

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

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{x}{a \cdot z} + \frac{y}{a}\right) - -1 \cdot \frac{t \cdot y}{{a}^{2} \cdot z}} \]
    5. Step-by-step derivation
      1. +-commutative71.0%

        \[\leadsto \color{blue}{\left(\frac{y}{a} + -1 \cdot \frac{x}{a \cdot z}\right)} - -1 \cdot \frac{t \cdot y}{{a}^{2} \cdot z} \]
      2. associate--l+71.0%

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

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

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

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

        \[\leadsto \frac{y}{a} + \left(\frac{-1 \cdot \frac{x}{a}}{z} - \color{blue}{\frac{-1 \cdot \frac{t \cdot y}{{a}^{2}}}{z}}\right) \]
      7. div-sub67.3%

        \[\leadsto \frac{y}{a} + \color{blue}{\frac{-1 \cdot \frac{x}{a} - -1 \cdot \frac{t \cdot y}{{a}^{2}}}{z}} \]
      8. distribute-lft-out--67.3%

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

        \[\leadsto \frac{y}{a} + \color{blue}{-1 \cdot \frac{\frac{x}{a} - \frac{t \cdot y}{{a}^{2}}}{z}} \]
      10. mul-1-neg67.3%

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

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

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

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

        \[\leadsto \frac{y}{a} - \frac{x}{\color{blue}{z \cdot a}} \]
    9. Simplified78.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8.8 \cdot 10^{+157}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;a \leq -8 \cdot 10^{+78}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-63}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{+62}:\\ \;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a}\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{+105}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \end{array} \]

Alternative 5: 68.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x - z \cdot y}{t}\\ t_2 := \frac{y}{a} - \frac{\frac{x}{a}}{z}\\ \mathbf{if}\;a \leq -6 \cdot 10^{+80}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-63}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{+63}:\\ \;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a}\\ \mathbf{elif}\;a \leq 4 \cdot 10^{+105}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- x (* z y)) t)) (t_2 (- (/ y a) (/ (/ x a) z))))
   (if (<= a -6e+80)
     t_2
     (if (<= a 6e-63)
       t_1
       (if (<= a 1.2e+63)
         (- (/ y a) (/ x (* z a)))
         (if (<= a 4e+105) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (x - (z * y)) / t;
	double t_2 = (y / a) - ((x / a) / z);
	double tmp;
	if (a <= -6e+80) {
		tmp = t_2;
	} else if (a <= 6e-63) {
		tmp = t_1;
	} else if (a <= 1.2e+63) {
		tmp = (y / a) - (x / (z * a));
	} else if (a <= 4e+105) {
		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 = (x - (z * y)) / t
    t_2 = (y / a) - ((x / a) / z)
    if (a <= (-6d+80)) then
        tmp = t_2
    else if (a <= 6d-63) then
        tmp = t_1
    else if (a <= 1.2d+63) then
        tmp = (y / a) - (x / (z * a))
    else if (a <= 4d+105) 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 = (x - (z * y)) / t;
	double t_2 = (y / a) - ((x / a) / z);
	double tmp;
	if (a <= -6e+80) {
		tmp = t_2;
	} else if (a <= 6e-63) {
		tmp = t_1;
	} else if (a <= 1.2e+63) {
		tmp = (y / a) - (x / (z * a));
	} else if (a <= 4e+105) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (x - (z * y)) / t
	t_2 = (y / a) - ((x / a) / z)
	tmp = 0
	if a <= -6e+80:
		tmp = t_2
	elif a <= 6e-63:
		tmp = t_1
	elif a <= 1.2e+63:
		tmp = (y / a) - (x / (z * a))
	elif a <= 4e+105:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(x - Float64(z * y)) / t)
	t_2 = Float64(Float64(y / a) - Float64(Float64(x / a) / z))
	tmp = 0.0
	if (a <= -6e+80)
		tmp = t_2;
	elseif (a <= 6e-63)
		tmp = t_1;
	elseif (a <= 1.2e+63)
		tmp = Float64(Float64(y / a) - Float64(x / Float64(z * a)));
	elseif (a <= 4e+105)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (x - (z * y)) / t;
	t_2 = (y / a) - ((x / a) / z);
	tmp = 0.0;
	if (a <= -6e+80)
		tmp = t_2;
	elseif (a <= 6e-63)
		tmp = t_1;
	elseif (a <= 1.2e+63)
		tmp = (y / a) - (x / (z * a));
	elseif (a <= 4e+105)
		tmp = t_1;
	else
		tmp = t_2;
	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]}, Block[{t$95$2 = N[(N[(y / a), $MachinePrecision] - N[(N[(x / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6e+80], t$95$2, If[LessEqual[a, 6e-63], t$95$1, If[LessEqual[a, 1.2e+63], N[(N[(y / a), $MachinePrecision] - N[(x / N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4e+105], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq 6 \cdot 10^{-63}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 1.2 \cdot 10^{+63}:\\
\;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a}\\

\mathbf{elif}\;a \leq 4 \cdot 10^{+105}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.99999999999999974e80 or 3.9999999999999998e105 < a

    1. Initial program 75.1%

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{y}{a} + -1 \cdot \frac{x}{a \cdot z}\right)} - -1 \cdot \frac{t \cdot y}{{a}^{2} \cdot z} \]
      2. associate--l+64.1%

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

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

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

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

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

        \[\leadsto \frac{y}{a} + \color{blue}{\frac{-1 \cdot \frac{x}{a} - -1 \cdot \frac{t \cdot y}{{a}^{2}}}{z}} \]
      8. distribute-lft-out--71.7%

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

        \[\leadsto \frac{y}{a} + \color{blue}{-1 \cdot \frac{\frac{x}{a} - \frac{t \cdot y}{{a}^{2}}}{z}} \]
      10. mul-1-neg71.7%

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

        \[\leadsto \color{blue}{\frac{y}{a} - \frac{\frac{x}{a} - \frac{t \cdot y}{{a}^{2}}}{z}} \]
    6. Simplified75.9%

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

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

    if -5.99999999999999974e80 < a < 5.99999999999999959e-63 or 1.2e63 < a < 3.9999999999999998e105

    1. Initial program 97.2%

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

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

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

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

    if 5.99999999999999959e-63 < a < 1.2e63

    1. Initial program 73.3%

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

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{x}{a \cdot z} + \frac{y}{a}\right) - -1 \cdot \frac{t \cdot y}{{a}^{2} \cdot z}} \]
    5. Step-by-step derivation
      1. +-commutative71.0%

        \[\leadsto \color{blue}{\left(\frac{y}{a} + -1 \cdot \frac{x}{a \cdot z}\right)} - -1 \cdot \frac{t \cdot y}{{a}^{2} \cdot z} \]
      2. associate--l+71.0%

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

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

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

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

        \[\leadsto \frac{y}{a} + \left(\frac{-1 \cdot \frac{x}{a}}{z} - \color{blue}{\frac{-1 \cdot \frac{t \cdot y}{{a}^{2}}}{z}}\right) \]
      7. div-sub67.3%

        \[\leadsto \frac{y}{a} + \color{blue}{\frac{-1 \cdot \frac{x}{a} - -1 \cdot \frac{t \cdot y}{{a}^{2}}}{z}} \]
      8. distribute-lft-out--67.3%

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

        \[\leadsto \frac{y}{a} + \color{blue}{-1 \cdot \frac{\frac{x}{a} - \frac{t \cdot y}{{a}^{2}}}{z}} \]
      10. mul-1-neg67.3%

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

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

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

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

        \[\leadsto \frac{y}{a} - \frac{x}{\color{blue}{z \cdot a}} \]
    9. Simplified78.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6 \cdot 10^{+80}:\\ \;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-63}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{+63}:\\ \;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a}\\ \mathbf{elif}\;a \leq 4 \cdot 10^{+105}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\ \end{array} \]

Alternative 6: 68.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x - z \cdot y}{t}\\ t_2 := \frac{y}{a} - \frac{\frac{x}{a}}{z}\\ \mathbf{if}\;a \leq -7.2 \cdot 10^{+78}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-63}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 7.6 \cdot 10^{+62}:\\ \;\;\;\;\frac{y}{a} + \frac{-1}{\frac{a}{\frac{x}{z}}}\\ \mathbf{elif}\;a \leq 2.25 \cdot 10^{+105}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- x (* z y)) t)) (t_2 (- (/ y a) (/ (/ x a) z))))
   (if (<= a -7.2e+78)
     t_2
     (if (<= a 6e-63)
       t_1
       (if (<= a 7.6e+62)
         (+ (/ y a) (/ -1.0 (/ a (/ x z))))
         (if (<= a 2.25e+105) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (x - (z * y)) / t;
	double t_2 = (y / a) - ((x / a) / z);
	double tmp;
	if (a <= -7.2e+78) {
		tmp = t_2;
	} else if (a <= 6e-63) {
		tmp = t_1;
	} else if (a <= 7.6e+62) {
		tmp = (y / a) + (-1.0 / (a / (x / z)));
	} else if (a <= 2.25e+105) {
		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 = (x - (z * y)) / t
    t_2 = (y / a) - ((x / a) / z)
    if (a <= (-7.2d+78)) then
        tmp = t_2
    else if (a <= 6d-63) then
        tmp = t_1
    else if (a <= 7.6d+62) then
        tmp = (y / a) + ((-1.0d0) / (a / (x / z)))
    else if (a <= 2.25d+105) 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 = (x - (z * y)) / t;
	double t_2 = (y / a) - ((x / a) / z);
	double tmp;
	if (a <= -7.2e+78) {
		tmp = t_2;
	} else if (a <= 6e-63) {
		tmp = t_1;
	} else if (a <= 7.6e+62) {
		tmp = (y / a) + (-1.0 / (a / (x / z)));
	} else if (a <= 2.25e+105) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (x - (z * y)) / t
	t_2 = (y / a) - ((x / a) / z)
	tmp = 0
	if a <= -7.2e+78:
		tmp = t_2
	elif a <= 6e-63:
		tmp = t_1
	elif a <= 7.6e+62:
		tmp = (y / a) + (-1.0 / (a / (x / z)))
	elif a <= 2.25e+105:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(x - Float64(z * y)) / t)
	t_2 = Float64(Float64(y / a) - Float64(Float64(x / a) / z))
	tmp = 0.0
	if (a <= -7.2e+78)
		tmp = t_2;
	elseif (a <= 6e-63)
		tmp = t_1;
	elseif (a <= 7.6e+62)
		tmp = Float64(Float64(y / a) + Float64(-1.0 / Float64(a / Float64(x / z))));
	elseif (a <= 2.25e+105)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (x - (z * y)) / t;
	t_2 = (y / a) - ((x / a) / z);
	tmp = 0.0;
	if (a <= -7.2e+78)
		tmp = t_2;
	elseif (a <= 6e-63)
		tmp = t_1;
	elseif (a <= 7.6e+62)
		tmp = (y / a) + (-1.0 / (a / (x / z)));
	elseif (a <= 2.25e+105)
		tmp = t_1;
	else
		tmp = t_2;
	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]}, Block[{t$95$2 = N[(N[(y / a), $MachinePrecision] - N[(N[(x / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.2e+78], t$95$2, If[LessEqual[a, 6e-63], t$95$1, If[LessEqual[a, 7.6e+62], N[(N[(y / a), $MachinePrecision] + N[(-1.0 / N[(a / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.25e+105], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq 6 \cdot 10^{-63}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 7.6 \cdot 10^{+62}:\\
\;\;\;\;\frac{y}{a} + \frac{-1}{\frac{a}{\frac{x}{z}}}\\

\mathbf{elif}\;a \leq 2.25 \cdot 10^{+105}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -7.20000000000000039e78 or 2.2500000000000001e105 < a

    1. Initial program 75.1%

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{y}{a} + -1 \cdot \frac{x}{a \cdot z}\right)} - -1 \cdot \frac{t \cdot y}{{a}^{2} \cdot z} \]
      2. associate--l+64.1%

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

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

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

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

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

        \[\leadsto \frac{y}{a} + \color{blue}{\frac{-1 \cdot \frac{x}{a} - -1 \cdot \frac{t \cdot y}{{a}^{2}}}{z}} \]
      8. distribute-lft-out--71.7%

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

        \[\leadsto \frac{y}{a} + \color{blue}{-1 \cdot \frac{\frac{x}{a} - \frac{t \cdot y}{{a}^{2}}}{z}} \]
      10. mul-1-neg71.7%

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

        \[\leadsto \color{blue}{\frac{y}{a} - \frac{\frac{x}{a} - \frac{t \cdot y}{{a}^{2}}}{z}} \]
    6. Simplified75.9%

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

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

    if -7.20000000000000039e78 < a < 5.99999999999999959e-63 or 7.59999999999999967e62 < a < 2.2500000000000001e105

    1. Initial program 97.2%

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

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

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

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

    if 5.99999999999999959e-63 < a < 7.59999999999999967e62

    1. Initial program 73.3%

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

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{x}{a \cdot z} + \frac{y}{a}\right) - -1 \cdot \frac{t \cdot y}{{a}^{2} \cdot z}} \]
    5. Step-by-step derivation
      1. +-commutative71.0%

        \[\leadsto \color{blue}{\left(\frac{y}{a} + -1 \cdot \frac{x}{a \cdot z}\right)} - -1 \cdot \frac{t \cdot y}{{a}^{2} \cdot z} \]
      2. associate--l+71.0%

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

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

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

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

        \[\leadsto \frac{y}{a} + \left(\frac{-1 \cdot \frac{x}{a}}{z} - \color{blue}{\frac{-1 \cdot \frac{t \cdot y}{{a}^{2}}}{z}}\right) \]
      7. div-sub67.3%

        \[\leadsto \frac{y}{a} + \color{blue}{\frac{-1 \cdot \frac{x}{a} - -1 \cdot \frac{t \cdot y}{{a}^{2}}}{z}} \]
      8. distribute-lft-out--67.3%

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

        \[\leadsto \frac{y}{a} + \color{blue}{-1 \cdot \frac{\frac{x}{a} - \frac{t \cdot y}{{a}^{2}}}{z}} \]
      10. mul-1-neg67.3%

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

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

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

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

        \[\leadsto \frac{y}{a} - \frac{x}{\color{blue}{z \cdot a}} \]
    9. Simplified78.6%

      \[\leadsto \color{blue}{\frac{y}{a} - \frac{x}{z \cdot a}} \]
    10. Step-by-step derivation
      1. clear-num78.6%

        \[\leadsto \frac{y}{a} - \color{blue}{\frac{1}{\frac{z \cdot a}{x}}} \]
      2. inv-pow78.6%

        \[\leadsto \frac{y}{a} - \color{blue}{{\left(\frac{z \cdot a}{x}\right)}^{-1}} \]
    11. Applied egg-rr78.6%

      \[\leadsto \frac{y}{a} - \color{blue}{{\left(\frac{z \cdot a}{x}\right)}^{-1}} \]
    12. Step-by-step derivation
      1. unpow-178.6%

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

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

        \[\leadsto \frac{y}{a} - \frac{1}{\color{blue}{\frac{a}{\frac{x}{z}}}} \]
    13. Simplified78.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7.2 \cdot 10^{+78}:\\ \;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-63}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;a \leq 7.6 \cdot 10^{+62}:\\ \;\;\;\;\frac{y}{a} + \frac{-1}{\frac{a}{\frac{x}{z}}}\\ \mathbf{elif}\;a \leq 2.25 \cdot 10^{+105}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\ \end{array} \]

Alternative 7: 65.8% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.8e99 or 3.1500000000000001e153 < z

    1. Initial program 60.2%

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

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

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

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

    if -3.8e99 < z < 3.1500000000000001e153

    1. Initial program 97.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+99}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 3.15 \cdot 10^{+153}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]

Alternative 8: 55.3% accurate, 1.1× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.5000000000000002e88 or 1.2e10 < z

    1. Initial program 67.8%

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

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

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

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

    if -6.5000000000000002e88 < z < -2.79999999999999985e-53

    1. Initial program 92.0%

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

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

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

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

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

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

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

    if -2.79999999999999985e-53 < z < 1.2e10

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+88}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-53}:\\ \;\;\;\;\frac{z \cdot \left(-y\right)}{t}\\ \mathbf{elif}\;z \leq 12000000000:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]

Alternative 9: 55.4% accurate, 1.1× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.5000000000000005e88 or 3.8e11 < z

    1. Initial program 67.8%

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

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

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

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

    if -8.5000000000000005e88 < z < -1.9000000000000002e-52

    1. Initial program 92.0%

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{y}{\frac{t}{z}}} \]
      3. distribute-neg-frac42.7%

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

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

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

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

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

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

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

    if -1.9000000000000002e-52 < z < 3.8e11

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+88}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-52}:\\ \;\;\;\;z \cdot \left(-\frac{y}{t}\right)\\ \mathbf{elif}\;z \leq 380000000000:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]

Alternative 10: 56.0% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.65 \cdot 10^{-51} \lor \neg \left(z \leq 105000000000\right):\\
\;\;\;\;\frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.64999999999999987e-51 or 1.05e11 < z

    1. Initial program 72.9%

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

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

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

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

    if -2.64999999999999987e-51 < z < 1.05e11

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

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

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

Alternative 11: 35.6% accurate, 3.7× speedup?

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

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

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

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

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

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

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

Developer target: 97.5% 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 2023293 
(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))))