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

Percentage Accurate: 84.4% → 89.9%
Time: 15.4s
Alternatives: 12
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 84.4% 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: 89.9% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := t - z \cdot a\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{+121} \lor \neg \left(z \leq 6.5 \cdot 10^{+202}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.59999999999999981e121 or 6.4999999999999996e202 < z

    1. Initial program 56.5%

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

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

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

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

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

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

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

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

    if -3.59999999999999981e121 < z < 6.4999999999999996e202

    1. Initial program 96.6%

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

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

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

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

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

Alternative 2: 54.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{z \cdot \left(-a\right)}\\ t_2 := z \cdot \frac{-y}{t}\\ \mathbf{if}\;z \leq -2.6 \cdot 10^{+65}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{+34}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-8}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-30}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{-72}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-76}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 0.0118:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+33}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ x (* z (- a)))) (t_2 (* z (/ (- y) t))))
   (if (<= z -2.6e+65)
     (/ y a)
     (if (<= z -3.2e+34)
       t_2
       (if (<= z -1.02e-8)
         (/ y a)
         (if (<= z -5.2e-30)
           t_1
           (if (<= z -7.2e-72)
             t_2
             (if (<= z 1.4e-76)
               (/ x t)
               (if (<= z 0.0118) t_2 (if (<= z 1.7e+33) t_1 (/ y a)))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x / (z * -a);
	double t_2 = z * (-y / t);
	double tmp;
	if (z <= -2.6e+65) {
		tmp = y / a;
	} else if (z <= -3.2e+34) {
		tmp = t_2;
	} else if (z <= -1.02e-8) {
		tmp = y / a;
	} else if (z <= -5.2e-30) {
		tmp = t_1;
	} else if (z <= -7.2e-72) {
		tmp = t_2;
	} else if (z <= 1.4e-76) {
		tmp = x / t;
	} else if (z <= 0.0118) {
		tmp = t_2;
	} else if (z <= 1.7e+33) {
		tmp = t_1;
	} else {
		tmp = y / a;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x / (z * -a)
    t_2 = z * (-y / t)
    if (z <= (-2.6d+65)) then
        tmp = y / a
    else if (z <= (-3.2d+34)) then
        tmp = t_2
    else if (z <= (-1.02d-8)) then
        tmp = y / a
    else if (z <= (-5.2d-30)) then
        tmp = t_1
    else if (z <= (-7.2d-72)) then
        tmp = t_2
    else if (z <= 1.4d-76) then
        tmp = x / t
    else if (z <= 0.0118d0) then
        tmp = t_2
    else if (z <= 1.7d+33) then
        tmp = t_1
    else
        tmp = y / a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x / (z * -a);
	double t_2 = z * (-y / t);
	double tmp;
	if (z <= -2.6e+65) {
		tmp = y / a;
	} else if (z <= -3.2e+34) {
		tmp = t_2;
	} else if (z <= -1.02e-8) {
		tmp = y / a;
	} else if (z <= -5.2e-30) {
		tmp = t_1;
	} else if (z <= -7.2e-72) {
		tmp = t_2;
	} else if (z <= 1.4e-76) {
		tmp = x / t;
	} else if (z <= 0.0118) {
		tmp = t_2;
	} else if (z <= 1.7e+33) {
		tmp = t_1;
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x / (z * -a)
	t_2 = z * (-y / t)
	tmp = 0
	if z <= -2.6e+65:
		tmp = y / a
	elif z <= -3.2e+34:
		tmp = t_2
	elif z <= -1.02e-8:
		tmp = y / a
	elif z <= -5.2e-30:
		tmp = t_1
	elif z <= -7.2e-72:
		tmp = t_2
	elif z <= 1.4e-76:
		tmp = x / t
	elif z <= 0.0118:
		tmp = t_2
	elif z <= 1.7e+33:
		tmp = t_1
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x / Float64(z * Float64(-a)))
	t_2 = Float64(z * Float64(Float64(-y) / t))
	tmp = 0.0
	if (z <= -2.6e+65)
		tmp = Float64(y / a);
	elseif (z <= -3.2e+34)
		tmp = t_2;
	elseif (z <= -1.02e-8)
		tmp = Float64(y / a);
	elseif (z <= -5.2e-30)
		tmp = t_1;
	elseif (z <= -7.2e-72)
		tmp = t_2;
	elseif (z <= 1.4e-76)
		tmp = Float64(x / t);
	elseif (z <= 0.0118)
		tmp = t_2;
	elseif (z <= 1.7e+33)
		tmp = t_1;
	else
		tmp = Float64(y / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x / (z * -a);
	t_2 = z * (-y / t);
	tmp = 0.0;
	if (z <= -2.6e+65)
		tmp = y / a;
	elseif (z <= -3.2e+34)
		tmp = t_2;
	elseif (z <= -1.02e-8)
		tmp = y / a;
	elseif (z <= -5.2e-30)
		tmp = t_1;
	elseif (z <= -7.2e-72)
		tmp = t_2;
	elseif (z <= 1.4e-76)
		tmp = x / t;
	elseif (z <= 0.0118)
		tmp = t_2;
	elseif (z <= 1.7e+33)
		tmp = t_1;
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(z * (-a)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e+65], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.2e+34], t$95$2, If[LessEqual[z, -1.02e-8], N[(y / a), $MachinePrecision], If[LessEqual[z, -5.2e-30], t$95$1, If[LessEqual[z, -7.2e-72], t$95$2, If[LessEqual[z, 1.4e-76], N[(x / t), $MachinePrecision], If[LessEqual[z, 0.0118], t$95$2, If[LessEqual[z, 1.7e+33], t$95$1, N[(y / a), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(-a\right)}\\
t_2 := z \cdot \frac{-y}{t}\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{+65}:\\
\;\;\;\;\frac{y}{a}\\

\mathbf{elif}\;z \leq -3.2 \cdot 10^{+34}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq -5.2 \cdot 10^{-30}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -7.2 \cdot 10^{-72}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq 0.0118:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 1.7 \cdot 10^{+33}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.60000000000000003e65 or -3.1999999999999998e34 < z < -1.02000000000000003e-8 or 1.7e33 < z

    1. Initial program 70.1%

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

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

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

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

    if -2.60000000000000003e65 < z < -3.1999999999999998e34 or -5.19999999999999973e-30 < z < -7.2e-72 or 1.40000000000000005e-76 < z < 0.0117999999999999997

    1. Initial program 99.5%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(-1 \cdot y\right) \cdot z}}{t} \]
      3. *-rgt-identity55.4%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{y}{t}\right)} \cdot \frac{z}{1} \]
      7. /-rgt-identity53.5%

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

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

    if -1.02000000000000003e-8 < z < -5.19999999999999973e-30 or 0.0117999999999999997 < z < 1.7e33

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{z \cdot \left(-a\right)}} \]
    10. Simplified42.9%

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

    if -7.2e-72 < z < 1.40000000000000005e-76

    1. Initial program 99.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+65}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{+34}:\\ \;\;\;\;z \cdot \frac{-y}{t}\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-8}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-30}:\\ \;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{-72}:\\ \;\;\;\;z \cdot \frac{-y}{t}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-76}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 0.0118:\\ \;\;\;\;z \cdot \frac{-y}{t}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+33}:\\ \;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 55.0% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{z \cdot \left(-a\right)}\\ t_2 := z \cdot \frac{-y}{t}\\ \mathbf{if}\;z \leq -3.5 \cdot 10^{+58}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{+39}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-10}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -6.9 \cdot 10^{-28}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -6.3 \cdot 10^{-71}:\\ \;\;\;\;\frac{z \cdot \left(-y\right)}{t}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-77}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{-5}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{+35}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ x (* z (- a)))) (t_2 (* z (/ (- y) t))))
   (if (<= z -3.5e+58)
     (/ y a)
     (if (<= z -1.4e+39)
       t_2
       (if (<= z -2.3e-10)
         (/ y a)
         (if (<= z -6.9e-28)
           t_1
           (if (<= z -6.3e-71)
             (/ (* z (- y)) t)
             (if (<= z 5.5e-77)
               (/ x t)
               (if (<= z 3.9e-5) t_2 (if (<= z 6.4e+35) t_1 (/ y a)))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x / (z * -a);
	double t_2 = z * (-y / t);
	double tmp;
	if (z <= -3.5e+58) {
		tmp = y / a;
	} else if (z <= -1.4e+39) {
		tmp = t_2;
	} else if (z <= -2.3e-10) {
		tmp = y / a;
	} else if (z <= -6.9e-28) {
		tmp = t_1;
	} else if (z <= -6.3e-71) {
		tmp = (z * -y) / t;
	} else if (z <= 5.5e-77) {
		tmp = x / t;
	} else if (z <= 3.9e-5) {
		tmp = t_2;
	} else if (z <= 6.4e+35) {
		tmp = t_1;
	} else {
		tmp = y / a;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x / (z * -a)
    t_2 = z * (-y / t)
    if (z <= (-3.5d+58)) then
        tmp = y / a
    else if (z <= (-1.4d+39)) then
        tmp = t_2
    else if (z <= (-2.3d-10)) then
        tmp = y / a
    else if (z <= (-6.9d-28)) then
        tmp = t_1
    else if (z <= (-6.3d-71)) then
        tmp = (z * -y) / t
    else if (z <= 5.5d-77) then
        tmp = x / t
    else if (z <= 3.9d-5) then
        tmp = t_2
    else if (z <= 6.4d+35) then
        tmp = t_1
    else
        tmp = y / a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x / (z * -a);
	double t_2 = z * (-y / t);
	double tmp;
	if (z <= -3.5e+58) {
		tmp = y / a;
	} else if (z <= -1.4e+39) {
		tmp = t_2;
	} else if (z <= -2.3e-10) {
		tmp = y / a;
	} else if (z <= -6.9e-28) {
		tmp = t_1;
	} else if (z <= -6.3e-71) {
		tmp = (z * -y) / t;
	} else if (z <= 5.5e-77) {
		tmp = x / t;
	} else if (z <= 3.9e-5) {
		tmp = t_2;
	} else if (z <= 6.4e+35) {
		tmp = t_1;
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x / (z * -a)
	t_2 = z * (-y / t)
	tmp = 0
	if z <= -3.5e+58:
		tmp = y / a
	elif z <= -1.4e+39:
		tmp = t_2
	elif z <= -2.3e-10:
		tmp = y / a
	elif z <= -6.9e-28:
		tmp = t_1
	elif z <= -6.3e-71:
		tmp = (z * -y) / t
	elif z <= 5.5e-77:
		tmp = x / t
	elif z <= 3.9e-5:
		tmp = t_2
	elif z <= 6.4e+35:
		tmp = t_1
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x / Float64(z * Float64(-a)))
	t_2 = Float64(z * Float64(Float64(-y) / t))
	tmp = 0.0
	if (z <= -3.5e+58)
		tmp = Float64(y / a);
	elseif (z <= -1.4e+39)
		tmp = t_2;
	elseif (z <= -2.3e-10)
		tmp = Float64(y / a);
	elseif (z <= -6.9e-28)
		tmp = t_1;
	elseif (z <= -6.3e-71)
		tmp = Float64(Float64(z * Float64(-y)) / t);
	elseif (z <= 5.5e-77)
		tmp = Float64(x / t);
	elseif (z <= 3.9e-5)
		tmp = t_2;
	elseif (z <= 6.4e+35)
		tmp = t_1;
	else
		tmp = Float64(y / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x / (z * -a);
	t_2 = z * (-y / t);
	tmp = 0.0;
	if (z <= -3.5e+58)
		tmp = y / a;
	elseif (z <= -1.4e+39)
		tmp = t_2;
	elseif (z <= -2.3e-10)
		tmp = y / a;
	elseif (z <= -6.9e-28)
		tmp = t_1;
	elseif (z <= -6.3e-71)
		tmp = (z * -y) / t;
	elseif (z <= 5.5e-77)
		tmp = x / t;
	elseif (z <= 3.9e-5)
		tmp = t_2;
	elseif (z <= 6.4e+35)
		tmp = t_1;
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(z * (-a)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e+58], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.4e+39], t$95$2, If[LessEqual[z, -2.3e-10], N[(y / a), $MachinePrecision], If[LessEqual[z, -6.9e-28], t$95$1, If[LessEqual[z, -6.3e-71], N[(N[(z * (-y)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 5.5e-77], N[(x / t), $MachinePrecision], If[LessEqual[z, 3.9e-5], t$95$2, If[LessEqual[z, 6.4e+35], t$95$1, N[(y / a), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(-a\right)}\\
t_2 := z \cdot \frac{-y}{t}\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{+58}:\\
\;\;\;\;\frac{y}{a}\\

\mathbf{elif}\;z \leq -1.4 \cdot 10^{+39}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq -6.9 \cdot 10^{-28}:\\
\;\;\;\;t_1\\

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

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

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

\mathbf{elif}\;z \leq 6.4 \cdot 10^{+35}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -3.4999999999999997e58 or -1.40000000000000001e39 < z < -2.30000000000000007e-10 or 6.39999999999999965e35 < z

    1. Initial program 70.1%

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

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

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

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

    if -3.4999999999999997e58 < z < -1.40000000000000001e39 or 5.49999999999999998e-77 < z < 3.8999999999999999e-5

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{y}{t}\right)} \cdot \frac{z}{1} \]
      7. /-rgt-identity58.7%

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

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

    if -2.30000000000000007e-10 < z < -6.90000000000000001e-28 or 3.8999999999999999e-5 < z < 6.39999999999999965e35

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{z \cdot \left(-a\right)}} \]
    10. Simplified42.9%

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

    if -6.90000000000000001e-28 < z < -6.3000000000000003e-71

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

    if -6.3000000000000003e-71 < z < 5.49999999999999998e-77

    1. Initial program 99.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+58}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{+39}:\\ \;\;\;\;z \cdot \frac{-y}{t}\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-10}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -6.9 \cdot 10^{-28}:\\ \;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\ \mathbf{elif}\;z \leq -6.3 \cdot 10^{-71}:\\ \;\;\;\;\frac{z \cdot \left(-y\right)}{t}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-77}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{-5}:\\ \;\;\;\;z \cdot \frac{-y}{t}\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{+35}:\\ \;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 54.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -3.6 \cdot 10^{-71}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.2 \cdot 10^{-27}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 12600000:\\
\;\;\;\;\frac{x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.1e58 or 1.26e7 < z

    1. Initial program 69.4%

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

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

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

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

    if -4.1e58 < z < -3.6e-71 or 2.15000000000000009e-82 < z < 1.20000000000000001e-27

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{y}{t}\right)} \cdot \frac{z}{1} \]
      7. /-rgt-identity46.1%

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

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

    if -3.6e-71 < z < 2.15000000000000009e-82 or 1.20000000000000001e-27 < z < 1.26e7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{+58}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-71}:\\ \;\;\;\;z \cdot \frac{-y}{t}\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-82}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-27}:\\ \;\;\;\;z \cdot \frac{-y}{t}\\ \mathbf{elif}\;z \leq 12600000:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 59.4% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.9 \cdot 10^{-24}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\

\mathbf{elif}\;a \leq 1.35 \cdot 10^{-12} \lor \neg \left(a \leq 5.8 \cdot 10^{+24}\right) \land a \leq 4.3 \cdot 10^{+72}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.8999999999999999e-24

    1. Initial program 85.9%

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

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

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

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

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

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

    if -2.8999999999999999e-24 < a < 1.3499999999999999e-12 or 5.79999999999999958e24 < a < 4.3000000000000001e72

    1. Initial program 93.7%

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

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

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

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

    if 1.3499999999999999e-12 < a < 5.79999999999999958e24 or 4.3000000000000001e72 < a

    1. Initial program 73.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.9 \cdot 10^{-24}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{-12} \lor \neg \left(a \leq 5.8 \cdot 10^{+24}\right) \land a \leq 4.3 \cdot 10^{+72}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 65.5% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.3199999999999999e70 or 1.55e33 < z

    1. Initial program 68.3%

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

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

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

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

    if -1.3199999999999999e70 < z < -5.79999999999999989e35

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.79999999999999989e35 < z < 1.55e33

    1. Initial program 99.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.32 \cdot 10^{+70}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{+35}:\\ \;\;\;\;z \cdot \frac{-y}{t}\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+33}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 90.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+121} \lor \neg \left(z \leq 6.8 \cdot 10^{+202}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.7999999999999998e121 or 6.8e202 < z

    1. Initial program 56.5%

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

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

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

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

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

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

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

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

    if -5.7999999999999998e121 < z < 6.8e202

    1. Initial program 96.6%

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

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

Alternative 8: 69.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.6 \cdot 10^{-56} \lor \neg \left(t \leq 8.2 \cdot 10^{+45}\right):\\
\;\;\;\;\frac{x}{t} - y \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.60000000000000005e-56 or 8.20000000000000025e45 < t

    1. Initial program 83.3%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{t} - \frac{y \cdot z}{\color{blue}{1 \cdot t}} \]
      5. times-frac67.6%

        \[\leadsto \frac{x}{t} - \color{blue}{\frac{y}{1} \cdot \frac{z}{t}} \]
      6. /-rgt-identity67.6%

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

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

    if -4.60000000000000005e-56 < t < 8.20000000000000025e45

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

Alternative 9: 68.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.6 \cdot 10^{-56}:\\
\;\;\;\;\frac{x}{t} + \frac{-1}{\frac{\frac{t}{z}}{y}}\\

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

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


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

    1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{t} - \frac{y}{\frac{t}{z}}} \]
    9. Step-by-step derivation
      1. clear-num70.3%

        \[\leadsto \frac{x}{t} - \color{blue}{\frac{1}{\frac{\frac{t}{z}}{y}}} \]
      2. inv-pow70.3%

        \[\leadsto \frac{x}{t} - \color{blue}{{\left(\frac{\frac{t}{z}}{y}\right)}^{-1}} \]
      3. associate-/l/69.0%

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

        \[\leadsto \frac{x}{t} - {\left(\frac{t}{\color{blue}{z \cdot y}}\right)}^{-1} \]
    10. Applied egg-rr69.0%

      \[\leadsto \frac{x}{t} - \color{blue}{{\left(\frac{t}{z \cdot y}\right)}^{-1}} \]
    11. Step-by-step derivation
      1. unpow-169.0%

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

        \[\leadsto \frac{x}{t} - \frac{1}{\color{blue}{\frac{\frac{t}{z}}{y}}} \]
    12. Simplified70.3%

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

    if -5.59999999999999986e-56 < t < 4.60000000000000025e45

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

    if 4.60000000000000025e45 < t

    1. Initial program 79.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{t} - \frac{y \cdot z}{t}} \]
      4. *-lft-identity61.4%

        \[\leadsto \frac{x}{t} - \frac{y \cdot z}{\color{blue}{1 \cdot t}} \]
      5. times-frac64.0%

        \[\leadsto \frac{x}{t} - \color{blue}{\frac{y}{1} \cdot \frac{z}{t}} \]
      6. /-rgt-identity64.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.6 \cdot 10^{-56}:\\ \;\;\;\;\frac{x}{t} + \frac{-1}{\frac{\frac{t}{z}}{y}}\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{+45}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t} - y \cdot \frac{z}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 68.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-56} \lor \neg \left(t \leq 2 \cdot 10^{+47}\right):\\
\;\;\;\;\frac{x - z \cdot y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.0000000000000002e-56 or 2.0000000000000001e47 < t

    1. Initial program 83.3%

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

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

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

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

    if -4.0000000000000002e-56 < t < 2.0000000000000001e47

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

Alternative 11: 55.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.55 \cdot 10^{-73} \lor \neg \left(z \leq 17500000000000\right):\\
\;\;\;\;\frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.55e-73 or 1.75e13 < z

    1. Initial program 75.8%

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

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

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

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

    if -2.55e-73 < z < 1.75e13

    1. Initial program 99.7%

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

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

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

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

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

Alternative 12: 35.5% accurate, 3.7× speedup?

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{x}{t}} \]
  6. Final simplification28.5%

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

Developer target: 97.1% 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 2024019 
(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))))