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

Percentage Accurate: 85.1% → 99.6%
Time: 18.6s
Alternatives: 15
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 15 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.1% 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: 99.6% accurate, 0.1× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x}{y} - z\\
t_2 := x - y \cdot z\\
t_3 := t - z \cdot a\\
t_4 := \frac{t\_2}{t\_3}\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;\frac{y}{t\_3} \cdot t\_1\\

\mathbf{elif}\;t\_4 \leq -2 \cdot 10^{-308}:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;\frac{t\_2}{a} \cdot \frac{-1}{z - \frac{t}{a}}\\

\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\frac{t\_1}{\frac{t\_3}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0

    1. Initial program 44.3%

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

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

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

      \[\leadsto \frac{\color{blue}{y \cdot \left(\frac{x}{y} - z\right)}}{t - z \cdot a} \]
    6. Step-by-step derivation
      1. div-inv44.3%

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

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

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

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

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

    if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.9999999999999998e-308 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 2.00000000000000003e306

    1. Initial program 99.7%

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

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

    1. Initial program 71.9%

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

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

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

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

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

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

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

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

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

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

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

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

    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 5 regimes into one program.
  4. Final simplification99.7%

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

Alternative 2: 99.6% accurate, 0.1× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x}{y} - z\\
t_2 := x - y \cdot z\\
t_3 := t - z \cdot a\\
t_4 := \frac{t\_2}{t\_3}\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;\frac{y}{t\_3} \cdot t\_1\\

\mathbf{elif}\;t\_4 \leq -2 \cdot 10^{-308}:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;\frac{1}{a} \cdot \frac{t\_2}{\frac{t}{a} - z}\\

\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\frac{t\_1}{\frac{t\_3}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0

    1. Initial program 44.3%

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

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

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

      \[\leadsto \frac{\color{blue}{y \cdot \left(\frac{x}{y} - z\right)}}{t - z \cdot a} \]
    6. Step-by-step derivation
      1. div-inv44.3%

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

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

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

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

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

    if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.9999999999999998e-308 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 2.00000000000000003e306

    1. Initial program 99.7%

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

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

    1. Initial program 71.9%

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

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

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

      \[\leadsto \frac{x - y \cdot z}{\color{blue}{a \cdot \left(\frac{t}{a} - z\right)}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity71.9%

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

        \[\leadsto \color{blue}{\frac{1}{a} \cdot \frac{x - y \cdot z}{\frac{t}{a} - z}} \]
    7. Applied egg-rr99.8%

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

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

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

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

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

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

    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 5 regimes into one program.
  4. Final simplification99.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y \cdot z}{t - z \cdot a} \leq -\infty:\\ \;\;\;\;\frac{y}{t - z \cdot a} \cdot \left(\frac{x}{y} - z\right)\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq -2 \cdot 10^{-308}:\\ \;\;\;\;\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 \frac{x - y \cdot z}{\frac{t}{a} - z}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq 2 \cdot 10^{+306}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq \infty:\\ \;\;\;\;\frac{\frac{x}{y} - z}{\frac{t - z \cdot a}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 97.6% accurate, 0.1× speedup?

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

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

\mathbf{elif}\;t\_3 \leq -4 \cdot 10^{-311}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;y \cdot \frac{\frac{z}{a}}{z - \frac{t}{a}}\\

\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\frac{t\_1}{\frac{t\_2}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0

    1. Initial program 44.3%

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

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

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

      \[\leadsto \frac{\color{blue}{y \cdot \left(\frac{x}{y} - z\right)}}{t - z \cdot a} \]
    6. Step-by-step derivation
      1. div-inv44.3%

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

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

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

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

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

    if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -3.99999999999979e-311 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 2.00000000000000003e306

    1. Initial program 99.7%

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

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

    1. Initial program 70.9%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

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

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

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

    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 5 regimes into one program.
  4. Final simplification98.7%

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

Alternative 4: 97.6% accurate, 0.1× speedup?

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

\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{y}{t\_1} \cdot \left(\frac{x}{y} - z\right)\\
t_3 := \frac{x - y \cdot z}{t\_1}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_3 \leq -4 \cdot 10^{-311}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;y \cdot \frac{\frac{z}{a}}{z - \frac{t}{a}}\\

\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_2\\

\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))) < -inf.0 or 2.00000000000000003e306 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0

    1. Initial program 57.5%

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

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

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -3.99999999999979e-311 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 2.00000000000000003e306

    1. Initial program 99.7%

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

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

    1. Initial program 70.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{\frac{z}{a}}{-\left(\frac{t}{a} - z\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.6%

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

Alternative 5: 97.0% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := x - y \cdot z\\
t_3 := t - z \cdot a\\
t_4 := \frac{x}{t\_3}\\
t_5 := \frac{t\_2}{t\_3}\\
\mathbf{if}\;t\_5 \leq -2 \cdot 10^{-308}:\\
\;\;\;\;z \cdot \frac{y}{t\_1} + t\_4\\

\mathbf{elif}\;t\_5 \leq 0:\\
\;\;\;\;\frac{t\_2}{a} \cdot \frac{-1}{z - \frac{t}{a}}\\

\mathbf{elif}\;t\_5 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;\frac{y \cdot z}{t\_1} + t\_4\\

\mathbf{elif}\;t\_5 \leq \infty:\\
\;\;\;\;\frac{\frac{x}{y} - z}{\frac{t\_3}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.9999999999999998e-308

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

    1. Initial program 71.9%

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

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

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

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

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

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

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

    if 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 2.00000000000000003e306

    1. Initial program 99.7%

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

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

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

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

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

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

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

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

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

    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 5 regimes into one program.
  4. Final simplification99.0%

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

Alternative 6: 97.0% accurate, 0.2× 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 -2 \cdot 10^{-308}:\\ \;\;\;\;z \cdot \frac{y}{z \cdot a - t} + \frac{x}{t\_2}\\ \mathbf{elif}\;t\_3 \leq 0:\\ \;\;\;\;\frac{t\_1}{a} \cdot \frac{-1}{z - \frac{t}{a}}\\ \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+306}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;\frac{\frac{x}{y} - z}{\frac{t\_2}{y}}\\ \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 -2e-308)
     (+ (* z (/ y (- (* z a) t))) (/ x t_2))
     (if (<= t_3 0.0)
       (* (/ t_1 a) (/ -1.0 (- z (/ t a))))
       (if (<= t_3 2e+306)
         t_3
         (if (<= t_3 INFINITY) (/ (- (/ x y) z) (/ t_2 y)) (/ 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 <= -2e-308) {
		tmp = (z * (y / ((z * a) - t))) + (x / t_2);
	} else if (t_3 <= 0.0) {
		tmp = (t_1 / a) * (-1.0 / (z - (t / a)));
	} else if (t_3 <= 2e+306) {
		tmp = t_3;
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = ((x / y) - z) / (t_2 / y);
	} 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 <= -2e-308) {
		tmp = (z * (y / ((z * a) - t))) + (x / t_2);
	} else if (t_3 <= 0.0) {
		tmp = (t_1 / a) * (-1.0 / (z - (t / a)));
	} else if (t_3 <= 2e+306) {
		tmp = t_3;
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = ((x / y) - z) / (t_2 / y);
	} 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 <= -2e-308:
		tmp = (z * (y / ((z * a) - t))) + (x / t_2)
	elif t_3 <= 0.0:
		tmp = (t_1 / a) * (-1.0 / (z - (t / a)))
	elif t_3 <= 2e+306:
		tmp = t_3
	elif t_3 <= math.inf:
		tmp = ((x / y) - z) / (t_2 / y)
	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 <= -2e-308)
		tmp = Float64(Float64(z * Float64(y / Float64(Float64(z * a) - t))) + Float64(x / t_2));
	elseif (t_3 <= 0.0)
		tmp = Float64(Float64(t_1 / a) * Float64(-1.0 / Float64(z - Float64(t / a))));
	elseif (t_3 <= 2e+306)
		tmp = t_3;
	elseif (t_3 <= Inf)
		tmp = Float64(Float64(Float64(x / y) - z) / Float64(t_2 / y));
	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 <= -2e-308)
		tmp = (z * (y / ((z * a) - t))) + (x / t_2);
	elseif (t_3 <= 0.0)
		tmp = (t_1 / a) * (-1.0 / (z - (t / a)));
	elseif (t_3 <= 2e+306)
		tmp = t_3;
	elseif (t_3 <= Inf)
		tmp = ((x / y) - z) / (t_2 / y);
	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, -2e-308], N[(N[(z * N[(y / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 0.0], N[(N[(t$95$1 / a), $MachinePrecision] * N[(-1.0 / N[(z - N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+306], t$95$3, If[LessEqual[t$95$3, Infinity], N[(N[(N[(x / y), $MachinePrecision] - z), $MachinePrecision] / N[(t$95$2 / y), $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 -2 \cdot 10^{-308}:\\
\;\;\;\;z \cdot \frac{y}{z \cdot a - t} + \frac{x}{t\_2}\\

\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{t\_1}{a} \cdot \frac{-1}{z - \frac{t}{a}}\\

\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\frac{\frac{x}{y} - z}{\frac{t\_2}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.9999999999999998e-308

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

    1. Initial program 71.9%

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

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

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

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

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

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

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

    if 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 2.00000000000000003e306

    1. Initial program 99.7%

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

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

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

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

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

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

    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 5 regimes into one program.
  4. Final simplification99.0%

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

Alternative 7: 97.1% accurate, 0.2× 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 -2 \cdot 10^{-308}:\\ \;\;\;\;\frac{x}{t\_2} + \frac{z}{\frac{z \cdot a - t}{y}}\\ \mathbf{elif}\;t\_3 \leq 0:\\ \;\;\;\;\frac{t\_1}{a} \cdot \frac{-1}{z - \frac{t}{a}}\\ \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+306}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;\frac{\frac{x}{y} - z}{\frac{t\_2}{y}}\\ \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 -2e-308)
     (+ (/ x t_2) (/ z (/ (- (* z a) t) y)))
     (if (<= t_3 0.0)
       (* (/ t_1 a) (/ -1.0 (- z (/ t a))))
       (if (<= t_3 2e+306)
         t_3
         (if (<= t_3 INFINITY) (/ (- (/ x y) z) (/ t_2 y)) (/ 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 <= -2e-308) {
		tmp = (x / t_2) + (z / (((z * a) - t) / y));
	} else if (t_3 <= 0.0) {
		tmp = (t_1 / a) * (-1.0 / (z - (t / a)));
	} else if (t_3 <= 2e+306) {
		tmp = t_3;
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = ((x / y) - z) / (t_2 / y);
	} 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 <= -2e-308) {
		tmp = (x / t_2) + (z / (((z * a) - t) / y));
	} else if (t_3 <= 0.0) {
		tmp = (t_1 / a) * (-1.0 / (z - (t / a)));
	} else if (t_3 <= 2e+306) {
		tmp = t_3;
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = ((x / y) - z) / (t_2 / y);
	} 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 <= -2e-308:
		tmp = (x / t_2) + (z / (((z * a) - t) / y))
	elif t_3 <= 0.0:
		tmp = (t_1 / a) * (-1.0 / (z - (t / a)))
	elif t_3 <= 2e+306:
		tmp = t_3
	elif t_3 <= math.inf:
		tmp = ((x / y) - z) / (t_2 / y)
	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 <= -2e-308)
		tmp = Float64(Float64(x / t_2) + Float64(z / Float64(Float64(Float64(z * a) - t) / y)));
	elseif (t_3 <= 0.0)
		tmp = Float64(Float64(t_1 / a) * Float64(-1.0 / Float64(z - Float64(t / a))));
	elseif (t_3 <= 2e+306)
		tmp = t_3;
	elseif (t_3 <= Inf)
		tmp = Float64(Float64(Float64(x / y) - z) / Float64(t_2 / y));
	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 <= -2e-308)
		tmp = (x / t_2) + (z / (((z * a) - t) / y));
	elseif (t_3 <= 0.0)
		tmp = (t_1 / a) * (-1.0 / (z - (t / a)));
	elseif (t_3 <= 2e+306)
		tmp = t_3;
	elseif (t_3 <= Inf)
		tmp = ((x / y) - z) / (t_2 / y);
	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, -2e-308], N[(N[(x / t$95$2), $MachinePrecision] + N[(z / N[(N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 0.0], N[(N[(t$95$1 / a), $MachinePrecision] * N[(-1.0 / N[(z - N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+306], t$95$3, If[LessEqual[t$95$3, Infinity], N[(N[(N[(x / y), $MachinePrecision] - z), $MachinePrecision] / N[(t$95$2 / y), $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 -2 \cdot 10^{-308}:\\
\;\;\;\;\frac{x}{t\_2} + \frac{z}{\frac{z \cdot a - t}{y}}\\

\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{t\_1}{a} \cdot \frac{-1}{z - \frac{t}{a}}\\

\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\frac{\frac{x}{y} - z}{\frac{t\_2}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.9999999999999998e-308

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{t - a \cdot z} - z \cdot \frac{y}{t - z \cdot a}} \]
      4. *-commutative97.8%

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

        \[\leadsto \frac{x}{t - z \cdot a} - z \cdot \color{blue}{\frac{1}{\frac{t - z \cdot a}{y}}} \]
      6. un-div-inv97.8%

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

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

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

    1. Initial program 71.9%

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

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

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

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

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

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

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

    if 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 2.00000000000000003e306

    1. Initial program 99.7%

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

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

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

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

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

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

    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 5 regimes into one program.
  4. Final simplification99.0%

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

Alternative 8: 90.6% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 55.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35999999999999998e101 < z < 1.74999999999999991e117

    1. Initial program 95.7%

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

    if 1.74999999999999991e117 < z

    1. Initial program 50.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} - \frac{x}{a \cdot z}} \]
      4. *-commutative79.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.36 \cdot 10^{+101}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+117}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 69.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{-48}:\\
\;\;\;\;\frac{x}{t} - y \cdot \frac{z}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.9999999999999998e-48

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.9999999999999998e-48 < t < 0.104999999999999996

    1. Initial program 82.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.104999999999999996 < t

    1. Initial program 89.7%

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

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

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

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

Alternative 10: 69.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.85 \cdot 10^{-26} \lor \neg \left(t \leq 0.23\right):\\
\;\;\;\;\frac{x - y \cdot z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.8499999999999999e-26 or 0.23000000000000001 < t

    1. Initial program 86.9%

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

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

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

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

    if -1.8499999999999999e-26 < t < 0.23000000000000001

    1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 65.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+101} \lor \neg \left(z \leq 1.95 \cdot 10^{+90}\right):\\
\;\;\;\;\frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.39999999999999991e101 or 1.9500000000000001e90 < z

    1. Initial program 54.4%

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

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

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

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

    if -1.39999999999999991e101 < z < 1.9500000000000001e90

    1. Initial program 97.6%

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

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

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

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

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

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

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

Alternative 12: 69.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.4 \cdot 10^{-28}:\\
\;\;\;\;\frac{x}{t} - y \cdot \frac{z}{t}\\

\mathbf{elif}\;t \leq 0.7:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.40000000000000039e-28

    1. Initial program 84.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{t} - \color{blue}{y \cdot \frac{z}{t}} \]
    10. Simplified76.6%

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

    if -7.40000000000000039e-28 < t < 0.69999999999999996

    1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.69999999999999996 < t

    1. Initial program 89.7%

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

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

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

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

Alternative 13: 59.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{-137}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.1499999999999999e-137

    1. Initial program 81.8%

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

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

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

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

    if -2.1499999999999999e-137 < y < 7.2000000000000002e-19

    1. Initial program 97.1%

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

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

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

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

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

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

    if 7.2000000000000002e-19 < y

    1. Initial program 69.5%

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

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

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

      \[\leadsto \color{blue}{\frac{y}{a}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 14: 53.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+87} \lor \neg \left(z \leq 2.2 \cdot 10^{+68}\right):\\
\;\;\;\;\frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.50000000000000014e87 or 2.19999999999999987e68 < z

    1. Initial program 57.1%

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

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

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

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

    if -7.50000000000000014e87 < z < 2.19999999999999987e68

    1. Initial program 97.5%

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

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

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

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

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

Alternative 15: 35.8% 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.8%

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

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

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

    \[\leadsto \color{blue}{\frac{x}{t}} \]
  6. 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 2024111 
(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))))