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

Percentage Accurate: 84.3% → 98.4%
Time: 13.9s
Alternatives: 12
Speedup: 0.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 84.3% accurate, 1.0× speedup?

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

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

Alternative 1: 98.4% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - y \cdot z\\ t_2 := t - z \cdot a\\ t_3 := \mathsf{fma}\left(-1, \frac{y}{\frac{t_2}{z}}, \frac{x}{t_2}\right)\\ t_4 := \frac{t_1}{t_2}\\ \mathbf{if}\;t_4 \leq -2 \cdot 10^{-94}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_4 \leq 10^{-165}:\\ \;\;\;\;{\left(a \cdot \left(z \cdot \frac{-1}{t_1}\right) + \frac{t}{t_1}\right)}^{-1}\\ \mathbf{elif}\;t_4 \leq \infty:\\ \;\;\;\;t_3\\ \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 (fma -1.0 (/ y (/ t_2 z)) (/ x t_2)))
        (t_4 (/ t_1 t_2)))
   (if (<= t_4 -2e-94)
     t_3
     (if (<= t_4 1e-165)
       (pow (+ (* a (* z (/ -1.0 t_1))) (/ t t_1)) -1.0)
       (if (<= t_4 INFINITY) t_3 (/ 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 = fma(-1.0, (y / (t_2 / z)), (x / t_2));
	double t_4 = t_1 / t_2;
	double tmp;
	if (t_4 <= -2e-94) {
		tmp = t_3;
	} else if (t_4 <= 1e-165) {
		tmp = pow(((a * (z * (-1.0 / t_1))) + (t / t_1)), -1.0);
	} else if (t_4 <= ((double) INFINITY)) {
		tmp = t_3;
	} 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 = fma(-1.0, Float64(y / Float64(t_2 / z)), Float64(x / t_2))
	t_4 = Float64(t_1 / t_2)
	tmp = 0.0
	if (t_4 <= -2e-94)
		tmp = t_3;
	elseif (t_4 <= 1e-165)
		tmp = Float64(Float64(a * Float64(z * Float64(-1.0 / t_1))) + Float64(t / t_1)) ^ -1.0;
	elseif (t_4 <= Inf)
		tmp = t_3;
	else
		tmp = Float64(y / a);
	end
	return 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[(-1.0 * N[(y / N[(t$95$2 / z), $MachinePrecision]), $MachinePrecision] + N[(x / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$4, -2e-94], t$95$3, If[LessEqual[t$95$4, 1e-165], N[Power[N[(N[(a * N[(z * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$3, N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x - y \cdot z\\
t_2 := t - z \cdot a\\
t_3 := \mathsf{fma}\left(-1, \frac{y}{\frac{t_2}{z}}, \frac{x}{t_2}\right)\\
t_4 := \frac{t_1}{t_2}\\
\mathbf{if}\;t_4 \leq -2 \cdot 10^{-94}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t_4 \leq 10^{-165}:\\
\;\;\;\;{\left(a \cdot \left(z \cdot \frac{-1}{t_1}\right) + \frac{t}{t_1}\right)}^{-1}\\

\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.9999999999999999e-94 or 1e-165 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0

    1. Initial program 92.9%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{y \cdot z}{t - a \cdot z}, \frac{x}{t - a \cdot z}\right)} \]
      2. associate-/l*99.8%

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

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

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

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

    if -1.9999999999999999e-94 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 1e-165

    1. Initial program 78.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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. Taylor expanded in z around inf 100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y \cdot z}{t - z \cdot a} \leq -2 \cdot 10^{-94}:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{y}{\frac{t - z \cdot a}{z}}, \frac{x}{t - z \cdot a}\right)\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq 10^{-165}:\\ \;\;\;\;{\left(a \cdot \left(z \cdot \frac{-1}{x - y \cdot z}\right) + \frac{t}{x - y \cdot z}\right)}^{-1}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{y}{\frac{t - z \cdot a}{z}}, \frac{x}{t - z \cdot a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]

Alternative 2: 94.8% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t - z \cdot a\\ t_2 := \mathsf{fma}\left(-1, \frac{y}{\frac{t_1}{z}}, \frac{x}{t_1}\right)\\ t_3 := \frac{x - y \cdot z}{t_1}\\ \mathbf{if}\;t_3 \leq -5 \cdot 10^{-304}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;\frac{y}{a} - \frac{\frac{x}{z}}{a}\\ \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 (fma -1.0 (/ y (/ t_1 z)) (/ x t_1)))
        (t_3 (/ (- x (* y z)) t_1)))
   (if (<= t_3 -5e-304)
     t_2
     (if (<= t_3 0.0)
       (- (/ y a) (/ (/ x z) a))
       (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 = fma(-1.0, (y / (t_1 / z)), (x / t_1));
	double t_3 = (x - (y * z)) / t_1;
	double tmp;
	if (t_3 <= -5e-304) {
		tmp = t_2;
	} else if (t_3 <= 0.0) {
		tmp = (y / a) - ((x / z) / a);
	} else if (t_3 <= ((double) INFINITY)) {
		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 = fma(-1.0, Float64(y / Float64(t_1 / z)), Float64(x / t_1))
	t_3 = Float64(Float64(x - Float64(y * z)) / t_1)
	tmp = 0.0
	if (t_3 <= -5e-304)
		tmp = t_2;
	elseif (t_3 <= 0.0)
		tmp = Float64(Float64(y / a) - Float64(Float64(x / z) / a));
	elseif (t_3 <= Inf)
		tmp = t_2;
	else
		tmp = Float64(y / a);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-1.0 * N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] + N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-304], t$95$2, If[LessEqual[t$95$3, 0.0], N[(N[(y / a), $MachinePrecision] - N[(N[(x / z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], 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 := \mathsf{fma}\left(-1, \frac{y}{\frac{t_1}{z}}, \frac{x}{t_1}\right)\\
t_3 := \frac{x - y \cdot z}{t_1}\\
\mathbf{if}\;t_3 \leq -5 \cdot 10^{-304}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_3 \leq 0:\\
\;\;\;\;\frac{y}{a} - \frac{\frac{x}{z}}{a}\\

\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -4.99999999999999965e-304 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0

    1. Initial program 93.9%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{y \cdot z}{t - a \cdot z}, \frac{x}{t - a \cdot z}\right)} \]
      2. associate-/l*97.9%

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

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

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

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

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

    1. Initial program 47.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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. Taylor expanded in z around inf 100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y \cdot z}{t - z \cdot a} \leq -5 \cdot 10^{-304}:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{y}{\frac{t - z \cdot a}{z}}, \frac{x}{t - z \cdot a}\right)\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq 0:\\ \;\;\;\;\frac{y}{a} - \frac{\frac{x}{z}}{a}\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{y}{\frac{t - z \cdot a}{z}}, \frac{x}{t - z \cdot a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]

Alternative 3: 71.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{t - z \cdot a}\\ t_2 := \frac{y}{a - \frac{t}{z}}\\ \mathbf{if}\;z \leq -4.4 \cdot 10^{+74}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-74}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 10^{-39}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+25}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+101}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} - \frac{\frac{x}{z}}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ x (- t (* z a)))) (t_2 (/ y (- a (/ t z)))))
   (if (<= z -4.4e+74)
     t_2
     (if (<= z -8.2e-74)
       t_1
       (if (<= z 1e-39)
         (/ (- x (* y z)) t)
         (if (<= z 1.55e+25)
           t_1
           (if (<= z 3.4e+101) t_2 (- (/ y a) (/ (/ x z) a)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x / (t - (z * a));
	double t_2 = y / (a - (t / z));
	double tmp;
	if (z <= -4.4e+74) {
		tmp = t_2;
	} else if (z <= -8.2e-74) {
		tmp = t_1;
	} else if (z <= 1e-39) {
		tmp = (x - (y * z)) / t;
	} else if (z <= 1.55e+25) {
		tmp = t_1;
	} else if (z <= 3.4e+101) {
		tmp = t_2;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x / (t - (z * a))
    t_2 = y / (a - (t / z))
    if (z <= (-4.4d+74)) then
        tmp = t_2
    else if (z <= (-8.2d-74)) then
        tmp = t_1
    else if (z <= 1d-39) then
        tmp = (x - (y * z)) / t
    else if (z <= 1.55d+25) then
        tmp = t_1
    else if (z <= 3.4d+101) then
        tmp = t_2
    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 t_1 = x / (t - (z * a));
	double t_2 = y / (a - (t / z));
	double tmp;
	if (z <= -4.4e+74) {
		tmp = t_2;
	} else if (z <= -8.2e-74) {
		tmp = t_1;
	} else if (z <= 1e-39) {
		tmp = (x - (y * z)) / t;
	} else if (z <= 1.55e+25) {
		tmp = t_1;
	} else if (z <= 3.4e+101) {
		tmp = t_2;
	} else {
		tmp = (y / a) - ((x / z) / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x / (t - (z * a))
	t_2 = y / (a - (t / z))
	tmp = 0
	if z <= -4.4e+74:
		tmp = t_2
	elif z <= -8.2e-74:
		tmp = t_1
	elif z <= 1e-39:
		tmp = (x - (y * z)) / t
	elif z <= 1.55e+25:
		tmp = t_1
	elif z <= 3.4e+101:
		tmp = t_2
	else:
		tmp = (y / a) - ((x / z) / a)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x / Float64(t - Float64(z * a)))
	t_2 = Float64(y / Float64(a - Float64(t / z)))
	tmp = 0.0
	if (z <= -4.4e+74)
		tmp = t_2;
	elseif (z <= -8.2e-74)
		tmp = t_1;
	elseif (z <= 1e-39)
		tmp = Float64(Float64(x - Float64(y * z)) / t);
	elseif (z <= 1.55e+25)
		tmp = t_1;
	elseif (z <= 3.4e+101)
		tmp = t_2;
	else
		tmp = Float64(Float64(y / a) - Float64(Float64(x / z) / a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x / (t - (z * a));
	t_2 = y / (a - (t / z));
	tmp = 0.0;
	if (z <= -4.4e+74)
		tmp = t_2;
	elseif (z <= -8.2e-74)
		tmp = t_1;
	elseif (z <= 1e-39)
		tmp = (x - (y * z)) / t;
	elseif (z <= 1.55e+25)
		tmp = t_1;
	elseif (z <= 3.4e+101)
		tmp = t_2;
	else
		tmp = (y / a) - ((x / z) / a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.4e+74], t$95$2, If[LessEqual[z, -8.2e-74], t$95$1, If[LessEqual[z, 1e-39], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.55e+25], t$95$1, If[LessEqual[z, 3.4e+101], t$95$2, N[(N[(y / a), $MachinePrecision] - N[(N[(x / z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -8.2 \cdot 10^{-74}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.55 \cdot 10^{+25}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 3.4 \cdot 10^{+101}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.4000000000000002e74 or 1.5499999999999999e25 < z < 3.40000000000000017e101

    1. Initial program 67.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.4000000000000002e74 < z < -8.20000000000000063e-74 or 9.99999999999999929e-40 < z < 1.5499999999999999e25

    1. Initial program 99.8%

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

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

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

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

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

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

    if -8.20000000000000063e-74 < z < 9.99999999999999929e-40

    1. Initial program 99.8%

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

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

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

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

    if 3.40000000000000017e101 < z

    1. Initial program 62.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+74}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-74}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 10^{-39}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+25}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+101}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} - \frac{\frac{x}{z}}{a}\\ \end{array} \]

Alternative 4: 90.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.66 \cdot 10^{+97}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+149}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} - \frac{\frac{x}{z}}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.66e+97)
   (/ y (- a (/ t z)))
   (if (<= z 3.6e+149)
     (/ (- 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.66e+97) {
		tmp = y / (a - (t / z));
	} else if (z <= 3.6e+149) {
		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.66d+97)) then
        tmp = y / (a - (t / z))
    else if (z <= 3.6d+149) 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.66e+97) {
		tmp = y / (a - (t / z));
	} else if (z <= 3.6e+149) {
		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.66e+97:
		tmp = y / (a - (t / z))
	elif z <= 3.6e+149:
		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.66e+97)
		tmp = Float64(y / Float64(a - Float64(t / z)));
	elseif (z <= 3.6e+149)
		tmp = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a)));
	else
		tmp = Float64(Float64(y / a) - Float64(Float64(x / z) / a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.66e+97)
		tmp = y / (a - (t / z));
	elseif (z <= 3.6e+149)
		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.66e+97], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+149], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / a), $MachinePrecision] - N[(N[(x / z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6599999999999999e97 < z < 3.59999999999999995e149

    1. Initial program 97.8%

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

    if 3.59999999999999995e149 < z

    1. Initial program 55.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.66 \cdot 10^{+97}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+149}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} - \frac{\frac{x}{z}}{a}\\ \end{array} \]

Alternative 5: 71.2% accurate, 0.8× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.99999999999999991e76 or 1.3200000000000001e-17 < z

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999991e76 < z < -7.4999999999999997e-76

    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. Taylor expanded in x around inf 66.0%

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

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

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

    if -7.4999999999999997e-76 < z < 1.3200000000000001e-17

    1. Initial program 99.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+76}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-76}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{-17}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \end{array} \]

Alternative 6: 64.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.36 \cdot 10^{+79} \lor \neg \left(z \leq 1.45 \cdot 10^{+26}\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.36e+79) (not (<= z 1.45e+26))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -1.36e+79) || !(z <= 1.45e+26)) {
		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.36d+79)) .or. (.not. (z <= 1.45d+26))) 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.36e+79) || !(z <= 1.45e+26)) {
		tmp = y / a;
	} else {
		tmp = x / (t - (z * a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -1.36e+79) or not (z <= 1.45e+26):
		tmp = y / a
	else:
		tmp = x / (t - (z * a))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -1.36e+79) || !(z <= 1.45e+26))
		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.36e+79) || ~((z <= 1.45e+26)))
		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.36e+79], N[Not[LessEqual[z, 1.45e+26]], $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.36 \cdot 10^{+79} \lor \neg \left(z \leq 1.45 \cdot 10^{+26}\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.36000000000000003e79 or 1.45e26 < z

    1. Initial program 65.8%

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

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

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

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

    if -1.36000000000000003e79 < z < 1.45e26

    1. Initial program 99.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.36 \cdot 10^{+79} \lor \neg \left(z \leq 1.45 \cdot 10^{+26}\right):\\ \;\;\;\;\frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \end{array} \]

Alternative 7: 69.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+86} \lor \neg \left(y \leq 6.2 \cdot 10^{-80}\right):\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.20000000000000011e86 or 6.20000000000000032e-80 < y

    1. Initial program 80.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.20000000000000011e86 < y < 6.20000000000000032e-80

    1. Initial program 93.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+86} \lor \neg \left(y \leq 6.2 \cdot 10^{-80}\right):\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \end{array} \]

Alternative 8: 54.8% accurate, 1.1× speedup?

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

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

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

\mathbf{elif}\;z \leq 10^{-15}:\\
\;\;\;\;\frac{x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.25999999999999995e54 or 1.0000000000000001e-15 < z

    1. Initial program 68.7%

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

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

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

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

    if -1.25999999999999995e54 < z < -9.4000000000000001e-42

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.4000000000000001e-42 < z < 1.0000000000000001e-15

    1. Initial program 99.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.26 \cdot 10^{+54}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -9.4 \cdot 10^{-42}:\\ \;\;\;\;\frac{-z}{\frac{t}{y}}\\ \mathbf{elif}\;z \leq 10^{-15}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]

Alternative 9: 54.5% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;z \leq -3.45 \cdot 10^{-41}:\\
\;\;\;\;\frac{\frac{-x}{a}}{z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.25000000000000001e54 or 2.7500000000000001e-15 < z

    1. Initial program 68.7%

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

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

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

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

    if -1.25000000000000001e54 < z < -3.4499999999999999e-41

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-1}}{-z} \cdot \frac{x - y \cdot z}{-a} \]
      5. add-sqr-sqrt67.8%

        \[\leadsto \frac{-1}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \cdot \frac{x - y \cdot z}{-a} \]
      6. sqrt-unprod68.1%

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

        \[\leadsto \frac{-1}{\sqrt{\color{blue}{z \cdot z}}} \cdot \frac{x - y \cdot z}{-a} \]
      8. sqrt-unprod0.0%

        \[\leadsto \frac{-1}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}} \cdot \frac{x - y \cdot z}{-a} \]
      9. add-sqr-sqrt5.6%

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

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

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

        \[\leadsto \frac{-1}{z} \cdot \frac{x + \color{blue}{\left(-z\right) \cdot y}}{-a} \]
      13. add-sqr-sqrt5.6%

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

        \[\leadsto \frac{-1}{z} \cdot \frac{x + \color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} \cdot y}{-a} \]
      15. sqr-neg5.6%

        \[\leadsto \frac{-1}{z} \cdot \frac{x + \sqrt{\color{blue}{z \cdot z}} \cdot y}{-a} \]
      16. sqrt-unprod0.0%

        \[\leadsto \frac{-1}{z} \cdot \frac{x + \color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot y}{-a} \]
      17. add-sqr-sqrt11.5%

        \[\leadsto \frac{-1}{z} \cdot \frac{x + \color{blue}{z} \cdot y}{-a} \]
      18. add-sqr-sqrt6.3%

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

        \[\leadsto \frac{-1}{z} \cdot \frac{x + z \cdot y}{\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}}} \]
      20. sqr-neg26.2%

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

        \[\leadsto \frac{-1}{z} \cdot \frac{x + z \cdot y}{\color{blue}{\sqrt{a} \cdot \sqrt{a}}} \]
      22. add-sqr-sqrt62.2%

        \[\leadsto \frac{-1}{z} \cdot \frac{x + z \cdot y}{\color{blue}{a}} \]
    8. Applied egg-rr62.2%

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

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

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

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

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

    if -3.4499999999999999e-41 < z < 2.7500000000000001e-15

    1. Initial program 99.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+54}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -3.45 \cdot 10^{-41}:\\ \;\;\;\;\frac{\frac{-x}{a}}{z}\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{-15}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]

Alternative 10: 54.5% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;z \leq -3.45 \cdot 10^{-41}:\\
\;\;\;\;\frac{-x}{z \cdot a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.0999999999999998e53 or 2.8500000000000002e-15 < z

    1. Initial program 68.7%

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

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

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

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

    if -5.0999999999999998e53 < z < -3.4499999999999999e-41

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-1}}{-z}}{-a} \cdot \left(x - y \cdot z\right) \]
      6. add-sqr-sqrt70.0%

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

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

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

        \[\leadsto \frac{\frac{-1}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}}{-a} \cdot \left(x - y \cdot z\right) \]
      10. add-sqr-sqrt5.6%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{-1}{z}}{a} \cdot \left(x + \color{blue}{\left(-z\right) \cdot y}\right) \]
      19. add-sqr-sqrt70.2%

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

        \[\leadsto \frac{\frac{-1}{z}}{a} \cdot \left(x + \color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} \cdot y\right) \]
      21. sqr-neg70.2%

        \[\leadsto \frac{\frac{-1}{z}}{a} \cdot \left(x + \sqrt{\color{blue}{z \cdot z}} \cdot y\right) \]
      22. sqrt-unprod0.0%

        \[\leadsto \frac{\frac{-1}{z}}{a} \cdot \left(x + \color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot y\right) \]
      23. add-sqr-sqrt62.2%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{a \cdot z} \]
    11. Simplified62.9%

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

    if -3.4499999999999999e-41 < z < 2.8500000000000002e-15

    1. Initial program 99.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.1 \cdot 10^{+53}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -3.45 \cdot 10^{-41}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{elif}\;z \leq 2.85 \cdot 10^{-15}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]

Alternative 11: 53.7% accurate, 1.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.30000000000000036e75 or 8.1999999999999995e-18 < z

    1. Initial program 67.5%

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

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

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

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

    if -6.30000000000000036e75 < z < 8.1999999999999995e-18

    1. Initial program 99.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.3 \cdot 10^{+75} \lor \neg \left(z \leq 8.2 \cdot 10^{-18}\right):\\ \;\;\;\;\frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t}\\ \end{array} \]

Alternative 12: 34.2% 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 87.1%

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

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

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

    \[\leadsto \color{blue}{\frac{x}{t}} \]
  5. Final simplification36.3%

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

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

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

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