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

Percentage Accurate: 85.4% → 91.7%
Time: 10.9s
Alternatives: 12
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 12 alternatives:

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

Initial Program: 85.4% accurate, 1.0× speedup?

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

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

Alternative 1: 91.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{+107} \lor \neg \left(z \leq 2.7 \cdot 10^{+135}\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 -2.1e+107) (not (<= z 2.7e+135)))
   (/ (- 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 <= -2.1e+107) || !(z <= 2.7e+135)) {
		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 <= (-2.1d+107)) .or. (.not. (z <= 2.7d+135))) 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 <= -2.1e+107) || !(z <= 2.7e+135)) {
		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 <= -2.1e+107) or not (z <= 2.7e+135):
		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 <= -2.1e+107) || !(z <= 2.7e+135))
		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 <= -2.1e+107) || ~((z <= 2.7e+135)))
		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, -2.1e+107], N[Not[LessEqual[z, 2.7e+135]], $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 -2.1 \cdot 10^{+107} \lor \neg \left(z \leq 2.7 \cdot 10^{+135}\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 < -2.1e107 or 2.69999999999999985e135 < z

    1. Initial program 57.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1e107 < z < 2.69999999999999985e135

    1. Initial program 97.5%

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

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

Alternative 2: 71.4% 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^{+29}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-27}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-84}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-7}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+77}:\\ \;\;\;\;z \cdot \left(\frac{x}{z \cdot t} - \frac{y}{t}\right)\\ \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+29)
     t_1
     (if (<= z -3.5e-27)
       (/ (- x (* z y)) t)
       (if (<= z -2e-84)
         t_1
         (if (<= z 1.7e-7)
           (/ x (- t (* z a)))
           (if (<= z 5.6e+77) (* z (- (/ x (* z t)) (/ y t))) 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+29) {
		tmp = t_1;
	} else if (z <= -3.5e-27) {
		tmp = (x - (z * y)) / t;
	} else if (z <= -2e-84) {
		tmp = t_1;
	} else if (z <= 1.7e-7) {
		tmp = x / (t - (z * a));
	} else if (z <= 5.6e+77) {
		tmp = z * ((x / (z * t)) - (y / t));
	} 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+29)) then
        tmp = t_1
    else if (z <= (-3.5d-27)) then
        tmp = (x - (z * y)) / t
    else if (z <= (-2d-84)) then
        tmp = t_1
    else if (z <= 1.7d-7) then
        tmp = x / (t - (z * a))
    else if (z <= 5.6d+77) then
        tmp = z * ((x / (z * t)) - (y / t))
    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+29) {
		tmp = t_1;
	} else if (z <= -3.5e-27) {
		tmp = (x - (z * y)) / t;
	} else if (z <= -2e-84) {
		tmp = t_1;
	} else if (z <= 1.7e-7) {
		tmp = x / (t - (z * a));
	} else if (z <= 5.6e+77) {
		tmp = z * ((x / (z * t)) - (y / t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y - (x / z)) / a
	tmp = 0
	if z <= -9e+29:
		tmp = t_1
	elif z <= -3.5e-27:
		tmp = (x - (z * y)) / t
	elif z <= -2e-84:
		tmp = t_1
	elif z <= 1.7e-7:
		tmp = x / (t - (z * a))
	elif z <= 5.6e+77:
		tmp = z * ((x / (z * t)) - (y / t))
	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+29)
		tmp = t_1;
	elseif (z <= -3.5e-27)
		tmp = Float64(Float64(x - Float64(z * y)) / t);
	elseif (z <= -2e-84)
		tmp = t_1;
	elseif (z <= 1.7e-7)
		tmp = Float64(x / Float64(t - Float64(z * a)));
	elseif (z <= 5.6e+77)
		tmp = Float64(z * Float64(Float64(x / Float64(z * t)) - Float64(y / t)));
	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+29)
		tmp = t_1;
	elseif (z <= -3.5e-27)
		tmp = (x - (z * y)) / t;
	elseif (z <= -2e-84)
		tmp = t_1;
	elseif (z <= 1.7e-7)
		tmp = x / (t - (z * a));
	elseif (z <= 5.6e+77)
		tmp = z * ((x / (z * t)) - (y / t));
	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+29], t$95$1, If[LessEqual[z, -3.5e-27], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, -2e-84], t$95$1, If[LessEqual[z, 1.7e-7], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e+77], N[(z * N[(N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(y / t), $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^{+29}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq -2 \cdot 10^{-84}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 5.6 \cdot 10^{+77}:\\
\;\;\;\;z \cdot \left(\frac{x}{z \cdot t} - \frac{y}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -9.0000000000000005e29 or -3.5000000000000001e-27 < z < -2.0000000000000001e-84 or 5.60000000000000001e77 < z

    1. Initial program 67.7%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\frac{x - y \cdot z}{z}}}{a} \]
      6. div-sub68.2%

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

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

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

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

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

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

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

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

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

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

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

    if -9.0000000000000005e29 < z < -3.5000000000000001e-27

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

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

    if -2.0000000000000001e-84 < z < 1.69999999999999987e-7

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

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

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

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

    if 1.69999999999999987e-7 < z < 5.60000000000000001e77

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{+29}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-27}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-84}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-7}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+77}:\\ \;\;\;\;z \cdot \left(\frac{x}{z \cdot t} - \frac{y}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 53.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{z \cdot \left(-a\right)}\\ \mathbf{if}\;z \leq -6.6 \cdot 10^{+106}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{+39}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{+20}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -1.36 \cdot 10^{-18}:\\ \;\;\;\;y \cdot \frac{z}{-t}\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{-109}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{+77}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ x (* z (- a)))))
   (if (<= z -6.6e+106)
     (/ y a)
     (if (<= z -5.8e+39)
       t_1
       (if (<= z -3.6e+20)
         (/ y a)
         (if (<= z -1.36e-18)
           (* y (/ z (- t)))
           (if (<= z -4.1e-109) t_1 (if (<= z 8.8e+77) (/ x t) (/ y a)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x / (z * -a);
	double tmp;
	if (z <= -6.6e+106) {
		tmp = y / a;
	} else if (z <= -5.8e+39) {
		tmp = t_1;
	} else if (z <= -3.6e+20) {
		tmp = y / a;
	} else if (z <= -1.36e-18) {
		tmp = y * (z / -t);
	} else if (z <= -4.1e-109) {
		tmp = t_1;
	} else if (z <= 8.8e+77) {
		tmp = x / t;
	} else {
		tmp = y / a;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x / (z * -a)
    if (z <= (-6.6d+106)) then
        tmp = y / a
    else if (z <= (-5.8d+39)) then
        tmp = t_1
    else if (z <= (-3.6d+20)) then
        tmp = y / a
    else if (z <= (-1.36d-18)) then
        tmp = y * (z / -t)
    else if (z <= (-4.1d-109)) then
        tmp = t_1
    else if (z <= 8.8d+77) then
        tmp = x / t
    else
        tmp = y / a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x / (z * -a);
	double tmp;
	if (z <= -6.6e+106) {
		tmp = y / a;
	} else if (z <= -5.8e+39) {
		tmp = t_1;
	} else if (z <= -3.6e+20) {
		tmp = y / a;
	} else if (z <= -1.36e-18) {
		tmp = y * (z / -t);
	} else if (z <= -4.1e-109) {
		tmp = t_1;
	} else if (z <= 8.8e+77) {
		tmp = x / t;
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x / (z * -a)
	tmp = 0
	if z <= -6.6e+106:
		tmp = y / a
	elif z <= -5.8e+39:
		tmp = t_1
	elif z <= -3.6e+20:
		tmp = y / a
	elif z <= -1.36e-18:
		tmp = y * (z / -t)
	elif z <= -4.1e-109:
		tmp = t_1
	elif z <= 8.8e+77:
		tmp = x / t
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x / Float64(z * Float64(-a)))
	tmp = 0.0
	if (z <= -6.6e+106)
		tmp = Float64(y / a);
	elseif (z <= -5.8e+39)
		tmp = t_1;
	elseif (z <= -3.6e+20)
		tmp = Float64(y / a);
	elseif (z <= -1.36e-18)
		tmp = Float64(y * Float64(z / Float64(-t)));
	elseif (z <= -4.1e-109)
		tmp = t_1;
	elseif (z <= 8.8e+77)
		tmp = Float64(x / t);
	else
		tmp = Float64(y / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x / (z * -a);
	tmp = 0.0;
	if (z <= -6.6e+106)
		tmp = y / a;
	elseif (z <= -5.8e+39)
		tmp = t_1;
	elseif (z <= -3.6e+20)
		tmp = y / a;
	elseif (z <= -1.36e-18)
		tmp = y * (z / -t);
	elseif (z <= -4.1e-109)
		tmp = t_1;
	elseif (z <= 8.8e+77)
		tmp = x / t;
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(z * (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e+106], N[(y / a), $MachinePrecision], If[LessEqual[z, -5.8e+39], t$95$1, If[LessEqual[z, -3.6e+20], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.36e-18], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.1e-109], t$95$1, If[LessEqual[z, 8.8e+77], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(-a\right)}\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{+106}:\\
\;\;\;\;\frac{y}{a}\\

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

\mathbf{elif}\;z \leq -3.6 \cdot 10^{+20}:\\
\;\;\;\;\frac{y}{a}\\

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

\mathbf{elif}\;z \leq -4.1 \cdot 10^{-109}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -6.60000000000000015e106 or -5.80000000000000059e39 < z < -3.6e20 or 8.8000000000000002e77 < z

    1. Initial program 60.9%

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

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

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

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

    if -6.60000000000000015e106 < z < -5.80000000000000059e39 or -1.3600000000000001e-18 < z < -4.1000000000000002e-109

    1. Initial program 90.9%

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

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

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

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

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

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

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

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

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

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

    if -3.6e20 < z < -1.3600000000000001e-18

    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-num98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.1000000000000002e-109 < z < 8.8000000000000002e77

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{+106}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{+39}:\\ \;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{+20}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -1.36 \cdot 10^{-18}:\\ \;\;\;\;y \cdot \frac{z}{-t}\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{-109}:\\ \;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{+77}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 66.3% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -3.4 \cdot 10^{-109}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -2.2 \cdot 10^{-174}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 5.6 \cdot 10^{+77}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.60000000000000015e106 or 5.60000000000000001e77 < z

    1. Initial program 60.5%

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

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

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

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

    if -6.60000000000000015e106 < z < -3.40000000000000012e-109 or -2.20000000000000022e-174 < z < 5.99999999999999987e-16

    1. Initial program 97.4%

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

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

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

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

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

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

    if -3.40000000000000012e-109 < z < -2.20000000000000022e-174 or 5.99999999999999987e-16 < z < 5.60000000000000001e77

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{+106}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-109}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-174}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-16}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+77}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 71.2% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -1.92 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -2 \cdot 10^{-84}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq 4.3 \cdot 10^{+77}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.4999999999999999e34 or -1.91999999999999994e-19 < z < -2.0000000000000001e-84 or 4.29999999999999991e77 < z

    1. Initial program 67.7%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\frac{x - y \cdot z}{z}}}{a} \]
      6. div-sub68.2%

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

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

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

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

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

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

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

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

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

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

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

    if -2.4999999999999999e34 < z < -1.91999999999999994e-19 or 6.8e-16 < z < 4.29999999999999991e77

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

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

    if -2.0000000000000001e-84 < z < 6.8e-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. Taylor expanded in x around inf 82.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{+34}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq -1.92 \cdot 10^{-19}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-84}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-16}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{+77}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 53.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{+106}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -960000:\\ \;\;\;\;\frac{\frac{x}{a}}{-z}\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-21}:\\ \;\;\;\;z \cdot \frac{y}{-t}\\ \mathbf{elif}\;z \leq -2.25 \cdot 10^{-108}:\\ \;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+77}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -6.6e+106)
   (/ y a)
   (if (<= z -960000.0)
     (/ (/ x a) (- z))
     (if (<= z -3.4e-21)
       (* z (/ y (- t)))
       (if (<= z -2.25e-108)
         (/ x (* z (- a)))
         (if (<= z 5.6e+77) (/ x t) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -6.6e+106) {
		tmp = y / a;
	} else if (z <= -960000.0) {
		tmp = (x / a) / -z;
	} else if (z <= -3.4e-21) {
		tmp = z * (y / -t);
	} else if (z <= -2.25e-108) {
		tmp = x / (z * -a);
	} else if (z <= 5.6e+77) {
		tmp = x / t;
	} else {
		tmp = y / a;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-6.6d+106)) then
        tmp = y / a
    else if (z <= (-960000.0d0)) then
        tmp = (x / a) / -z
    else if (z <= (-3.4d-21)) then
        tmp = z * (y / -t)
    else if (z <= (-2.25d-108)) then
        tmp = x / (z * -a)
    else if (z <= 5.6d+77) then
        tmp = x / t
    else
        tmp = y / a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -6.6e+106) {
		tmp = y / a;
	} else if (z <= -960000.0) {
		tmp = (x / a) / -z;
	} else if (z <= -3.4e-21) {
		tmp = z * (y / -t);
	} else if (z <= -2.25e-108) {
		tmp = x / (z * -a);
	} else if (z <= 5.6e+77) {
		tmp = x / t;
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -6.6e+106:
		tmp = y / a
	elif z <= -960000.0:
		tmp = (x / a) / -z
	elif z <= -3.4e-21:
		tmp = z * (y / -t)
	elif z <= -2.25e-108:
		tmp = x / (z * -a)
	elif z <= 5.6e+77:
		tmp = x / t
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -6.6e+106)
		tmp = Float64(y / a);
	elseif (z <= -960000.0)
		tmp = Float64(Float64(x / a) / Float64(-z));
	elseif (z <= -3.4e-21)
		tmp = Float64(z * Float64(y / Float64(-t)));
	elseif (z <= -2.25e-108)
		tmp = Float64(x / Float64(z * Float64(-a)));
	elseif (z <= 5.6e+77)
		tmp = Float64(x / t);
	else
		tmp = Float64(y / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -6.6e+106)
		tmp = y / a;
	elseif (z <= -960000.0)
		tmp = (x / a) / -z;
	elseif (z <= -3.4e-21)
		tmp = z * (y / -t);
	elseif (z <= -2.25e-108)
		tmp = x / (z * -a);
	elseif (z <= 5.6e+77)
		tmp = x / t;
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.6e+106], N[(y / a), $MachinePrecision], If[LessEqual[z, -960000.0], N[(N[(x / a), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[z, -3.4e-21], N[(z * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.25e-108], N[(x / N[(z * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e+77], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -960000:\\
\;\;\;\;\frac{\frac{x}{a}}{-z}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -6.60000000000000015e106 or 5.60000000000000001e77 < z

    1. Initial program 60.5%

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

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

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

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

    if -6.60000000000000015e106 < z < -9.6e5

    1. Initial program 86.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{a}}{\color{blue}{-z}} \]
    11. Simplified45.7%

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

    if -9.6e5 < z < -3.4e-21

    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-num98.4%

        \[\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. *-commutative99.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{z}{-t}} \]
    10. Simplified71.4%

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{z \cdot y}{t}} \]
      5. associate-*r/71.6%

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

        \[\leadsto \color{blue}{z \cdot \left(-\frac{y}{t}\right)} \]
      7. distribute-neg-frac271.6%

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

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

    if -3.4e-21 < z < -2.24999999999999985e-108

    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 inf 63.3%

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

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

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

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

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

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

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

    if -2.24999999999999985e-108 < z < 5.60000000000000001e77

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{+106}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -960000:\\ \;\;\;\;\frac{\frac{x}{a}}{-z}\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-21}:\\ \;\;\;\;z \cdot \frac{y}{-t}\\ \mathbf{elif}\;z \leq -2.25 \cdot 10^{-108}:\\ \;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+77}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 53.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -750000:\\
\;\;\;\;\frac{\frac{x}{z}}{-a}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.3500000000000001e107 or 5.9999999999999996e77 < z

    1. Initial program 60.5%

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

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

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

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

    if -1.3500000000000001e107 < z < -7.5e5

    1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.5e5 < z < -6.60000000000000055e-29

    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-num98.4%

        \[\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. *-commutative99.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{z}{-t}} \]
    10. Simplified71.4%

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{z \cdot y}{t}} \]
      5. associate-*r/71.6%

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

        \[\leadsto \color{blue}{z \cdot \left(-\frac{y}{t}\right)} \]
      7. distribute-neg-frac271.6%

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

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

    if -6.60000000000000055e-29 < z < -2.5e-108

    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 inf 63.3%

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

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

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

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

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

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

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

    if -2.5e-108 < z < 5.9999999999999996e77

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+107}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -750000:\\ \;\;\;\;\frac{\frac{x}{z}}{-a}\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{-29}:\\ \;\;\;\;z \cdot \frac{y}{-t}\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-108}:\\ \;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+77}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 53.5% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.40000000000000001e71 or 2.3000000000000002e78 < z

    1. Initial program 61.7%

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

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

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

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

    if -1.40000000000000001e71 < z < -6.99999999999999947e-110

    1. Initial program 97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.99999999999999947e-110 < z < 2.3000000000000002e78

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

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

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

Alternative 9: 53.7% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.3999999999999999e61 or 3.69999999999999995e77 < z

    1. Initial program 63.1%

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

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

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

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

    if -2.3999999999999999e61 < z < -7.1999999999999999e-110

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{y \cdot \frac{z}{t}} \]
      3. *-commutative37.9%

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

        \[\leadsto -\color{blue}{\frac{z \cdot y}{t}} \]
      5. associate-*r/40.7%

        \[\leadsto -\color{blue}{z \cdot \frac{y}{t}} \]
      6. distribute-rgt-neg-in40.7%

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

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

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

    if -7.1999999999999999e-110 < z < 3.69999999999999995e77

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+61}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{-110}:\\ \;\;\;\;z \cdot \frac{y}{-t}\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+77}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 66.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+106} \lor \neg \left(z \leq 3.6 \cdot 10^{+77}\right):\\
\;\;\;\;\frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.79999999999999989e106 or 3.5999999999999998e77 < z

    1. Initial program 60.5%

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

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

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

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

    if -6.79999999999999989e106 < z < 3.5999999999999998e77

    1. Initial program 98.0%

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

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

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

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

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

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

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

Alternative 11: 54.8% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.20000000000000009e36 or 2.3000000000000002e78 < z

    1. Initial program 64.1%

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

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

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

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

    if -4.20000000000000009e36 < z < 2.3000000000000002e78

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

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

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

Alternative 12: 35.7% 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 83.6%

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

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

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

    \[\leadsto \color{blue}{\frac{x}{t}} \]
  6. Final simplification33.7%

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

Developer target: 97.3% 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 2024080 
(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))))