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

Percentage Accurate: 85.1% → 93.9%
Time: 15.0s
Alternatives: 14
Speedup: 0.4×

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 14 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: 93.9% accurate, 0.1× speedup?

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

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

\mathbf{elif}\;t_2 \leq 5 \cdot 10^{-163}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{y}{\frac{t_1}{z}}, t_3\right)\\

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


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

    1. Initial program 90.9%

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

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

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

      \[\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. fma-def90.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*99.6%

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000018e56 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 4.99999999999999977e-163

    1. Initial program 92.7%

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

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

    1. Initial program 92.1%

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

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

      \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 92.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. fma-def92.1%

        \[\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.9%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{y}{\frac{t - z \cdot a}{z}}, \frac{x}{t - z \cdot a}\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 simplification96.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y \cdot z}{t - z \cdot a} \leq -2 \cdot 10^{+56}:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{y}{\frac{1}{\frac{z}{t - z \cdot a}}}, \frac{x}{t - z \cdot a}\right)\\ \mathbf{elif}\;\frac{x - y \cdot z}{t - z \cdot a} \leq 5 \cdot 10^{-163}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot 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} \]
  5. Add Preprocessing

Alternative 2: 93.9% 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 -1.6 \cdot 10^{+43}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_3 \leq 5 \cdot 10^{-163}:\\ \;\;\;\;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 (fma -1.0 (/ y (/ t_1 z)) (/ x t_1)))
        (t_3 (/ (- x (* y z)) t_1)))
   (if (<= t_3 -1.6e+43)
     t_2
     (if (<= t_3 5e-163) 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 = fma(-1.0, (y / (t_1 / z)), (x / t_1));
	double t_3 = (x - (y * z)) / t_1;
	double tmp;
	if (t_3 <= -1.6e+43) {
		tmp = t_2;
	} else if (t_3 <= 5e-163) {
		tmp = t_3;
	} 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 <= -1.6e+43)
		tmp = t_2;
	elseif (t_3 <= 5e-163)
		tmp = t_3;
	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, -1.6e+43], t$95$2, If[LessEqual[t$95$3, 5e-163], 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 := \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 -1.6 \cdot 10^{+43}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_3 \leq 5 \cdot 10^{-163}:\\
\;\;\;\;t_3\\

\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))) < -1.60000000000000007e43 or 4.99999999999999977e-163 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0

    1. Initial program 91.8%

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

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

      \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 91.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. fma-def91.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) \]
    7. 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.60000000000000007e43 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 4.99999999999999977e-163

    1. Initial program 92.6%

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

    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 3 regimes into one program.
  4. Final simplification96.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y \cdot z}{t - z \cdot a} \leq -1.6 \cdot 10^{+43}:\\ \;\;\;\;\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 5 \cdot 10^{-163}:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot 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} \]
  5. Add Preprocessing

Alternative 3: 89.9% accurate, 0.1× speedup?

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

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

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{y}{\frac{1}{\frac{z}{t_1}}}, \frac{x}{t}\right)\\

\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))) < 3.99999999999999981e271

    1. Initial program 94.4%

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

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

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

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

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

    1. Initial program 63.9%

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

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

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

      \[\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. fma-def63.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*100.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(-1, \frac{y}{\frac{1}{\frac{z}{t - a \cdot z}}}, \color{blue}{\frac{x}{t}}\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 3 regimes into one program.
  4. Final simplification94.3%

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

Alternative 4: 67.3% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;a \leq -2.7 \cdot 10^{-15}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \leq -1.2 \cdot 10^{-119}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \leq 1.85 \cdot 10^{+21}:\\
\;\;\;\;\frac{y}{a}\\

\mathbf{elif}\;a \leq 2.15 \cdot 10^{+71}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -2.70000000000000009e-15 or -1.3000000000000001e-96 < a < -1.20000000000000004e-119 or 2.14999999999999992e71 < a

    1. Initial program 81.5%

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

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

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

      \[\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. fma-def81.5%

        \[\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*81.9%

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

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

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

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

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

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

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

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

    if -2.70000000000000009e-15 < a < -1.3000000000000001e-96

    1. Initial program 87.2%

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

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

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

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

    if -1.20000000000000004e-119 < a < 3.7e-8

    1. Initial program 94.5%

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

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

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

      \[\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. fma-def94.5%

        \[\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*96.1%

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

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

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

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

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

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

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

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

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

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

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

    if 3.7e-8 < a < 1.85e21

    1. Initial program 69.1%

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

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

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

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

    if 1.85e21 < a < 2.14999999999999992e71

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 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}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification76.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.7 \cdot 10^{-15}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;a \leq -1.3 \cdot 10^{-96}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;a \leq -1.2 \cdot 10^{-119}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;a \leq 3.7 \cdot 10^{-8}:\\ \;\;\;\;\frac{x}{t} - \frac{z}{\frac{t}{y}}\\ \mathbf{elif}\;a \leq 1.85 \cdot 10^{+21}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq 2.15 \cdot 10^{+71}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 67.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;a \leq -6 \cdot 10^{-36}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;a \leq 5.4 \cdot 10^{+23}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 7.4 \cdot 10^{+71}:\\
\;\;\;\;\frac{x}{t_1}\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -4.2999999999999999e23 or 7.4e71 < a

    1. Initial program 79.8%

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

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

      \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 79.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. fma-def79.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*79.4%

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

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

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

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

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

        \[\leadsto \frac{y + \color{blue}{\left(-\frac{x}{z}\right)}}{a} \]
      2. sub-neg74.9%

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

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

    if -4.2999999999999999e23 < a < -6.0000000000000003e-36 or 1.70000000000000001e-108 < a < 5.3999999999999997e23

    1. Initial program 84.0%

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{y}{\frac{t - a \cdot z}{z}}} \]
      3. associate-/r/86.3%

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

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

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

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

        \[\leadsto -\frac{y}{\color{blue}{\mathsf{fma}\left(a, -z, t\right)}} \cdot z \]
      8. distribute-rgt-neg-in86.3%

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

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

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

        \[\leadsto \frac{y}{\color{blue}{t + \left(-a \cdot z\right)}} \cdot \left(-z\right) \]
      12. sub-neg86.3%

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

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

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

    if -6.0000000000000003e-36 < a < 1.70000000000000001e-108

    1. Initial program 95.3%

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

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

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

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

    if 5.3999999999999997e23 < a < 7.4e71

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 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}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification78.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.3 \cdot 10^{+23}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;a \leq -6 \cdot 10^{-36}:\\ \;\;\;\;z \cdot \frac{-y}{t - z \cdot a}\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-108}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;a \leq 5.4 \cdot 10^{+23}:\\ \;\;\;\;z \cdot \frac{-y}{t - z \cdot a}\\ \mathbf{elif}\;a \leq 7.4 \cdot 10^{+71}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 88.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t - z \cdot a\\ \mathbf{if}\;\frac{x - y \cdot z}{t_1} \leq \infty:\\ \;\;\;\;\frac{x}{t_1} - \frac{y \cdot z}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- t (* z a))))
   (if (<= (/ (- x (* y z)) t_1) INFINITY)
     (- (/ x t_1) (/ (* y z) t_1))
     (/ y a))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t - (z * a);
	double tmp;
	if (((x - (y * z)) / t_1) <= ((double) INFINITY)) {
		tmp = (x / t_1) - ((y * z) / t_1);
	} 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 tmp;
	if (((x - (y * z)) / t_1) <= Double.POSITIVE_INFINITY) {
		tmp = (x / t_1) - ((y * z) / t_1);
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t - (z * a)
	tmp = 0
	if ((x - (y * z)) / t_1) <= math.inf:
		tmp = (x / t_1) - ((y * z) / t_1)
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t - Float64(z * a))
	tmp = 0.0
	if (Float64(Float64(x - Float64(y * z)) / t_1) <= Inf)
		tmp = Float64(Float64(x / t_1) - Float64(Float64(y * z) / t_1));
	else
		tmp = Float64(y / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t - (z * a);
	tmp = 0.0;
	if (((x - (y * z)) / t_1) <= Inf)
		tmp = (x / t_1) - ((y * z) / t_1);
	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]}, If[LessEqual[N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], Infinity], N[(N[(x / t$95$1), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}

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

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


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

    1. Initial program 92.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y \cdot z}{t - z \cdot a} \leq \infty:\\ \;\;\;\;\frac{x}{t - z \cdot a} - \frac{y \cdot z}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 64.2% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -8.49999999999999941e-101

    1. Initial program 83.2%

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

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

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

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

    if -8.49999999999999941e-101 < t < 1.29999999999999993e-191

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.29999999999999993e-191 < t < 1.04999999999999999e-131

    1. Initial program 92.6%

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

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

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

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

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

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

    if 1.04999999999999999e-131 < t < 1.1e116

    1. Initial program 83.8%

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

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

      \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 83.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. fma-def83.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*89.2%

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

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

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

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

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

        \[\leadsto \frac{y + \color{blue}{\left(-\frac{x}{z}\right)}}{a} \]
      2. sub-neg68.6%

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

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

    if 1.1e116 < t

    1. Initial program 81.1%

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

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

      \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 81.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. fma-def81.1%

        \[\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*81.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{t} - \color{blue}{\frac{z}{\frac{t}{y}}} \]
    10. Simplified74.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{-101}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-191}:\\ \;\;\;\;\frac{y \cdot z - x}{z \cdot a}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{-131}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+116}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t} - \frac{z}{\frac{t}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 59.1% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;a \leq 2.85 \cdot 10^{+23} \lor \neg \left(a \leq 2 \cdot 10^{+72}\right):\\
\;\;\;\;\frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.2499999999999999e-8 or 5.70000000000000009e-8 < a < 2.85e23 or 1.99999999999999989e72 < a

    1. Initial program 79.7%

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

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

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

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

    if -1.2499999999999999e-8 < a < 5.70000000000000009e-8

    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. Add Preprocessing
    5. Taylor expanded in t around inf 74.0%

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

    if 2.85e23 < a < 1.99999999999999989e72

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 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}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.25 \cdot 10^{-8}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq 5.7 \cdot 10^{-8}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;a \leq 2.85 \cdot 10^{+23} \lor \neg \left(a \leq 2 \cdot 10^{+72}\right):\\ \;\;\;\;\frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 56.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{t - z \cdot a}\\ \mathbf{if}\;x \leq -0.0026:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4.2 \cdot 10^{-175}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;x \leq -3.35 \cdot 10^{-299}:\\ \;\;\;\;\frac{y \cdot \left(-z\right)}{t}\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-44}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ x (- t (* z a)))))
   (if (<= x -0.0026)
     t_1
     (if (<= x -4.2e-175)
       (/ y a)
       (if (<= x -3.35e-299)
         (/ (* y (- z)) t)
         (if (<= x 5.5e-44) (/ y a) t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x / (t - (z * a));
	double tmp;
	if (x <= -0.0026) {
		tmp = t_1;
	} else if (x <= -4.2e-175) {
		tmp = y / a;
	} else if (x <= -3.35e-299) {
		tmp = (y * -z) / t;
	} else if (x <= 5.5e-44) {
		tmp = y / a;
	} 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 = x / (t - (z * a))
    if (x <= (-0.0026d0)) then
        tmp = t_1
    else if (x <= (-4.2d-175)) then
        tmp = y / a
    else if (x <= (-3.35d-299)) then
        tmp = (y * -z) / t
    else if (x <= 5.5d-44) then
        tmp = y / a
    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 = x / (t - (z * a));
	double tmp;
	if (x <= -0.0026) {
		tmp = t_1;
	} else if (x <= -4.2e-175) {
		tmp = y / a;
	} else if (x <= -3.35e-299) {
		tmp = (y * -z) / t;
	} else if (x <= 5.5e-44) {
		tmp = y / a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x / (t - (z * a))
	tmp = 0
	if x <= -0.0026:
		tmp = t_1
	elif x <= -4.2e-175:
		tmp = y / a
	elif x <= -3.35e-299:
		tmp = (y * -z) / t
	elif x <= 5.5e-44:
		tmp = y / a
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x / Float64(t - Float64(z * a)))
	tmp = 0.0
	if (x <= -0.0026)
		tmp = t_1;
	elseif (x <= -4.2e-175)
		tmp = Float64(y / a);
	elseif (x <= -3.35e-299)
		tmp = Float64(Float64(y * Float64(-z)) / t);
	elseif (x <= 5.5e-44)
		tmp = Float64(y / a);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x / (t - (z * a));
	tmp = 0.0;
	if (x <= -0.0026)
		tmp = t_1;
	elseif (x <= -4.2e-175)
		tmp = y / a;
	elseif (x <= -3.35e-299)
		tmp = (y * -z) / t;
	elseif (x <= 5.5e-44)
		tmp = y / a;
	else
		tmp = t_1;
	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]}, If[LessEqual[x, -0.0026], t$95$1, If[LessEqual[x, -4.2e-175], N[(y / a), $MachinePrecision], If[LessEqual[x, -3.35e-299], N[(N[(y * (-z)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[x, 5.5e-44], N[(y / a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
\mathbf{if}\;x \leq -0.0026:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -4.2 \cdot 10^{-175}:\\
\;\;\;\;\frac{y}{a}\\

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

\mathbf{elif}\;x \leq 5.5 \cdot 10^{-44}:\\
\;\;\;\;\frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -0.0025999999999999999 or 5.49999999999999993e-44 < x

    1. Initial program 86.7%

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

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

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

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

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

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

    if -0.0025999999999999999 < x < -4.2e-175 or -3.34999999999999999e-299 < x < 5.49999999999999993e-44

    1. Initial program 86.1%

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

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

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

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

    if -4.2e-175 < x < -3.34999999999999999e-299

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.0026:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;x \leq -4.2 \cdot 10^{-175}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;x \leq -3.35 \cdot 10^{-299}:\\ \;\;\;\;\frac{y \cdot \left(-z\right)}{t}\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-44}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 68.6% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;a \leq -3.3 \cdot 10^{-15}:\\
\;\;\;\;t_1\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -3.3e-15 or 5.5999999999999998e72 < a

    1. Initial program 80.2%

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

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

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

      \[\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. fma-def80.2%

        \[\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*80.7%

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

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

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

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

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

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

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

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

    if -3.3e-15 < a < 2.70000000000000002e-8

    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. Add Preprocessing
    5. Taylor expanded in t around inf 74.0%

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

    if 2.70000000000000002e-8 < a < 7.2e20

    1. Initial program 69.1%

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

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

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

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

    if 7.2e20 < a < 5.5999999999999998e72

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{\frac{x - y \cdot z}{t - z \cdot a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 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}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification74.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.3 \cdot 10^{-15}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;a \leq 2.7 \cdot 10^{-8}:\\ \;\;\;\;\frac{x - y \cdot z}{t}\\ \mathbf{elif}\;a \leq 7.2 \cdot 10^{+20}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;a \leq 5.6 \cdot 10^{+72}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 89.2% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 92.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y \cdot z}{t - z \cdot a} \leq \infty:\\ \;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 55.0% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;z \leq -8.2 \cdot 10^{-50} \lor \neg \left(z \leq 2.7 \cdot 10^{-68}\right):\\
\;\;\;\;\frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.60000000000000044e73 or -6.2000000000000001e-9 < z < -8.19999999999999971e-50 or 2.7000000000000002e-68 < z

    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. Add Preprocessing
    5. Taylor expanded in z around inf 56.4%

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

    if -7.60000000000000044e73 < z < -6.2000000000000001e-9

    1. Initial program 79.6%

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{y}{\frac{t}{z}}} \]
      3. distribute-neg-frac56.2%

        \[\leadsto \color{blue}{\frac{-y}{\frac{t}{z}}} \]
    8. Simplified56.2%

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

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

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

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

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

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

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

    if -8.19999999999999971e-50 < z < 2.7000000000000002e-68

    1. Initial program 99.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.6 \cdot 10^{+73}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{-9}:\\ \;\;\;\;y \cdot \frac{-z}{t}\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-50} \lor \neg \left(z \leq 2.7 \cdot 10^{-68}\right):\\ \;\;\;\;\frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 55.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{-49} \lor \neg \left(z \leq 1.6 \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 < -1.39999999999999999e-49 or 1.5999999999999999e-68 < z

    1. Initial program 78.8%

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

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

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

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

    if -1.39999999999999999e-49 < z < 1.5999999999999999e-68

    1. Initial program 99.8%

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

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

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

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

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

Alternative 14: 36.3% 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.4%

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

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

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

    \[\leadsto \color{blue}{\frac{x}{t}} \]
  6. Final simplification30.8%

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

Developer target: 97.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t - a \cdot z\\ t_2 := \frac{x}{t_1} - \frac{y}{\frac{t}{z} - a}\\ \mathbf{if}\;z < -32113435955957344:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\ \;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t_1}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- t (* a z))) (t_2 (- (/ x t_1) (/ y (- (/ t z) a)))))
   (if (< z -32113435955957344.0)
     t_2
     (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 t_1)) t_2))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t - (a * z);
	double t_2 = (x / t_1) - (y / ((t / z) - a));
	double tmp;
	if (z < -32113435955957344.0) {
		tmp = t_2;
	} else if (z < 3.5139522372978296e-86) {
		tmp = (x - (y * z)) * (1.0 / t_1);
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t - (a * z)
    t_2 = (x / t_1) - (y / ((t / z) - a))
    if (z < (-32113435955957344.0d0)) then
        tmp = t_2
    else if (z < 3.5139522372978296d-86) then
        tmp = (x - (y * z)) * (1.0d0 / t_1)
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t - (a * z);
	double t_2 = (x / t_1) - (y / ((t / z) - a));
	double tmp;
	if (z < -32113435955957344.0) {
		tmp = t_2;
	} else if (z < 3.5139522372978296e-86) {
		tmp = (x - (y * z)) * (1.0 / t_1);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t - (a * z)
	t_2 = (x / t_1) - (y / ((t / z) - a))
	tmp = 0
	if z < -32113435955957344.0:
		tmp = t_2
	elif z < 3.5139522372978296e-86:
		tmp = (x - (y * z)) * (1.0 / t_1)
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t - Float64(a * z))
	t_2 = Float64(Float64(x / t_1) - Float64(y / Float64(Float64(t / z) - a)))
	tmp = 0.0
	if (z < -32113435955957344.0)
		tmp = t_2;
	elseif (z < 3.5139522372978296e-86)
		tmp = Float64(Float64(x - Float64(y * z)) * Float64(1.0 / t_1));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t - (a * z);
	t_2 = (x / t_1) - (y / ((t / z) - a));
	tmp = 0.0;
	if (z < -32113435955957344.0)
		tmp = t_2;
	elseif (z < 3.5139522372978296e-86)
		tmp = (x - (y * z)) * (1.0 / t_1);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t$95$1), $MachinePrecision] - N[(y / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -32113435955957344.0], t$95$2, If[Less[z, 3.5139522372978296e-86], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t - a \cdot z\\
t_2 := \frac{x}{t_1} - \frac{y}{\frac{t}{z} - a}\\
\mathbf{if}\;z < -32113435955957344:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\
\;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t_1}\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024021 
(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))))