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

Percentage Accurate: 85.6% → 96.4%
Time: 15.5s
Alternatives: 11
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 11 alternatives:

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

Initial Program: 85.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: 96.4% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - y \cdot z\\ t_2 := t - z \cdot a\\ t_3 := \frac{t\_1}{t\_2}\\ \mathbf{if}\;t\_3 \leq -4 \cdot 10^{-306}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_3 \leq 0:\\ \;\;\;\;\frac{1}{a \cdot \left(\frac{z}{y \cdot z - x} + \frac{t}{t\_1 \cdot a}\right)}\\ \mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+285}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;y \cdot \left(\frac{x}{y \cdot t\_2} - \frac{z}{t\_2}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (* y z))) (t_2 (- t (* z a))) (t_3 (/ t_1 t_2)))
   (if (<= t_3 -4e-306)
     t_3
     (if (<= t_3 0.0)
       (/ 1.0 (* a (+ (/ z (- (* y z) x)) (/ t (* t_1 a)))))
       (if (<= t_3 4e+285)
         t_3
         (if (<= t_3 INFINITY)
           (* y (- (/ x (* y t_2)) (/ z t_2)))
           (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (y * z);
	double t_2 = t - (z * a);
	double t_3 = t_1 / t_2;
	double tmp;
	if (t_3 <= -4e-306) {
		tmp = t_3;
	} else if (t_3 <= 0.0) {
		tmp = 1.0 / (a * ((z / ((y * z) - x)) + (t / (t_1 * a))));
	} else if (t_3 <= 4e+285) {
		tmp = t_3;
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = y * ((x / (y * t_2)) - (z / t_2));
	} else {
		tmp = y / a;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (y * z);
	double t_2 = t - (z * a);
	double t_3 = t_1 / t_2;
	double tmp;
	if (t_3 <= -4e-306) {
		tmp = t_3;
	} else if (t_3 <= 0.0) {
		tmp = 1.0 / (a * ((z / ((y * z) - x)) + (t / (t_1 * a))));
	} else if (t_3 <= 4e+285) {
		tmp = t_3;
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = y * ((x / (y * t_2)) - (z / t_2));
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (y * z)
	t_2 = t - (z * a)
	t_3 = t_1 / t_2
	tmp = 0
	if t_3 <= -4e-306:
		tmp = t_3
	elif t_3 <= 0.0:
		tmp = 1.0 / (a * ((z / ((y * z) - x)) + (t / (t_1 * a))))
	elif t_3 <= 4e+285:
		tmp = t_3
	elif t_3 <= math.inf:
		tmp = y * ((x / (y * t_2)) - (z / t_2))
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(y * z))
	t_2 = Float64(t - Float64(z * a))
	t_3 = Float64(t_1 / t_2)
	tmp = 0.0
	if (t_3 <= -4e-306)
		tmp = t_3;
	elseif (t_3 <= 0.0)
		tmp = Float64(1.0 / Float64(a * Float64(Float64(z / Float64(Float64(y * z) - x)) + Float64(t / Float64(t_1 * a)))));
	elseif (t_3 <= 4e+285)
		tmp = t_3;
	elseif (t_3 <= Inf)
		tmp = Float64(y * Float64(Float64(x / Float64(y * t_2)) - Float64(z / t_2)));
	else
		tmp = Float64(y / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (y * z);
	t_2 = t - (z * a);
	t_3 = t_1 / t_2;
	tmp = 0.0;
	if (t_3 <= -4e-306)
		tmp = t_3;
	elseif (t_3 <= 0.0)
		tmp = 1.0 / (a * ((z / ((y * z) - x)) + (t / (t_1 * a))));
	elseif (t_3 <= 4e+285)
		tmp = t_3;
	elseif (t_3 <= Inf)
		tmp = y * ((x / (y * t_2)) - (z / t_2));
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, -4e-306], t$95$3, If[LessEqual[t$95$3, 0.0], N[(1.0 / N[(a * N[(N[(z / N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(t / N[(t$95$1 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 4e+285], t$95$3, If[LessEqual[t$95$3, Infinity], N[(y * N[(N[(x / N[(y * t$95$2), $MachinePrecision]), $MachinePrecision] - N[(z / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{1}{a \cdot \left(\frac{z}{y \cdot z - x} + \frac{t}{t\_1 \cdot a}\right)}\\

\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+285}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;y \cdot \left(\frac{x}{y \cdot t\_2} - \frac{z}{t\_2}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -4.00000000000000011e-306 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 3.9999999999999999e285

    1. Initial program 97.6%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Add Preprocessing

    if -4.00000000000000011e-306 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0

    1. Initial program 60.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\frac{\mathsf{fma}\left(a, -z, t\right)}{x - y \cdot z}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-160.5%

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

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

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

    if 3.9999999999999999e285 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0

    1. Initial program 41.3%

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

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

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

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

    if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z)))

    1. Initial program 0.0%

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

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

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

      \[\leadsto \color{blue}{\frac{y}{a}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification98.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y \cdot z}{t - z \cdot a} \leq -4 \cdot 10^{-306}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq 0:\\ \;\;\;\;\frac{1}{a \cdot \left(\frac{z}{y \cdot z - x} + \frac{t}{\left(x - y \cdot z\right) \cdot a}\right)}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq 4 \cdot 10^{+285}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq \infty:\\ \;\;\;\;y \cdot \left(\frac{x}{y \cdot \left(t - z \cdot a\right)} - \frac{z}{t - z \cdot a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 54.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \frac{y}{-t}\\ \mathbf{if}\;z \leq -3.9 \cdot 10^{-27}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-39}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-60}:\\ \;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\ \mathbf{elif}\;z \leq -2.25 \cdot 10^{-88}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{-28}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{+40}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* z (/ y (- t)))))
   (if (<= z -3.9e-27)
     (/ y a)
     (if (<= z -9.2e-39)
       (/ x t)
       (if (<= z -2.3e-60)
         (/ x (* z (- a)))
         (if (<= z -2.25e-88)
           t_1
           (if (<= z 1.32e-28) (/ x t) (if (<= z 2.5e+40) t_1 (/ y a)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = z * (y / -t);
	double tmp;
	if (z <= -3.9e-27) {
		tmp = y / a;
	} else if (z <= -9.2e-39) {
		tmp = x / t;
	} else if (z <= -2.3e-60) {
		tmp = x / (z * -a);
	} else if (z <= -2.25e-88) {
		tmp = t_1;
	} else if (z <= 1.32e-28) {
		tmp = x / t;
	} else if (z <= 2.5e+40) {
		tmp = t_1;
	} else {
		tmp = y / a;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * (y / -t)
    if (z <= (-3.9d-27)) then
        tmp = y / a
    else if (z <= (-9.2d-39)) then
        tmp = x / t
    else if (z <= (-2.3d-60)) then
        tmp = x / (z * -a)
    else if (z <= (-2.25d-88)) then
        tmp = t_1
    else if (z <= 1.32d-28) then
        tmp = x / t
    else if (z <= 2.5d+40) then
        tmp = t_1
    else
        tmp = y / a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = z * (y / -t);
	double tmp;
	if (z <= -3.9e-27) {
		tmp = y / a;
	} else if (z <= -9.2e-39) {
		tmp = x / t;
	} else if (z <= -2.3e-60) {
		tmp = x / (z * -a);
	} else if (z <= -2.25e-88) {
		tmp = t_1;
	} else if (z <= 1.32e-28) {
		tmp = x / t;
	} else if (z <= 2.5e+40) {
		tmp = t_1;
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = z * (y / -t)
	tmp = 0
	if z <= -3.9e-27:
		tmp = y / a
	elif z <= -9.2e-39:
		tmp = x / t
	elif z <= -2.3e-60:
		tmp = x / (z * -a)
	elif z <= -2.25e-88:
		tmp = t_1
	elif z <= 1.32e-28:
		tmp = x / t
	elif z <= 2.5e+40:
		tmp = t_1
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(z * Float64(y / Float64(-t)))
	tmp = 0.0
	if (z <= -3.9e-27)
		tmp = Float64(y / a);
	elseif (z <= -9.2e-39)
		tmp = Float64(x / t);
	elseif (z <= -2.3e-60)
		tmp = Float64(x / Float64(z * Float64(-a)));
	elseif (z <= -2.25e-88)
		tmp = t_1;
	elseif (z <= 1.32e-28)
		tmp = Float64(x / t);
	elseif (z <= 2.5e+40)
		tmp = t_1;
	else
		tmp = Float64(y / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = z * (y / -t);
	tmp = 0.0;
	if (z <= -3.9e-27)
		tmp = y / a;
	elseif (z <= -9.2e-39)
		tmp = x / t;
	elseif (z <= -2.3e-60)
		tmp = x / (z * -a);
	elseif (z <= -2.25e-88)
		tmp = t_1;
	elseif (z <= 1.32e-28)
		tmp = x / t;
	elseif (z <= 2.5e+40)
		tmp = t_1;
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / (-t)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.9e-27], N[(y / a), $MachinePrecision], If[LessEqual[z, -9.2e-39], N[(x / t), $MachinePrecision], If[LessEqual[z, -2.3e-60], N[(x / N[(z * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.25e-88], t$95$1, If[LessEqual[z, 1.32e-28], N[(x / t), $MachinePrecision], If[LessEqual[z, 2.5e+40], t$95$1, N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{-t}\\
\mathbf{if}\;z \leq -3.9 \cdot 10^{-27}:\\
\;\;\;\;\frac{y}{a}\\

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

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

\mathbf{elif}\;z \leq -2.25 \cdot 10^{-88}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 2.5 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.89999999999999972e-27 or 2.50000000000000002e40 < z

    1. Initial program 66.4%

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

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

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

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

    if -3.89999999999999972e-27 < z < -9.20000000000000033e-39 or -2.24999999999999996e-88 < z < 1.32000000000000011e-28

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

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

    if -9.20000000000000033e-39 < z < -2.3000000000000001e-60

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

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

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

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

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

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

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

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

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

    if -2.3000000000000001e-60 < z < -2.24999999999999996e-88 or 1.32000000000000011e-28 < z < 2.50000000000000002e40

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \frac{z \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{t} \]
      13. sqr-neg24.0%

        \[\leadsto -1 \cdot \frac{z \cdot \sqrt{\color{blue}{y \cdot y}}}{t} \]
      14. sqrt-unprod19.7%

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

        \[\leadsto -1 \cdot \frac{z \cdot \color{blue}{y}}{t} \]
    10. Applied egg-rr56.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.9 \cdot 10^{-27}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-39}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-60}:\\ \;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\ \mathbf{elif}\;z \leq -2.25 \cdot 10^{-88}:\\ \;\;\;\;z \cdot \frac{y}{-t}\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{-28}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{+40}:\\ \;\;\;\;z \cdot \frac{y}{-t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 72.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y - \frac{x}{z}}{a}\\ \mathbf{if}\;z \leq -1.58 \cdot 10^{-27}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-267}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-27}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 52000000 \lor \neg \left(z \leq 1.75 \cdot 10^{+38}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{-t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- y (/ x z)) a)))
   (if (<= z -1.58e-27)
     t_1
     (if (<= z 7e-267)
       (/ x (- t (* z a)))
       (if (<= z 6e-27)
         (/ (- x (* y z)) t)
         (if (or (<= z 52000000.0) (not (<= z 1.75e+38)))
           t_1
           (* z (/ y (- t)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y - (x / z)) / a;
	double tmp;
	if (z <= -1.58e-27) {
		tmp = t_1;
	} else if (z <= 7e-267) {
		tmp = x / (t - (z * a));
	} else if (z <= 6e-27) {
		tmp = (x - (y * z)) / t;
	} else if ((z <= 52000000.0) || !(z <= 1.75e+38)) {
		tmp = t_1;
	} else {
		tmp = z * (y / -t);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (y - (x / z)) / a
    if (z <= (-1.58d-27)) then
        tmp = t_1
    else if (z <= 7d-267) then
        tmp = x / (t - (z * a))
    else if (z <= 6d-27) then
        tmp = (x - (y * z)) / t
    else if ((z <= 52000000.0d0) .or. (.not. (z <= 1.75d+38))) then
        tmp = t_1
    else
        tmp = z * (y / -t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y - (x / z)) / a;
	double tmp;
	if (z <= -1.58e-27) {
		tmp = t_1;
	} else if (z <= 7e-267) {
		tmp = x / (t - (z * a));
	} else if (z <= 6e-27) {
		tmp = (x - (y * z)) / t;
	} else if ((z <= 52000000.0) || !(z <= 1.75e+38)) {
		tmp = t_1;
	} else {
		tmp = z * (y / -t);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y - (x / z)) / a
	tmp = 0
	if z <= -1.58e-27:
		tmp = t_1
	elif z <= 7e-267:
		tmp = x / (t - (z * a))
	elif z <= 6e-27:
		tmp = (x - (y * z)) / t
	elif (z <= 52000000.0) or not (z <= 1.75e+38):
		tmp = t_1
	else:
		tmp = z * (y / -t)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y - Float64(x / z)) / a)
	tmp = 0.0
	if (z <= -1.58e-27)
		tmp = t_1;
	elseif (z <= 7e-267)
		tmp = Float64(x / Float64(t - Float64(z * a)));
	elseif (z <= 6e-27)
		tmp = Float64(Float64(x - Float64(y * z)) / t);
	elseif ((z <= 52000000.0) || !(z <= 1.75e+38))
		tmp = t_1;
	else
		tmp = Float64(z * Float64(y / Float64(-t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y - (x / z)) / a;
	tmp = 0.0;
	if (z <= -1.58e-27)
		tmp = t_1;
	elseif (z <= 7e-267)
		tmp = x / (t - (z * a));
	elseif (z <= 6e-27)
		tmp = (x - (y * z)) / t;
	elseif ((z <= 52000000.0) || ~((z <= 1.75e+38)))
		tmp = t_1;
	else
		tmp = z * (y / -t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -1.58e-27], t$95$1, If[LessEqual[z, 7e-267], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e-27], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[z, 52000000.0], N[Not[LessEqual[z, 1.75e+38]], $MachinePrecision]], t$95$1, N[(z * N[(y / (-t)), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq 52000000 \lor \neg \left(z \leq 1.75 \cdot 10^{+38}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.58e-27 or 6.0000000000000002e-27 < z < 5.2e7 or 1.75000000000000001e38 < z

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.58e-27 < z < 6.9999999999999999e-267

    1. Initial program 99.7%

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

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

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

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

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

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

    if 6.9999999999999999e-267 < z < 6.0000000000000002e-27

    1. Initial program 99.8%

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

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

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

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

    if 5.2e7 < z < 1.75000000000000001e38

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\frac{\left(-y\right) \cdot z}{t}} \]
      10. *-commutative30.7%

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

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

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

        \[\leadsto -1 \cdot \frac{z \cdot \sqrt{\color{blue}{y \cdot y}}}{t} \]
      14. sqrt-unprod38.5%

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

        \[\leadsto -1 \cdot \frac{z \cdot \color{blue}{y}}{t} \]
    10. Applied egg-rr80.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.58 \cdot 10^{-27}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-267}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-27}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 52000000 \lor \neg \left(z \leq 1.75 \cdot 10^{+38}\right):\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{-t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 72.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y - \frac{x}{z}}{a}\\ \mathbf{if}\;z \leq -1.05 \cdot 10^{-26}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-266}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-27}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 48000000:\\ \;\;\;\;\frac{y \cdot z - x}{z \cdot a}\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+38}:\\ \;\;\;\;z \cdot \frac{y}{-t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- y (/ x z)) a)))
   (if (<= z -1.05e-26)
     t_1
     (if (<= z 2.9e-266)
       (/ x (- t (* z a)))
       (if (<= z 8e-27)
         (/ (- x (* y z)) t)
         (if (<= z 48000000.0)
           (/ (- (* y z) x) (* z a))
           (if (<= z 2.05e+38) (* z (/ y (- t))) t_1)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y - (x / z)) / a;
	double tmp;
	if (z <= -1.05e-26) {
		tmp = t_1;
	} else if (z <= 2.9e-266) {
		tmp = x / (t - (z * a));
	} else if (z <= 8e-27) {
		tmp = (x - (y * z)) / t;
	} else if (z <= 48000000.0) {
		tmp = ((y * z) - x) / (z * a);
	} else if (z <= 2.05e+38) {
		tmp = z * (y / -t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (y - (x / z)) / a
    if (z <= (-1.05d-26)) then
        tmp = t_1
    else if (z <= 2.9d-266) then
        tmp = x / (t - (z * a))
    else if (z <= 8d-27) then
        tmp = (x - (y * z)) / t
    else if (z <= 48000000.0d0) then
        tmp = ((y * z) - x) / (z * a)
    else if (z <= 2.05d+38) then
        tmp = z * (y / -t)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y - (x / z)) / a;
	double tmp;
	if (z <= -1.05e-26) {
		tmp = t_1;
	} else if (z <= 2.9e-266) {
		tmp = x / (t - (z * a));
	} else if (z <= 8e-27) {
		tmp = (x - (y * z)) / t;
	} else if (z <= 48000000.0) {
		tmp = ((y * z) - x) / (z * a);
	} else if (z <= 2.05e+38) {
		tmp = z * (y / -t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y - (x / z)) / a
	tmp = 0
	if z <= -1.05e-26:
		tmp = t_1
	elif z <= 2.9e-266:
		tmp = x / (t - (z * a))
	elif z <= 8e-27:
		tmp = (x - (y * z)) / t
	elif z <= 48000000.0:
		tmp = ((y * z) - x) / (z * a)
	elif z <= 2.05e+38:
		tmp = z * (y / -t)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y - Float64(x / z)) / a)
	tmp = 0.0
	if (z <= -1.05e-26)
		tmp = t_1;
	elseif (z <= 2.9e-266)
		tmp = Float64(x / Float64(t - Float64(z * a)));
	elseif (z <= 8e-27)
		tmp = Float64(Float64(x - Float64(y * z)) / t);
	elseif (z <= 48000000.0)
		tmp = Float64(Float64(Float64(y * z) - x) / Float64(z * a));
	elseif (z <= 2.05e+38)
		tmp = Float64(z * Float64(y / Float64(-t)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y - (x / z)) / a;
	tmp = 0.0;
	if (z <= -1.05e-26)
		tmp = t_1;
	elseif (z <= 2.9e-266)
		tmp = x / (t - (z * a));
	elseif (z <= 8e-27)
		tmp = (x - (y * z)) / t;
	elseif (z <= 48000000.0)
		tmp = ((y * z) - x) / (z * a);
	elseif (z <= 2.05e+38)
		tmp = z * (y / -t);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -1.05e-26], t$95$1, If[LessEqual[z, 2.9e-266], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-27], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 48000000.0], N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.05e+38], N[(z * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq 48000000:\\
\;\;\;\;\frac{y \cdot z - x}{z \cdot a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.05000000000000004e-26 or 2.0500000000000002e38 < z

    1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.05000000000000004e-26 < z < 2.89999999999999996e-266

    1. Initial program 99.7%

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

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

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

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

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

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

    if 2.89999999999999996e-266 < z < 8.0000000000000003e-27

    1. Initial program 99.8%

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

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

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

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

    if 8.0000000000000003e-27 < z < 4.8e7

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(0 - y \cdot \left(-z\right)\right) - x}}{a \cdot z} \]
      8. neg-sub082.0%

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

        \[\leadsto \frac{\left(-\color{blue}{\left(-y \cdot z\right)}\right) - x}{a \cdot z} \]
      10. remove-double-neg82.0%

        \[\leadsto \frac{\color{blue}{y \cdot z} - x}{a \cdot z} \]
      11. *-commutative82.0%

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

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

    if 4.8e7 < z < 2.0500000000000002e38

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\frac{\left(-y\right) \cdot z}{t}} \]
      10. *-commutative30.7%

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

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

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

        \[\leadsto -1 \cdot \frac{z \cdot \sqrt{\color{blue}{y \cdot y}}}{t} \]
      14. sqrt-unprod38.5%

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

        \[\leadsto -1 \cdot \frac{z \cdot \color{blue}{y}}{t} \]
    10. Applied egg-rr80.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{-26}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-266}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-27}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 48000000:\\ \;\;\;\;\frac{y \cdot z - x}{z \cdot a}\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+38}:\\ \;\;\;\;z \cdot \frac{y}{-t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 64.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+53}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-268}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-17}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 38000000:\\ \;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{+39}:\\ \;\;\;\;z \cdot \frac{y}{-t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -2.6e+53)
   (/ y a)
   (if (<= z 6.8e-268)
     (/ x (- t (* z a)))
     (if (<= z 5e-17)
       (/ (- x (* y z)) t)
       (if (<= z 38000000.0)
         (/ x (* z (- a)))
         (if (<= z 2.25e+39) (* z (/ y (- t))) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.6e+53) {
		tmp = y / a;
	} else if (z <= 6.8e-268) {
		tmp = x / (t - (z * a));
	} else if (z <= 5e-17) {
		tmp = (x - (y * z)) / t;
	} else if (z <= 38000000.0) {
		tmp = x / (z * -a);
	} else if (z <= 2.25e+39) {
		tmp = z * (y / -t);
	} else {
		tmp = y / a;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-2.6d+53)) then
        tmp = y / a
    else if (z <= 6.8d-268) then
        tmp = x / (t - (z * a))
    else if (z <= 5d-17) then
        tmp = (x - (y * z)) / t
    else if (z <= 38000000.0d0) then
        tmp = x / (z * -a)
    else if (z <= 2.25d+39) then
        tmp = z * (y / -t)
    else
        tmp = y / a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.6e+53) {
		tmp = y / a;
	} else if (z <= 6.8e-268) {
		tmp = x / (t - (z * a));
	} else if (z <= 5e-17) {
		tmp = (x - (y * z)) / t;
	} else if (z <= 38000000.0) {
		tmp = x / (z * -a);
	} else if (z <= 2.25e+39) {
		tmp = z * (y / -t);
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -2.6e+53:
		tmp = y / a
	elif z <= 6.8e-268:
		tmp = x / (t - (z * a))
	elif z <= 5e-17:
		tmp = (x - (y * z)) / t
	elif z <= 38000000.0:
		tmp = x / (z * -a)
	elif z <= 2.25e+39:
		tmp = z * (y / -t)
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -2.6e+53)
		tmp = Float64(y / a);
	elseif (z <= 6.8e-268)
		tmp = Float64(x / Float64(t - Float64(z * a)));
	elseif (z <= 5e-17)
		tmp = Float64(Float64(x - Float64(y * z)) / t);
	elseif (z <= 38000000.0)
		tmp = Float64(x / Float64(z * Float64(-a)));
	elseif (z <= 2.25e+39)
		tmp = Float64(z * Float64(y / Float64(-t)));
	else
		tmp = Float64(y / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -2.6e+53)
		tmp = y / a;
	elseif (z <= 6.8e-268)
		tmp = x / (t - (z * a));
	elseif (z <= 5e-17)
		tmp = (x - (y * z)) / t;
	elseif (z <= 38000000.0)
		tmp = x / (z * -a);
	elseif (z <= 2.25e+39)
		tmp = z * (y / -t);
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.6e+53], N[(y / a), $MachinePrecision], If[LessEqual[z, 6.8e-268], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e-17], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 38000000.0], N[(x / N[(z * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.25e+39], N[(z * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq 38000000:\\
\;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.59999999999999998e53 or 2.24999999999999998e39 < z

    1. Initial program 63.3%

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

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

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

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

    if -2.59999999999999998e53 < z < 6.8e-268

    1. Initial program 97.2%

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

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

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

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

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

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

    if 6.8e-268 < z < 4.9999999999999999e-17

    1. Initial program 99.8%

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

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

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

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

    if 4.9999999999999999e-17 < z < 3.8e7

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

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

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

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

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

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

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

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

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

    if 3.8e7 < z < 2.24999999999999998e39

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\frac{\left(-y\right) \cdot z}{t}} \]
      10. *-commutative30.7%

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

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

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

        \[\leadsto -1 \cdot \frac{z \cdot \sqrt{\color{blue}{y \cdot y}}}{t} \]
      14. sqrt-unprod38.5%

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

        \[\leadsto -1 \cdot \frac{z \cdot \color{blue}{y}}{t} \]
    10. Applied egg-rr80.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+53}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-268}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-17}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 38000000:\\ \;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{+39}:\\ \;\;\;\;z \cdot \frac{y}{-t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 71.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y - \frac{x}{z}}{a}\\ \mathbf{if}\;z \leq -1.6 \cdot 10^{-27}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-267}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-101}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+115}:\\ \;\;\;\;y \cdot \frac{z}{z \cdot a - t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- y (/ x z)) a)))
   (if (<= z -1.6e-27)
     t_1
     (if (<= z 6.5e-267)
       (/ x (- t (* z a)))
       (if (<= z 1.4e-101)
         (/ (- x (* y z)) t)
         (if (<= z 8.5e+115) (* y (/ z (- (* z a) t))) t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y - (x / z)) / a;
	double tmp;
	if (z <= -1.6e-27) {
		tmp = t_1;
	} else if (z <= 6.5e-267) {
		tmp = x / (t - (z * a));
	} else if (z <= 1.4e-101) {
		tmp = (x - (y * z)) / t;
	} else if (z <= 8.5e+115) {
		tmp = y * (z / ((z * a) - t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (y - (x / z)) / a
    if (z <= (-1.6d-27)) then
        tmp = t_1
    else if (z <= 6.5d-267) then
        tmp = x / (t - (z * a))
    else if (z <= 1.4d-101) then
        tmp = (x - (y * z)) / t
    else if (z <= 8.5d+115) then
        tmp = y * (z / ((z * a) - t))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y - (x / z)) / a;
	double tmp;
	if (z <= -1.6e-27) {
		tmp = t_1;
	} else if (z <= 6.5e-267) {
		tmp = x / (t - (z * a));
	} else if (z <= 1.4e-101) {
		tmp = (x - (y * z)) / t;
	} else if (z <= 8.5e+115) {
		tmp = y * (z / ((z * a) - t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y - (x / z)) / a
	tmp = 0
	if z <= -1.6e-27:
		tmp = t_1
	elif z <= 6.5e-267:
		tmp = x / (t - (z * a))
	elif z <= 1.4e-101:
		tmp = (x - (y * z)) / t
	elif z <= 8.5e+115:
		tmp = y * (z / ((z * a) - t))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y - Float64(x / z)) / a)
	tmp = 0.0
	if (z <= -1.6e-27)
		tmp = t_1;
	elseif (z <= 6.5e-267)
		tmp = Float64(x / Float64(t - Float64(z * a)));
	elseif (z <= 1.4e-101)
		tmp = Float64(Float64(x - Float64(y * z)) / t);
	elseif (z <= 8.5e+115)
		tmp = Float64(y * Float64(z / Float64(Float64(z * a) - t)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y - (x / z)) / a;
	tmp = 0.0;
	if (z <= -1.6e-27)
		tmp = t_1;
	elseif (z <= 6.5e-267)
		tmp = x / (t - (z * a));
	elseif (z <= 1.4e-101)
		tmp = (x - (y * z)) / t;
	elseif (z <= 8.5e+115)
		tmp = y * (z / ((z * a) - t));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -1.6e-27], t$95$1, If[LessEqual[z, 6.5e-267], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-101], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 8.5e+115], N[(y * N[(z / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.59999999999999995e-27 or 8.50000000000000057e115 < z

    1. Initial program 63.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.59999999999999995e-27 < z < 6.4999999999999999e-267

    1. Initial program 99.7%

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

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

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

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

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

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

    if 6.4999999999999999e-267 < z < 1.39999999999999995e-101

    1. Initial program 99.8%

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

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

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

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

    if 1.39999999999999995e-101 < z < 8.50000000000000057e115

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{-27}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-267}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-101}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+115}:\\ \;\;\;\;y \cdot \frac{z}{z \cdot a - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 55.3% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.60000000000000008e-27 or 4.4999999999999998e38 < z

    1. Initial program 66.4%

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

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

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

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

    if -9.60000000000000008e-27 < z < 1.18e-27

    1. Initial program 99.7%

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

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

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

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

    if 1.18e-27 < z < 4.4999999999999998e38

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\frac{\left(-y\right) \cdot z}{t}} \]
      10. *-commutative16.6%

        \[\leadsto -1 \cdot \frac{\color{blue}{z \cdot \left(-y\right)}}{t} \]
      11. add-sqr-sqrt5.2%

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

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

        \[\leadsto -1 \cdot \frac{z \cdot \sqrt{\color{blue}{y \cdot y}}}{t} \]
      14. sqrt-unprod23.9%

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

        \[\leadsto -1 \cdot \frac{z \cdot \color{blue}{y}}{t} \]
    10. Applied egg-rr53.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.6 \cdot 10^{-27}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 1.18 \cdot 10^{-27}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+38}:\\ \;\;\;\;z \cdot \frac{y}{-t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 65.3% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 48000000:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.3500000000000001e51 or 3.90000000000000023e38 < z

    1. Initial program 63.3%

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

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

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

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

    if -2.3500000000000001e51 < z < 4.8e7

    1. Initial program 98.3%

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

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

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

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

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

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

    if 4.8e7 < z < 3.90000000000000023e38

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\frac{\left(-y\right) \cdot z}{t}} \]
      10. *-commutative30.7%

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

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

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

        \[\leadsto -1 \cdot \frac{z \cdot \sqrt{\color{blue}{y \cdot y}}}{t} \]
      14. sqrt-unprod38.5%

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

        \[\leadsto -1 \cdot \frac{z \cdot \color{blue}{y}}{t} \]
    10. Applied egg-rr80.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.35 \cdot 10^{+51}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 48000000:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+38}:\\ \;\;\;\;z \cdot \frac{y}{-t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 90.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+104} \lor \neg \left(z \leq 6.6 \cdot 10^{+117}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.5000000000000002e104 or 6.5999999999999996e117 < z

    1. Initial program 52.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.5000000000000002e104 < z < 6.5999999999999996e117

    1. Initial program 96.6%

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

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

Alternative 10: 55.4% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.5000000000000002e-27 or 1.7199999999999999e-28 < z

    1. Initial program 72.0%

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

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

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

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

    if -4.5000000000000002e-27 < z < 1.7199999999999999e-28

    1. Initial program 99.7%

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

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

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

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

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

Alternative 11: 35.9% accurate, 3.7× speedup?

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

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

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

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

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

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

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

Developer target: 97.4% 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 2024053 
(FPCore (x y z t a)
  :name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
  :precision binary64

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

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