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

Percentage Accurate: 85.6% → 89.1%
Time: 10.4s
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: 85.6% accurate, 1.0× speedup?

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

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

Alternative 1: 89.1% accurate, 0.5× speedup?

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

\mathbf{elif}\;z \leq 1.4 \cdot 10^{+53}:\\
\;\;\;\;\frac{x - z \cdot y}{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 < -3.60000000000000011e264

    1. Initial program 28.4%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      6. *-lowering-*.f6428.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    3. Simplified28.4%

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

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{x}{a \cdot z} + \frac{y}{a}\right) - -1 \cdot \frac{t \cdot y}{{a}^{2} \cdot z}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \frac{y}{a} + \color{blue}{\left(-1 \cdot \frac{x}{a \cdot z} - -1 \cdot \frac{t \cdot y}{{a}^{2} \cdot z}\right)} \]
      3. associate-/r*N/A

        \[\leadsto \frac{y}{a} + \left(-1 \cdot \frac{\frac{x}{a}}{z} - -1 \cdot \frac{t \cdot y}{{a}^{2} \cdot z}\right) \]
      4. associate-*r/N/A

        \[\leadsto \frac{y}{a} + \left(\frac{-1 \cdot \frac{x}{a}}{z} - \color{blue}{-1} \cdot \frac{t \cdot y}{{a}^{2} \cdot z}\right) \]
      5. associate-/r*N/A

        \[\leadsto \frac{y}{a} + \left(\frac{-1 \cdot \frac{x}{a}}{z} - -1 \cdot \frac{\frac{t \cdot y}{{a}^{2}}}{\color{blue}{z}}\right) \]
      6. associate-*r/N/A

        \[\leadsto \frac{y}{a} + \left(\frac{-1 \cdot \frac{x}{a}}{z} - \frac{-1 \cdot \frac{t \cdot y}{{a}^{2}}}{\color{blue}{z}}\right) \]
      7. div-subN/A

        \[\leadsto \frac{y}{a} + \frac{-1 \cdot \frac{x}{a} - -1 \cdot \frac{t \cdot y}{{a}^{2}}}{\color{blue}{z}} \]
      8. distribute-lft-out--N/A

        \[\leadsto \frac{y}{a} + \frac{-1 \cdot \left(\frac{x}{a} - \frac{t \cdot y}{{a}^{2}}\right)}{z} \]
      9. associate-*r/N/A

        \[\leadsto \frac{y}{a} + -1 \cdot \color{blue}{\frac{\frac{x}{a} - \frac{t \cdot y}{{a}^{2}}}{z}} \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{y}{a}\right), \color{blue}{\left(-1 \cdot \frac{\frac{x}{a} - \frac{t \cdot y}{{a}^{2}}}{z}\right)}\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(y, a\right), \left(\color{blue}{-1} \cdot \frac{\frac{x}{a} - \frac{t \cdot y}{{a}^{2}}}{z}\right)\right) \]
      12. associate-*r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(y, a\right), \left(\frac{-1 \cdot \left(\frac{x}{a} - \frac{t \cdot y}{{a}^{2}}\right)}{\color{blue}{z}}\right)\right) \]
      13. distribute-lft-out--N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(y, a\right), \left(\frac{-1 \cdot \frac{x}{a} - -1 \cdot \frac{t \cdot y}{{a}^{2}}}{z}\right)\right) \]
    7. Simplified72.7%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(y, a\right), \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot \frac{x}{a}\right)}, z\right)\right) \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(y, a\right), \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{x}{a}\right)\right), z\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(y, a\right), \mathsf{/.f64}\left(\left(0 - \frac{x}{a}\right), z\right)\right) \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(y, a\right), \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \left(\frac{x}{a}\right)\right), z\right)\right) \]
      4. /-lowering-/.f6491.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(y, a\right), \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(x, a\right)\right), z\right)\right) \]
    10. Simplified91.0%

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

    if -3.60000000000000011e264 < z < 1.4e53

    1. Initial program 97.2%

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

    if 1.4e53 < z

    1. Initial program 58.6%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      6. *-lowering-*.f6458.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    3. Simplified58.6%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \color{blue}{\left(z \cdot \left(\frac{t}{z} - a\right)\right)}\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(z, \color{blue}{\left(\frac{t}{z} - a\right)}\right)\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(\left(\frac{t}{z}\right), \color{blue}{a}\right)\right)\right) \]
      3. /-lowering-/.f6458.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(t, z\right), a\right)\right)\right) \]
    7. Simplified58.6%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y}{\frac{t}{z} - a}} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{y}{\frac{t}{z} - a}\right) \]
      2. distribute-neg-frac2N/A

        \[\leadsto \frac{y}{\color{blue}{\mathsf{neg}\left(\left(\frac{t}{z} - a\right)\right)}} \]
      3. mul-1-negN/A

        \[\leadsto \frac{y}{-1 \cdot \color{blue}{\left(\frac{t}{z} - a\right)}} \]
      4. distribute-lft-out--N/A

        \[\leadsto \frac{y}{-1 \cdot \frac{t}{z} - \color{blue}{-1 \cdot a}} \]
      5. sub-negN/A

        \[\leadsto \frac{y}{-1 \cdot \frac{t}{z} + \color{blue}{\left(\mathsf{neg}\left(-1 \cdot a\right)\right)}} \]
      6. mul-1-negN/A

        \[\leadsto \frac{y}{-1 \cdot \frac{t}{z} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a\right)\right)\right)\right)} \]
      7. remove-double-negN/A

        \[\leadsto \frac{y}{-1 \cdot \frac{t}{z} + a} \]
      8. +-commutativeN/A

        \[\leadsto \frac{y}{a + \color{blue}{-1 \cdot \frac{t}{z}}} \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(a + -1 \cdot \frac{t}{z}\right)}\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(y, \left(a + \left(\mathsf{neg}\left(\frac{t}{z}\right)\right)\right)\right) \]
      11. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(y, \left(a - \color{blue}{\frac{t}{z}}\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(a, \color{blue}{\left(\frac{t}{z}\right)}\right)\right) \]
      13. /-lowering-/.f6486.1%

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(a, \mathsf{/.f64}\left(t, \color{blue}{z}\right)\right)\right) \]
    10. Simplified86.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{+264}:\\ \;\;\;\;\frac{y}{a} - \frac{\frac{x}{a}}{z}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+53}:\\ \;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 72.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.56 \cdot 10^{-12}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-83}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;z \leq 0.235:\\ \;\;\;\;\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.56e-12)
   (/ (- y (/ x z)) a)
   (if (<= z 1.45e-83)
     (/ (- x (* z y)) t)
     (if (<= z 0.235) (/ 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.56e-12) {
		tmp = (y - (x / z)) / a;
	} else if (z <= 1.45e-83) {
		tmp = (x - (z * y)) / t;
	} else if (z <= 0.235) {
		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.56d-12)) then
        tmp = (y - (x / z)) / a
    else if (z <= 1.45d-83) then
        tmp = (x - (z * y)) / t
    else if (z <= 0.235d0) 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.56e-12) {
		tmp = (y - (x / z)) / a;
	} else if (z <= 1.45e-83) {
		tmp = (x - (z * y)) / t;
	} else if (z <= 0.235) {
		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.56e-12:
		tmp = (y - (x / z)) / a
	elif z <= 1.45e-83:
		tmp = (x - (z * y)) / t
	elif z <= 0.235:
		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.56e-12)
		tmp = Float64(Float64(y - Float64(x / z)) / a);
	elseif (z <= 1.45e-83)
		tmp = Float64(Float64(x - Float64(z * y)) / t);
	elseif (z <= 0.235)
		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.56e-12)
		tmp = (y - (x / z)) / a;
	elseif (z <= 1.45e-83)
		tmp = (x - (z * y)) / t;
	elseif (z <= 0.235)
		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.56e-12], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 1.45e-83], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 0.235], 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.56 \cdot 10^{-12}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\

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

\mathbf{elif}\;z \leq 0.235:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.56000000000000002e-12

    1. Initial program 77.6%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      6. *-lowering-*.f6477.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    3. Simplified77.6%

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

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

        \[\leadsto \frac{-1 \cdot \left(x - y \cdot z\right)}{\color{blue}{a \cdot z}} \]
      2. *-commutativeN/A

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

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

        \[\leadsto \frac{-1 \cdot \frac{x - y \cdot z}{z}}{a} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 \cdot \frac{x - y \cdot z}{z}\right), \color{blue}{a}\right) \]
      6. div-subN/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 \cdot \left(\frac{x}{z} - \frac{y \cdot z}{z}\right)\right), a\right) \]
      7. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 \cdot \left(\frac{x}{z} - y \cdot \frac{z}{z}\right)\right), a\right) \]
      8. *-inversesN/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 \cdot \left(\frac{x}{z} - y \cdot 1\right)\right), a\right) \]
      9. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 \cdot \left(\frac{x}{z} - y\right)\right), a\right) \]
      10. distribute-lft-out--N/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 \cdot \frac{x}{z} - -1 \cdot y\right), a\right) \]
      11. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 \cdot \frac{x}{z} + \left(\mathsf{neg}\left(-1 \cdot y\right)\right)\right), a\right) \]
      12. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 \cdot \frac{x}{z} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(y\right)\right)\right)\right)\right), a\right) \]
      13. remove-double-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 \cdot \frac{x}{z} + y\right), a\right) \]
      14. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y + -1 \cdot \frac{x}{z}\right), a\right) \]
      15. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y + \left(\mathsf{neg}\left(\frac{x}{z}\right)\right)\right), a\right) \]
      16. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y - \frac{x}{z}\right), a\right) \]
      17. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \left(\frac{x}{z}\right)\right), a\right) \]
      18. /-lowering-/.f6477.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(y, \mathsf{/.f64}\left(x, z\right)\right), a\right) \]
    7. Simplified77.5%

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

    if -1.56000000000000002e-12 < z < 1.45e-83

    1. Initial program 99.9%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      6. *-lowering-*.f6499.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    3. Simplified99.9%

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

      \[\leadsto \color{blue}{\frac{x - y \cdot z}{t}} \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{t}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), t\right) \]
      3. *-lowering-*.f6485.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), t\right) \]
    7. Simplified85.8%

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

    if 1.45e-83 < z < 0.23499999999999999

    1. Initial program 99.8%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      6. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    3. Simplified99.8%

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

      \[\leadsto \color{blue}{\frac{x}{t - a \cdot z}} \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      4. *-lowering-*.f6483.5%

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    7. Simplified83.5%

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

    if 0.23499999999999999 < z

    1. Initial program 64.7%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      6. *-lowering-*.f6464.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    3. Simplified64.7%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \color{blue}{\left(z \cdot \left(\frac{t}{z} - a\right)\right)}\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(z, \color{blue}{\left(\frac{t}{z} - a\right)}\right)\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(\left(\frac{t}{z}\right), \color{blue}{a}\right)\right)\right) \]
      3. /-lowering-/.f6464.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(t, z\right), a\right)\right)\right) \]
    7. Simplified64.7%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y}{\frac{t}{z} - a}} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{y}{\frac{t}{z} - a}\right) \]
      2. distribute-neg-frac2N/A

        \[\leadsto \frac{y}{\color{blue}{\mathsf{neg}\left(\left(\frac{t}{z} - a\right)\right)}} \]
      3. mul-1-negN/A

        \[\leadsto \frac{y}{-1 \cdot \color{blue}{\left(\frac{t}{z} - a\right)}} \]
      4. distribute-lft-out--N/A

        \[\leadsto \frac{y}{-1 \cdot \frac{t}{z} - \color{blue}{-1 \cdot a}} \]
      5. sub-negN/A

        \[\leadsto \frac{y}{-1 \cdot \frac{t}{z} + \color{blue}{\left(\mathsf{neg}\left(-1 \cdot a\right)\right)}} \]
      6. mul-1-negN/A

        \[\leadsto \frac{y}{-1 \cdot \frac{t}{z} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a\right)\right)\right)\right)} \]
      7. remove-double-negN/A

        \[\leadsto \frac{y}{-1 \cdot \frac{t}{z} + a} \]
      8. +-commutativeN/A

        \[\leadsto \frac{y}{a + \color{blue}{-1 \cdot \frac{t}{z}}} \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(a + -1 \cdot \frac{t}{z}\right)}\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(y, \left(a + \left(\mathsf{neg}\left(\frac{t}{z}\right)\right)\right)\right) \]
      11. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(y, \left(a - \color{blue}{\frac{t}{z}}\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(a, \color{blue}{\left(\frac{t}{z}\right)}\right)\right) \]
      13. /-lowering-/.f6480.8%

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(a, \mathsf{/.f64}\left(t, \color{blue}{z}\right)\right)\right) \]
    10. Simplified80.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.56 \cdot 10^{-12}:\\ \;\;\;\;\frac{y - \frac{x}{z}}{a}\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-83}:\\ \;\;\;\;\frac{x - z \cdot y}{t}\\ \mathbf{elif}\;z \leq 0.235:\\ \;\;\;\;\frac{x}{t - z \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a - \frac{t}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 73.8% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.35000000000000006e32 or 5.5999999999999996 < z

    1. Initial program 68.9%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      6. *-lowering-*.f6468.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    3. Simplified68.9%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \color{blue}{\left(z \cdot \left(\frac{t}{z} - a\right)\right)}\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(z, \color{blue}{\left(\frac{t}{z} - a\right)}\right)\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(\left(\frac{t}{z}\right), \color{blue}{a}\right)\right)\right) \]
      3. /-lowering-/.f6468.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(t, z\right), a\right)\right)\right) \]
    7. Simplified68.9%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y}{\frac{t}{z} - a}} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{y}{\frac{t}{z} - a}\right) \]
      2. distribute-neg-frac2N/A

        \[\leadsto \frac{y}{\color{blue}{\mathsf{neg}\left(\left(\frac{t}{z} - a\right)\right)}} \]
      3. mul-1-negN/A

        \[\leadsto \frac{y}{-1 \cdot \color{blue}{\left(\frac{t}{z} - a\right)}} \]
      4. distribute-lft-out--N/A

        \[\leadsto \frac{y}{-1 \cdot \frac{t}{z} - \color{blue}{-1 \cdot a}} \]
      5. sub-negN/A

        \[\leadsto \frac{y}{-1 \cdot \frac{t}{z} + \color{blue}{\left(\mathsf{neg}\left(-1 \cdot a\right)\right)}} \]
      6. mul-1-negN/A

        \[\leadsto \frac{y}{-1 \cdot \frac{t}{z} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a\right)\right)\right)\right)} \]
      7. remove-double-negN/A

        \[\leadsto \frac{y}{-1 \cdot \frac{t}{z} + a} \]
      8. +-commutativeN/A

        \[\leadsto \frac{y}{a + \color{blue}{-1 \cdot \frac{t}{z}}} \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(a + -1 \cdot \frac{t}{z}\right)}\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(y, \left(a + \left(\mathsf{neg}\left(\frac{t}{z}\right)\right)\right)\right) \]
      11. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(y, \left(a - \color{blue}{\frac{t}{z}}\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(a, \color{blue}{\left(\frac{t}{z}\right)}\right)\right) \]
      13. /-lowering-/.f6478.6%

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(a, \mathsf{/.f64}\left(t, \color{blue}{z}\right)\right)\right) \]
    10. Simplified78.6%

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

    if -1.35000000000000006e32 < z < 1.6000000000000001e-83

    1. Initial program 99.8%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      6. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    3. Simplified99.8%

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

      \[\leadsto \color{blue}{\frac{x - y \cdot z}{t}} \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{t}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), t\right) \]
      3. *-lowering-*.f6484.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), t\right) \]
    7. Simplified84.0%

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

    if 1.6000000000000001e-83 < z < 5.5999999999999996

    1. Initial program 99.8%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      6. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    3. Simplified99.8%

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

      \[\leadsto \color{blue}{\frac{x}{t - a \cdot z}} \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      4. *-lowering-*.f6483.5%

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    7. Simplified83.5%

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

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

Alternative 4: 55.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -3.4 \cdot 10^{-66}:\\
\;\;\;\;z \cdot \frac{0 - y}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.1999999999999997e46 or 1.65e14 < z

    1. Initial program 67.3%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      6. *-lowering-*.f6467.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    3. Simplified67.3%

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

      \[\leadsto \color{blue}{\frac{y}{a}} \]
    6. Step-by-step derivation
      1. /-lowering-/.f6463.5%

        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{a}\right) \]
    7. Simplified63.5%

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

    if -7.1999999999999997e46 < z < -3.39999999999999997e-66

    1. Initial program 99.8%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      6. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    3. Simplified99.8%

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

      \[\leadsto \color{blue}{\frac{x - y \cdot z}{t}} \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{t}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), t\right) \]
      3. *-lowering-*.f6467.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), t\right) \]
    7. Simplified67.4%

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

      \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \frac{y}{t} + \frac{x}{t \cdot z}\right)} \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \frac{y}{t} + \frac{x}{t \cdot z}\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{x}{t \cdot z} + \color{blue}{-1 \cdot \frac{y}{t}}\right)\right) \]
      3. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{x}{t \cdot z} + \left(\mathsf{neg}\left(\frac{y}{t}\right)\right)\right)\right) \]
      4. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{x}{t \cdot z} - \color{blue}{\frac{y}{t}}\right)\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(\left(\frac{x}{t \cdot z}\right), \color{blue}{\left(\frac{y}{t}\right)}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(x, \left(t \cdot z\right)\right), \left(\frac{\color{blue}{y}}{t}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(x, \mathsf{*.f64}\left(t, z\right)\right), \left(\frac{y}{t}\right)\right)\right) \]
      8. /-lowering-/.f6467.4%

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(x, \mathsf{*.f64}\left(t, z\right)\right), \mathsf{/.f64}\left(y, \color{blue}{t}\right)\right)\right) \]
    10. Simplified67.4%

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

      \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \frac{y}{t}\right)}\right) \]
    12. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\mathsf{neg}\left(\frac{y}{t}\right)\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(0 - \color{blue}{\frac{y}{t}}\right)\right) \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{y}{t}\right)}\right)\right) \]
      4. /-lowering-/.f6460.6%

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(y, \color{blue}{t}\right)\right)\right) \]
    13. Simplified60.6%

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

    if -3.39999999999999997e-66 < z < 1.65e14

    1. Initial program 99.8%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      6. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    3. Simplified99.8%

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

      \[\leadsto \color{blue}{\frac{x}{t}} \]
    6. Step-by-step derivation
      1. /-lowering-/.f6461.5%

        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{t}\right) \]
    7. Simplified61.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{+46}:\\ \;\;\;\;\frac{y}{a}\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-66}:\\ \;\;\;\;z \cdot \frac{0 - y}{t}\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{+14}:\\ \;\;\;\;\frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 73.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{y}{a - \frac{t}{z}}\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 0.8:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.4000000000000002e-65 or 0.80000000000000004 < z

    1. Initial program 71.8%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      6. *-lowering-*.f6471.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    3. Simplified71.8%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \color{blue}{\left(z \cdot \left(\frac{t}{z} - a\right)\right)}\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(z, \color{blue}{\left(\frac{t}{z} - a\right)}\right)\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(\left(\frac{t}{z}\right), \color{blue}{a}\right)\right)\right) \]
      3. /-lowering-/.f6471.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(t, z\right), a\right)\right)\right) \]
    7. Simplified71.8%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y}{\frac{t}{z} - a}} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{y}{\frac{t}{z} - a}\right) \]
      2. distribute-neg-frac2N/A

        \[\leadsto \frac{y}{\color{blue}{\mathsf{neg}\left(\left(\frac{t}{z} - a\right)\right)}} \]
      3. mul-1-negN/A

        \[\leadsto \frac{y}{-1 \cdot \color{blue}{\left(\frac{t}{z} - a\right)}} \]
      4. distribute-lft-out--N/A

        \[\leadsto \frac{y}{-1 \cdot \frac{t}{z} - \color{blue}{-1 \cdot a}} \]
      5. sub-negN/A

        \[\leadsto \frac{y}{-1 \cdot \frac{t}{z} + \color{blue}{\left(\mathsf{neg}\left(-1 \cdot a\right)\right)}} \]
      6. mul-1-negN/A

        \[\leadsto \frac{y}{-1 \cdot \frac{t}{z} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a\right)\right)\right)\right)} \]
      7. remove-double-negN/A

        \[\leadsto \frac{y}{-1 \cdot \frac{t}{z} + a} \]
      8. +-commutativeN/A

        \[\leadsto \frac{y}{a + \color{blue}{-1 \cdot \frac{t}{z}}} \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(a + -1 \cdot \frac{t}{z}\right)}\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(y, \left(a + \left(\mathsf{neg}\left(\frac{t}{z}\right)\right)\right)\right) \]
      11. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(y, \left(a - \color{blue}{\frac{t}{z}}\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(a, \color{blue}{\left(\frac{t}{z}\right)}\right)\right) \]
      13. /-lowering-/.f6477.8%

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(a, \mathsf{/.f64}\left(t, \color{blue}{z}\right)\right)\right) \]
    10. Simplified77.8%

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

    if -2.4000000000000002e-65 < z < 0.80000000000000004

    1. Initial program 99.8%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      6. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    3. Simplified99.8%

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

      \[\leadsto \color{blue}{\frac{x}{t - a \cdot z}} \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      4. *-lowering-*.f6477.5%

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    7. Simplified77.5%

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

Alternative 6: 66.4% accurate, 0.6× speedup?

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

\mathbf{elif}\;z \leq 5.4 \cdot 10^{+45}:\\
\;\;\;\;\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.9000000000000002e42 or 5.39999999999999968e45 < z

    1. Initial program 65.9%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      6. *-lowering-*.f6465.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    3. Simplified65.9%

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

      \[\leadsto \color{blue}{\frac{y}{a}} \]
    6. Step-by-step derivation
      1. /-lowering-/.f6464.4%

        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{a}\right) \]
    7. Simplified64.4%

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

    if -4.9000000000000002e42 < z < 5.39999999999999968e45

    1. Initial program 99.8%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      6. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    3. Simplified99.8%

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

      \[\leadsto \color{blue}{\frac{x}{t - a \cdot z}} \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      4. *-lowering-*.f6473.1%

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    7. Simplified73.1%

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

Alternative 7: 56.1% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.3e29 or 6e13 < z

    1. Initial program 68.1%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      6. *-lowering-*.f6468.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    3. Simplified68.1%

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

      \[\leadsto \color{blue}{\frac{y}{a}} \]
    6. Step-by-step derivation
      1. /-lowering-/.f6462.0%

        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{a}\right) \]
    7. Simplified62.0%

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

    if -1.3e29 < z < 6e13

    1. Initial program 99.8%

      \[\frac{x - y \cdot z}{t - a \cdot z} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
      6. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
    3. Simplified99.8%

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

      \[\leadsto \color{blue}{\frac{x}{t}} \]
    6. Step-by-step derivation
      1. /-lowering-/.f6458.4%

        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{t}\right) \]
    7. Simplified58.4%

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

Alternative 8: 35.9% 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 84.7%

    \[\frac{x - y \cdot z}{t - a \cdot z} \]
  2. Step-by-step derivation
    1. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(x - y \cdot z\right), \color{blue}{\left(t - a \cdot z\right)}\right) \]
    2. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \left(y \cdot z\right)\right), \left(\color{blue}{t} - a \cdot z\right)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \left(t - a \cdot z\right)\right) \]
    4. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(a \cdot z\right)}\right)\right) \]
    5. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \left(z \cdot \color{blue}{a}\right)\right)\right) \]
    6. *-lowering-*.f6484.7%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(y, z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{a}\right)\right)\right) \]
  3. Simplified84.7%

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

    \[\leadsto \color{blue}{\frac{x}{t}} \]
  6. Step-by-step derivation
    1. /-lowering-/.f6436.0%

      \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{t}\right) \]
  7. Simplified36.0%

    \[\leadsto \color{blue}{\frac{x}{t}} \]
  8. Add Preprocessing

Developer Target 1: 97.5% 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 2024163 
(FPCore (x y z t a)
  :name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< z -32113435955957344) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 4392440296622287/125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* (- x (* y z)) (/ 1 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))))))

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