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

Percentage Accurate: 84.8% → 98.9%
Time: 13.5s
Alternatives: 13
Speedup: 0.5×

Specification

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

\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 13 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 84.8% accurate, 1.0× speedup?

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

\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}

Alternative 1: 98.9% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := a - \frac{t}{z}\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+64} \lor \neg \left(z \leq 3.3 \cdot 10^{-49}\right):\\
\;\;\;\;\frac{y}{t\_1} - \frac{\frac{x}{z}}{t\_1}\\

\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 < -1.80000000000000007e64 or 3.3e-49 < z

    1. Initial program 68.3%

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

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

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

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

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

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

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

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

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

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

    if -1.80000000000000007e64 < z < 3.3e-49

    1. Initial program 99.8%

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

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

Alternative 2: 71.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y - \frac{x}{z}}{a}\\ \mathbf{if}\;z \leq -2.9 \cdot 10^{+131}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2 \cdot 10^{+56}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-16}:\\ \;\;\;\;\left(x - z \cdot y\right) \cdot \frac{\frac{-1}{a}}{z}\\ \mathbf{elif}\;z \leq -6.1 \cdot 10^{-80}:\\ \;\;\;\;\frac{z \cdot y}{z \cdot a - t}\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+18}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- y (/ x z)) a)))
   (if (<= z -2.9e+131)
     t_1
     (if (<= z -2e+56)
       (/ y (- a (/ t z)))
       (if (<= z -3.8e-16)
         (* (- x (* z y)) (/ (/ -1.0 a) z))
         (if (<= z -6.1e-80)
           (/ (* z y) (- (* z a) t))
           (if (<= z 6.2e+18) (/ x (- t (* z a))) t_1)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y - (x / z)) / a;
	double tmp;
	if (z <= -2.9e+131) {
		tmp = t_1;
	} else if (z <= -2e+56) {
		tmp = y / (a - (t / z));
	} else if (z <= -3.8e-16) {
		tmp = (x - (z * y)) * ((-1.0 / a) / z);
	} else if (z <= -6.1e-80) {
		tmp = (z * y) / ((z * a) - t);
	} else if (z <= 6.2e+18) {
		tmp = x / (t - (z * a));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (y - (x / z)) / a
    if (z <= (-2.9d+131)) then
        tmp = t_1
    else if (z <= (-2d+56)) then
        tmp = y / (a - (t / z))
    else if (z <= (-3.8d-16)) then
        tmp = (x - (z * y)) * (((-1.0d0) / a) / z)
    else if (z <= (-6.1d-80)) then
        tmp = (z * y) / ((z * a) - t)
    else if (z <= 6.2d+18) then
        tmp = x / (t - (z * a))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y - (x / z)) / a;
	double tmp;
	if (z <= -2.9e+131) {
		tmp = t_1;
	} else if (z <= -2e+56) {
		tmp = y / (a - (t / z));
	} else if (z <= -3.8e-16) {
		tmp = (x - (z * y)) * ((-1.0 / a) / z);
	} else if (z <= -6.1e-80) {
		tmp = (z * y) / ((z * a) - t);
	} else if (z <= 6.2e+18) {
		tmp = x / (t - (z * a));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y - (x / z)) / a
	tmp = 0
	if z <= -2.9e+131:
		tmp = t_1
	elif z <= -2e+56:
		tmp = y / (a - (t / z))
	elif z <= -3.8e-16:
		tmp = (x - (z * y)) * ((-1.0 / a) / z)
	elif z <= -6.1e-80:
		tmp = (z * y) / ((z * a) - t)
	elif z <= 6.2e+18:
		tmp = x / (t - (z * a))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y - Float64(x / z)) / a)
	tmp = 0.0
	if (z <= -2.9e+131)
		tmp = t_1;
	elseif (z <= -2e+56)
		tmp = Float64(y / Float64(a - Float64(t / z)));
	elseif (z <= -3.8e-16)
		tmp = Float64(Float64(x - Float64(z * y)) * Float64(Float64(-1.0 / a) / z));
	elseif (z <= -6.1e-80)
		tmp = Float64(Float64(z * y) / Float64(Float64(z * a) - t));
	elseif (z <= 6.2e+18)
		tmp = Float64(x / Float64(t - Float64(z * a)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y - (x / z)) / a;
	tmp = 0.0;
	if (z <= -2.9e+131)
		tmp = t_1;
	elseif (z <= -2e+56)
		tmp = y / (a - (t / z));
	elseif (z <= -3.8e-16)
		tmp = (x - (z * y)) * ((-1.0 / a) / z);
	elseif (z <= -6.1e-80)
		tmp = (z * y) / ((z * a) - t);
	elseif (z <= 6.2e+18)
		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[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -2.9e+131], t$95$1, If[LessEqual[z, -2e+56], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.8e-16], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] * N[(N[(-1.0 / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.1e-80], N[(N[(z * y), $MachinePrecision] / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e+18], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2 \cdot 10^{+56}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\

\mathbf{elif}\;z \leq -3.8 \cdot 10^{-16}:\\
\;\;\;\;\left(x - z \cdot y\right) \cdot \frac{\frac{-1}{a}}{z}\\

\mathbf{elif}\;z \leq -6.1 \cdot 10^{-80}:\\
\;\;\;\;\frac{z \cdot y}{z \cdot a - t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.9000000000000001e131 or 6.2e18 < z

    1. Initial program 66.2%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{t - z \cdot a}{x - y \cdot z}}} \]
      2. associate-/r/66.1%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(z, -a, t\right)} \cdot \left(x - y \cdot z\right)} \]
    7. Taylor expanded in z around inf 52.2%

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

        \[\leadsto \color{blue}{\frac{\frac{-1}{a}}{z}} \cdot \left(x - y \cdot z\right) \]
    9. Simplified52.4%

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

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

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

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

        \[\leadsto \frac{y}{a} + \frac{\color{blue}{-x}}{a \cdot z} \]
      4. *-commutative80.0%

        \[\leadsto \frac{y}{a} + \frac{-x}{\color{blue}{z \cdot a}} \]
    12. Simplified80.0%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} + \left(-\frac{\frac{x}{z}}{a}\right)} \]
      4. sub-neg84.0%

        \[\leadsto \color{blue}{\frac{y}{a} - \frac{\frac{x}{z}}{a}} \]
      5. div-sub84.0%

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

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

    if -2.9000000000000001e131 < z < -2.00000000000000018e56

    1. Initial program 68.2%

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

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

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

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

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

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

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

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

    if -2.00000000000000018e56 < z < -3.80000000000000012e-16

    1. Initial program 99.8%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{t - z \cdot a}{x - y \cdot z}}} \]
      2. associate-/r/99.8%

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

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

        \[\leadsto \frac{1}{\color{blue}{\left(-z \cdot a\right) + t}} \cdot \left(x - y \cdot z\right) \]
      5. distribute-rgt-neg-in99.8%

        \[\leadsto \frac{1}{\color{blue}{z \cdot \left(-a\right)} + t} \cdot \left(x - y \cdot z\right) \]
      6. fma-define99.8%

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

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(z, -a, t\right)} \cdot \left(x - y \cdot z\right)} \]
    7. Taylor expanded in z around inf 72.8%

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

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

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

    if -3.80000000000000012e-16 < z < -6.1000000000000002e-80

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot \frac{z}{t - a \cdot z}\right)} \]
      2. cancel-sign-sub-inv71.6%

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{\color{blue}{t + \left(-a\right) \cdot z}}\right) \]
      3. *-commutative71.6%

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{t + \color{blue}{z \cdot \left(-a\right)}}\right) \]
      4. +-commutative71.6%

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{\color{blue}{z \cdot \left(-a\right) + t}}\right) \]
      5. fma-define71.6%

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{\color{blue}{\mathsf{fma}\left(z, -a, t\right)}}\right) \]
      6. neg-mul-171.6%

        \[\leadsto \color{blue}{-y \cdot \frac{z}{\mathsf{fma}\left(z, -a, t\right)}} \]
      7. associate-*r/79.4%

        \[\leadsto -\color{blue}{\frac{y \cdot z}{\mathsf{fma}\left(z, -a, t\right)}} \]
      8. distribute-frac-neg279.4%

        \[\leadsto \color{blue}{\frac{y \cdot z}{-\mathsf{fma}\left(z, -a, t\right)}} \]
      9. neg-sub079.4%

        \[\leadsto \frac{y \cdot z}{\color{blue}{0 - \mathsf{fma}\left(z, -a, t\right)}} \]
      10. fma-define79.4%

        \[\leadsto \frac{y \cdot z}{0 - \color{blue}{\left(z \cdot \left(-a\right) + t\right)}} \]
      11. associate--r+79.4%

        \[\leadsto \frac{y \cdot z}{\color{blue}{\left(0 - z \cdot \left(-a\right)\right) - t}} \]
      12. neg-sub079.4%

        \[\leadsto \frac{y \cdot z}{\color{blue}{\left(-z \cdot \left(-a\right)\right)} - t} \]
      13. distribute-rgt-neg-out79.4%

        \[\leadsto \frac{y \cdot z}{\left(-\color{blue}{\left(-z \cdot a\right)}\right) - t} \]
      14. remove-double-neg79.4%

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

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

    if -6.1000000000000002e-80 < z < 6.2e18

    1. Initial program 99.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+131}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq -2 \cdot 10^{+56}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-16}:\\ \;\;\;\;\left(x - z \cdot y\right) \cdot \frac{\frac{-1}{a}}{z}\\ \mathbf{elif}\;z \leq -6.1 \cdot 10^{-80}:\\ \;\;\;\;\frac{z \cdot y}{z \cdot a - t}\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+18}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 71.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y - \frac{x}{z}}{a}\\ \mathbf{if}\;z \leq -9 \cdot 10^{+132}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -6.4 \cdot 10^{+63}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-16}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-80}:\\ \;\;\;\;\frac{z \cdot y}{z \cdot a - t}\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+19}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- y (/ x z)) a)))
   (if (<= z -9e+132)
     t_1
     (if (<= z -6.4e+63)
       (/ y (- a (/ t z)))
       (if (<= z -2.3e-16)
         t_1
         (if (<= z -1.4e-80)
           (/ (* z y) (- (* z a) t))
           (if (<= z 1.05e+19) (/ x (- t (* z a))) t_1)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y - (x / z)) / a;
	double tmp;
	if (z <= -9e+132) {
		tmp = t_1;
	} else if (z <= -6.4e+63) {
		tmp = y / (a - (t / z));
	} else if (z <= -2.3e-16) {
		tmp = t_1;
	} else if (z <= -1.4e-80) {
		tmp = (z * y) / ((z * a) - t);
	} else if (z <= 1.05e+19) {
		tmp = x / (t - (z * a));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (y - (x / z)) / a
    if (z <= (-9d+132)) then
        tmp = t_1
    else if (z <= (-6.4d+63)) then
        tmp = y / (a - (t / z))
    else if (z <= (-2.3d-16)) then
        tmp = t_1
    else if (z <= (-1.4d-80)) then
        tmp = (z * y) / ((z * a) - t)
    else if (z <= 1.05d+19) then
        tmp = x / (t - (z * a))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y - (x / z)) / a;
	double tmp;
	if (z <= -9e+132) {
		tmp = t_1;
	} else if (z <= -6.4e+63) {
		tmp = y / (a - (t / z));
	} else if (z <= -2.3e-16) {
		tmp = t_1;
	} else if (z <= -1.4e-80) {
		tmp = (z * y) / ((z * a) - t);
	} else if (z <= 1.05e+19) {
		tmp = x / (t - (z * a));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y - (x / z)) / a
	tmp = 0
	if z <= -9e+132:
		tmp = t_1
	elif z <= -6.4e+63:
		tmp = y / (a - (t / z))
	elif z <= -2.3e-16:
		tmp = t_1
	elif z <= -1.4e-80:
		tmp = (z * y) / ((z * a) - t)
	elif z <= 1.05e+19:
		tmp = x / (t - (z * a))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y - Float64(x / z)) / a)
	tmp = 0.0
	if (z <= -9e+132)
		tmp = t_1;
	elseif (z <= -6.4e+63)
		tmp = Float64(y / Float64(a - Float64(t / z)));
	elseif (z <= -2.3e-16)
		tmp = t_1;
	elseif (z <= -1.4e-80)
		tmp = Float64(Float64(z * y) / Float64(Float64(z * a) - t));
	elseif (z <= 1.05e+19)
		tmp = Float64(x / Float64(t - Float64(z * a)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y - (x / z)) / a;
	tmp = 0.0;
	if (z <= -9e+132)
		tmp = t_1;
	elseif (z <= -6.4e+63)
		tmp = y / (a - (t / z));
	elseif (z <= -2.3e-16)
		tmp = t_1;
	elseif (z <= -1.4e-80)
		tmp = (z * y) / ((z * a) - t);
	elseif (z <= 1.05e+19)
		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[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -9e+132], t$95$1, If[LessEqual[z, -6.4e+63], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.3e-16], t$95$1, If[LessEqual[z, -1.4e-80], N[(N[(z * y), $MachinePrecision] / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e+19], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -2.3 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.4 \cdot 10^{-80}:\\
\;\;\;\;\frac{z \cdot y}{z \cdot a - t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.99999999999999944e132 or -6.40000000000000022e63 < z < -2.2999999999999999e-16 or 1.05e19 < z

    1. Initial program 70.3%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{t - z \cdot a}{x - y \cdot z}}} \]
      2. associate-/r/70.2%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(z, -a, t\right)} \cdot \left(x - y \cdot z\right)} \]
    7. Taylor expanded in z around inf 54.7%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{a \cdot z} + \frac{y}{a}} \]
    11. Step-by-step derivation
      1. +-commutative78.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} - \frac{\frac{x}{z}}{a}} \]
      5. div-sub82.6%

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

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

    if -8.99999999999999944e132 < z < -6.40000000000000022e63

    1. Initial program 68.2%

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

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

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

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

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

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

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

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

    if -2.2999999999999999e-16 < z < -1.39999999999999995e-80

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot \frac{z}{t - a \cdot z}\right)} \]
      2. cancel-sign-sub-inv71.6%

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{\color{blue}{t + \left(-a\right) \cdot z}}\right) \]
      3. *-commutative71.6%

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{t + \color{blue}{z \cdot \left(-a\right)}}\right) \]
      4. +-commutative71.6%

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{\color{blue}{z \cdot \left(-a\right) + t}}\right) \]
      5. fma-define71.6%

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{\color{blue}{\mathsf{fma}\left(z, -a, t\right)}}\right) \]
      6. neg-mul-171.6%

        \[\leadsto \color{blue}{-y \cdot \frac{z}{\mathsf{fma}\left(z, -a, t\right)}} \]
      7. associate-*r/79.4%

        \[\leadsto -\color{blue}{\frac{y \cdot z}{\mathsf{fma}\left(z, -a, t\right)}} \]
      8. distribute-frac-neg279.4%

        \[\leadsto \color{blue}{\frac{y \cdot z}{-\mathsf{fma}\left(z, -a, t\right)}} \]
      9. neg-sub079.4%

        \[\leadsto \frac{y \cdot z}{\color{blue}{0 - \mathsf{fma}\left(z, -a, t\right)}} \]
      10. fma-define79.4%

        \[\leadsto \frac{y \cdot z}{0 - \color{blue}{\left(z \cdot \left(-a\right) + t\right)}} \]
      11. associate--r+79.4%

        \[\leadsto \frac{y \cdot z}{\color{blue}{\left(0 - z \cdot \left(-a\right)\right) - t}} \]
      12. neg-sub079.4%

        \[\leadsto \frac{y \cdot z}{\color{blue}{\left(-z \cdot \left(-a\right)\right)} - t} \]
      13. distribute-rgt-neg-out79.4%

        \[\leadsto \frac{y \cdot z}{\left(-\color{blue}{\left(-z \cdot a\right)}\right) - t} \]
      14. remove-double-neg79.4%

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

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

    if -1.39999999999999995e-80 < z < 1.05e19

    1. Initial program 99.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{+132}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq -6.4 \cdot 10^{+63}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-16}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-80}:\\ \;\;\;\;\frac{z \cdot y}{z \cdot a - t}\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+19}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 71.1% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;z \leq -3.6 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -6.1 \cdot 10^{-80}:\\
\;\;\;\;\frac{z}{\frac{z \cdot a - t}{y}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.09999999999999997e129 or -2.99999999999999999e63 < z < -3.59999999999999983e-16 or 1.6e21 < z

    1. Initial program 70.3%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{t - z \cdot a}{x - y \cdot z}}} \]
      2. associate-/r/70.2%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(z, -a, t\right)} \cdot \left(x - y \cdot z\right)} \]
    7. Taylor expanded in z around inf 54.7%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{a \cdot z} + \frac{y}{a}} \]
    11. Step-by-step derivation
      1. +-commutative78.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} - \frac{\frac{x}{z}}{a}} \]
      5. div-sub82.6%

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

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

    if -2.09999999999999997e129 < z < -2.99999999999999999e63

    1. Initial program 68.2%

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

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

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

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

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

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

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

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

    if -3.59999999999999983e-16 < z < -6.1000000000000002e-80

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot \frac{z}{t - a \cdot z}\right)} \]
      2. cancel-sign-sub-inv71.6%

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{\color{blue}{t + \left(-a\right) \cdot z}}\right) \]
      3. *-commutative71.6%

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{t + \color{blue}{z \cdot \left(-a\right)}}\right) \]
      4. +-commutative71.6%

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{\color{blue}{z \cdot \left(-a\right) + t}}\right) \]
      5. fma-define71.6%

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{\color{blue}{\mathsf{fma}\left(z, -a, t\right)}}\right) \]
      6. neg-mul-171.6%

        \[\leadsto \color{blue}{-y \cdot \frac{z}{\mathsf{fma}\left(z, -a, t\right)}} \]
      7. associate-*r/79.4%

        \[\leadsto -\color{blue}{\frac{y \cdot z}{\mathsf{fma}\left(z, -a, t\right)}} \]
      8. distribute-frac-neg279.4%

        \[\leadsto \color{blue}{\frac{y \cdot z}{-\mathsf{fma}\left(z, -a, t\right)}} \]
      9. neg-sub079.4%

        \[\leadsto \frac{y \cdot z}{\color{blue}{0 - \mathsf{fma}\left(z, -a, t\right)}} \]
      10. fma-define79.4%

        \[\leadsto \frac{y \cdot z}{0 - \color{blue}{\left(z \cdot \left(-a\right) + t\right)}} \]
      11. associate--r+79.4%

        \[\leadsto \frac{y \cdot z}{\color{blue}{\left(0 - z \cdot \left(-a\right)\right) - t}} \]
      12. neg-sub079.4%

        \[\leadsto \frac{y \cdot z}{\color{blue}{\left(-z \cdot \left(-a\right)\right)} - t} \]
      13. distribute-rgt-neg-out79.4%

        \[\leadsto \frac{y \cdot z}{\left(-\color{blue}{\left(-z \cdot a\right)}\right) - t} \]
      14. remove-double-neg79.4%

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{z \cdot a - t}} \]
    8. Step-by-step derivation
      1. *-commutative79.4%

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{z \cdot a - t}} \]
    9. Applied egg-rr79.2%

      \[\leadsto \color{blue}{z \cdot \frac{y}{z \cdot a - t}} \]
    10. Step-by-step derivation
      1. clear-num79.2%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{z \cdot a - t}{y}}} \]
      2. un-div-inv79.3%

        \[\leadsto \color{blue}{\frac{z}{\frac{z \cdot a - t}{y}}} \]
    11. Applied egg-rr79.3%

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

    if -6.1000000000000002e-80 < z < 1.6e21

    1. Initial program 99.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{+129}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq -3 \cdot 10^{+63}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-16}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq -6.1 \cdot 10^{-80}:\\ \;\;\;\;\frac{z}{\frac{z \cdot a - t}{y}}\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+21}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 71.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y - \frac{x}{z}}{a}\\ \mathbf{if}\;z \leq -2.75 \cdot 10^{+132}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{+63}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-16}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-69}:\\ \;\;\;\;z \cdot \frac{y}{z \cdot a - t}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+23}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- y (/ x z)) a)))
   (if (<= z -2.75e+132)
     t_1
     (if (<= z -5.5e+63)
       (/ y (- a (/ t z)))
       (if (<= z -1.95e-16)
         t_1
         (if (<= z -2.1e-69)
           (* z (/ y (- (* z a) t)))
           (if (<= z 1.7e+23) (/ x (- t (* z a))) t_1)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y - (x / z)) / a;
	double tmp;
	if (z <= -2.75e+132) {
		tmp = t_1;
	} else if (z <= -5.5e+63) {
		tmp = y / (a - (t / z));
	} else if (z <= -1.95e-16) {
		tmp = t_1;
	} else if (z <= -2.1e-69) {
		tmp = z * (y / ((z * a) - t));
	} else if (z <= 1.7e+23) {
		tmp = x / (t - (z * a));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (y - (x / z)) / a
    if (z <= (-2.75d+132)) then
        tmp = t_1
    else if (z <= (-5.5d+63)) then
        tmp = y / (a - (t / z))
    else if (z <= (-1.95d-16)) then
        tmp = t_1
    else if (z <= (-2.1d-69)) then
        tmp = z * (y / ((z * a) - t))
    else if (z <= 1.7d+23) then
        tmp = x / (t - (z * a))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y - (x / z)) / a;
	double tmp;
	if (z <= -2.75e+132) {
		tmp = t_1;
	} else if (z <= -5.5e+63) {
		tmp = y / (a - (t / z));
	} else if (z <= -1.95e-16) {
		tmp = t_1;
	} else if (z <= -2.1e-69) {
		tmp = z * (y / ((z * a) - t));
	} else if (z <= 1.7e+23) {
		tmp = x / (t - (z * a));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y - (x / z)) / a
	tmp = 0
	if z <= -2.75e+132:
		tmp = t_1
	elif z <= -5.5e+63:
		tmp = y / (a - (t / z))
	elif z <= -1.95e-16:
		tmp = t_1
	elif z <= -2.1e-69:
		tmp = z * (y / ((z * a) - t))
	elif z <= 1.7e+23:
		tmp = x / (t - (z * a))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y - Float64(x / z)) / a)
	tmp = 0.0
	if (z <= -2.75e+132)
		tmp = t_1;
	elseif (z <= -5.5e+63)
		tmp = Float64(y / Float64(a - Float64(t / z)));
	elseif (z <= -1.95e-16)
		tmp = t_1;
	elseif (z <= -2.1e-69)
		tmp = Float64(z * Float64(y / Float64(Float64(z * a) - t)));
	elseif (z <= 1.7e+23)
		tmp = Float64(x / Float64(t - Float64(z * a)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y - (x / z)) / a;
	tmp = 0.0;
	if (z <= -2.75e+132)
		tmp = t_1;
	elseif (z <= -5.5e+63)
		tmp = y / (a - (t / z));
	elseif (z <= -1.95e-16)
		tmp = t_1;
	elseif (z <= -2.1e-69)
		tmp = z * (y / ((z * a) - t));
	elseif (z <= 1.7e+23)
		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[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -2.75e+132], t$95$1, If[LessEqual[z, -5.5e+63], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.95e-16], t$95$1, If[LessEqual[z, -2.1e-69], N[(z * N[(y / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e+23], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -1.95 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -2.1 \cdot 10^{-69}:\\
\;\;\;\;z \cdot \frac{y}{z \cdot a - t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.75e132 or -5.50000000000000004e63 < z < -1.94999999999999989e-16 or 1.69999999999999996e23 < z

    1. Initial program 70.3%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{t - z \cdot a}{x - y \cdot z}}} \]
      2. associate-/r/70.2%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(z, -a, t\right)} \cdot \left(x - y \cdot z\right)} \]
    7. Taylor expanded in z around inf 54.7%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{a \cdot z} + \frac{y}{a}} \]
    11. Step-by-step derivation
      1. +-commutative78.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} - \frac{\frac{x}{z}}{a}} \]
      5. div-sub82.6%

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

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

    if -2.75e132 < z < -5.50000000000000004e63

    1. Initial program 68.2%

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

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

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

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

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

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

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

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

    if -1.94999999999999989e-16 < z < -2.1e-69

    1. Initial program 99.6%

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot \frac{z}{t - a \cdot z}\right)} \]
      2. cancel-sign-sub-inv82.8%

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{\color{blue}{t + \left(-a\right) \cdot z}}\right) \]
      3. *-commutative82.8%

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

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{\color{blue}{z \cdot \left(-a\right) + t}}\right) \]
      5. fma-define82.8%

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{\color{blue}{\mathsf{fma}\left(z, -a, t\right)}}\right) \]
      6. neg-mul-182.8%

        \[\leadsto \color{blue}{-y \cdot \frac{z}{\mathsf{fma}\left(z, -a, t\right)}} \]
      7. associate-*r/84.0%

        \[\leadsto -\color{blue}{\frac{y \cdot z}{\mathsf{fma}\left(z, -a, t\right)}} \]
      8. distribute-frac-neg284.0%

        \[\leadsto \color{blue}{\frac{y \cdot z}{-\mathsf{fma}\left(z, -a, t\right)}} \]
      9. neg-sub084.0%

        \[\leadsto \frac{y \cdot z}{\color{blue}{0 - \mathsf{fma}\left(z, -a, t\right)}} \]
      10. fma-define84.0%

        \[\leadsto \frac{y \cdot z}{0 - \color{blue}{\left(z \cdot \left(-a\right) + t\right)}} \]
      11. associate--r+84.0%

        \[\leadsto \frac{y \cdot z}{\color{blue}{\left(0 - z \cdot \left(-a\right)\right) - t}} \]
      12. neg-sub084.0%

        \[\leadsto \frac{y \cdot z}{\color{blue}{\left(-z \cdot \left(-a\right)\right)} - t} \]
      13. distribute-rgt-neg-out84.0%

        \[\leadsto \frac{y \cdot z}{\left(-\color{blue}{\left(-z \cdot a\right)}\right) - t} \]
      14. remove-double-neg84.0%

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{z \cdot a - t}} \]
    8. Step-by-step derivation
      1. *-commutative84.0%

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{z \cdot a - t}} \]
    9. Applied egg-rr83.9%

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

    if -2.1e-69 < z < 1.69999999999999996e23

    1. Initial program 99.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.75 \cdot 10^{+132}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{+63}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-16}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-69}:\\ \;\;\;\;z \cdot \frac{y}{z \cdot a - t}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+23}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 71.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{a - \frac{t}{z}}\\ t_2 := \frac{y - \frac{x}{z}}{a}\\ \mathbf{if}\;z \leq -5 \cdot 10^{+128}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+62}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-16}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -1.12 \cdot 10^{-69}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+20}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ y (- a (/ t z)))) (t_2 (/ (- y (/ x z)) a)))
   (if (<= z -5e+128)
     t_2
     (if (<= z -1.5e+62)
       t_1
       (if (<= z -1.6e-16)
         t_2
         (if (<= z -1.12e-69)
           t_1
           (if (<= z 2.05e+20) (/ x (- t (* z a))) t_2)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y / (a - (t / z));
	double t_2 = (y - (x / z)) / a;
	double tmp;
	if (z <= -5e+128) {
		tmp = t_2;
	} else if (z <= -1.5e+62) {
		tmp = t_1;
	} else if (z <= -1.6e-16) {
		tmp = t_2;
	} else if (z <= -1.12e-69) {
		tmp = t_1;
	} else if (z <= 2.05e+20) {
		tmp = x / (t - (z * a));
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = y / (a - (t / z))
    t_2 = (y - (x / z)) / a
    if (z <= (-5d+128)) then
        tmp = t_2
    else if (z <= (-1.5d+62)) then
        tmp = t_1
    else if (z <= (-1.6d-16)) then
        tmp = t_2
    else if (z <= (-1.12d-69)) then
        tmp = t_1
    else if (z <= 2.05d+20) then
        tmp = x / (t - (z * a))
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y / (a - (t / z));
	double t_2 = (y - (x / z)) / a;
	double tmp;
	if (z <= -5e+128) {
		tmp = t_2;
	} else if (z <= -1.5e+62) {
		tmp = t_1;
	} else if (z <= -1.6e-16) {
		tmp = t_2;
	} else if (z <= -1.12e-69) {
		tmp = t_1;
	} else if (z <= 2.05e+20) {
		tmp = x / (t - (z * a));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y / (a - (t / z))
	t_2 = (y - (x / z)) / a
	tmp = 0
	if z <= -5e+128:
		tmp = t_2
	elif z <= -1.5e+62:
		tmp = t_1
	elif z <= -1.6e-16:
		tmp = t_2
	elif z <= -1.12e-69:
		tmp = t_1
	elif z <= 2.05e+20:
		tmp = x / (t - (z * a))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y / Float64(a - Float64(t / z)))
	t_2 = Float64(Float64(y - Float64(x / z)) / a)
	tmp = 0.0
	if (z <= -5e+128)
		tmp = t_2;
	elseif (z <= -1.5e+62)
		tmp = t_1;
	elseif (z <= -1.6e-16)
		tmp = t_2;
	elseif (z <= -1.12e-69)
		tmp = t_1;
	elseif (z <= 2.05e+20)
		tmp = Float64(x / Float64(t - Float64(z * a)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y / (a - (t / z));
	t_2 = (y - (x / z)) / a;
	tmp = 0.0;
	if (z <= -5e+128)
		tmp = t_2;
	elseif (z <= -1.5e+62)
		tmp = t_1;
	elseif (z <= -1.6e-16)
		tmp = t_2;
	elseif (z <= -1.12e-69)
		tmp = t_1;
	elseif (z <= 2.05e+20)
		tmp = x / (t - (z * a));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -5e+128], t$95$2, If[LessEqual[z, -1.5e+62], t$95$1, If[LessEqual[z, -1.6e-16], t$95$2, If[LessEqual[z, -1.12e-69], t$95$1, If[LessEqual[z, 2.05e+20], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.5 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.6 \cdot 10^{-16}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -1.12 \cdot 10^{-69}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5e128 or -1.5e62 < z < -1.60000000000000011e-16 or 2.05e20 < z

    1. Initial program 70.3%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{t - z \cdot a}{x - y \cdot z}}} \]
      2. associate-/r/70.2%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(z, -a, t\right)} \cdot \left(x - y \cdot z\right)} \]
    7. Taylor expanded in z around inf 54.7%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{a \cdot z} + \frac{y}{a}} \]
    11. Step-by-step derivation
      1. +-commutative78.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} - \frac{\frac{x}{z}}{a}} \]
      5. div-sub82.6%

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

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

    if -5e128 < z < -1.5e62 or -1.60000000000000011e-16 < z < -1.12e-69

    1. Initial program 80.8%

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

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

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

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

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

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

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

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

    if -1.12e-69 < z < 2.05e20

    1. Initial program 99.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+128}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+62}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-16}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq -1.12 \cdot 10^{-69}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+20}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 53.2% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.75 \cdot 10^{-14}:\\
\;\;\;\;\frac{y}{a}\\

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

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

\mathbf{elif}\;z \leq 1.02 \cdot 10^{+197} \lor \neg \left(z \leq 5.5 \cdot 10^{+237}\right):\\
\;\;\;\;\frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.74999999999999996e-14 or 6.8e18 < z < 1.02000000000000008e197 or 5.5000000000000001e237 < z

    1. Initial program 68.3%

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

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

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

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

    if -2.74999999999999996e-14 < z < -5.10000000000000008e-80

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot \frac{z}{t - a \cdot z}\right)} \]
      2. cancel-sign-sub-inv66.9%

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

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{t + \color{blue}{z \cdot \left(-a\right)}}\right) \]
      4. +-commutative66.9%

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{\color{blue}{z \cdot \left(-a\right) + t}}\right) \]
      5. fma-define66.9%

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{\color{blue}{\mathsf{fma}\left(z, -a, t\right)}}\right) \]
      6. neg-mul-166.9%

        \[\leadsto \color{blue}{-y \cdot \frac{z}{\mathsf{fma}\left(z, -a, t\right)}} \]
      7. associate-*r/74.3%

        \[\leadsto -\color{blue}{\frac{y \cdot z}{\mathsf{fma}\left(z, -a, t\right)}} \]
      8. distribute-frac-neg274.3%

        \[\leadsto \color{blue}{\frac{y \cdot z}{-\mathsf{fma}\left(z, -a, t\right)}} \]
      9. neg-sub074.3%

        \[\leadsto \frac{y \cdot z}{\color{blue}{0 - \mathsf{fma}\left(z, -a, t\right)}} \]
      10. fma-define74.3%

        \[\leadsto \frac{y \cdot z}{0 - \color{blue}{\left(z \cdot \left(-a\right) + t\right)}} \]
      11. associate--r+74.3%

        \[\leadsto \frac{y \cdot z}{\color{blue}{\left(0 - z \cdot \left(-a\right)\right) - t}} \]
      12. neg-sub074.3%

        \[\leadsto \frac{y \cdot z}{\color{blue}{\left(-z \cdot \left(-a\right)\right)} - t} \]
      13. distribute-rgt-neg-out74.3%

        \[\leadsto \frac{y \cdot z}{\left(-\color{blue}{\left(-z \cdot a\right)}\right) - t} \]
      14. remove-double-neg74.3%

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{z \cdot a - t}} \]
    8. Step-by-step derivation
      1. *-commutative74.3%

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

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

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

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

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

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

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

    if -5.10000000000000008e-80 < z < 6.8e18

    1. Initial program 99.8%

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

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

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

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

    if 1.02000000000000008e197 < z < 5.5000000000000001e237

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{a \cdot z}} \]
      2. associate-/l/79.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.75 \cdot 10^{-14}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -5.1 \cdot 10^{-80}:\\ \;\;\;\;z \cdot \frac{y}{-t}\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+18}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{+197} \lor \neg \left(z \leq 5.5 \cdot 10^{+237}\right):\\ \;\;\;\;\frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{-z}}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 64.0% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq 1.02 \cdot 10^{+197} \lor \neg \left(z \leq 5.5 \cdot 10^{+237}\right):\\
\;\;\;\;\frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.15000000000000007e56 or 1.36e57 < z < 1.02000000000000008e197 or 5.5000000000000001e237 < z

    1. Initial program 61.1%

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

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

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

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

    if -1.15000000000000007e56 < z < 1.36e57

    1. Initial program 99.8%

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

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

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

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

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

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

    if 1.02000000000000008e197 < z < 5.5000000000000001e237

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{a \cdot z}} \]
      2. associate-/l/79.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{+56}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 1.36 \cdot 10^{+57}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{+197} \lor \neg \left(z \leq 5.5 \cdot 10^{+237}\right):\\ \;\;\;\;\frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{-z}}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 89.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{+123} \lor \neg \left(z \leq 4.5 \cdot 10^{+80}\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 -1.85e+123) (not (<= z 4.5e+80)))
   (/ (- 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 <= -1.85e+123) || !(z <= 4.5e+80)) {
		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 <= (-1.85d+123)) .or. (.not. (z <= 4.5d+80))) 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 <= -1.85e+123) || !(z <= 4.5e+80)) {
		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 <= -1.85e+123) or not (z <= 4.5e+80):
		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 <= -1.85e+123) || !(z <= 4.5e+80))
		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 <= -1.85e+123) || ~((z <= 4.5e+80)))
		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, -1.85e+123], N[Not[LessEqual[z, 4.5e+80]], $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 -1.85 \cdot 10^{+123} \lor \neg \left(z \leq 4.5 \cdot 10^{+80}\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 < -1.84999999999999998e123 or 4.50000000000000007e80 < z

    1. Initial program 61.5%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{t - z \cdot a}{x - y \cdot z}}} \]
      2. associate-/r/61.5%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(z, -a, t\right)} \cdot \left(x - y \cdot z\right)} \]
    7. Taylor expanded in z around inf 49.2%

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

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

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

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

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

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

        \[\leadsto \frac{y}{a} + \frac{\color{blue}{-x}}{a \cdot z} \]
      4. *-commutative80.0%

        \[\leadsto \frac{y}{a} + \frac{-x}{\color{blue}{z \cdot a}} \]
    12. Simplified80.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} - \frac{\frac{x}{z}}{a}} \]
      5. div-sub84.4%

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

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

    if -1.84999999999999998e123 < z < 4.50000000000000007e80

    1. Initial program 96.9%

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

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

Alternative 10: 54.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{y}{a}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.20000000000000009e-15 or 1.6e23 < z

    1. Initial program 69.8%

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

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

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

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

    if -5.20000000000000009e-15 < z < -6.49999999999999984e-80

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot \frac{z}{t - a \cdot z}\right)} \]
      2. cancel-sign-sub-inv66.9%

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

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{t + \color{blue}{z \cdot \left(-a\right)}}\right) \]
      4. +-commutative66.9%

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{\color{blue}{z \cdot \left(-a\right) + t}}\right) \]
      5. fma-define66.9%

        \[\leadsto -1 \cdot \left(y \cdot \frac{z}{\color{blue}{\mathsf{fma}\left(z, -a, t\right)}}\right) \]
      6. neg-mul-166.9%

        \[\leadsto \color{blue}{-y \cdot \frac{z}{\mathsf{fma}\left(z, -a, t\right)}} \]
      7. associate-*r/74.3%

        \[\leadsto -\color{blue}{\frac{y \cdot z}{\mathsf{fma}\left(z, -a, t\right)}} \]
      8. distribute-frac-neg274.3%

        \[\leadsto \color{blue}{\frac{y \cdot z}{-\mathsf{fma}\left(z, -a, t\right)}} \]
      9. neg-sub074.3%

        \[\leadsto \frac{y \cdot z}{\color{blue}{0 - \mathsf{fma}\left(z, -a, t\right)}} \]
      10. fma-define74.3%

        \[\leadsto \frac{y \cdot z}{0 - \color{blue}{\left(z \cdot \left(-a\right) + t\right)}} \]
      11. associate--r+74.3%

        \[\leadsto \frac{y \cdot z}{\color{blue}{\left(0 - z \cdot \left(-a\right)\right) - t}} \]
      12. neg-sub074.3%

        \[\leadsto \frac{y \cdot z}{\color{blue}{\left(-z \cdot \left(-a\right)\right)} - t} \]
      13. distribute-rgt-neg-out74.3%

        \[\leadsto \frac{y \cdot z}{\left(-\color{blue}{\left(-z \cdot a\right)}\right) - t} \]
      14. remove-double-neg74.3%

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{z \cdot a - t}} \]
    8. Step-by-step derivation
      1. *-commutative74.3%

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

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

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

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

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

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

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

    if -6.49999999999999984e-80 < z < 1.6e23

    1. Initial program 99.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{-15}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{-80}:\\ \;\;\;\;z \cdot \frac{y}{-t}\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+23}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 70.9% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.60000000000000011e-16 or 1.05000000000000001e-80 < z

    1. Initial program 72.8%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{t - z \cdot a}{x - y \cdot z}}} \]
      2. associate-/r/72.8%

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

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

        \[\leadsto \frac{1}{\color{blue}{\left(-z \cdot a\right) + t}} \cdot \left(x - y \cdot z\right) \]
      5. distribute-rgt-neg-in72.8%

        \[\leadsto \frac{1}{\color{blue}{z \cdot \left(-a\right)} + t} \cdot \left(x - y \cdot z\right) \]
      6. fma-define72.8%

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

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(z, -a, t\right)} \cdot \left(x - y \cdot z\right)} \]
    7. Taylor expanded in z around inf 53.3%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{a \cdot z} + \frac{y}{a}} \]
    11. Step-by-step derivation
      1. +-commutative74.3%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} + \left(-\frac{\frac{x}{z}}{a}\right)} \]
      4. sub-neg77.0%

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

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

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

    if -1.60000000000000011e-16 < z < 1.05000000000000001e-80

    1. Initial program 99.8%

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

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

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

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

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

Alternative 12: 54.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-45} \lor \neg \left(z \leq 4.4 \cdot 10^{+18}\right):\\
\;\;\;\;\frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7e-45 or 4.4e18 < z

    1. Initial program 71.7%

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

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

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

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

    if -7e-45 < z < 4.4e18

    1. Initial program 99.8%

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

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

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

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

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

Alternative 13: 34.9% accurate, 3.7× speedup?

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

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

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

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

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

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

Developer target: 97.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t - a \cdot z\\ t_2 := \frac{x}{t\_1} - \frac{y}{\frac{t}{z} - a}\\ \mathbf{if}\;z < -32113435955957344:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\ \;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- t (* a z))) (t_2 (- (/ x t_1) (/ y (- (/ t z) a)))))
   (if (< z -32113435955957344.0)
     t_2
     (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 t_1)) t_2))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t - (a * z);
	double t_2 = (x / t_1) - (y / ((t / z) - a));
	double tmp;
	if (z < -32113435955957344.0) {
		tmp = t_2;
	} else if (z < 3.5139522372978296e-86) {
		tmp = (x - (y * z)) * (1.0 / t_1);
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t - (a * z)
    t_2 = (x / t_1) - (y / ((t / z) - a))
    if (z < (-32113435955957344.0d0)) then
        tmp = t_2
    else if (z < 3.5139522372978296d-86) then
        tmp = (x - (y * z)) * (1.0d0 / t_1)
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t - (a * z);
	double t_2 = (x / t_1) - (y / ((t / z) - a));
	double tmp;
	if (z < -32113435955957344.0) {
		tmp = t_2;
	} else if (z < 3.5139522372978296e-86) {
		tmp = (x - (y * z)) * (1.0 / t_1);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t - (a * z)
	t_2 = (x / t_1) - (y / ((t / z) - a))
	tmp = 0
	if z < -32113435955957344.0:
		tmp = t_2
	elif z < 3.5139522372978296e-86:
		tmp = (x - (y * z)) * (1.0 / t_1)
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t - Float64(a * z))
	t_2 = Float64(Float64(x / t_1) - Float64(y / Float64(Float64(t / z) - a)))
	tmp = 0.0
	if (z < -32113435955957344.0)
		tmp = t_2;
	elseif (z < 3.5139522372978296e-86)
		tmp = Float64(Float64(x - Float64(y * z)) * Float64(1.0 / t_1));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t - (a * z);
	t_2 = (x / t_1) - (y / ((t / z) - a));
	tmp = 0.0;
	if (z < -32113435955957344.0)
		tmp = t_2;
	elseif (z < 3.5139522372978296e-86)
		tmp = (x - (y * z)) * (1.0 / t_1);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t$95$1), $MachinePrecision] - N[(y / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -32113435955957344.0], t$95$2, If[Less[z, 3.5139522372978296e-86], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t - a \cdot z\\
t_2 := \frac{x}{t\_1} - \frac{y}{\frac{t}{z} - a}\\
\mathbf{if}\;z < -32113435955957344:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\
\;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t\_1}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024096 
(FPCore (x y z t a)
  :name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
  :precision binary64

  :alt
  (if (< z -32113435955957344.0) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a)))))

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