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

Percentage Accurate: 84.8% → 92.3%
Time: 9.2s
Alternatives: 8
Speedup: 0.2×

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 8 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.8% 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: 92.3% accurate, 0.2× speedup?

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

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

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

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

\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+300}:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 28.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -5.0000000000022e-312 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 2.0000000000000001e300

    1. Initial program 99.6%

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

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

    1. Initial program 45.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{a \cdot z} - -1 \cdot \frac{y}{a}} \]
    7. Step-by-step derivation
      1. distribute-lft-out--65.4%

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

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

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

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

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

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

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

Alternative 2: 44.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.8 \cdot 10^{-59}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;t \leq -3 \cdot 10^{-244}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{-157}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-51}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;t \leq 5 \cdot 10^{+194}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;t \leq 3.1 \cdot 10^{+264}:\\ \;\;\;\;-z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= t -2.8e-59)
   (/ x t)
   (if (<= t -3e-244)
     (/ y a)
     (if (<= t 6.8e-157)
       (/ (- x) (* z a))
       (if (<= t 4.8e-51)
         (/ y a)
         (if (<= t 5e+194)
           (/ x t)
           (if (<= t 3.1e+264) (- (* z (/ y t))) (/ x t))))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= -2.8e-59) {
		tmp = x / t;
	} else if (t <= -3e-244) {
		tmp = y / a;
	} else if (t <= 6.8e-157) {
		tmp = -x / (z * a);
	} else if (t <= 4.8e-51) {
		tmp = y / a;
	} else if (t <= 5e+194) {
		tmp = x / t;
	} else if (t <= 3.1e+264) {
		tmp = -(z * (y / t));
	} 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 (t <= (-2.8d-59)) then
        tmp = x / t
    else if (t <= (-3d-244)) then
        tmp = y / a
    else if (t <= 6.8d-157) then
        tmp = -x / (z * a)
    else if (t <= 4.8d-51) then
        tmp = y / a
    else if (t <= 5d+194) then
        tmp = x / t
    else if (t <= 3.1d+264) then
        tmp = -(z * (y / t))
    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 (t <= -2.8e-59) {
		tmp = x / t;
	} else if (t <= -3e-244) {
		tmp = y / a;
	} else if (t <= 6.8e-157) {
		tmp = -x / (z * a);
	} else if (t <= 4.8e-51) {
		tmp = y / a;
	} else if (t <= 5e+194) {
		tmp = x / t;
	} else if (t <= 3.1e+264) {
		tmp = -(z * (y / t));
	} else {
		tmp = x / t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if t <= -2.8e-59:
		tmp = x / t
	elif t <= -3e-244:
		tmp = y / a
	elif t <= 6.8e-157:
		tmp = -x / (z * a)
	elif t <= 4.8e-51:
		tmp = y / a
	elif t <= 5e+194:
		tmp = x / t
	elif t <= 3.1e+264:
		tmp = -(z * (y / t))
	else:
		tmp = x / t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (t <= -2.8e-59)
		tmp = Float64(x / t);
	elseif (t <= -3e-244)
		tmp = Float64(y / a);
	elseif (t <= 6.8e-157)
		tmp = Float64(Float64(-x) / Float64(z * a));
	elseif (t <= 4.8e-51)
		tmp = Float64(y / a);
	elseif (t <= 5e+194)
		tmp = Float64(x / t);
	elseif (t <= 3.1e+264)
		tmp = Float64(-Float64(z * Float64(y / t)));
	else
		tmp = Float64(x / t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (t <= -2.8e-59)
		tmp = x / t;
	elseif (t <= -3e-244)
		tmp = y / a;
	elseif (t <= 6.8e-157)
		tmp = -x / (z * a);
	elseif (t <= 4.8e-51)
		tmp = y / a;
	elseif (t <= 5e+194)
		tmp = x / t;
	elseif (t <= 3.1e+264)
		tmp = -(z * (y / t));
	else
		tmp = x / t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.8e-59], N[(x / t), $MachinePrecision], If[LessEqual[t, -3e-244], N[(y / a), $MachinePrecision], If[LessEqual[t, 6.8e-157], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e-51], N[(y / a), $MachinePrecision], If[LessEqual[t, 5e+194], N[(x / t), $MachinePrecision], If[LessEqual[t, 3.1e+264], (-N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), N[(x / t), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{-59}:\\
\;\;\;\;\frac{x}{t}\\

\mathbf{elif}\;t \leq -3 \cdot 10^{-244}:\\
\;\;\;\;\frac{y}{a}\\

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

\mathbf{elif}\;t \leq 4.8 \cdot 10^{-51}:\\
\;\;\;\;\frac{y}{a}\\

\mathbf{elif}\;t \leq 5 \cdot 10^{+194}:\\
\;\;\;\;\frac{x}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.79999999999999981e-59 or 4.8e-51 < t < 4.99999999999999989e194 or 3.09999999999999981e264 < t

    1. Initial program 84.4%

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

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

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

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

    if -2.79999999999999981e-59 < t < -3.0000000000000001e-244 or 6.79999999999999955e-157 < t < 4.8e-51

    1. Initial program 79.0%

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

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

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

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

    if -3.0000000000000001e-244 < t < 6.79999999999999955e-157

    1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot x}}{z \cdot a} \]
    8. Step-by-step derivation
      1. neg-mul-159.2%

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

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

    if 4.99999999999999989e194 < t < 3.09999999999999981e264

    1. Initial program 65.7%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, -1 \cdot \frac{y}{t} - -1 \cdot \frac{a \cdot x}{{t}^{2}}, \frac{x}{t}\right)} \]
      2. distribute-lft-out--90.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.8 \cdot 10^{-59}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;t \leq -3 \cdot 10^{-244}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{-157}:\\ \;\;\;\;\frac{-x}{z \cdot a}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-51}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;t \leq 5 \cdot 10^{+194}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;t \leq 3.1 \cdot 10^{+264}:\\ \;\;\;\;-z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t}\\ \end{array} \]

Alternative 3: 65.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.15 \cdot 10^{+93}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 5.3 \cdot 10^{+17} \lor \neg \left(z \leq 1.5 \cdot 10^{+77}\right) \land z \leq 5.2 \cdot 10^{+143}:\\ \;\;\;\;\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 -4.15e+93)
   (/ y a)
   (if (or (<= z 5.3e+17) (and (not (<= z 1.5e+77)) (<= z 5.2e+143)))
     (/ x (- t (* z a)))
     (/ y a))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4.15e+93) {
		tmp = y / a;
	} else if ((z <= 5.3e+17) || (!(z <= 1.5e+77) && (z <= 5.2e+143))) {
		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 <= (-4.15d+93)) then
        tmp = y / a
    else if ((z <= 5.3d+17) .or. (.not. (z <= 1.5d+77)) .and. (z <= 5.2d+143)) 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 <= -4.15e+93) {
		tmp = y / a;
	} else if ((z <= 5.3e+17) || (!(z <= 1.5e+77) && (z <= 5.2e+143))) {
		tmp = x / (t - (z * a));
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -4.15e+93:
		tmp = y / a
	elif (z <= 5.3e+17) or (not (z <= 1.5e+77) and (z <= 5.2e+143)):
		tmp = x / (t - (z * a))
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -4.15e+93)
		tmp = Float64(y / a);
	elseif ((z <= 5.3e+17) || (!(z <= 1.5e+77) && (z <= 5.2e+143)))
		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 <= -4.15e+93)
		tmp = y / a;
	elseif ((z <= 5.3e+17) || (~((z <= 1.5e+77)) && (z <= 5.2e+143)))
		tmp = x / (t - (z * a));
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.15e+93], N[(y / a), $MachinePrecision], If[Or[LessEqual[z, 5.3e+17], And[N[Not[LessEqual[z, 1.5e+77]], $MachinePrecision], LessEqual[z, 5.2e+143]]], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 5.3 \cdot 10^{+17} \lor \neg \left(z \leq 1.5 \cdot 10^{+77}\right) \land z \leq 5.2 \cdot 10^{+143}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.1499999999999999e93 or 5.3e17 < z < 1.4999999999999999e77 or 5.1999999999999998e143 < z

    1. Initial program 54.7%

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

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

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

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

    if -4.1499999999999999e93 < z < 5.3e17 or 1.4999999999999999e77 < z < 5.1999999999999998e143

    1. Initial program 98.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.15 \cdot 10^{+93}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 5.3 \cdot 10^{+17} \lor \neg \left(z \leq 1.5 \cdot 10^{+77}\right) \land z \leq 5.2 \cdot 10^{+143}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]

Alternative 4: 54.3% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;z \leq 5.9 \cdot 10^{+84}:\\
\;\;\;\;\frac{y}{a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.50000000000000005e45 or 3.1e15 < z < 5.89999999999999984e84 or 9.79999999999999952e123 < z

    1. Initial program 62.0%

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

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

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

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

    if -1.50000000000000005e45 < z < 3.1e15

    1. Initial program 99.7%

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

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

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

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

    if 5.89999999999999984e84 < z < 9.79999999999999952e123

    1. Initial program 87.6%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, -1 \cdot \frac{y}{t} - -1 \cdot \frac{a \cdot x}{{t}^{2}}, \frac{x}{t}\right)} \]
      2. distribute-lft-out--63.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+45}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+15}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{elif}\;z \leq 5.9 \cdot 10^{+84}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 9.8 \cdot 10^{+123}:\\ \;\;\;\;-z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]

Alternative 5: 71.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+85} \lor \neg \left(y \leq 0.000105\right):\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.1000000000000001e85 or 1.05e-4 < y

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1000000000000001e85 < y < 1.05e-4

    1. Initial program 92.2%

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

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

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

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

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

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

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

Alternative 6: 73.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 61.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{a \cdot z} - -1 \cdot \frac{y}{a}} \]
    7. Step-by-step derivation
      1. distribute-lft-out--69.5%

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

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

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

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

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

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

    if -1.06e45 < z < 1.15e-8

    1. Initial program 99.7%

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

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

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

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

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

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

    if 1.15e-8 < z

    1. Initial program 70.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.06 \cdot 10^{+45}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-8}:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \end{array} \]

Alternative 7: 55.0% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;z \leq 1.52 \cdot 10^{+16}:\\
\;\;\;\;\frac{x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.19999999999999991e44 or 1.52e16 < z

    1. Initial program 63.7%

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

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

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

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

    if -6.19999999999999991e44 < z < 1.52e16

    1. Initial program 99.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.2 \cdot 10^{+44}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq 1.52 \cdot 10^{+16}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]

Alternative 8: 35.4% 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 83.1%

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

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

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

    \[\leadsto \color{blue}{\frac{x}{t}} \]
  5. Final simplification34.4%

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

Developer target: 97.5% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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