Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2

Percentage Accurate: 85.9% → 99.3%
Time: 10.6s
Alternatives: 12
Speedup: 0.8×

Specification

?
\[\begin{array}{l} \\ \frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
	return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
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) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
	return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t):
	return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t)
	return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z)))
end
function tmp = code(x, y, z, t)
	tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 85.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
	return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
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) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
	return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t):
	return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t)
	return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z)))
end
function tmp = code(x, y, z, t)
	tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}

Alternative 1: 99.3% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{x}{y} + \frac{2 + \left(2 \cdot z\right) \cdot \left(1 - t\right)}{z \cdot t} \leq \infty:\\ \;\;\;\;\frac{x}{y} + {\left(\frac{t}{\frac{\mathsf{fma}\left(2 \cdot z, 1 - t, 2\right)}{z}}\right)}^{-1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} + -2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (+ (/ x y) (/ (+ 2.0 (* (* 2.0 z) (- 1.0 t))) (* z t))) INFINITY)
   (+ (/ x y) (pow (/ t (/ (fma (* 2.0 z) (- 1.0 t) 2.0) z)) -1.0))
   (+ (/ x y) -2.0)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((x / y) + ((2.0 + ((2.0 * z) * (1.0 - t))) / (z * t))) <= ((double) INFINITY)) {
		tmp = (x / y) + pow((t / (fma((2.0 * z), (1.0 - t), 2.0) / z)), -1.0);
	} else {
		tmp = (x / y) + -2.0;
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(2.0 * z) * Float64(1.0 - t))) / Float64(z * t))) <= Inf)
		tmp = Float64(Float64(x / y) + (Float64(t / Float64(fma(Float64(2.0 * z), Float64(1.0 - t), 2.0) / z)) ^ -1.0));
	else
		tmp = Float64(Float64(x / y) + -2.0);
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(2.0 * z), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x / y), $MachinePrecision] + N[Power[N[(t / N[(N[(N[(2.0 * z), $MachinePrecision] * N[(1.0 - t), $MachinePrecision] + 2.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} + \frac{2 + \left(2 \cdot z\right) \cdot \left(1 - t\right)}{z \cdot t} \leq \infty:\\
\;\;\;\;\frac{x}{y} + {\left(\frac{t}{\frac{\mathsf{fma}\left(2 \cdot z, 1 - t, 2\right)}{z}}\right)}^{-1}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + -2\\


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

    1. Initial program 99.8%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto \frac{x}{y} + \color{blue}{\frac{1}{\frac{t \cdot z}{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}}} \]
      2. inv-pow99.8%

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

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

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

        \[\leadsto \frac{x}{y} + {\left(\frac{t}{\frac{\color{blue}{\mathsf{fma}\left(z \cdot 2, 1 - t, 2\right)}}{z}}\right)}^{-1} \]
      6. *-commutative99.9%

        \[\leadsto \frac{x}{y} + {\left(\frac{t}{\frac{\mathsf{fma}\left(\color{blue}{2 \cdot z}, 1 - t, 2\right)}{z}}\right)}^{-1} \]
    4. Applied egg-rr99.9%

      \[\leadsto \frac{x}{y} + \color{blue}{{\left(\frac{t}{\frac{\mathsf{fma}\left(2 \cdot z, 1 - t, 2\right)}{z}}\right)}^{-1}} \]

    if +inf.0 < (+.f64 (/.f64 x y) (/.f64 (+.f64 2 (*.f64 (*.f64 z 2) (-.f64 1 t))) (*.f64 t z)))

    1. Initial program 0.0%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 90.0%

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

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

Alternative 2: 99.3% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2 + \left(2 \cdot z\right) \cdot \left(1 - t\right)}{z \cdot t}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + -2\\


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

    1. Initial program 99.8%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing

    if +inf.0 < (+.f64 (/.f64 x y) (/.f64 (+.f64 2 (*.f64 (*.f64 z 2) (-.f64 1 t))) (*.f64 t z)))

    1. Initial program 0.0%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 90.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} + \frac{2 + \left(2 \cdot z\right) \cdot \left(1 - t\right)}{z \cdot t} \leq \infty:\\ \;\;\;\;\frac{x}{y} + \frac{2 + \left(2 \cdot z\right) \cdot \left(1 - t\right)}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} + -2\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 64.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} + -2\\ \mathbf{if}\;z \leq -1.7 \cdot 10^{+122}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{+81}:\\ \;\;\;\;2 \cdot \frac{1 - t}{t}\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-71}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{-85}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+198} \lor \neg \left(z \leq 1.5 \cdot 10^{+227}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ (/ x y) -2.0)))
   (if (<= z -1.7e+122)
     t_1
     (if (<= z -8.2e+81)
       (* 2.0 (/ (- 1.0 t) t))
       (if (<= z -1.95e-71)
         t_1
         (if (<= z 4.7e-85)
           (/ 2.0 (* z t))
           (if (or (<= z 2.8e+198) (not (<= z 1.5e+227))) t_1 (/ 2.0 t))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x / y) + -2.0;
	double tmp;
	if (z <= -1.7e+122) {
		tmp = t_1;
	} else if (z <= -8.2e+81) {
		tmp = 2.0 * ((1.0 - t) / t);
	} else if (z <= -1.95e-71) {
		tmp = t_1;
	} else if (z <= 4.7e-85) {
		tmp = 2.0 / (z * t);
	} else if ((z <= 2.8e+198) || !(z <= 1.5e+227)) {
		tmp = t_1;
	} else {
		tmp = 2.0 / t;
	}
	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 = (x / y) + (-2.0d0)
    if (z <= (-1.7d+122)) then
        tmp = t_1
    else if (z <= (-8.2d+81)) then
        tmp = 2.0d0 * ((1.0d0 - t) / t)
    else if (z <= (-1.95d-71)) then
        tmp = t_1
    else if (z <= 4.7d-85) then
        tmp = 2.0d0 / (z * t)
    else if ((z <= 2.8d+198) .or. (.not. (z <= 1.5d+227))) then
        tmp = t_1
    else
        tmp = 2.0d0 / t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / y) + -2.0;
	double tmp;
	if (z <= -1.7e+122) {
		tmp = t_1;
	} else if (z <= -8.2e+81) {
		tmp = 2.0 * ((1.0 - t) / t);
	} else if (z <= -1.95e-71) {
		tmp = t_1;
	} else if (z <= 4.7e-85) {
		tmp = 2.0 / (z * t);
	} else if ((z <= 2.8e+198) || !(z <= 1.5e+227)) {
		tmp = t_1;
	} else {
		tmp = 2.0 / t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x / y) + -2.0
	tmp = 0
	if z <= -1.7e+122:
		tmp = t_1
	elif z <= -8.2e+81:
		tmp = 2.0 * ((1.0 - t) / t)
	elif z <= -1.95e-71:
		tmp = t_1
	elif z <= 4.7e-85:
		tmp = 2.0 / (z * t)
	elif (z <= 2.8e+198) or not (z <= 1.5e+227):
		tmp = t_1
	else:
		tmp = 2.0 / t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x / y) + -2.0)
	tmp = 0.0
	if (z <= -1.7e+122)
		tmp = t_1;
	elseif (z <= -8.2e+81)
		tmp = Float64(2.0 * Float64(Float64(1.0 - t) / t));
	elseif (z <= -1.95e-71)
		tmp = t_1;
	elseif (z <= 4.7e-85)
		tmp = Float64(2.0 / Float64(z * t));
	elseif ((z <= 2.8e+198) || !(z <= 1.5e+227))
		tmp = t_1;
	else
		tmp = Float64(2.0 / t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x / y) + -2.0;
	tmp = 0.0;
	if (z <= -1.7e+122)
		tmp = t_1;
	elseif (z <= -8.2e+81)
		tmp = 2.0 * ((1.0 - t) / t);
	elseif (z <= -1.95e-71)
		tmp = t_1;
	elseif (z <= 4.7e-85)
		tmp = 2.0 / (z * t);
	elseif ((z <= 2.8e+198) || ~((z <= 1.5e+227)))
		tmp = t_1;
	else
		tmp = 2.0 / t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[z, -1.7e+122], t$95$1, If[LessEqual[z, -8.2e+81], N[(2.0 * N[(N[(1.0 - t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.95e-71], t$95$1, If[LessEqual[z, 4.7e-85], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 2.8e+198], N[Not[LessEqual[z, 1.5e+227]], $MachinePrecision]], t$95$1, N[(2.0 / t), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+122}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -8.2 \cdot 10^{+81}:\\
\;\;\;\;2 \cdot \frac{1 - t}{t}\\

\mathbf{elif}\;z \leq -1.95 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 4.7 \cdot 10^{-85}:\\
\;\;\;\;\frac{2}{z \cdot t}\\

\mathbf{elif}\;z \leq 2.8 \cdot 10^{+198} \lor \neg \left(z \leq 1.5 \cdot 10^{+227}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.7e122 or -8.20000000000000024e81 < z < -1.9500000000000001e-71 or 4.70000000000000009e-85 < z < 2.8e198 or 1.49999999999999993e227 < z

    1. Initial program 78.0%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 73.0%

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

    if -1.7e122 < z < -8.20000000000000024e81

    1. Initial program 88.5%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Step-by-step derivation
      1. +-commutative88.5%

        \[\leadsto \color{blue}{\frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} + \frac{x}{y}} \]
      2. remove-double-neg88.5%

        \[\leadsto \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} + \color{blue}{\left(-\left(-\frac{x}{y}\right)\right)} \]
      3. distribute-frac-neg88.5%

        \[\leadsto \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} + \left(-\color{blue}{\frac{-x}{y}}\right) \]
      4. unsub-neg88.5%

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

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

        \[\leadsto \frac{2 + \color{blue}{\left(\left(1 - t\right) \cdot z\right) \cdot 2}}{t \cdot z} - \frac{-x}{y} \]
      7. distribute-rgt1-in88.5%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(1 - t\right) \cdot z + 1}{1}, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
      11. /-rgt-identity88.5%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 - t\right) \cdot z + 1}, \frac{2}{t \cdot z}, -\frac{-x}{y}\right) \]
      12. *-commutative88.5%

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot \left(1 - t\right)} + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right) \]
      13. fma-def88.5%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 1 - t, 1\right)}, \frac{2}{t \cdot z}, -\frac{-x}{y}\right) \]
      14. *-commutative88.5%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{\color{blue}{z \cdot t}}, -\frac{-x}{y}\right) \]
      15. distribute-frac-neg88.5%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      16. remove-double-neg88.5%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 77.6%

      \[\leadsto \color{blue}{2 \cdot \frac{1 + z \cdot \left(1 - t\right)}{t \cdot z}} \]
    6. Taylor expanded in z around inf 89.0%

      \[\leadsto 2 \cdot \color{blue}{\frac{1 - t}{t}} \]

    if -1.9500000000000001e-71 < z < 4.70000000000000009e-85

    1. Initial program 94.2%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num94.2%

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

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

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

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

        \[\leadsto \frac{x}{y} + {\left(\frac{t}{\frac{\color{blue}{\mathsf{fma}\left(z \cdot 2, 1 - t, 2\right)}}{z}}\right)}^{-1} \]
      6. *-commutative94.2%

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

      \[\leadsto \frac{x}{y} + \color{blue}{{\left(\frac{t}{\frac{\mathsf{fma}\left(2 \cdot z, 1 - t, 2\right)}{z}}\right)}^{-1}} \]
    5. Taylor expanded in z around 0 75.1%

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

        \[\leadsto \frac{2}{\color{blue}{z \cdot t}} \]
    7. Simplified75.1%

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

    if 2.8e198 < z < 1.49999999999999993e227

    1. Initial program 85.3%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 85.9%

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

        \[\leadsto \frac{2 + \color{blue}{\frac{2 \cdot 1}{z}}}{t} \]
      2. metadata-eval85.9%

        \[\leadsto \frac{2 + \frac{\color{blue}{2}}{z}}{t} \]
    5. Simplified85.9%

      \[\leadsto \color{blue}{\frac{2 + \frac{2}{z}}{t}} \]
    6. Taylor expanded in z around inf 85.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+122}:\\ \;\;\;\;\frac{x}{y} + -2\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{+81}:\\ \;\;\;\;2 \cdot \frac{1 - t}{t}\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-71}:\\ \;\;\;\;\frac{x}{y} + -2\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{-85}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+198} \lor \neg \left(z \leq 1.5 \cdot 10^{+227}\right):\\ \;\;\;\;\frac{x}{y} + -2\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 82.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} + \frac{\frac{2}{t}}{z}\\ t_2 := \frac{x}{y} + -2\\ \mathbf{if}\;t \leq -4.9 \cdot 10^{+66}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -2.5 \cdot 10^{-64}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-24}:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \mathbf{elif}\;t \leq 8 \cdot 10^{+114}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ (/ x y) (/ (/ 2.0 t) z))) (t_2 (+ (/ x y) -2.0)))
   (if (<= t -4.9e+66)
     t_2
     (if (<= t -2.5e-64)
       t_1
       (if (<= t 4e-24) (/ (+ 2.0 (/ 2.0 z)) t) (if (<= t 8e+114) t_1 t_2))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x / y) + ((2.0 / t) / z);
	double t_2 = (x / y) + -2.0;
	double tmp;
	if (t <= -4.9e+66) {
		tmp = t_2;
	} else if (t <= -2.5e-64) {
		tmp = t_1;
	} else if (t <= 4e-24) {
		tmp = (2.0 + (2.0 / z)) / t;
	} else if (t <= 8e+114) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = (x / y) + ((2.0d0 / t) / z)
    t_2 = (x / y) + (-2.0d0)
    if (t <= (-4.9d+66)) then
        tmp = t_2
    else if (t <= (-2.5d-64)) then
        tmp = t_1
    else if (t <= 4d-24) then
        tmp = (2.0d0 + (2.0d0 / z)) / t
    else if (t <= 8d+114) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / y) + ((2.0 / t) / z);
	double t_2 = (x / y) + -2.0;
	double tmp;
	if (t <= -4.9e+66) {
		tmp = t_2;
	} else if (t <= -2.5e-64) {
		tmp = t_1;
	} else if (t <= 4e-24) {
		tmp = (2.0 + (2.0 / z)) / t;
	} else if (t <= 8e+114) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x / y) + ((2.0 / t) / z)
	t_2 = (x / y) + -2.0
	tmp = 0
	if t <= -4.9e+66:
		tmp = t_2
	elif t <= -2.5e-64:
		tmp = t_1
	elif t <= 4e-24:
		tmp = (2.0 + (2.0 / z)) / t
	elif t <= 8e+114:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z))
	t_2 = Float64(Float64(x / y) + -2.0)
	tmp = 0.0
	if (t <= -4.9e+66)
		tmp = t_2;
	elseif (t <= -2.5e-64)
		tmp = t_1;
	elseif (t <= 4e-24)
		tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t);
	elseif (t <= 8e+114)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x / y) + ((2.0 / t) / z);
	t_2 = (x / y) + -2.0;
	tmp = 0.0;
	if (t <= -4.9e+66)
		tmp = t_2;
	elseif (t <= -2.5e-64)
		tmp = t_1;
	elseif (t <= 4e-24)
		tmp = (2.0 + (2.0 / z)) / t;
	elseif (t <= 8e+114)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[t, -4.9e+66], t$95$2, If[LessEqual[t, -2.5e-64], t$95$1, If[LessEqual[t, 4e-24], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 8e+114], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{\frac{2}{t}}{z}\\
t_2 := \frac{x}{y} + -2\\
\mathbf{if}\;t \leq -4.9 \cdot 10^{+66}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq -2.5 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 4 \cdot 10^{-24}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\

\mathbf{elif}\;t \leq 8 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.89999999999999975e66 or 8e114 < t

    1. Initial program 62.2%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 92.8%

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

    if -4.89999999999999975e66 < t < -2.50000000000000017e-64 or 3.99999999999999969e-24 < t < 8e114

    1. Initial program 98.2%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 82.1%

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

        \[\leadsto \frac{x}{y} + \color{blue}{\frac{\frac{2}{t}}{z}} \]
    5. Simplified82.0%

      \[\leadsto \frac{x}{y} + \color{blue}{\frac{\frac{2}{t}}{z}} \]

    if -2.50000000000000017e-64 < t < 3.99999999999999969e-24

    1. Initial program 94.9%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 84.0%

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

        \[\leadsto \frac{2 + \color{blue}{\frac{2 \cdot 1}{z}}}{t} \]
      2. metadata-eval84.0%

        \[\leadsto \frac{2 + \frac{\color{blue}{2}}{z}}{t} \]
    5. Simplified84.0%

      \[\leadsto \color{blue}{\frac{2 + \frac{2}{z}}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification86.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.9 \cdot 10^{+66}:\\ \;\;\;\;\frac{x}{y} + -2\\ \mathbf{elif}\;t \leq -2.5 \cdot 10^{-64}:\\ \;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-24}:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \mathbf{elif}\;t \leq 8 \cdot 10^{+114}:\\ \;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} + -2\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 79.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} + -2\\ \mathbf{if}\;t \leq -2.7 \cdot 10^{+63}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -50000000000000:\\ \;\;\;\;2 \cdot \left(-1 + \frac{1}{z \cdot t}\right)\\ \mathbf{elif}\;t \leq -11.2:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-21}:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ (/ x y) -2.0)))
   (if (<= t -2.7e+63)
     t_1
     (if (<= t -50000000000000.0)
       (* 2.0 (+ -1.0 (/ 1.0 (* z t))))
       (if (<= t -11.2)
         (/ x y)
         (if (<= t 4.2e-21) (/ (+ 2.0 (/ 2.0 z)) t) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x / y) + -2.0;
	double tmp;
	if (t <= -2.7e+63) {
		tmp = t_1;
	} else if (t <= -50000000000000.0) {
		tmp = 2.0 * (-1.0 + (1.0 / (z * t)));
	} else if (t <= -11.2) {
		tmp = x / y;
	} else if (t <= 4.2e-21) {
		tmp = (2.0 + (2.0 / 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 = (x / y) + (-2.0d0)
    if (t <= (-2.7d+63)) then
        tmp = t_1
    else if (t <= (-50000000000000.0d0)) then
        tmp = 2.0d0 * ((-1.0d0) + (1.0d0 / (z * t)))
    else if (t <= (-11.2d0)) then
        tmp = x / y
    else if (t <= 4.2d-21) then
        tmp = (2.0d0 + (2.0d0 / 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 = (x / y) + -2.0;
	double tmp;
	if (t <= -2.7e+63) {
		tmp = t_1;
	} else if (t <= -50000000000000.0) {
		tmp = 2.0 * (-1.0 + (1.0 / (z * t)));
	} else if (t <= -11.2) {
		tmp = x / y;
	} else if (t <= 4.2e-21) {
		tmp = (2.0 + (2.0 / z)) / t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x / y) + -2.0
	tmp = 0
	if t <= -2.7e+63:
		tmp = t_1
	elif t <= -50000000000000.0:
		tmp = 2.0 * (-1.0 + (1.0 / (z * t)))
	elif t <= -11.2:
		tmp = x / y
	elif t <= 4.2e-21:
		tmp = (2.0 + (2.0 / z)) / t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x / y) + -2.0)
	tmp = 0.0
	if (t <= -2.7e+63)
		tmp = t_1;
	elseif (t <= -50000000000000.0)
		tmp = Float64(2.0 * Float64(-1.0 + Float64(1.0 / Float64(z * t))));
	elseif (t <= -11.2)
		tmp = Float64(x / y);
	elseif (t <= 4.2e-21)
		tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x / y) + -2.0;
	tmp = 0.0;
	if (t <= -2.7e+63)
		tmp = t_1;
	elseif (t <= -50000000000000.0)
		tmp = 2.0 * (-1.0 + (1.0 / (z * t)));
	elseif (t <= -11.2)
		tmp = x / y;
	elseif (t <= 4.2e-21)
		tmp = (2.0 + (2.0 / z)) / t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[t, -2.7e+63], t$95$1, If[LessEqual[t, -50000000000000.0], N[(2.0 * N[(-1.0 + N[(1.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -11.2], N[(x / y), $MachinePrecision], If[LessEqual[t, 4.2e-21], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;t \leq -2.7 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -50000000000000:\\
\;\;\;\;2 \cdot \left(-1 + \frac{1}{z \cdot t}\right)\\

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

\mathbf{elif}\;t \leq 4.2 \cdot 10^{-21}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.70000000000000017e63 or 4.20000000000000025e-21 < t

    1. Initial program 72.2%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 86.8%

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

    if -2.70000000000000017e63 < t < -5e13

    1. Initial program 99.8%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Step-by-step derivation
      1. +-commutative99.8%

        \[\leadsto \color{blue}{\frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} + \frac{x}{y}} \]
      2. remove-double-neg99.8%

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

        \[\leadsto \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} + \left(-\color{blue}{\frac{-x}{y}}\right) \]
      4. unsub-neg99.8%

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

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

        \[\leadsto \frac{2 + \color{blue}{\left(\left(1 - t\right) \cdot z\right) \cdot 2}}{t \cdot z} - \frac{-x}{y} \]
      7. distribute-rgt1-in99.8%

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

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

        \[\leadsto \color{blue}{\frac{\left(1 - t\right) \cdot z + 1}{1}} \cdot \frac{2}{t \cdot z} - \frac{-x}{y} \]
      10. fma-neg99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(1 - t\right) \cdot z + 1}{1}, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
      11. /-rgt-identity99.8%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 - t\right) \cdot z + 1}, \frac{2}{t \cdot z}, -\frac{-x}{y}\right) \]
      12. *-commutative99.8%

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot \left(1 - t\right)} + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right) \]
      13. fma-def99.8%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 1 - t, 1\right)}, \frac{2}{t \cdot z}, -\frac{-x}{y}\right) \]
      14. *-commutative99.8%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{\color{blue}{z \cdot t}}, -\frac{-x}{y}\right) \]
      15. distribute-frac-neg99.8%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      16. remove-double-neg99.8%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 99.8%

      \[\leadsto \color{blue}{2 \cdot \frac{1 + z \cdot \left(1 - t\right)}{t \cdot z}} \]
    6. Taylor expanded in t around inf 99.8%

      \[\leadsto 2 \cdot \frac{1 + \color{blue}{-1 \cdot \left(t \cdot z\right)}}{t \cdot z} \]
    7. Step-by-step derivation
      1. associate-*r*99.8%

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

        \[\leadsto 2 \cdot \frac{1 + \color{blue}{\left(-t\right)} \cdot z}{t \cdot z} \]
      3. *-commutative99.8%

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

      \[\leadsto 2 \cdot \frac{1 + \color{blue}{z \cdot \left(-t\right)}}{t \cdot z} \]
    9. Taylor expanded in z around 0 99.8%

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

    if -5e13 < t < -11.199999999999999

    1. Initial program 100.0%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 100.0%

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

    if -11.199999999999999 < t < 4.20000000000000025e-21

    1. Initial program 95.5%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 81.6%

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

        \[\leadsto \frac{2 + \color{blue}{\frac{2 \cdot 1}{z}}}{t} \]
      2. metadata-eval81.6%

        \[\leadsto \frac{2 + \frac{\color{blue}{2}}{z}}{t} \]
    5. Simplified81.6%

      \[\leadsto \color{blue}{\frac{2 + \frac{2}{z}}{t}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification84.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.7 \cdot 10^{+63}:\\ \;\;\;\;\frac{x}{y} + -2\\ \mathbf{elif}\;t \leq -50000000000000:\\ \;\;\;\;2 \cdot \left(-1 + \frac{1}{z \cdot t}\right)\\ \mathbf{elif}\;t \leq -11.2:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-21}:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} + -2\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 64.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} + -2\\ \mathbf{if}\;z \leq -4.1 \cdot 10^{-71}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-87}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+198} \lor \neg \left(z \leq 9.5 \cdot 10^{+226}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ (/ x y) -2.0)))
   (if (<= z -4.1e-71)
     t_1
     (if (<= z 3.2e-87)
       (/ 2.0 (* z t))
       (if (or (<= z 3.9e+198) (not (<= z 9.5e+226))) t_1 (/ 2.0 t))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x / y) + -2.0;
	double tmp;
	if (z <= -4.1e-71) {
		tmp = t_1;
	} else if (z <= 3.2e-87) {
		tmp = 2.0 / (z * t);
	} else if ((z <= 3.9e+198) || !(z <= 9.5e+226)) {
		tmp = t_1;
	} else {
		tmp = 2.0 / t;
	}
	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 = (x / y) + (-2.0d0)
    if (z <= (-4.1d-71)) then
        tmp = t_1
    else if (z <= 3.2d-87) then
        tmp = 2.0d0 / (z * t)
    else if ((z <= 3.9d+198) .or. (.not. (z <= 9.5d+226))) then
        tmp = t_1
    else
        tmp = 2.0d0 / t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / y) + -2.0;
	double tmp;
	if (z <= -4.1e-71) {
		tmp = t_1;
	} else if (z <= 3.2e-87) {
		tmp = 2.0 / (z * t);
	} else if ((z <= 3.9e+198) || !(z <= 9.5e+226)) {
		tmp = t_1;
	} else {
		tmp = 2.0 / t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x / y) + -2.0
	tmp = 0
	if z <= -4.1e-71:
		tmp = t_1
	elif z <= 3.2e-87:
		tmp = 2.0 / (z * t)
	elif (z <= 3.9e+198) or not (z <= 9.5e+226):
		tmp = t_1
	else:
		tmp = 2.0 / t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x / y) + -2.0)
	tmp = 0.0
	if (z <= -4.1e-71)
		tmp = t_1;
	elseif (z <= 3.2e-87)
		tmp = Float64(2.0 / Float64(z * t));
	elseif ((z <= 3.9e+198) || !(z <= 9.5e+226))
		tmp = t_1;
	else
		tmp = Float64(2.0 / t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x / y) + -2.0;
	tmp = 0.0;
	if (z <= -4.1e-71)
		tmp = t_1;
	elseif (z <= 3.2e-87)
		tmp = 2.0 / (z * t);
	elseif ((z <= 3.9e+198) || ~((z <= 9.5e+226)))
		tmp = t_1;
	else
		tmp = 2.0 / t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[z, -4.1e-71], t$95$1, If[LessEqual[z, 3.2e-87], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 3.9e+198], N[Not[LessEqual[z, 9.5e+226]], $MachinePrecision]], t$95$1, N[(2.0 / t), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.2 \cdot 10^{-87}:\\
\;\;\;\;\frac{2}{z \cdot t}\\

\mathbf{elif}\;z \leq 3.9 \cdot 10^{+198} \lor \neg \left(z \leq 9.5 \cdot 10^{+226}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.09999999999999993e-71 or 3.19999999999999979e-87 < z < 3.9e198 or 9.50000000000000088e226 < z

    1. Initial program 78.6%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 70.9%

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

    if -4.09999999999999993e-71 < z < 3.19999999999999979e-87

    1. Initial program 94.2%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num94.2%

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

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

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

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

        \[\leadsto \frac{x}{y} + {\left(\frac{t}{\frac{\color{blue}{\mathsf{fma}\left(z \cdot 2, 1 - t, 2\right)}}{z}}\right)}^{-1} \]
      6. *-commutative94.2%

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

      \[\leadsto \frac{x}{y} + \color{blue}{{\left(\frac{t}{\frac{\mathsf{fma}\left(2 \cdot z, 1 - t, 2\right)}{z}}\right)}^{-1}} \]
    5. Taylor expanded in z around 0 75.1%

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

        \[\leadsto \frac{2}{\color{blue}{z \cdot t}} \]
    7. Simplified75.1%

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

    if 3.9e198 < z < 9.50000000000000088e226

    1. Initial program 85.3%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 85.9%

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

        \[\leadsto \frac{2 + \color{blue}{\frac{2 \cdot 1}{z}}}{t} \]
      2. metadata-eval85.9%

        \[\leadsto \frac{2 + \frac{\color{blue}{2}}{z}}{t} \]
    5. Simplified85.9%

      \[\leadsto \color{blue}{\frac{2 + \frac{2}{z}}{t}} \]
    6. Taylor expanded in z around inf 85.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{-71}:\\ \;\;\;\;\frac{x}{y} + -2\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-87}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+198} \lor \neg \left(z \leq 9.5 \cdot 10^{+226}\right):\\ \;\;\;\;\frac{x}{y} + -2\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 91.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{-23} \lor \neg \left(z \leq 4.9 \cdot 10^{-8}\right):\\ \;\;\;\;\frac{x}{y} + \frac{2 \cdot \left(1 - t\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -4.5e-23) (not (<= z 4.9e-8)))
   (+ (/ x y) (/ (* 2.0 (- 1.0 t)) t))
   (+ (/ x y) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -4.5e-23) || !(z <= 4.9e-8)) {
		tmp = (x / y) + ((2.0 * (1.0 - t)) / t);
	} else {
		tmp = (x / y) + ((2.0 / t) / z);
	}
	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) :: tmp
    if ((z <= (-4.5d-23)) .or. (.not. (z <= 4.9d-8))) then
        tmp = (x / y) + ((2.0d0 * (1.0d0 - t)) / t)
    else
        tmp = (x / y) + ((2.0d0 / t) / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -4.5e-23) || !(z <= 4.9e-8)) {
		tmp = (x / y) + ((2.0 * (1.0 - t)) / t);
	} else {
		tmp = (x / y) + ((2.0 / t) / z);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -4.5e-23) or not (z <= 4.9e-8):
		tmp = (x / y) + ((2.0 * (1.0 - t)) / t)
	else:
		tmp = (x / y) + ((2.0 / t) / z)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -4.5e-23) || !(z <= 4.9e-8))
		tmp = Float64(Float64(x / y) + Float64(Float64(2.0 * Float64(1.0 - t)) / t));
	else
		tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -4.5e-23) || ~((z <= 4.9e-8)))
		tmp = (x / y) + ((2.0 * (1.0 - t)) / t);
	else
		tmp = (x / y) + ((2.0 / t) / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.5e-23], N[Not[LessEqual[z, 4.9e-8]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 * N[(1.0 - t), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-23} \lor \neg \left(z \leq 4.9 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2 \cdot \left(1 - t\right)}{t}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.49999999999999975e-23 or 4.9000000000000002e-8 < z

    1. Initial program 73.1%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 98.5%

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

        \[\leadsto \frac{x}{y} + \color{blue}{\frac{2 \cdot \left(1 - t\right)}{t}} \]
    5. Simplified98.5%

      \[\leadsto \frac{x}{y} + \color{blue}{\frac{2 \cdot \left(1 - t\right)}{t}} \]

    if -4.49999999999999975e-23 < z < 4.9000000000000002e-8

    1. Initial program 95.8%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 84.6%

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

        \[\leadsto \frac{x}{y} + \color{blue}{\frac{\frac{2}{t}}{z}} \]
    5. Simplified84.6%

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

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

Alternative 8: 51.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -4.9 \cdot 10^{-23} \lor \neg \left(\frac{x}{y} \leq 2\right):\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;-2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= (/ x y) -4.9e-23) (not (<= (/ x y) 2.0))) (/ x y) -2.0))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((x / y) <= -4.9e-23) || !((x / y) <= 2.0)) {
		tmp = x / y;
	} else {
		tmp = -2.0;
	}
	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) :: tmp
    if (((x / y) <= (-4.9d-23)) .or. (.not. ((x / y) <= 2.0d0))) then
        tmp = x / y
    else
        tmp = -2.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (((x / y) <= -4.9e-23) || !((x / y) <= 2.0)) {
		tmp = x / y;
	} else {
		tmp = -2.0;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((x / y) <= -4.9e-23) or not ((x / y) <= 2.0):
		tmp = x / y
	else:
		tmp = -2.0
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((Float64(x / y) <= -4.9e-23) || !(Float64(x / y) <= 2.0))
		tmp = Float64(x / y);
	else
		tmp = -2.0;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (((x / y) <= -4.9e-23) || ~(((x / y) <= 2.0)))
		tmp = x / y;
	else
		tmp = -2.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -4.9e-23], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], -2.0]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -4.9 \cdot 10^{-23} \lor \neg \left(\frac{x}{y} \leq 2\right):\\
\;\;\;\;\frac{x}{y}\\

\mathbf{else}:\\
\;\;\;\;-2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x y) < -4.8999999999999998e-23 or 2 < (/.f64 x y)

    1. Initial program 81.4%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 68.0%

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

    if -4.8999999999999998e-23 < (/.f64 x y) < 2

    1. Initial program 87.4%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Step-by-step derivation
      1. +-commutative87.4%

        \[\leadsto \color{blue}{\frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} + \frac{x}{y}} \]
      2. remove-double-neg87.4%

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

        \[\leadsto \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} + \left(-\color{blue}{\frac{-x}{y}}\right) \]
      4. unsub-neg87.4%

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

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

        \[\leadsto \frac{2 + \color{blue}{\left(\left(1 - t\right) \cdot z\right) \cdot 2}}{t \cdot z} - \frac{-x}{y} \]
      7. distribute-rgt1-in87.4%

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

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

        \[\leadsto \color{blue}{\frac{\left(1 - t\right) \cdot z + 1}{1}} \cdot \frac{2}{t \cdot z} - \frac{-x}{y} \]
      10. fma-neg87.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(1 - t\right) \cdot z + 1}{1}, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
      11. /-rgt-identity87.3%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 - t\right) \cdot z + 1}, \frac{2}{t \cdot z}, -\frac{-x}{y}\right) \]
      12. *-commutative87.3%

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot \left(1 - t\right)} + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right) \]
      13. fma-def87.3%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 1 - t, 1\right)}, \frac{2}{t \cdot z}, -\frac{-x}{y}\right) \]
      14. *-commutative87.3%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{\color{blue}{z \cdot t}}, -\frac{-x}{y}\right) \]
      15. distribute-frac-neg87.3%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      16. remove-double-neg87.3%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 87.4%

      \[\leadsto \color{blue}{2 \cdot \frac{1 + z \cdot \left(1 - t\right)}{t \cdot z}} \]
    6. Taylor expanded in t around inf 39.6%

      \[\leadsto 2 \cdot \color{blue}{-1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.6%

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

Alternative 9: 80.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -10 \lor \neg \left(t \leq 4.5 \cdot 10^{-20}\right):\\ \;\;\;\;\frac{x}{y} + -2\\ \mathbf{else}:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= t -10.0) (not (<= t 4.5e-20)))
   (+ (/ x y) -2.0)
   (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -10.0) || !(t <= 4.5e-20)) {
		tmp = (x / y) + -2.0;
	} else {
		tmp = (2.0 + (2.0 / z)) / t;
	}
	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) :: tmp
    if ((t <= (-10.0d0)) .or. (.not. (t <= 4.5d-20))) then
        tmp = (x / y) + (-2.0d0)
    else
        tmp = (2.0d0 + (2.0d0 / z)) / t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -10.0) || !(t <= 4.5e-20)) {
		tmp = (x / y) + -2.0;
	} else {
		tmp = (2.0 + (2.0 / z)) / t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (t <= -10.0) or not (t <= 4.5e-20):
		tmp = (x / y) + -2.0
	else:
		tmp = (2.0 + (2.0 / z)) / t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((t <= -10.0) || !(t <= 4.5e-20))
		tmp = Float64(Float64(x / y) + -2.0);
	else
		tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((t <= -10.0) || ~((t <= 4.5e-20)))
		tmp = (x / y) + -2.0;
	else
		tmp = (2.0 + (2.0 / z)) / t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -10.0], N[Not[LessEqual[t, 4.5e-20]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -10 or 4.5000000000000001e-20 < t

    1. Initial program 74.2%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 84.3%

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

    if -10 < t < 4.5000000000000001e-20

    1. Initial program 95.5%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 81.6%

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

        \[\leadsto \frac{2 + \color{blue}{\frac{2 \cdot 1}{z}}}{t} \]
      2. metadata-eval81.6%

        \[\leadsto \frac{2 + \frac{\color{blue}{2}}{z}}{t} \]
    5. Simplified81.6%

      \[\leadsto \color{blue}{\frac{2 + \frac{2}{z}}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification83.0%

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

Alternative 10: 59.5% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.14 \cdot 10^{-66} \lor \neg \left(t \leq 1.12 \cdot 10^{-23}\right):\\ \;\;\;\;\frac{x}{y} + -2\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= t -1.14e-66) (not (<= t 1.12e-23))) (+ (/ x y) -2.0) (/ 2.0 t)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -1.14e-66) || !(t <= 1.12e-23)) {
		tmp = (x / y) + -2.0;
	} else {
		tmp = 2.0 / t;
	}
	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) :: tmp
    if ((t <= (-1.14d-66)) .or. (.not. (t <= 1.12d-23))) then
        tmp = (x / y) + (-2.0d0)
    else
        tmp = 2.0d0 / t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -1.14e-66) || !(t <= 1.12e-23)) {
		tmp = (x / y) + -2.0;
	} else {
		tmp = 2.0 / t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (t <= -1.14e-66) or not (t <= 1.12e-23):
		tmp = (x / y) + -2.0
	else:
		tmp = 2.0 / t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((t <= -1.14e-66) || !(t <= 1.12e-23))
		tmp = Float64(Float64(x / y) + -2.0);
	else
		tmp = Float64(2.0 / t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((t <= -1.14e-66) || ~((t <= 1.12e-23)))
		tmp = (x / y) + -2.0;
	else
		tmp = 2.0 / t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.14e-66], N[Not[LessEqual[t, 1.12e-23]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision], N[(2.0 / t), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.14 \cdot 10^{-66} \lor \neg \left(t \leq 1.12 \cdot 10^{-23}\right):\\
\;\;\;\;\frac{x}{y} + -2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.14e-66 or 1.1200000000000001e-23 < t

    1. Initial program 76.9%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 78.9%

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

    if -1.14e-66 < t < 1.1200000000000001e-23

    1. Initial program 94.9%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 84.0%

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

        \[\leadsto \frac{2 + \color{blue}{\frac{2 \cdot 1}{z}}}{t} \]
      2. metadata-eval84.0%

        \[\leadsto \frac{2 + \frac{\color{blue}{2}}{z}}{t} \]
    5. Simplified84.0%

      \[\leadsto \color{blue}{\frac{2 + \frac{2}{z}}{t}} \]
    6. Taylor expanded in z around inf 36.4%

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

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

Alternative 11: 35.6% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1:\\
\;\;\;\;-2\\

\mathbf{elif}\;t \leq 4.5 \cdot 10^{-20}:\\
\;\;\;\;\frac{2}{t}\\

\mathbf{else}:\\
\;\;\;\;-2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1 or 4.5000000000000001e-20 < t

    1. Initial program 74.4%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Step-by-step derivation
      1. +-commutative74.4%

        \[\leadsto \color{blue}{\frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} + \frac{x}{y}} \]
      2. remove-double-neg74.4%

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

        \[\leadsto \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} + \left(-\color{blue}{\frac{-x}{y}}\right) \]
      4. unsub-neg74.4%

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

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

        \[\leadsto \frac{2 + \color{blue}{\left(\left(1 - t\right) \cdot z\right) \cdot 2}}{t \cdot z} - \frac{-x}{y} \]
      7. distribute-rgt1-in74.4%

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

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

        \[\leadsto \color{blue}{\frac{\left(1 - t\right) \cdot z + 1}{1}} \cdot \frac{2}{t \cdot z} - \frac{-x}{y} \]
      10. fma-neg74.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(1 - t\right) \cdot z + 1}{1}, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
      11. /-rgt-identity74.3%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 - t\right) \cdot z + 1}, \frac{2}{t \cdot z}, -\frac{-x}{y}\right) \]
      12. *-commutative74.3%

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot \left(1 - t\right)} + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right) \]
      13. fma-def74.3%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 1 - t, 1\right)}, \frac{2}{t \cdot z}, -\frac{-x}{y}\right) \]
      14. *-commutative74.3%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{\color{blue}{z \cdot t}}, -\frac{-x}{y}\right) \]
      15. distribute-frac-neg74.3%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      16. remove-double-neg74.3%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 40.3%

      \[\leadsto \color{blue}{2 \cdot \frac{1 + z \cdot \left(1 - t\right)}{t \cdot z}} \]
    6. Taylor expanded in t around inf 35.4%

      \[\leadsto 2 \cdot \color{blue}{-1} \]

    if -1 < t < 4.5000000000000001e-20

    1. Initial program 95.5%

      \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 81.5%

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

        \[\leadsto \frac{2 + \color{blue}{\frac{2 \cdot 1}{z}}}{t} \]
      2. metadata-eval81.5%

        \[\leadsto \frac{2 + \frac{\color{blue}{2}}{z}}{t} \]
    5. Simplified81.5%

      \[\leadsto \color{blue}{\frac{2 + \frac{2}{z}}{t}} \]
    6. Taylor expanded in z around inf 34.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1:\\ \;\;\;\;-2\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-20}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{else}:\\ \;\;\;\;-2\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 19.8% accurate, 17.0× speedup?

\[\begin{array}{l} \\ -2 \end{array} \]
(FPCore (x y z t) :precision binary64 -2.0)
double code(double x, double y, double z, double t) {
	return -2.0;
}
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 = -2.0d0
end function
public static double code(double x, double y, double z, double t) {
	return -2.0;
}
def code(x, y, z, t):
	return -2.0
function code(x, y, z, t)
	return -2.0
end
function tmp = code(x, y, z, t)
	tmp = -2.0;
end
code[x_, y_, z_, t_] := -2.0
\begin{array}{l}

\\
-2
\end{array}
Derivation
  1. Initial program 84.2%

    \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
  2. Step-by-step derivation
    1. +-commutative84.2%

      \[\leadsto \color{blue}{\frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} + \frac{x}{y}} \]
    2. remove-double-neg84.2%

      \[\leadsto \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} + \color{blue}{\left(-\left(-\frac{x}{y}\right)\right)} \]
    3. distribute-frac-neg84.2%

      \[\leadsto \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} + \left(-\color{blue}{\frac{-x}{y}}\right) \]
    4. unsub-neg84.2%

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

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

      \[\leadsto \frac{2 + \color{blue}{\left(\left(1 - t\right) \cdot z\right) \cdot 2}}{t \cdot z} - \frac{-x}{y} \]
    7. distribute-rgt1-in84.2%

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

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

      \[\leadsto \color{blue}{\frac{\left(1 - t\right) \cdot z + 1}{1}} \cdot \frac{2}{t \cdot z} - \frac{-x}{y} \]
    10. fma-neg84.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(1 - t\right) \cdot z + 1}{1}, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
    11. /-rgt-identity84.2%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 - t\right) \cdot z + 1}, \frac{2}{t \cdot z}, -\frac{-x}{y}\right) \]
    12. *-commutative84.2%

      \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot \left(1 - t\right)} + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right) \]
    13. fma-def84.2%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 1 - t, 1\right)}, \frac{2}{t \cdot z}, -\frac{-x}{y}\right) \]
    14. *-commutative84.2%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{\color{blue}{z \cdot t}}, -\frac{-x}{y}\right) \]
    15. distribute-frac-neg84.2%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
    16. remove-double-neg84.2%

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around 0 59.5%

    \[\leadsto \color{blue}{2 \cdot \frac{1 + z \cdot \left(1 - t\right)}{t \cdot z}} \]
  6. Taylor expanded in t around inf 20.0%

    \[\leadsto 2 \cdot \color{blue}{-1} \]
  7. Final simplification20.0%

    \[\leadsto -2 \]
  8. Add Preprocessing

Developer target: 99.1% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \frac{\frac{2}{z} + 2}{t} - \left(2 - \frac{x}{y}\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y))))
double code(double x, double y, double z, double t) {
	return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
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 = (((2.0d0 / z) + 2.0d0) / t) - (2.0d0 - (x / y))
end function
public static double code(double x, double y, double z, double t) {
	return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
def code(x, y, z, t):
	return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y))
function code(x, y, z, t)
	return Float64(Float64(Float64(Float64(2.0 / z) + 2.0) / t) - Float64(2.0 - Float64(x / y)))
end
function tmp = code(x, y, z, t)
	tmp = (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
end
code[x_, y_, z_, t_] := N[(N[(N[(N[(2.0 / z), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] - N[(2.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{2}{z} + 2}{t} - \left(2 - \frac{x}{y}\right)
\end{array}

Reproduce

?
herbie shell --seed 2024027 
(FPCore (x y z t)
  :name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
  :precision binary64

  :herbie-target
  (- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))

  (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))