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

Percentage Accurate: 96.0% → 99.7%
Time: 8.4s
Alternatives: 9
Speedup: 0.5×

Specification

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

\\
\frac{x}{y - z \cdot t}
\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 9 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: 96.0% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 0.1× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -\infty:\\ \;\;\;\;\frac{\frac{-x}{t}}{z}\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+228}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(z, -t, y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= (* z t) (- INFINITY))
   (/ (/ (- x) t) z)
   (if (<= (* z t) 5e+228) (/ x (fma z (- t) y)) (/ (/ x (- z)) t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * t) <= -((double) INFINITY)) {
		tmp = (-x / t) / z;
	} else if ((z * t) <= 5e+228) {
		tmp = x / fma(z, -t, y);
	} else {
		tmp = (x / -z) / t;
	}
	return tmp;
}
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * t) <= Float64(-Inf))
		tmp = Float64(Float64(Float64(-x) / t) / z);
	elseif (Float64(z * t) <= 5e+228)
		tmp = Float64(x / fma(z, Float64(-t), y));
	else
		tmp = Float64(Float64(x / Float64(-z)) / t);
	end
	return tmp
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[N[(z * t), $MachinePrecision], (-Infinity)], N[(N[((-x) / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 5e+228], N[(x / N[(z * (-t) + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / (-z)), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -\infty:\\
\;\;\;\;\frac{\frac{-x}{t}}{z}\\

\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+228}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(z, -t, y\right)}\\

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


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

    1. Initial program 74.1%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 74.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-neg74.1%

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. distribute-neg-frac99.9%

        \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    5. Simplified99.9%

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

    if -inf.0 < (*.f64 z t) < 5e228

    1. Initial program 99.9%

      \[\frac{x}{y - z \cdot t} \]
    2. Step-by-step derivation
      1. cancel-sign-sub-inv99.9%

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

        \[\leadsto \frac{x}{\color{blue}{\left(-z\right) \cdot t + y}} \]
      3. distribute-lft-neg-out99.9%

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

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

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

      \[\leadsto \color{blue}{\frac{x}{\mathsf{fma}\left(z, -t, y\right)}} \]
    4. Add Preprocessing

    if 5e228 < (*.f64 z t)

    1. Initial program 82.5%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 82.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-neg82.5%

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. distribute-neg-frac100.0%

        \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    5. Simplified100.0%

      \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u99.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\frac{x}{t}}{z}\right)\right)} \]
      2. expm1-udef76.5%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\frac{x}{t}}{z}\right)} - 1} \]
      3. add-sqr-sqrt50.7%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{-\frac{x}{t}} \cdot \sqrt{-\frac{x}{t}}}}{z}\right)} - 1 \]
      4. sqrt-unprod76.5%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\left(-\frac{x}{t}\right) \cdot \left(-\frac{x}{t}\right)}}}{z}\right)} - 1 \]
      5. sqr-neg76.5%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\sqrt{\color{blue}{\frac{x}{t} \cdot \frac{x}{t}}}}{z}\right)} - 1 \]
      6. sqrt-unprod50.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\frac{x}{t}} \cdot \sqrt{\frac{x}{t}}}}{z}\right)} - 1 \]
      7. add-sqr-sqrt72.5%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{x}{t}}}{z}\right)} - 1 \]
    7. Applied egg-rr72.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{x}{t}}{z}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def72.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{x}{t}}{z}\right)\right)} \]
      2. expm1-log1p72.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. associate-/r*72.3%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt27.8%

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

        \[\leadsto \frac{\color{blue}{\sqrt{x \cdot x}}}{t \cdot z} \]
      3. sqr-neg75.6%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{t \cdot z} \]
      4. sqrt-unprod54.5%

        \[\leadsto \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{t \cdot z} \]
      5. add-sqr-sqrt82.5%

        \[\leadsto \frac{\color{blue}{-x}}{t \cdot z} \]
      6. neg-mul-182.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot x}}{t \cdot z} \]
      7. times-frac99.8%

        \[\leadsto \color{blue}{\frac{-1}{t} \cdot \frac{x}{z}} \]
    11. Applied egg-rr99.8%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. *-commutative82.5%

        \[\leadsto \frac{\color{blue}{x \cdot -1}}{t \cdot z} \]
      3. frac-times99.9%

        \[\leadsto \color{blue}{\frac{x}{t} \cdot \frac{-1}{z}} \]
      4. clear-num99.9%

        \[\leadsto \frac{x}{t} \cdot \color{blue}{\frac{1}{\frac{z}{-1}}} \]
      5. frac-times82.5%

        \[\leadsto \color{blue}{\frac{x \cdot 1}{t \cdot \frac{z}{-1}}} \]
      6. *-commutative82.5%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{t \cdot \frac{z}{-1}} \]
      7. *-un-lft-identity82.5%

        \[\leadsto \frac{\color{blue}{x}}{t \cdot \frac{z}{-1}} \]
      8. div-inv82.5%

        \[\leadsto \frac{x}{t \cdot \color{blue}{\left(z \cdot \frac{1}{-1}\right)}} \]
      9. metadata-eval82.5%

        \[\leadsto \frac{x}{t \cdot \left(z \cdot \color{blue}{-1}\right)} \]
    13. Applied egg-rr82.5%

      \[\leadsto \color{blue}{\frac{x}{t \cdot \left(z \cdot -1\right)}} \]
    14. Step-by-step derivation
      1. *-commutative82.5%

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

        \[\leadsto \frac{x}{t \cdot \color{blue}{\left(-z\right)}} \]
      3. associate-/l/99.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{-z}}{t}} \]
    15. Simplified99.9%

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

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

Alternative 2: 99.7% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -\infty:\\ \;\;\;\;\frac{\frac{-x}{t}}{z}\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+228}:\\ \;\;\;\;\frac{x}{y - z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= (* z t) (- INFINITY))
   (/ (/ (- x) t) z)
   (if (<= (* z t) 5e+228) (/ x (- y (* z t))) (/ (/ x (- z)) t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * t) <= -((double) INFINITY)) {
		tmp = (-x / t) / z;
	} else if ((z * t) <= 5e+228) {
		tmp = x / (y - (z * t));
	} else {
		tmp = (x / -z) / t;
	}
	return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * t) <= -Double.POSITIVE_INFINITY) {
		tmp = (-x / t) / z;
	} else if ((z * t) <= 5e+228) {
		tmp = x / (y - (z * t));
	} else {
		tmp = (x / -z) / t;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if (z * t) <= -math.inf:
		tmp = (-x / t) / z
	elif (z * t) <= 5e+228:
		tmp = x / (y - (z * t))
	else:
		tmp = (x / -z) / t
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * t) <= Float64(-Inf))
		tmp = Float64(Float64(Float64(-x) / t) / z);
	elseif (Float64(z * t) <= 5e+228)
		tmp = Float64(x / Float64(y - Float64(z * t)));
	else
		tmp = Float64(Float64(x / Float64(-z)) / t);
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z * t) <= -Inf)
		tmp = (-x / t) / z;
	elseif ((z * t) <= 5e+228)
		tmp = x / (y - (z * t));
	else
		tmp = (x / -z) / t;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[N[(z * t), $MachinePrecision], (-Infinity)], N[(N[((-x) / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 5e+228], N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / (-z)), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -\infty:\\
\;\;\;\;\frac{\frac{-x}{t}}{z}\\

\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+228}:\\
\;\;\;\;\frac{x}{y - z \cdot t}\\

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


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

    1. Initial program 74.1%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 74.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-neg74.1%

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. distribute-neg-frac99.9%

        \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    5. Simplified99.9%

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

    if -inf.0 < (*.f64 z t) < 5e228

    1. Initial program 99.9%

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

    if 5e228 < (*.f64 z t)

    1. Initial program 82.5%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 82.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-neg82.5%

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. distribute-neg-frac100.0%

        \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    5. Simplified100.0%

      \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u99.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\frac{x}{t}}{z}\right)\right)} \]
      2. expm1-udef76.5%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\frac{x}{t}}{z}\right)} - 1} \]
      3. add-sqr-sqrt50.7%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{-\frac{x}{t}} \cdot \sqrt{-\frac{x}{t}}}}{z}\right)} - 1 \]
      4. sqrt-unprod76.5%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\left(-\frac{x}{t}\right) \cdot \left(-\frac{x}{t}\right)}}}{z}\right)} - 1 \]
      5. sqr-neg76.5%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\sqrt{\color{blue}{\frac{x}{t} \cdot \frac{x}{t}}}}{z}\right)} - 1 \]
      6. sqrt-unprod50.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\frac{x}{t}} \cdot \sqrt{\frac{x}{t}}}}{z}\right)} - 1 \]
      7. add-sqr-sqrt72.5%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{x}{t}}}{z}\right)} - 1 \]
    7. Applied egg-rr72.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{x}{t}}{z}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def72.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{x}{t}}{z}\right)\right)} \]
      2. expm1-log1p72.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. associate-/r*72.3%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt27.8%

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

        \[\leadsto \frac{\color{blue}{\sqrt{x \cdot x}}}{t \cdot z} \]
      3. sqr-neg75.6%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{t \cdot z} \]
      4. sqrt-unprod54.5%

        \[\leadsto \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{t \cdot z} \]
      5. add-sqr-sqrt82.5%

        \[\leadsto \frac{\color{blue}{-x}}{t \cdot z} \]
      6. neg-mul-182.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot x}}{t \cdot z} \]
      7. times-frac99.8%

        \[\leadsto \color{blue}{\frac{-1}{t} \cdot \frac{x}{z}} \]
    11. Applied egg-rr99.8%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. *-commutative82.5%

        \[\leadsto \frac{\color{blue}{x \cdot -1}}{t \cdot z} \]
      3. frac-times99.9%

        \[\leadsto \color{blue}{\frac{x}{t} \cdot \frac{-1}{z}} \]
      4. clear-num99.9%

        \[\leadsto \frac{x}{t} \cdot \color{blue}{\frac{1}{\frac{z}{-1}}} \]
      5. frac-times82.5%

        \[\leadsto \color{blue}{\frac{x \cdot 1}{t \cdot \frac{z}{-1}}} \]
      6. *-commutative82.5%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{t \cdot \frac{z}{-1}} \]
      7. *-un-lft-identity82.5%

        \[\leadsto \frac{\color{blue}{x}}{t \cdot \frac{z}{-1}} \]
      8. div-inv82.5%

        \[\leadsto \frac{x}{t \cdot \color{blue}{\left(z \cdot \frac{1}{-1}\right)}} \]
      9. metadata-eval82.5%

        \[\leadsto \frac{x}{t \cdot \left(z \cdot \color{blue}{-1}\right)} \]
    13. Applied egg-rr82.5%

      \[\leadsto \color{blue}{\frac{x}{t \cdot \left(z \cdot -1\right)}} \]
    14. Step-by-step derivation
      1. *-commutative82.5%

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

        \[\leadsto \frac{x}{t \cdot \color{blue}{\left(-z\right)}} \]
      3. associate-/l/99.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{-z}}{t}} \]
    15. Simplified99.9%

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

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

Alternative 3: 73.2% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{-77}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;t \leq 27000:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{z \cdot \frac{t}{x}}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= t -8.5e-77)
   (/ (/ x (- z)) t)
   (if (<= t 27000.0) (/ x y) (/ -1.0 (* z (/ t x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -8.5e-77) {
		tmp = (x / -z) / t;
	} else if (t <= 27000.0) {
		tmp = x / y;
	} else {
		tmp = -1.0 / (z * (t / x));
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-8.5d-77)) then
        tmp = (x / -z) / t
    else if (t <= 27000.0d0) then
        tmp = x / y
    else
        tmp = (-1.0d0) / (z * (t / x))
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -8.5e-77) {
		tmp = (x / -z) / t;
	} else if (t <= 27000.0) {
		tmp = x / y;
	} else {
		tmp = -1.0 / (z * (t / x));
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if t <= -8.5e-77:
		tmp = (x / -z) / t
	elif t <= 27000.0:
		tmp = x / y
	else:
		tmp = -1.0 / (z * (t / x))
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -8.5e-77)
		tmp = Float64(Float64(x / Float64(-z)) / t);
	elseif (t <= 27000.0)
		tmp = Float64(x / y);
	else
		tmp = Float64(-1.0 / Float64(z * Float64(t / x)));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -8.5e-77)
		tmp = (x / -z) / t;
	elseif (t <= 27000.0)
		tmp = x / y;
	else
		tmp = -1.0 / (z * (t / x));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[t, -8.5e-77], N[(N[(x / (-z)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 27000.0], N[(x / y), $MachinePrecision], N[(-1.0 / N[(z * N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-77}:\\
\;\;\;\;\frac{\frac{x}{-z}}{t}\\

\mathbf{elif}\;t \leq 27000:\\
\;\;\;\;\frac{x}{y}\\

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


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

    1. Initial program 93.5%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 59.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-neg59.6%

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. distribute-neg-frac66.1%

        \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    5. Simplified66.1%

      \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u57.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\frac{x}{t}}{z}\right)\right)} \]
      2. expm1-udef38.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\frac{x}{t}}{z}\right)} - 1} \]
      3. add-sqr-sqrt25.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{-\frac{x}{t}} \cdot \sqrt{-\frac{x}{t}}}}{z}\right)} - 1 \]
      4. sqrt-unprod30.1%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\left(-\frac{x}{t}\right) \cdot \left(-\frac{x}{t}\right)}}}{z}\right)} - 1 \]
      5. sqr-neg30.1%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\sqrt{\color{blue}{\frac{x}{t} \cdot \frac{x}{t}}}}{z}\right)} - 1 \]
      6. sqrt-unprod21.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\frac{x}{t}} \cdot \sqrt{\frac{x}{t}}}}{z}\right)} - 1 \]
      7. add-sqr-sqrt28.8%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{x}{t}}}{z}\right)} - 1 \]
    7. Applied egg-rr28.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{x}{t}}{z}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def25.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{x}{t}}{z}\right)\right)} \]
      2. expm1-log1p27.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. associate-/r*25.5%

        \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    9. Simplified25.5%

      \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt10.4%

        \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{t \cdot z} \]
      2. sqrt-unprod40.0%

        \[\leadsto \frac{\color{blue}{\sqrt{x \cdot x}}}{t \cdot z} \]
      3. sqr-neg40.0%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{t \cdot z} \]
      4. sqrt-unprod32.7%

        \[\leadsto \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{t \cdot z} \]
      5. add-sqr-sqrt59.6%

        \[\leadsto \frac{\color{blue}{-x}}{t \cdot z} \]
      6. neg-mul-159.6%

        \[\leadsto \frac{\color{blue}{-1 \cdot x}}{t \cdot z} \]
      7. times-frac62.4%

        \[\leadsto \color{blue}{\frac{-1}{t} \cdot \frac{x}{z}} \]
    11. Applied egg-rr62.4%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. *-commutative59.6%

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

        \[\leadsto \color{blue}{\frac{x}{t} \cdot \frac{-1}{z}} \]
      4. clear-num66.1%

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

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

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{t \cdot \frac{z}{-1}} \]
      7. *-un-lft-identity59.6%

        \[\leadsto \frac{\color{blue}{x}}{t \cdot \frac{z}{-1}} \]
      8. div-inv59.6%

        \[\leadsto \frac{x}{t \cdot \color{blue}{\left(z \cdot \frac{1}{-1}\right)}} \]
      9. metadata-eval59.6%

        \[\leadsto \frac{x}{t \cdot \left(z \cdot \color{blue}{-1}\right)} \]
    13. Applied egg-rr59.6%

      \[\leadsto \color{blue}{\frac{x}{t \cdot \left(z \cdot -1\right)}} \]
    14. Step-by-step derivation
      1. *-commutative59.6%

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

        \[\leadsto \frac{x}{t \cdot \color{blue}{\left(-z\right)}} \]
      3. associate-/l/62.5%

        \[\leadsto \color{blue}{\frac{\frac{x}{-z}}{t}} \]
    15. Simplified62.5%

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

    if -8.4999999999999998e-77 < t < 27000

    1. Initial program 99.9%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 76.2%

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

    if 27000 < t

    1. Initial program 94.4%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 76.9%

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

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. distribute-neg-frac81.4%

        \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    5. Simplified81.4%

      \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u70.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\frac{x}{t}}{z}\right)\right)} \]
      2. expm1-udef50.7%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\frac{x}{t}}{z}\right)} - 1} \]
      3. add-sqr-sqrt35.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{-\frac{x}{t}} \cdot \sqrt{-\frac{x}{t}}}}{z}\right)} - 1 \]
      4. sqrt-unprod45.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\left(-\frac{x}{t}\right) \cdot \left(-\frac{x}{t}\right)}}}{z}\right)} - 1 \]
      5. sqr-neg45.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\sqrt{\color{blue}{\frac{x}{t} \cdot \frac{x}{t}}}}{z}\right)} - 1 \]
      6. sqrt-unprod28.4%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\frac{x}{t}} \cdot \sqrt{\frac{x}{t}}}}{z}\right)} - 1 \]
      7. add-sqr-sqrt43.7%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{x}{t}}}{z}\right)} - 1 \]
    7. Applied egg-rr43.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{x}{t}}{z}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def41.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{x}{t}}{z}\right)\right)} \]
      2. expm1-log1p42.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. associate-/r*40.5%

        \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    9. Simplified40.5%

      \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt16.0%

        \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{t \cdot z} \]
      2. sqrt-unprod51.5%

        \[\leadsto \frac{\color{blue}{\sqrt{x \cdot x}}}{t \cdot z} \]
      3. sqr-neg51.5%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{t \cdot z} \]
      4. sqrt-unprod43.3%

        \[\leadsto \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{t \cdot z} \]
      5. add-sqr-sqrt76.9%

        \[\leadsto \frac{\color{blue}{-x}}{t \cdot z} \]
      6. neg-mul-176.9%

        \[\leadsto \frac{\color{blue}{-1 \cdot x}}{t \cdot z} \]
      7. times-frac73.8%

        \[\leadsto \color{blue}{\frac{-1}{t} \cdot \frac{x}{z}} \]
    11. Applied egg-rr73.8%

      \[\leadsto \color{blue}{\frac{-1}{t} \cdot \frac{x}{z}} \]
    12. Step-by-step derivation
      1. frac-times76.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. *-commutative76.9%

        \[\leadsto \frac{\color{blue}{x \cdot -1}}{t \cdot z} \]
      3. frac-times81.4%

        \[\leadsto \color{blue}{\frac{x}{t} \cdot \frac{-1}{z}} \]
      4. clear-num82.8%

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

        \[\leadsto \color{blue}{\frac{1 \cdot -1}{\frac{t}{x} \cdot z}} \]
      6. metadata-eval82.0%

        \[\leadsto \frac{\color{blue}{-1}}{\frac{t}{x} \cdot z} \]
    13. Applied egg-rr82.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{-77}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;t \leq 27000:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{z \cdot \frac{t}{x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 70.0% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -5.2 \cdot 10^{-77} \lor \neg \left(t \leq 27500\right):\\ \;\;\;\;\frac{-x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (or (<= t -5.2e-77) (not (<= t 27500.0))) (/ (- x) (* z t)) (/ x y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -5.2e-77) || !(t <= 27500.0)) {
		tmp = -x / (z * t);
	} else {
		tmp = x / y;
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((t <= (-5.2d-77)) .or. (.not. (t <= 27500.0d0))) then
        tmp = -x / (z * t)
    else
        tmp = x / y
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -5.2e-77) || !(t <= 27500.0)) {
		tmp = -x / (z * t);
	} else {
		tmp = x / y;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if (t <= -5.2e-77) or not (t <= 27500.0):
		tmp = -x / (z * t)
	else:
		tmp = x / y
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if ((t <= -5.2e-77) || !(t <= 27500.0))
		tmp = Float64(Float64(-x) / Float64(z * t));
	else
		tmp = Float64(x / y);
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((t <= -5.2e-77) || ~((t <= 27500.0)))
		tmp = -x / (z * t);
	else
		tmp = x / y;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -5.2e-77], N[Not[LessEqual[t, 27500.0]], $MachinePrecision]], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{-77} \lor \neg \left(t \leq 27500\right):\\
\;\;\;\;\frac{-x}{z \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.2000000000000002e-77 or 27500 < t

    1. Initial program 93.9%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 67.4%

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

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

        \[\leadsto \frac{\color{blue}{-x}}{t \cdot z} \]
    5. Simplified67.4%

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

    if -5.2000000000000002e-77 < t < 27500

    1. Initial program 99.9%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 76.2%

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

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

Alternative 5: 73.3% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{-77} \lor \neg \left(t \leq 27500\right):\\ \;\;\;\;\frac{\frac{-x}{t}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (or (<= t -4.3e-77) (not (<= t 27500.0))) (/ (/ (- x) t) z) (/ x y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -4.3e-77) || !(t <= 27500.0)) {
		tmp = (-x / t) / z;
	} else {
		tmp = x / y;
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((t <= (-4.3d-77)) .or. (.not. (t <= 27500.0d0))) then
        tmp = (-x / t) / z
    else
        tmp = x / y
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -4.3e-77) || !(t <= 27500.0)) {
		tmp = (-x / t) / z;
	} else {
		tmp = x / y;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if (t <= -4.3e-77) or not (t <= 27500.0):
		tmp = (-x / t) / z
	else:
		tmp = x / y
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if ((t <= -4.3e-77) || !(t <= 27500.0))
		tmp = Float64(Float64(Float64(-x) / t) / z);
	else
		tmp = Float64(x / y);
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((t <= -4.3e-77) || ~((t <= 27500.0)))
		tmp = (-x / t) / z;
	else
		tmp = x / y;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.3e-77], N[Not[LessEqual[t, 27500.0]], $MachinePrecision]], N[(N[((-x) / t), $MachinePrecision] / z), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{-77} \lor \neg \left(t \leq 27500\right):\\
\;\;\;\;\frac{\frac{-x}{t}}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.3000000000000002e-77 or 27500 < t

    1. Initial program 93.9%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 67.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-neg67.4%

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. distribute-neg-frac73.1%

        \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    5. Simplified73.1%

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

    if -4.3000000000000002e-77 < t < 27500

    1. Initial program 99.9%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 76.2%

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

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

Alternative 6: 73.3% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -9.5 \cdot 10^{-77}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;t \leq 27000:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-x}{t}}{z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= t -9.5e-77)
   (/ (/ x (- z)) t)
   (if (<= t 27000.0) (/ x y) (/ (/ (- x) t) z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -9.5e-77) {
		tmp = (x / -z) / t;
	} else if (t <= 27000.0) {
		tmp = x / y;
	} else {
		tmp = (-x / t) / z;
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-9.5d-77)) then
        tmp = (x / -z) / t
    else if (t <= 27000.0d0) then
        tmp = x / y
    else
        tmp = (-x / t) / z
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -9.5e-77) {
		tmp = (x / -z) / t;
	} else if (t <= 27000.0) {
		tmp = x / y;
	} else {
		tmp = (-x / t) / z;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if t <= -9.5e-77:
		tmp = (x / -z) / t
	elif t <= 27000.0:
		tmp = x / y
	else:
		tmp = (-x / t) / z
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -9.5e-77)
		tmp = Float64(Float64(x / Float64(-z)) / t);
	elseif (t <= 27000.0)
		tmp = Float64(x / y);
	else
		tmp = Float64(Float64(Float64(-x) / t) / z);
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -9.5e-77)
		tmp = (x / -z) / t;
	elseif (t <= 27000.0)
		tmp = x / y;
	else
		tmp = (-x / t) / z;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[t, -9.5e-77], N[(N[(x / (-z)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 27000.0], N[(x / y), $MachinePrecision], N[(N[((-x) / t), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{-77}:\\
\;\;\;\;\frac{\frac{x}{-z}}{t}\\

\mathbf{elif}\;t \leq 27000:\\
\;\;\;\;\frac{x}{y}\\

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


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

    1. Initial program 93.5%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 59.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-neg59.6%

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. distribute-neg-frac66.1%

        \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    5. Simplified66.1%

      \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u57.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\frac{x}{t}}{z}\right)\right)} \]
      2. expm1-udef38.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\frac{x}{t}}{z}\right)} - 1} \]
      3. add-sqr-sqrt25.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{-\frac{x}{t}} \cdot \sqrt{-\frac{x}{t}}}}{z}\right)} - 1 \]
      4. sqrt-unprod30.1%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\left(-\frac{x}{t}\right) \cdot \left(-\frac{x}{t}\right)}}}{z}\right)} - 1 \]
      5. sqr-neg30.1%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\sqrt{\color{blue}{\frac{x}{t} \cdot \frac{x}{t}}}}{z}\right)} - 1 \]
      6. sqrt-unprod21.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\frac{x}{t}} \cdot \sqrt{\frac{x}{t}}}}{z}\right)} - 1 \]
      7. add-sqr-sqrt28.8%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{x}{t}}}{z}\right)} - 1 \]
    7. Applied egg-rr28.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{x}{t}}{z}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def25.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{x}{t}}{z}\right)\right)} \]
      2. expm1-log1p27.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. associate-/r*25.5%

        \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    9. Simplified25.5%

      \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt10.4%

        \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{t \cdot z} \]
      2. sqrt-unprod40.0%

        \[\leadsto \frac{\color{blue}{\sqrt{x \cdot x}}}{t \cdot z} \]
      3. sqr-neg40.0%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{t \cdot z} \]
      4. sqrt-unprod32.7%

        \[\leadsto \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{t \cdot z} \]
      5. add-sqr-sqrt59.6%

        \[\leadsto \frac{\color{blue}{-x}}{t \cdot z} \]
      6. neg-mul-159.6%

        \[\leadsto \frac{\color{blue}{-1 \cdot x}}{t \cdot z} \]
      7. times-frac62.4%

        \[\leadsto \color{blue}{\frac{-1}{t} \cdot \frac{x}{z}} \]
    11. Applied egg-rr62.4%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. *-commutative59.6%

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

        \[\leadsto \color{blue}{\frac{x}{t} \cdot \frac{-1}{z}} \]
      4. clear-num66.1%

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

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

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{t \cdot \frac{z}{-1}} \]
      7. *-un-lft-identity59.6%

        \[\leadsto \frac{\color{blue}{x}}{t \cdot \frac{z}{-1}} \]
      8. div-inv59.6%

        \[\leadsto \frac{x}{t \cdot \color{blue}{\left(z \cdot \frac{1}{-1}\right)}} \]
      9. metadata-eval59.6%

        \[\leadsto \frac{x}{t \cdot \left(z \cdot \color{blue}{-1}\right)} \]
    13. Applied egg-rr59.6%

      \[\leadsto \color{blue}{\frac{x}{t \cdot \left(z \cdot -1\right)}} \]
    14. Step-by-step derivation
      1. *-commutative59.6%

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

        \[\leadsto \frac{x}{t \cdot \color{blue}{\left(-z\right)}} \]
      3. associate-/l/62.5%

        \[\leadsto \color{blue}{\frac{\frac{x}{-z}}{t}} \]
    15. Simplified62.5%

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

    if -9.5000000000000005e-77 < t < 27000

    1. Initial program 99.9%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 76.2%

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

    if 27000 < t

    1. Initial program 94.4%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 76.9%

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

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. distribute-neg-frac81.4%

        \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    5. Simplified81.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9.5 \cdot 10^{-77}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;t \leq 27000:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-x}{t}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 58.6% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -1.25 \cdot 10^{+36} \lor \neg \left(t \leq 2.8 \cdot 10^{+174}\right):\\ \;\;\;\;\frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (or (<= t -1.25e+36) (not (<= t 2.8e+174))) (/ x (* z t)) (/ x y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -1.25e+36) || !(t <= 2.8e+174)) {
		tmp = x / (z * t);
	} else {
		tmp = x / y;
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((t <= (-1.25d+36)) .or. (.not. (t <= 2.8d+174))) then
        tmp = x / (z * t)
    else
        tmp = x / y
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -1.25e+36) || !(t <= 2.8e+174)) {
		tmp = x / (z * t);
	} else {
		tmp = x / y;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if (t <= -1.25e+36) or not (t <= 2.8e+174):
		tmp = x / (z * t)
	else:
		tmp = x / y
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if ((t <= -1.25e+36) || !(t <= 2.8e+174))
		tmp = Float64(x / Float64(z * t));
	else
		tmp = Float64(x / y);
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((t <= -1.25e+36) || ~((t <= 2.8e+174)))
		tmp = x / (z * t);
	else
		tmp = x / y;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.25e+36], N[Not[LessEqual[t, 2.8e+174]], $MachinePrecision]], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{+36} \lor \neg \left(t \leq 2.8 \cdot 10^{+174}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.24999999999999994e36 or 2.7999999999999999e174 < t

    1. Initial program 90.5%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 68.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-neg68.1%

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. distribute-neg-frac76.9%

        \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    5. Simplified76.9%

      \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u68.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\frac{x}{t}}{z}\right)\right)} \]
      2. expm1-udef47.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\frac{x}{t}}{z}\right)} - 1} \]
      3. add-sqr-sqrt36.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{-\frac{x}{t}} \cdot \sqrt{-\frac{x}{t}}}}{z}\right)} - 1 \]
      4. sqrt-unprod43.4%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\left(-\frac{x}{t}\right) \cdot \left(-\frac{x}{t}\right)}}}{z}\right)} - 1 \]
      5. sqr-neg43.4%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\sqrt{\color{blue}{\frac{x}{t} \cdot \frac{x}{t}}}}{z}\right)} - 1 \]
      6. sqrt-unprod30.5%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\frac{x}{t}} \cdot \sqrt{\frac{x}{t}}}}{z}\right)} - 1 \]
      7. add-sqr-sqrt42.4%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{x}{t}}}{z}\right)} - 1 \]
    7. Applied egg-rr42.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{x}{t}}{z}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def40.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{x}{t}}{z}\right)\right)} \]
      2. expm1-log1p41.3%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. associate-/r*38.4%

        \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    9. Simplified38.4%

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

    if -1.24999999999999994e36 < t < 2.7999999999999999e174

    1. Initial program 99.9%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 64.5%

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

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

Alternative 8: 59.3% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -7.5 \cdot 10^{+35}:\\ \;\;\;\;\frac{x}{z \cdot t}\\ \mathbf{elif}\;t \leq 2.05 \cdot 10^{+175}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= t -7.5e+35)
   (/ x (* z t))
   (if (<= t 2.05e+175) (/ x y) (/ (/ x t) z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -7.5e+35) {
		tmp = x / (z * t);
	} else if (t <= 2.05e+175) {
		tmp = x / y;
	} else {
		tmp = (x / t) / z;
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-7.5d+35)) then
        tmp = x / (z * t)
    else if (t <= 2.05d+175) then
        tmp = x / y
    else
        tmp = (x / t) / z
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -7.5e+35) {
		tmp = x / (z * t);
	} else if (t <= 2.05e+175) {
		tmp = x / y;
	} else {
		tmp = (x / t) / z;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if t <= -7.5e+35:
		tmp = x / (z * t)
	elif t <= 2.05e+175:
		tmp = x / y
	else:
		tmp = (x / t) / z
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -7.5e+35)
		tmp = Float64(x / Float64(z * t));
	elseif (t <= 2.05e+175)
		tmp = Float64(x / y);
	else
		tmp = Float64(Float64(x / t) / z);
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -7.5e+35)
		tmp = x / (z * t);
	elseif (t <= 2.05e+175)
		tmp = x / y;
	else
		tmp = (x / t) / z;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[t, -7.5e+35], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.05e+175], N[(x / y), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{+35}:\\
\;\;\;\;\frac{x}{z \cdot t}\\

\mathbf{elif}\;t \leq 2.05 \cdot 10^{+175}:\\
\;\;\;\;\frac{x}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.4999999999999999e35

    1. Initial program 91.0%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 63.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-neg63.2%

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. distribute-neg-frac72.4%

        \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    5. Simplified72.4%

      \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u64.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\frac{x}{t}}{z}\right)\right)} \]
      2. expm1-udef42.5%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\frac{x}{t}}{z}\right)} - 1} \]
      3. add-sqr-sqrt29.7%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{-\frac{x}{t}} \cdot \sqrt{-\frac{x}{t}}}}{z}\right)} - 1 \]
      4. sqrt-unprod39.5%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\left(-\frac{x}{t}\right) \cdot \left(-\frac{x}{t}\right)}}}{z}\right)} - 1 \]
      5. sqr-neg39.5%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\sqrt{\color{blue}{\frac{x}{t} \cdot \frac{x}{t}}}}{z}\right)} - 1 \]
      6. sqrt-unprod27.6%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\frac{x}{t}} \cdot \sqrt{\frac{x}{t}}}}{z}\right)} - 1 \]
      7. add-sqr-sqrt37.8%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{x}{t}}}{z}\right)} - 1 \]
    7. Applied egg-rr37.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{x}{t}}{z}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def34.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{x}{t}}{z}\right)\right)} \]
      2. expm1-log1p36.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. associate-/r*33.1%

        \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    9. Simplified33.1%

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

    if -7.4999999999999999e35 < t < 2.04999999999999989e175

    1. Initial program 99.9%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 64.5%

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

    if 2.04999999999999989e175 < t

    1. Initial program 89.8%

      \[\frac{x}{y - z \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 75.9%

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

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. distribute-neg-frac84.1%

        \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    5. Simplified84.1%

      \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u75.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\frac{x}{t}}{z}\right)\right)} \]
      2. expm1-udef54.9%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\frac{x}{t}}{z}\right)} - 1} \]
      3. add-sqr-sqrt46.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{-\frac{x}{t}} \cdot \sqrt{-\frac{x}{t}}}}{z}\right)} - 1 \]
      4. sqrt-unprod49.8%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\left(-\frac{x}{t}\right) \cdot \left(-\frac{x}{t}\right)}}}{z}\right)} - 1 \]
      5. sqr-neg49.8%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\sqrt{\color{blue}{\frac{x}{t} \cdot \frac{x}{t}}}}{z}\right)} - 1 \]
      6. sqrt-unprod35.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\frac{x}{t}} \cdot \sqrt{\frac{x}{t}}}}{z}\right)} - 1 \]
      7. add-sqr-sqrt49.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{x}{t}}}{z}\right)} - 1 \]
    7. Applied egg-rr49.9%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{x}{t}}{z}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def49.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{x}{t}}{z}\right)\right)} \]
      2. expm1-log1p49.7%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. associate-/r*47.0%

        \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    9. Simplified47.0%

      \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt17.6%

        \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{t \cdot z} \]
      2. sqrt-unprod54.5%

        \[\leadsto \frac{\color{blue}{\sqrt{x \cdot x}}}{t \cdot z} \]
      3. sqr-neg54.5%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{t \cdot z} \]
      4. sqrt-unprod44.3%

        \[\leadsto \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{t \cdot z} \]
      5. add-sqr-sqrt75.9%

        \[\leadsto \frac{\color{blue}{-x}}{t \cdot z} \]
      6. neg-mul-175.9%

        \[\leadsto \frac{\color{blue}{-1 \cdot x}}{t \cdot z} \]
      7. times-frac75.3%

        \[\leadsto \color{blue}{\frac{-1}{t} \cdot \frac{x}{z}} \]
    11. Applied egg-rr75.3%

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{-1}{t}}{z}} \]
      3. frac-2neg84.1%

        \[\leadsto \frac{x \cdot \color{blue}{\frac{--1}{-t}}}{z} \]
      4. metadata-eval84.1%

        \[\leadsto \frac{x \cdot \frac{\color{blue}{1}}{-t}}{z} \]
      5. div-inv84.1%

        \[\leadsto \frac{\color{blue}{\frac{x}{-t}}}{z} \]
      6. add-sqr-sqrt0.0%

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

        \[\leadsto \frac{\frac{x}{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}}{z} \]
      8. sqr-neg50.3%

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

        \[\leadsto \frac{\frac{x}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}}{z} \]
      10. add-sqr-sqrt49.7%

        \[\leadsto \frac{\frac{x}{\color{blue}{t}}}{z} \]
    13. Applied egg-rr49.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.5 \cdot 10^{+35}:\\ \;\;\;\;\frac{x}{z \cdot t}\\ \mathbf{elif}\;t \leq 2.05 \cdot 10^{+175}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 54.1% accurate, 2.3× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \frac{x}{y} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t) :precision binary64 (/ x y))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	return x / y;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x / y
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	return x / y;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	return x / y
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	return Float64(x / y)
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
	tmp = x / y;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{x}{y}
\end{array}
Derivation
  1. Initial program 96.4%

    \[\frac{x}{y - z \cdot t} \]
  2. Add Preprocessing
  3. Taylor expanded in y around inf 53.1%

    \[\leadsto \color{blue}{\frac{x}{y}} \]
  4. Final simplification53.1%

    \[\leadsto \frac{x}{y} \]
  5. Add Preprocessing

Developer target: 96.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{1}{\frac{y}{x} - \frac{z}{x} \cdot t}\\
\mathbf{if}\;x < -1.618195973607049 \cdot 10^{+50}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x < 2.1378306434876444 \cdot 10^{+131}:\\
\;\;\;\;\frac{x}{y - z \cdot t}\\

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


\end{array}
\end{array}

Reproduce

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

  :herbie-target
  (if (< x -1.618195973607049e+50) (/ 1.0 (- (/ y x) (* (/ z x) t))) (if (< x 2.1378306434876444e+131) (/ x (- y (* z t))) (/ 1.0 (- (/ y x) (* (/ z x) t)))))

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