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

Percentage Accurate: 84.6% → 90.5%
Time: 17.5s
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: 84.6% accurate, 1.0× speedup?

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

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

Alternative 1: 90.5% accurate, 0.5× speedup?

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

\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.55000000000000002e56 or 2.99999999999999991e95 < z

    1. Initial program 58.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t - a \cdot z}{-z}}} \]
      5. *-commutative55.7%

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

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

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

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

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

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

    if -1.55000000000000002e56 < z < 2.99999999999999991e95

    1. Initial program 99.2%

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

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

Alternative 2: 72.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{t - z \cdot a}\\ t_2 := \frac{y}{a - \frac{t}{z}}\\ \mathbf{if}\;z \leq -2 \cdot 10^{+22}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-34}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-138}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{-77} \lor \neg \left(z \leq 9.2 \cdot 10^{+14}\right) \land z \leq 2.5 \cdot 10^{+45}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ x (- t (* z a)))) (t_2 (/ y (- a (/ t z)))))
   (if (<= z -2e+22)
     t_2
     (if (<= z -6e-34)
       t_1
       (if (<= z -4.5e-138)
         (/ (- x (* z y)) t)
         (if (or (<= z 6.4e-77) (and (not (<= z 9.2e+14)) (<= z 2.5e+45)))
           t_1
           t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x / (t - (z * a));
	double t_2 = y / (a - (t / z));
	double tmp;
	if (z <= -2e+22) {
		tmp = t_2;
	} else if (z <= -6e-34) {
		tmp = t_1;
	} else if (z <= -4.5e-138) {
		tmp = (x - (z * y)) / t;
	} else if ((z <= 6.4e-77) || (!(z <= 9.2e+14) && (z <= 2.5e+45))) {
		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 / (t - (z * a))
    t_2 = y / (a - (t / z))
    if (z <= (-2d+22)) then
        tmp = t_2
    else if (z <= (-6d-34)) then
        tmp = t_1
    else if (z <= (-4.5d-138)) then
        tmp = (x - (z * y)) / t
    else if ((z <= 6.4d-77) .or. (.not. (z <= 9.2d+14)) .and. (z <= 2.5d+45)) 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 / (t - (z * a));
	double t_2 = y / (a - (t / z));
	double tmp;
	if (z <= -2e+22) {
		tmp = t_2;
	} else if (z <= -6e-34) {
		tmp = t_1;
	} else if (z <= -4.5e-138) {
		tmp = (x - (z * y)) / t;
	} else if ((z <= 6.4e-77) || (!(z <= 9.2e+14) && (z <= 2.5e+45))) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x / (t - (z * a))
	t_2 = y / (a - (t / z))
	tmp = 0
	if z <= -2e+22:
		tmp = t_2
	elif z <= -6e-34:
		tmp = t_1
	elif z <= -4.5e-138:
		tmp = (x - (z * y)) / t
	elif (z <= 6.4e-77) or (not (z <= 9.2e+14) and (z <= 2.5e+45)):
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x / Float64(t - Float64(z * a)))
	t_2 = Float64(y / Float64(a - Float64(t / z)))
	tmp = 0.0
	if (z <= -2e+22)
		tmp = t_2;
	elseif (z <= -6e-34)
		tmp = t_1;
	elseif (z <= -4.5e-138)
		tmp = Float64(Float64(x - Float64(z * y)) / t);
	elseif ((z <= 6.4e-77) || (!(z <= 9.2e+14) && (z <= 2.5e+45)))
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x / (t - (z * a));
	t_2 = y / (a - (t / z));
	tmp = 0.0;
	if (z <= -2e+22)
		tmp = t_2;
	elseif (z <= -6e-34)
		tmp = t_1;
	elseif (z <= -4.5e-138)
		tmp = (x - (z * y)) / t;
	elseif ((z <= 6.4e-77) || (~((z <= 9.2e+14)) && (z <= 2.5e+45)))
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+22], t$95$2, If[LessEqual[z, -6e-34], t$95$1, If[LessEqual[z, -4.5e-138], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[z, 6.4e-77], And[N[Not[LessEqual[z, 9.2e+14]], $MachinePrecision], LessEqual[z, 2.5e+45]]], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -6 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 6.4 \cdot 10^{-77} \lor \neg \left(z \leq 9.2 \cdot 10^{+14}\right) \land z \leq 2.5 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2e22 or 6.39999999999999999e-77 < z < 9.2e14 or 2.5e45 < z

    1. Initial program 67.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{a - \frac{t}{z}}} \]
    10. Simplified77.1%

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

    if -2e22 < z < -6e-34 or -4.50000000000000008e-138 < z < 6.39999999999999999e-77 or 9.2e14 < z < 2.5e45

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

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

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

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

    if -6e-34 < z < -4.50000000000000008e-138

    1. Initial program 99.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+22}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-34}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-138}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{-77} \lor \neg \left(z \leq 9.2 \cdot 10^{+14}\right) \land z \leq 2.5 \cdot 10^{+45}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 72.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t - z \cdot a\\ t_2 := \frac{x}{t\_1}\\ t_3 := \frac{y}{a - \frac{t}{z}}\\ \mathbf{if}\;z \leq -1.55 \cdot 10^{+22}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-34}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-134}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-76}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+19}:\\ \;\;\;\;\frac{y}{\frac{t\_1}{-z}}\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+46}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- t (* z a))) (t_2 (/ x t_1)) (t_3 (/ y (- a (/ t z)))))
   (if (<= z -1.55e+22)
     t_3
     (if (<= z -5e-34)
       t_2
       (if (<= z -1.4e-134)
         (/ (- x (* z y)) t)
         (if (<= z 1.4e-76)
           t_2
           (if (<= z 1.25e+19)
             (/ y (/ t_1 (- z)))
             (if (<= z 1.9e+46) t_2 t_3))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t - (z * a);
	double t_2 = x / t_1;
	double t_3 = y / (a - (t / z));
	double tmp;
	if (z <= -1.55e+22) {
		tmp = t_3;
	} else if (z <= -5e-34) {
		tmp = t_2;
	} else if (z <= -1.4e-134) {
		tmp = (x - (z * y)) / t;
	} else if (z <= 1.4e-76) {
		tmp = t_2;
	} else if (z <= 1.25e+19) {
		tmp = y / (t_1 / -z);
	} else if (z <= 1.9e+46) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	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) :: t_3
    real(8) :: tmp
    t_1 = t - (z * a)
    t_2 = x / t_1
    t_3 = y / (a - (t / z))
    if (z <= (-1.55d+22)) then
        tmp = t_3
    else if (z <= (-5d-34)) then
        tmp = t_2
    else if (z <= (-1.4d-134)) then
        tmp = (x - (z * y)) / t
    else if (z <= 1.4d-76) then
        tmp = t_2
    else if (z <= 1.25d+19) then
        tmp = y / (t_1 / -z)
    else if (z <= 1.9d+46) then
        tmp = t_2
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t - (z * a);
	double t_2 = x / t_1;
	double t_3 = y / (a - (t / z));
	double tmp;
	if (z <= -1.55e+22) {
		tmp = t_3;
	} else if (z <= -5e-34) {
		tmp = t_2;
	} else if (z <= -1.4e-134) {
		tmp = (x - (z * y)) / t;
	} else if (z <= 1.4e-76) {
		tmp = t_2;
	} else if (z <= 1.25e+19) {
		tmp = y / (t_1 / -z);
	} else if (z <= 1.9e+46) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t - (z * a)
	t_2 = x / t_1
	t_3 = y / (a - (t / z))
	tmp = 0
	if z <= -1.55e+22:
		tmp = t_3
	elif z <= -5e-34:
		tmp = t_2
	elif z <= -1.4e-134:
		tmp = (x - (z * y)) / t
	elif z <= 1.4e-76:
		tmp = t_2
	elif z <= 1.25e+19:
		tmp = y / (t_1 / -z)
	elif z <= 1.9e+46:
		tmp = t_2
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t - Float64(z * a))
	t_2 = Float64(x / t_1)
	t_3 = Float64(y / Float64(a - Float64(t / z)))
	tmp = 0.0
	if (z <= -1.55e+22)
		tmp = t_3;
	elseif (z <= -5e-34)
		tmp = t_2;
	elseif (z <= -1.4e-134)
		tmp = Float64(Float64(x - Float64(z * y)) / t);
	elseif (z <= 1.4e-76)
		tmp = t_2;
	elseif (z <= 1.25e+19)
		tmp = Float64(y / Float64(t_1 / Float64(-z)));
	elseif (z <= 1.9e+46)
		tmp = t_2;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t - (z * a);
	t_2 = x / t_1;
	t_3 = y / (a - (t / z));
	tmp = 0.0;
	if (z <= -1.55e+22)
		tmp = t_3;
	elseif (z <= -5e-34)
		tmp = t_2;
	elseif (z <= -1.4e-134)
		tmp = (x - (z * y)) / t;
	elseif (z <= 1.4e-76)
		tmp = t_2;
	elseif (z <= 1.25e+19)
		tmp = y / (t_1 / -z);
	elseif (z <= 1.9e+46)
		tmp = t_2;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.55e+22], t$95$3, If[LessEqual[z, -5e-34], t$95$2, If[LessEqual[z, -1.4e-134], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.4e-76], t$95$2, If[LessEqual[z, 1.25e+19], N[(y / N[(t$95$1 / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e+46], t$95$2, t$95$3]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x}{t\_1}\\
t_3 := \frac{y}{a - \frac{t}{z}}\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{+22}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq -5 \cdot 10^{-34}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq 1.4 \cdot 10^{-76}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 1.25 \cdot 10^{+19}:\\
\;\;\;\;\frac{y}{\frac{t\_1}{-z}}\\

\mathbf{elif}\;z \leq 1.9 \cdot 10^{+46}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.5500000000000001e22 or 1.9e46 < z

    1. Initial program 62.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t - a \cdot z}{-z}}} \]
      5. *-commutative58.1%

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

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

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

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

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

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

    if -1.5500000000000001e22 < z < -5.0000000000000003e-34 or -1.3999999999999999e-134 < z < 1.40000000000000005e-76 or 1.25e19 < z < 1.9e46

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

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

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

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

    if -5.0000000000000003e-34 < z < -1.3999999999999999e-134

    1. Initial program 99.9%

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

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

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

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

    if 1.40000000000000005e-76 < z < 1.25e19

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{+22}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-34}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-134}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-76}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+19}:\\ \;\;\;\;\frac{y}{\frac{t - z \cdot a}{-z}}\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+46}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 72.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t - z \cdot a\\ t_2 := \frac{x}{t\_1}\\ t_3 := \frac{y}{a - \frac{t}{z}}\\ \mathbf{if}\;z \leq -2.4 \cdot 10^{+22}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq -6.4 \cdot 10^{-34}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-134}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-76}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+15}:\\ \;\;\;\;\frac{z \cdot \left(-y\right)}{t\_1}\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{+47}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- t (* z a))) (t_2 (/ x t_1)) (t_3 (/ y (- a (/ t z)))))
   (if (<= z -2.4e+22)
     t_3
     (if (<= z -6.4e-34)
       t_2
       (if (<= z -7e-134)
         (/ (- x (* z y)) t)
         (if (<= z 2.3e-76)
           t_2
           (if (<= z 3.1e+15)
             (/ (* z (- y)) t_1)
             (if (<= z 3.3e+47) t_2 t_3))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t - (z * a);
	double t_2 = x / t_1;
	double t_3 = y / (a - (t / z));
	double tmp;
	if (z <= -2.4e+22) {
		tmp = t_3;
	} else if (z <= -6.4e-34) {
		tmp = t_2;
	} else if (z <= -7e-134) {
		tmp = (x - (z * y)) / t;
	} else if (z <= 2.3e-76) {
		tmp = t_2;
	} else if (z <= 3.1e+15) {
		tmp = (z * -y) / t_1;
	} else if (z <= 3.3e+47) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	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) :: t_3
    real(8) :: tmp
    t_1 = t - (z * a)
    t_2 = x / t_1
    t_3 = y / (a - (t / z))
    if (z <= (-2.4d+22)) then
        tmp = t_3
    else if (z <= (-6.4d-34)) then
        tmp = t_2
    else if (z <= (-7d-134)) then
        tmp = (x - (z * y)) / t
    else if (z <= 2.3d-76) then
        tmp = t_2
    else if (z <= 3.1d+15) then
        tmp = (z * -y) / t_1
    else if (z <= 3.3d+47) then
        tmp = t_2
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t - (z * a);
	double t_2 = x / t_1;
	double t_3 = y / (a - (t / z));
	double tmp;
	if (z <= -2.4e+22) {
		tmp = t_3;
	} else if (z <= -6.4e-34) {
		tmp = t_2;
	} else if (z <= -7e-134) {
		tmp = (x - (z * y)) / t;
	} else if (z <= 2.3e-76) {
		tmp = t_2;
	} else if (z <= 3.1e+15) {
		tmp = (z * -y) / t_1;
	} else if (z <= 3.3e+47) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t - (z * a)
	t_2 = x / t_1
	t_3 = y / (a - (t / z))
	tmp = 0
	if z <= -2.4e+22:
		tmp = t_3
	elif z <= -6.4e-34:
		tmp = t_2
	elif z <= -7e-134:
		tmp = (x - (z * y)) / t
	elif z <= 2.3e-76:
		tmp = t_2
	elif z <= 3.1e+15:
		tmp = (z * -y) / t_1
	elif z <= 3.3e+47:
		tmp = t_2
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t - Float64(z * a))
	t_2 = Float64(x / t_1)
	t_3 = Float64(y / Float64(a - Float64(t / z)))
	tmp = 0.0
	if (z <= -2.4e+22)
		tmp = t_3;
	elseif (z <= -6.4e-34)
		tmp = t_2;
	elseif (z <= -7e-134)
		tmp = Float64(Float64(x - Float64(z * y)) / t);
	elseif (z <= 2.3e-76)
		tmp = t_2;
	elseif (z <= 3.1e+15)
		tmp = Float64(Float64(z * Float64(-y)) / t_1);
	elseif (z <= 3.3e+47)
		tmp = t_2;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t - (z * a);
	t_2 = x / t_1;
	t_3 = y / (a - (t / z));
	tmp = 0.0;
	if (z <= -2.4e+22)
		tmp = t_3;
	elseif (z <= -6.4e-34)
		tmp = t_2;
	elseif (z <= -7e-134)
		tmp = (x - (z * y)) / t;
	elseif (z <= 2.3e-76)
		tmp = t_2;
	elseif (z <= 3.1e+15)
		tmp = (z * -y) / t_1;
	elseif (z <= 3.3e+47)
		tmp = t_2;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e+22], t$95$3, If[LessEqual[z, -6.4e-34], t$95$2, If[LessEqual[z, -7e-134], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 2.3e-76], t$95$2, If[LessEqual[z, 3.1e+15], N[(N[(z * (-y)), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 3.3e+47], t$95$2, t$95$3]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x}{t\_1}\\
t_3 := \frac{y}{a - \frac{t}{z}}\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+22}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq -6.4 \cdot 10^{-34}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq 2.3 \cdot 10^{-76}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 3.1 \cdot 10^{+15}:\\
\;\;\;\;\frac{z \cdot \left(-y\right)}{t\_1}\\

\mathbf{elif}\;z \leq 3.3 \cdot 10^{+47}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.4e22 or 3.2999999999999999e47 < z

    1. Initial program 62.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t - a \cdot z}{-z}}} \]
      5. *-commutative58.1%

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

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

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

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

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

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

    if -2.4e22 < z < -6.40000000000000005e-34 or -6.9999999999999997e-134 < z < 2.30000000000000006e-76 or 3.1e15 < z < 3.2999999999999999e47

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

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

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

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

    if -6.40000000000000005e-34 < z < -6.9999999999999997e-134

    1. Initial program 99.9%

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

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

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

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

    if 2.30000000000000006e-76 < z < 3.1e15

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+22}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{elif}\;z \leq -6.4 \cdot 10^{-34}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-134}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-76}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+15}:\\ \;\;\;\;\frac{z \cdot \left(-y\right)}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{+47}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 55.1% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -1.55 \cdot 10^{+25}:\\
\;\;\;\;y \cdot \frac{-z}{t}\\

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.5999999999999998e84 or -1.5499999999999999e25 < z < -9.2e17 or 4.4000000000000003e39 < z

    1. Initial program 61.8%

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

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

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

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

    if -4.5999999999999998e84 < z < -1.5499999999999999e25

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

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

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

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

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

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

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

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

    if -9.2e17 < z < 1.2200000000000001e-39 or 5.1e16 < z < 4.4000000000000003e39

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

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

    if 1.2200000000000001e-39 < z < 5.1e16

    1. Initial program 91.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(y \cdot z\right)}{t}} \]
      2. mul-1-neg44.0%

        \[\leadsto \frac{\color{blue}{-y \cdot z}}{t} \]
    8. Simplified44.0%

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

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

        \[\leadsto \color{blue}{\left(y \cdot \left(-z\right)\right)} \cdot \frac{1}{t} \]
      3. associate-*l*38.0%

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\sqrt{-z} \cdot \sqrt{-z}\right)} \cdot \frac{1}{t}\right) \]
      5. sqrt-unprod1.9%

        \[\leadsto y \cdot \left(\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} \cdot \frac{1}{t}\right) \]
      6. sqr-neg1.9%

        \[\leadsto y \cdot \left(\sqrt{\color{blue}{z \cdot z}} \cdot \frac{1}{t}\right) \]
      7. sqrt-unprod1.9%

        \[\leadsto y \cdot \left(\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \frac{1}{t}\right) \]
      8. add-sqr-sqrt1.9%

        \[\leadsto y \cdot \left(\color{blue}{z} \cdot \frac{1}{t}\right) \]
      9. div-inv1.9%

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

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

        \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
      2. add-sqr-sqrt0.5%

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

        \[\leadsto \frac{y \cdot z}{\color{blue}{\sqrt{t \cdot t}}} \]
      4. sqr-neg18.4%

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

        \[\leadsto \frac{y \cdot z}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}} \]
      6. add-sqr-sqrt44.0%

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

        \[\leadsto \color{blue}{\frac{y}{-t} \cdot z} \]
      8. associate-/r/35.7%

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

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

        \[\leadsto \frac{-y}{\color{blue}{\frac{-\left(-t\right)}{z}}} \]
      11. remove-double-neg35.7%

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

        \[\leadsto \color{blue}{-\frac{y}{\frac{t}{z}}} \]
      13. associate-/l*44.0%

        \[\leadsto -\color{blue}{\frac{y \cdot z}{t}} \]
      14. add-sqr-sqrt9.5%

        \[\leadsto -\frac{y \cdot z}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}} \]
      15. sqrt-unprod11.4%

        \[\leadsto -\frac{y \cdot z}{\color{blue}{\sqrt{t \cdot t}}} \]
      16. sqr-neg11.4%

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

        \[\leadsto -\frac{y \cdot z}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}} \]
      18. add-sqr-sqrt1.9%

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{y}{-t}} \]
      21. add-sqr-sqrt1.4%

        \[\leadsto -z \cdot \frac{y}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}} \]
      22. sqrt-unprod11.4%

        \[\leadsto -z \cdot \frac{y}{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}} \]
      23. sqr-neg11.4%

        \[\leadsto -z \cdot \frac{y}{\sqrt{\color{blue}{t \cdot t}}} \]
      24. sqrt-unprod9.5%

        \[\leadsto -z \cdot \frac{y}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}} \]
      25. add-sqr-sqrt44.0%

        \[\leadsto -z \cdot \frac{y}{\color{blue}{t}} \]
    12. Applied egg-rr44.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.6 \cdot 10^{+84}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{+25}:\\ \;\;\;\;y \cdot \frac{-z}{t}\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{+17}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 1.22 \cdot 10^{-39}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 5.1 \cdot 10^{+16}:\\ \;\;\;\;z \cdot \frac{-y}{t}\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{+39}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 55.1% accurate, 0.3× speedup?

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

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

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

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

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

\mathbf{elif}\;z \leq 3.8 \cdot 10^{+14}:\\
\;\;\;\;z \cdot \frac{-y}{t}\\

\mathbf{elif}\;z \leq 10^{+41}:\\
\;\;\;\;\frac{x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7.4999999999999997e86 or -3.89999999999999968e29 < z < -9.2e17 or 1.00000000000000001e41 < z

    1. Initial program 61.8%

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

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

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

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

    if -7.4999999999999997e86 < z < -3.89999999999999968e29

    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 x around 0 67.5%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t - a \cdot z}{-z}}} \]
      5. *-commutative83.9%

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

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

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

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

        \[\leadsto \frac{y}{\frac{\color{blue}{-t}}{z}} \]
    10. Simplified67.5%

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

    if -9.2e17 < z < 5.50000000000000002e-40 or 3.8e14 < z < 1.00000000000000001e41

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

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

    if 5.50000000000000002e-40 < z < 3.8e14

    1. Initial program 91.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(y \cdot z\right)}{t}} \]
      2. mul-1-neg44.0%

        \[\leadsto \frac{\color{blue}{-y \cdot z}}{t} \]
    8. Simplified44.0%

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

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

        \[\leadsto \color{blue}{\left(y \cdot \left(-z\right)\right)} \cdot \frac{1}{t} \]
      3. associate-*l*38.0%

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\sqrt{-z} \cdot \sqrt{-z}\right)} \cdot \frac{1}{t}\right) \]
      5. sqrt-unprod1.9%

        \[\leadsto y \cdot \left(\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} \cdot \frac{1}{t}\right) \]
      6. sqr-neg1.9%

        \[\leadsto y \cdot \left(\sqrt{\color{blue}{z \cdot z}} \cdot \frac{1}{t}\right) \]
      7. sqrt-unprod1.9%

        \[\leadsto y \cdot \left(\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \frac{1}{t}\right) \]
      8. add-sqr-sqrt1.9%

        \[\leadsto y \cdot \left(\color{blue}{z} \cdot \frac{1}{t}\right) \]
      9. div-inv1.9%

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

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

        \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
      2. add-sqr-sqrt0.5%

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

        \[\leadsto \frac{y \cdot z}{\color{blue}{\sqrt{t \cdot t}}} \]
      4. sqr-neg18.4%

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

        \[\leadsto \frac{y \cdot z}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}} \]
      6. add-sqr-sqrt44.0%

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

        \[\leadsto \color{blue}{\frac{y}{-t} \cdot z} \]
      8. associate-/r/35.7%

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

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

        \[\leadsto \frac{-y}{\color{blue}{\frac{-\left(-t\right)}{z}}} \]
      11. remove-double-neg35.7%

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

        \[\leadsto \color{blue}{-\frac{y}{\frac{t}{z}}} \]
      13. associate-/l*44.0%

        \[\leadsto -\color{blue}{\frac{y \cdot z}{t}} \]
      14. add-sqr-sqrt9.5%

        \[\leadsto -\frac{y \cdot z}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}} \]
      15. sqrt-unprod11.4%

        \[\leadsto -\frac{y \cdot z}{\color{blue}{\sqrt{t \cdot t}}} \]
      16. sqr-neg11.4%

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

        \[\leadsto -\frac{y \cdot z}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}} \]
      18. add-sqr-sqrt1.9%

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{y}{-t}} \]
      21. add-sqr-sqrt1.4%

        \[\leadsto -z \cdot \frac{y}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}} \]
      22. sqrt-unprod11.4%

        \[\leadsto -z \cdot \frac{y}{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}} \]
      23. sqr-neg11.4%

        \[\leadsto -z \cdot \frac{y}{\sqrt{\color{blue}{t \cdot t}}} \]
      24. sqrt-unprod9.5%

        \[\leadsto -z \cdot \frac{y}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}} \]
      25. add-sqr-sqrt44.0%

        \[\leadsto -z \cdot \frac{y}{\color{blue}{t}} \]
    12. Applied egg-rr44.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+86}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -3.9 \cdot 10^{+29}:\\ \;\;\;\;\frac{y}{\frac{-t}{z}}\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{+17}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-40}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+14}:\\ \;\;\;\;z \cdot \frac{-y}{t}\\ \mathbf{elif}\;z \leq 10^{+41}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 54.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+84}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{+25}:\\ \;\;\;\;\frac{y}{\frac{-t}{z}}\\ \mathbf{elif}\;z \leq -6 \cdot 10^{+17}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-49}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+20}:\\ \;\;\;\;\frac{\frac{-x}{a}}{z}\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{+39}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -4.2e+84)
   (/ y a)
   (if (<= z -6.6e+25)
     (/ y (/ (- t) z))
     (if (<= z -6e+17)
       (/ y a)
       (if (<= z 5e-49)
         (/ x t)
         (if (<= z 2.2e+20)
           (/ (/ (- x) a) z)
           (if (<= z 4.8e+39) (/ x t) (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4.2e+84) {
		tmp = y / a;
	} else if (z <= -6.6e+25) {
		tmp = y / (-t / z);
	} else if (z <= -6e+17) {
		tmp = y / a;
	} else if (z <= 5e-49) {
		tmp = x / t;
	} else if (z <= 2.2e+20) {
		tmp = (-x / a) / z;
	} else if (z <= 4.8e+39) {
		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 <= (-4.2d+84)) then
        tmp = y / a
    else if (z <= (-6.6d+25)) then
        tmp = y / (-t / z)
    else if (z <= (-6d+17)) then
        tmp = y / a
    else if (z <= 5d-49) then
        tmp = x / t
    else if (z <= 2.2d+20) then
        tmp = (-x / a) / z
    else if (z <= 4.8d+39) 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 <= -4.2e+84) {
		tmp = y / a;
	} else if (z <= -6.6e+25) {
		tmp = y / (-t / z);
	} else if (z <= -6e+17) {
		tmp = y / a;
	} else if (z <= 5e-49) {
		tmp = x / t;
	} else if (z <= 2.2e+20) {
		tmp = (-x / a) / z;
	} else if (z <= 4.8e+39) {
		tmp = x / t;
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -4.2e+84:
		tmp = y / a
	elif z <= -6.6e+25:
		tmp = y / (-t / z)
	elif z <= -6e+17:
		tmp = y / a
	elif z <= 5e-49:
		tmp = x / t
	elif z <= 2.2e+20:
		tmp = (-x / a) / z
	elif z <= 4.8e+39:
		tmp = x / t
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -4.2e+84)
		tmp = Float64(y / a);
	elseif (z <= -6.6e+25)
		tmp = Float64(y / Float64(Float64(-t) / z));
	elseif (z <= -6e+17)
		tmp = Float64(y / a);
	elseif (z <= 5e-49)
		tmp = Float64(x / t);
	elseif (z <= 2.2e+20)
		tmp = Float64(Float64(Float64(-x) / a) / z);
	elseif (z <= 4.8e+39)
		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 <= -4.2e+84)
		tmp = y / a;
	elseif (z <= -6.6e+25)
		tmp = y / (-t / z);
	elseif (z <= -6e+17)
		tmp = y / a;
	elseif (z <= 5e-49)
		tmp = x / t;
	elseif (z <= 2.2e+20)
		tmp = (-x / a) / z;
	elseif (z <= 4.8e+39)
		tmp = x / t;
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.2e+84], N[(y / a), $MachinePrecision], If[LessEqual[z, -6.6e+25], N[(y / N[((-t) / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6e+17], N[(y / a), $MachinePrecision], If[LessEqual[z, 5e-49], N[(x / t), $MachinePrecision], If[LessEqual[z, 2.2e+20], N[(N[((-x) / a), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 4.8e+39], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.20000000000000037e84 or -6.6000000000000002e25 < z < -6e17 or 4.8000000000000002e39 < z

    1. Initial program 61.8%

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

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

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

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

    if -4.20000000000000037e84 < z < -6.6000000000000002e25

    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 x around 0 67.5%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t - a \cdot z}{-z}}} \]
      5. *-commutative83.9%

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

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

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

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

        \[\leadsto \frac{y}{\frac{\color{blue}{-t}}{z}} \]
    10. Simplified67.5%

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

    if -6e17 < z < 4.9999999999999999e-49 or 2.2e20 < z < 4.8000000000000002e39

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

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

    if 4.9999999999999999e-49 < z < 2.2e20

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

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

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

      \[\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 inf 57.8%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+84}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{+25}:\\ \;\;\;\;\frac{y}{\frac{-t}{z}}\\ \mathbf{elif}\;z \leq -6 \cdot 10^{+17}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-49}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+20}:\\ \;\;\;\;\frac{\frac{-x}{a}}{z}\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{+39}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 72.4% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.25 \cdot 10^{+22} \lor \neg \left(z \leq 2.25 \cdot 10^{-76} \lor \neg \left(z \leq 1.9 \cdot 10^{+16}\right) \land z \leq 2 \cdot 10^{+46}\right):\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.2499999999999999e22 or 2.25e-76 < z < 1.9e16 or 2e46 < z

    1. Initial program 67.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{a - \frac{t}{z}}} \]
    10. Simplified77.1%

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

    if -3.2499999999999999e22 < z < 2.25e-76 or 1.9e16 < z < 2e46

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.25 \cdot 10^{+22} \lor \neg \left(z \leq 2.25 \cdot 10^{-76} \lor \neg \left(z \leq 1.9 \cdot 10^{+16}\right) \land z \leq 2 \cdot 10^{+46}\right):\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 55.1% accurate, 0.5× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.8000000000000004e50 or 5.6000000000000003e40 < z

    1. Initial program 61.0%

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

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

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

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

    if -4.8000000000000004e50 < z < 6.00000000000000055e-39 or 3.3e18 < z < 5.6000000000000003e40

    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 6.00000000000000055e-39 < z < 3.3e18

    1. Initial program 91.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(y \cdot z\right)}{t}} \]
      2. mul-1-neg44.0%

        \[\leadsto \frac{\color{blue}{-y \cdot z}}{t} \]
    8. Simplified44.0%

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

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

        \[\leadsto \color{blue}{\left(y \cdot \left(-z\right)\right)} \cdot \frac{1}{t} \]
      3. associate-*l*38.0%

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\sqrt{-z} \cdot \sqrt{-z}\right)} \cdot \frac{1}{t}\right) \]
      5. sqrt-unprod1.9%

        \[\leadsto y \cdot \left(\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} \cdot \frac{1}{t}\right) \]
      6. sqr-neg1.9%

        \[\leadsto y \cdot \left(\sqrt{\color{blue}{z \cdot z}} \cdot \frac{1}{t}\right) \]
      7. sqrt-unprod1.9%

        \[\leadsto y \cdot \left(\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \frac{1}{t}\right) \]
      8. add-sqr-sqrt1.9%

        \[\leadsto y \cdot \left(\color{blue}{z} \cdot \frac{1}{t}\right) \]
      9. div-inv1.9%

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

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

        \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
      2. add-sqr-sqrt0.5%

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

        \[\leadsto \frac{y \cdot z}{\color{blue}{\sqrt{t \cdot t}}} \]
      4. sqr-neg18.4%

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

        \[\leadsto \frac{y \cdot z}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}} \]
      6. add-sqr-sqrt44.0%

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

        \[\leadsto \color{blue}{\frac{y}{-t} \cdot z} \]
      8. associate-/r/35.7%

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

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

        \[\leadsto \frac{-y}{\color{blue}{\frac{-\left(-t\right)}{z}}} \]
      11. remove-double-neg35.7%

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

        \[\leadsto \color{blue}{-\frac{y}{\frac{t}{z}}} \]
      13. associate-/l*44.0%

        \[\leadsto -\color{blue}{\frac{y \cdot z}{t}} \]
      14. add-sqr-sqrt9.5%

        \[\leadsto -\frac{y \cdot z}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}} \]
      15. sqrt-unprod11.4%

        \[\leadsto -\frac{y \cdot z}{\color{blue}{\sqrt{t \cdot t}}} \]
      16. sqr-neg11.4%

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

        \[\leadsto -\frac{y \cdot z}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}} \]
      18. add-sqr-sqrt1.9%

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{y}{-t}} \]
      21. add-sqr-sqrt1.4%

        \[\leadsto -z \cdot \frac{y}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}} \]
      22. sqrt-unprod11.4%

        \[\leadsto -z \cdot \frac{y}{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}} \]
      23. sqr-neg11.4%

        \[\leadsto -z \cdot \frac{y}{\sqrt{\color{blue}{t \cdot t}}} \]
      24. sqrt-unprod9.5%

        \[\leadsto -z \cdot \frac{y}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}} \]
      25. add-sqr-sqrt44.0%

        \[\leadsto -z \cdot \frac{y}{\color{blue}{t}} \]
    12. Applied egg-rr44.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+50}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-39}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{+18}:\\ \;\;\;\;z \cdot \frac{-y}{t}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+40}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 65.9% accurate, 0.6× speedup?

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

    1. Initial program 60.6%

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

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

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

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

    if -3.2000000000000002e51 < z < 7.9999999999999999e52

    1. Initial program 99.2%

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

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

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

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

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

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

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

Alternative 11: 54.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+44} \lor \neg \left(z \leq 1.7 \cdot 10^{-76}\right):\\
\;\;\;\;\frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.9000000000000002e44 or 1.7e-76 < z

    1. Initial program 67.8%

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

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

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

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

    if -2.9000000000000002e44 < z < 1.7e-76

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

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

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

Alternative 12: 35.5% 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.6%

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

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

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

    \[\leadsto \color{blue}{\frac{x}{t}} \]
  6. Final simplification38.1%

    \[\leadsto \frac{x}{t} \]
  7. 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 2024040 
(FPCore (x y z t a)
  :name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
  :precision binary64

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

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