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

Percentage Accurate: 84.7% → 90.9%
Time: 13.2s
Alternatives: 8
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 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.7% 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: 90.9% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 51.1%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]

    if -3.29999999999999978e179 < z < 1.54999999999999996e109

    1. Initial program 95.0%

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

    if 1.54999999999999996e109 < z

    1. Initial program 40.8%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in t around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 2: 52.8% accurate, 0.4× speedup?

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.80000000000000025e179 or -2.8000000000000001e120 < z < -4.00000000000000036e25 or 7.40000000000000005e-93 < z

    1. Initial program 68.1%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -4.80000000000000025e179 < z < -2.8000000000000001e120

    1. Initial program 66.4%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]
    8. Taylor expanded in a around 0 0

      \[\leadsto expr\]
    9. Simplified0

      \[\leadsto expr\]

    if -4.00000000000000036e25 < z < -3.2999999999999999e-55

    1. Initial program 99.8%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]
    8. Taylor expanded in a around 0 0

      \[\leadsto expr\]
    9. Simplified0

      \[\leadsto expr\]

    if -3.2999999999999999e-55 < z < 7.40000000000000005e-93

    1. Initial program 99.8%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 3: 53.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{\frac{-t}{z}}\\ \mathbf{if}\;z \leq -7 \cdot 10^{+179}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{+123}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -4 \cdot 10^{+25}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -1.24 \cdot 10^{-54}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-93}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ y (/ (- t) z))))
   (if (<= z -7e+179)
     (/ y a)
     (if (<= z -9.2e+123)
       t_1
       (if (<= z -4e+25)
         (/ y a)
         (if (<= z -1.24e-54) t_1 (if (<= z 5.5e-93) (/ x t) (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y / (-t / z);
	double tmp;
	if (z <= -7e+179) {
		tmp = y / a;
	} else if (z <= -9.2e+123) {
		tmp = t_1;
	} else if (z <= -4e+25) {
		tmp = y / a;
	} else if (z <= -1.24e-54) {
		tmp = t_1;
	} else if (z <= 5.5e-93) {
		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 = y / (-t / z)
    if (z <= (-7d+179)) then
        tmp = y / a
    else if (z <= (-9.2d+123)) then
        tmp = t_1
    else if (z <= (-4d+25)) then
        tmp = y / a
    else if (z <= (-1.24d-54)) then
        tmp = t_1
    else if (z <= 5.5d-93) 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 = y / (-t / z);
	double tmp;
	if (z <= -7e+179) {
		tmp = y / a;
	} else if (z <= -9.2e+123) {
		tmp = t_1;
	} else if (z <= -4e+25) {
		tmp = y / a;
	} else if (z <= -1.24e-54) {
		tmp = t_1;
	} else if (z <= 5.5e-93) {
		tmp = x / t;
	} else {
		tmp = y / a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y / (-t / z)
	tmp = 0
	if z <= -7e+179:
		tmp = y / a
	elif z <= -9.2e+123:
		tmp = t_1
	elif z <= -4e+25:
		tmp = y / a
	elif z <= -1.24e-54:
		tmp = t_1
	elif z <= 5.5e-93:
		tmp = x / t
	else:
		tmp = y / a
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y / Float64(Float64(-t) / z))
	tmp = 0.0
	if (z <= -7e+179)
		tmp = Float64(y / a);
	elseif (z <= -9.2e+123)
		tmp = t_1;
	elseif (z <= -4e+25)
		tmp = Float64(y / a);
	elseif (z <= -1.24e-54)
		tmp = t_1;
	elseif (z <= 5.5e-93)
		tmp = Float64(x / t);
	else
		tmp = Float64(y / a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y / (-t / z);
	tmp = 0.0;
	if (z <= -7e+179)
		tmp = y / a;
	elseif (z <= -9.2e+123)
		tmp = t_1;
	elseif (z <= -4e+25)
		tmp = y / a;
	elseif (z <= -1.24e-54)
		tmp = t_1;
	elseif (z <= 5.5e-93)
		tmp = x / t;
	else
		tmp = y / a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[((-t) / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e+179], N[(y / a), $MachinePrecision], If[LessEqual[z, -9.2e+123], t$95$1, If[LessEqual[z, -4e+25], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.24e-54], t$95$1, If[LessEqual[z, 5.5e-93], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -9.2 \cdot 10^{+123}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq -1.24 \cdot 10^{-54}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.0000000000000003e179 or -9.19999999999999962e123 < z < -4.00000000000000036e25 or 5.49999999999999968e-93 < z

    1. Initial program 68.1%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -7.0000000000000003e179 < z < -9.19999999999999962e123 or -4.00000000000000036e25 < z < -1.23999999999999999e-54

    1. Initial program 89.2%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]
    8. Taylor expanded in a around 0 0

      \[\leadsto expr\]
    9. Simplified0

      \[\leadsto expr\]

    if -1.23999999999999999e-54 < z < 5.49999999999999968e-93

    1. Initial program 99.8%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 67.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x - z \cdot y}{t}\\ t_2 := \frac{y - \frac{x}{z}}{a}\\ \mathbf{if}\;a \leq -6500000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -2.9 \cdot 10^{-33}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -4.2 \cdot 10^{-77}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq 1.45 \cdot 10^{-105}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- x (* z y)) t)) (t_2 (/ (- y (/ x z)) a)))
   (if (<= a -6500000.0)
     t_2
     (if (<= a -2.9e-33)
       t_1
       (if (<= a -4.2e-77) t_2 (if (<= a 1.45e-105) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (x - (z * y)) / t;
	double t_2 = (y - (x / z)) / a;
	double tmp;
	if (a <= -6500000.0) {
		tmp = t_2;
	} else if (a <= -2.9e-33) {
		tmp = t_1;
	} else if (a <= -4.2e-77) {
		tmp = t_2;
	} else if (a <= 1.45e-105) {
		tmp = 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 = (x - (z * y)) / t
    t_2 = (y - (x / z)) / a
    if (a <= (-6500000.0d0)) then
        tmp = t_2
    else if (a <= (-2.9d-33)) then
        tmp = t_1
    else if (a <= (-4.2d-77)) then
        tmp = t_2
    else if (a <= 1.45d-105) then
        tmp = 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 = (x - (z * y)) / t;
	double t_2 = (y - (x / z)) / a;
	double tmp;
	if (a <= -6500000.0) {
		tmp = t_2;
	} else if (a <= -2.9e-33) {
		tmp = t_1;
	} else if (a <= -4.2e-77) {
		tmp = t_2;
	} else if (a <= 1.45e-105) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (x - (z * y)) / t
	t_2 = (y - (x / z)) / a
	tmp = 0
	if a <= -6500000.0:
		tmp = t_2
	elif a <= -2.9e-33:
		tmp = t_1
	elif a <= -4.2e-77:
		tmp = t_2
	elif a <= 1.45e-105:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(x - Float64(z * y)) / t)
	t_2 = Float64(Float64(y - Float64(x / z)) / a)
	tmp = 0.0
	if (a <= -6500000.0)
		tmp = t_2;
	elseif (a <= -2.9e-33)
		tmp = t_1;
	elseif (a <= -4.2e-77)
		tmp = t_2;
	elseif (a <= 1.45e-105)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (x - (z * y)) / t;
	t_2 = (y - (x / z)) / a;
	tmp = 0.0;
	if (a <= -6500000.0)
		tmp = t_2;
	elseif (a <= -2.9e-33)
		tmp = t_1;
	elseif (a <= -4.2e-77)
		tmp = t_2;
	elseif (a <= 1.45e-105)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -6500000.0], t$95$2, If[LessEqual[a, -2.9e-33], t$95$1, If[LessEqual[a, -4.2e-77], t$95$2, If[LessEqual[a, 1.45e-105], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -2.9 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -4.2 \cdot 10^{-77}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq 1.45 \cdot 10^{-105}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.5e6 or -2.90000000000000003e-33 < a < -4.20000000000000031e-77 or 1.45000000000000002e-105 < a

    1. Initial program 73.8%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in t around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -6.5e6 < a < -2.90000000000000003e-33 or -4.20000000000000031e-77 < a < 1.45000000000000002e-105

    1. Initial program 96.4%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 58.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{t - z \cdot a}\\ \mathbf{if}\;y \leq -2.9 \cdot 10^{+103}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{+21}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+53}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{+171}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{-t}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ x (- t (* z a)))))
   (if (<= y -2.9e+103)
     (/ y a)
     (if (<= y 4.2e+21)
       t_1
       (if (<= y 2.4e+53)
         (/ y a)
         (if (<= y 2.8e+171) t_1 (/ y (/ (- t) z))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x / (t - (z * a));
	double tmp;
	if (y <= -2.9e+103) {
		tmp = y / a;
	} else if (y <= 4.2e+21) {
		tmp = t_1;
	} else if (y <= 2.4e+53) {
		tmp = y / a;
	} else if (y <= 2.8e+171) {
		tmp = t_1;
	} else {
		tmp = y / (-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) :: t_1
    real(8) :: tmp
    t_1 = x / (t - (z * a))
    if (y <= (-2.9d+103)) then
        tmp = y / a
    else if (y <= 4.2d+21) then
        tmp = t_1
    else if (y <= 2.4d+53) then
        tmp = y / a
    else if (y <= 2.8d+171) then
        tmp = t_1
    else
        tmp = y / (-t / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x / (t - (z * a));
	double tmp;
	if (y <= -2.9e+103) {
		tmp = y / a;
	} else if (y <= 4.2e+21) {
		tmp = t_1;
	} else if (y <= 2.4e+53) {
		tmp = y / a;
	} else if (y <= 2.8e+171) {
		tmp = t_1;
	} else {
		tmp = y / (-t / z);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x / (t - (z * a))
	tmp = 0
	if y <= -2.9e+103:
		tmp = y / a
	elif y <= 4.2e+21:
		tmp = t_1
	elif y <= 2.4e+53:
		tmp = y / a
	elif y <= 2.8e+171:
		tmp = t_1
	else:
		tmp = y / (-t / z)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x / Float64(t - Float64(z * a)))
	tmp = 0.0
	if (y <= -2.9e+103)
		tmp = Float64(y / a);
	elseif (y <= 4.2e+21)
		tmp = t_1;
	elseif (y <= 2.4e+53)
		tmp = Float64(y / a);
	elseif (y <= 2.8e+171)
		tmp = t_1;
	else
		tmp = Float64(y / Float64(Float64(-t) / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x / (t - (z * a));
	tmp = 0.0;
	if (y <= -2.9e+103)
		tmp = y / a;
	elseif (y <= 4.2e+21)
		tmp = t_1;
	elseif (y <= 2.4e+53)
		tmp = y / a;
	elseif (y <= 2.8e+171)
		tmp = t_1;
	else
		tmp = y / (-t / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.9e+103], N[(y / a), $MachinePrecision], If[LessEqual[y, 4.2e+21], t$95$1, If[LessEqual[y, 2.4e+53], N[(y / a), $MachinePrecision], If[LessEqual[y, 2.8e+171], t$95$1, N[(y / N[((-t) / z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 4.2 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 2.4 \cdot 10^{+53}:\\
\;\;\;\;\frac{y}{a}\\

\mathbf{elif}\;y \leq 2.8 \cdot 10^{+171}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.8999999999999998e103 or 4.2e21 < y < 2.4e53

    1. Initial program 69.0%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -2.8999999999999998e103 < y < 4.2e21 or 2.4e53 < y < 2.80000000000000004e171

    1. Initial program 91.6%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if 2.80000000000000004e171 < y

    1. Initial program 61.8%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]
    8. Taylor expanded in a around 0 0

      \[\leadsto expr\]
    9. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 6: 71.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-25}:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.6499999999999999e-25 or 2e-19 < x

    1. Initial program 84.4%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -1.6499999999999999e-25 < x < 2e-19

    1. Initial program 82.7%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 54.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -660000000:\\
\;\;\;\;\frac{y}{a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.6e8 or 7.40000000000000005e-93 < z

    1. Initial program 70.0%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -6.6e8 < z < 7.40000000000000005e-93

    1. Initial program 99.8%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 8: 35.0% 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.6%

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

    \[\leadsto expr\]
  3. Add Preprocessing
  4. Taylor expanded in z around 0 0

    \[\leadsto expr\]
  5. Simplified0

    \[\leadsto expr\]
  6. Add Preprocessing

Developer target: 97.3% accurate, 0.4× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024110 
(FPCore (x y z t a)
  :name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
  :precision binary64

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

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