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

Percentage Accurate: 86.7% → 99.5%
Time: 10.1s
Alternatives: 11
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 11 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: 86.7% 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.5% 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 97.4%

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

    \[\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 2: 69.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} + \frac{2}{t}\\ t_2 := \frac{x}{y} - 2\\ \mathbf{if}\;t \leq -1:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -4.6 \cdot 10^{-143}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -8 \cdot 10^{-194}:\\ \;\;\;\;\frac{\frac{2}{t}}{z}\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{-291}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{-195}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{elif}\;t \leq 0.8:\\ \;\;\;\;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))) (t_2 (- (/ x y) 2.0)))
   (if (<= t -1.0)
     t_2
     (if (<= t -4.6e-143)
       t_1
       (if (<= t -8e-194)
         (/ (/ 2.0 t) z)
         (if (<= t 4.6e-291)
           t_1
           (if (<= t 1.6e-195) (/ 2.0 (* z t)) (if (<= t 0.8) t_1 t_2))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x / y) + (2.0 / t);
	double t_2 = (x / y) - 2.0;
	double tmp;
	if (t <= -1.0) {
		tmp = t_2;
	} else if (t <= -4.6e-143) {
		tmp = t_1;
	} else if (t <= -8e-194) {
		tmp = (2.0 / t) / z;
	} else if (t <= 4.6e-291) {
		tmp = t_1;
	} else if (t <= 1.6e-195) {
		tmp = 2.0 / (z * t);
	} else if (t <= 0.8) {
		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)
    t_2 = (x / y) - 2.0d0
    if (t <= (-1.0d0)) then
        tmp = t_2
    else if (t <= (-4.6d-143)) then
        tmp = t_1
    else if (t <= (-8d-194)) then
        tmp = (2.0d0 / t) / z
    else if (t <= 4.6d-291) then
        tmp = t_1
    else if (t <= 1.6d-195) then
        tmp = 2.0d0 / (z * t)
    else if (t <= 0.8d0) 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);
	double t_2 = (x / y) - 2.0;
	double tmp;
	if (t <= -1.0) {
		tmp = t_2;
	} else if (t <= -4.6e-143) {
		tmp = t_1;
	} else if (t <= -8e-194) {
		tmp = (2.0 / t) / z;
	} else if (t <= 4.6e-291) {
		tmp = t_1;
	} else if (t <= 1.6e-195) {
		tmp = 2.0 / (z * t);
	} else if (t <= 0.8) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x / y) + (2.0 / t)
	t_2 = (x / y) - 2.0
	tmp = 0
	if t <= -1.0:
		tmp = t_2
	elif t <= -4.6e-143:
		tmp = t_1
	elif t <= -8e-194:
		tmp = (2.0 / t) / z
	elif t <= 4.6e-291:
		tmp = t_1
	elif t <= 1.6e-195:
		tmp = 2.0 / (z * t)
	elif t <= 0.8:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x / y) + Float64(2.0 / t))
	t_2 = Float64(Float64(x / y) - 2.0)
	tmp = 0.0
	if (t <= -1.0)
		tmp = t_2;
	elseif (t <= -4.6e-143)
		tmp = t_1;
	elseif (t <= -8e-194)
		tmp = Float64(Float64(2.0 / t) / z);
	elseif (t <= 4.6e-291)
		tmp = t_1;
	elseif (t <= 1.6e-195)
		tmp = Float64(2.0 / Float64(z * t));
	elseif (t <= 0.8)
		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);
	t_2 = (x / y) - 2.0;
	tmp = 0.0;
	if (t <= -1.0)
		tmp = t_2;
	elseif (t <= -4.6e-143)
		tmp = t_1;
	elseif (t <= -8e-194)
		tmp = (2.0 / t) / z;
	elseif (t <= 4.6e-291)
		tmp = t_1;
	elseif (t <= 1.6e-195)
		tmp = 2.0 / (z * t);
	elseif (t <= 0.8)
		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[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -1.0], t$95$2, If[LessEqual[t, -4.6e-143], t$95$1, If[LessEqual[t, -8e-194], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 4.6e-291], t$95$1, If[LessEqual[t, 1.6e-195], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.8], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2}{t}\\
t_2 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -1:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq -4.6 \cdot 10^{-143}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 4.6 \cdot 10^{-291}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 0.8:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1 or 0.80000000000000004 < t

    1. Initial program 71.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 93.3%

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

    if -1 < t < -4.60000000000000023e-143 or -8.00000000000000014e-194 < t < 4.6000000000000001e-291 or 1.6000000000000001e-195 < t < 0.80000000000000004

    1. Initial program 98.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 inf 66.3%

      \[\leadsto \frac{x}{y} + \color{blue}{2 \cdot \frac{1 - t}{t}} \]
    4. Step-by-step derivation
      1. div-sub66.3%

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

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

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

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

      \[\leadsto \frac{x}{y} + \color{blue}{2 \cdot \left(\frac{1}{t} + -1\right)} \]
    6. Taylor expanded in t around 0 65.3%

      \[\leadsto \frac{x}{y} + 2 \cdot \color{blue}{\frac{1}{t}} \]
    7. Taylor expanded in x around 0 65.3%

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

        \[\leadsto \color{blue}{\frac{2 \cdot 1}{t}} + \frac{x}{y} \]
      2. metadata-eval65.3%

        \[\leadsto \frac{\color{blue}{2}}{t} + \frac{x}{y} \]
      3. +-commutative65.3%

        \[\leadsto \color{blue}{\frac{x}{y} + \frac{2}{t}} \]
    9. Simplified65.3%

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

    if -4.60000000000000023e-143 < t < -8.00000000000000014e-194

    1. Initial program 99.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 99.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{2}{t}}{z}} \]
      2. div-inv74.8%

        \[\leadsto \color{blue}{\frac{2}{t} \cdot \frac{1}{z}} \]
    8. Applied egg-rr74.8%

      \[\leadsto \color{blue}{\frac{2}{t} \cdot \frac{1}{z}} \]
    9. Taylor expanded in t around 0 74.8%

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

        \[\leadsto \color{blue}{\frac{\frac{2}{t}}{z}} \]
    11. Simplified74.9%

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

    if 4.6000000000000001e-291 < t < 1.6000000000000001e-195

    1. Initial program 93.7%

      \[\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 94.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;t \leq -4.6 \cdot 10^{-143}:\\ \;\;\;\;\frac{x}{y} + \frac{2}{t}\\ \mathbf{elif}\;t \leq -8 \cdot 10^{-194}:\\ \;\;\;\;\frac{\frac{2}{t}}{z}\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{-291}:\\ \;\;\;\;\frac{x}{y} + \frac{2}{t}\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{-195}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{elif}\;t \leq 0.8:\\ \;\;\;\;\frac{x}{y} + \frac{2}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 62.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{2}{z \cdot t}\\ t_2 := \frac{x}{y} - 2\\ \mathbf{if}\;t \leq -1.55 \cdot 10^{-66}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -1.02 \cdot 10^{-194}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.95 \cdot 10^{-290}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq 5 \cdot 10^{-157}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ 2.0 (* z t))) (t_2 (- (/ x y) 2.0)))
   (if (<= t -1.55e-66)
     t_2
     (if (<= t -1.02e-194)
       t_1
       (if (<= t 1.95e-290) (/ 2.0 t) (if (<= t 5e-157) t_1 t_2))))))
double code(double x, double y, double z, double t) {
	double t_1 = 2.0 / (z * t);
	double t_2 = (x / y) - 2.0;
	double tmp;
	if (t <= -1.55e-66) {
		tmp = t_2;
	} else if (t <= -1.02e-194) {
		tmp = t_1;
	} else if (t <= 1.95e-290) {
		tmp = 2.0 / t;
	} else if (t <= 5e-157) {
		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 = 2.0d0 / (z * t)
    t_2 = (x / y) - 2.0d0
    if (t <= (-1.55d-66)) then
        tmp = t_2
    else if (t <= (-1.02d-194)) then
        tmp = t_1
    else if (t <= 1.95d-290) then
        tmp = 2.0d0 / t
    else if (t <= 5d-157) 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 = 2.0 / (z * t);
	double t_2 = (x / y) - 2.0;
	double tmp;
	if (t <= -1.55e-66) {
		tmp = t_2;
	} else if (t <= -1.02e-194) {
		tmp = t_1;
	} else if (t <= 1.95e-290) {
		tmp = 2.0 / t;
	} else if (t <= 5e-157) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = 2.0 / (z * t)
	t_2 = (x / y) - 2.0
	tmp = 0
	if t <= -1.55e-66:
		tmp = t_2
	elif t <= -1.02e-194:
		tmp = t_1
	elif t <= 1.95e-290:
		tmp = 2.0 / t
	elif t <= 5e-157:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(2.0 / Float64(z * t))
	t_2 = Float64(Float64(x / y) - 2.0)
	tmp = 0.0
	if (t <= -1.55e-66)
		tmp = t_2;
	elseif (t <= -1.02e-194)
		tmp = t_1;
	elseif (t <= 1.95e-290)
		tmp = Float64(2.0 / t);
	elseif (t <= 5e-157)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = 2.0 / (z * t);
	t_2 = (x / y) - 2.0;
	tmp = 0.0;
	if (t <= -1.55e-66)
		tmp = t_2;
	elseif (t <= -1.02e-194)
		tmp = t_1;
	elseif (t <= 1.95e-290)
		tmp = 2.0 / t;
	elseif (t <= 5e-157)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -1.55e-66], t$95$2, If[LessEqual[t, -1.02e-194], t$95$1, If[LessEqual[t, 1.95e-290], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, 5e-157], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -1.02 \cdot 10^{-194}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 1.95 \cdot 10^{-290}:\\
\;\;\;\;\frac{2}{t}\\

\mathbf{elif}\;t \leq 5 \cdot 10^{-157}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.5499999999999999e-66 or 5.0000000000000002e-157 < t

    1. Initial program 78.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 t around inf 80.0%

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

    if -1.5499999999999999e-66 < t < -1.02e-194 or 1.94999999999999986e-290 < t < 5.0000000000000002e-157

    1. Initial program 98.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 t around 0 90.9%

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

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

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

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

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

    if -1.02e-194 < t < 1.94999999999999986e-290

    1. Initial program 99.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 85.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.55 \cdot 10^{-66}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;t \leq -1.02 \cdot 10^{-194}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{elif}\;t \leq 1.95 \cdot 10^{-290}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq 5 \cdot 10^{-157}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 62.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} - 2\\ \mathbf{if}\;t \leq -6.8 \cdot 10^{-68}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -3.8 \cdot 10^{-194}:\\ \;\;\;\;\frac{\frac{2}{t}}{z}\\ \mathbf{elif}\;t \leq 7 \cdot 10^{-292}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-157}:\\ \;\;\;\;\frac{2}{z \cdot 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 -6.8e-68)
     t_1
     (if (<= t -3.8e-194)
       (/ (/ 2.0 t) z)
       (if (<= t 7e-292)
         (/ 2.0 t)
         (if (<= t 5.5e-157) (/ 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 <= -6.8e-68) {
		tmp = t_1;
	} else if (t <= -3.8e-194) {
		tmp = (2.0 / t) / z;
	} else if (t <= 7e-292) {
		tmp = 2.0 / t;
	} else if (t <= 5.5e-157) {
		tmp = 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 <= (-6.8d-68)) then
        tmp = t_1
    else if (t <= (-3.8d-194)) then
        tmp = (2.0d0 / t) / z
    else if (t <= 7d-292) then
        tmp = 2.0d0 / t
    else if (t <= 5.5d-157) then
        tmp = 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 <= -6.8e-68) {
		tmp = t_1;
	} else if (t <= -3.8e-194) {
		tmp = (2.0 / t) / z;
	} else if (t <= 7e-292) {
		tmp = 2.0 / t;
	} else if (t <= 5.5e-157) {
		tmp = 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 <= -6.8e-68:
		tmp = t_1
	elif t <= -3.8e-194:
		tmp = (2.0 / t) / z
	elif t <= 7e-292:
		tmp = 2.0 / t
	elif t <= 5.5e-157:
		tmp = 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 <= -6.8e-68)
		tmp = t_1;
	elseif (t <= -3.8e-194)
		tmp = Float64(Float64(2.0 / t) / z);
	elseif (t <= 7e-292)
		tmp = Float64(2.0 / t);
	elseif (t <= 5.5e-157)
		tmp = Float64(2.0 / Float64(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 <= -6.8e-68)
		tmp = t_1;
	elseif (t <= -3.8e-194)
		tmp = (2.0 / t) / z;
	elseif (t <= 7e-292)
		tmp = 2.0 / t;
	elseif (t <= 5.5e-157)
		tmp = 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, -6.8e-68], t$95$1, If[LessEqual[t, -3.8e-194], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 7e-292], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, 5.5e-157], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -6.8 \cdot 10^{-68}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 7 \cdot 10^{-292}:\\
\;\;\;\;\frac{2}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -6.80000000000000037e-68 or 5.4999999999999998e-157 < t

    1. Initial program 78.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 t around inf 80.0%

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

    if -6.80000000000000037e-68 < t < -3.8000000000000003e-194

    1. Initial program 99.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 89.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{2}{t}}{z}} \]
      2. div-inv58.1%

        \[\leadsto \color{blue}{\frac{2}{t} \cdot \frac{1}{z}} \]
    8. Applied egg-rr58.1%

      \[\leadsto \color{blue}{\frac{2}{t} \cdot \frac{1}{z}} \]
    9. Taylor expanded in t around 0 58.1%

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

        \[\leadsto \color{blue}{\frac{\frac{2}{t}}{z}} \]
    11. Simplified58.3%

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

    if -3.8000000000000003e-194 < t < 6.9999999999999999e-292

    1. Initial program 99.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 85.3%

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

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

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

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

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

    if 6.9999999999999999e-292 < t < 5.4999999999999998e-157

    1. Initial program 96.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 t around 0 92.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.8 \cdot 10^{-68}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;t \leq -3.8 \cdot 10^{-194}:\\ \;\;\;\;\frac{\frac{2}{t}}{z}\\ \mathbf{elif}\;t \leq 7 \cdot 10^{-292}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-157}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 81.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} - 2\\ \mathbf{if}\;t \leq -1500000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{-104}:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \mathbf{elif}\;t \leq 2.05 \cdot 10^{+23}:\\ \;\;\;\;\frac{x}{y} + \frac{2}{z \cdot 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 -1500000.0)
     t_1
     (if (<= t 2.7e-104)
       (/ (+ 2.0 (/ 2.0 z)) t)
       (if (<= t 2.05e+23) (+ (/ x y) (/ 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 <= -1500000.0) {
		tmp = t_1;
	} else if (t <= 2.7e-104) {
		tmp = (2.0 + (2.0 / z)) / t;
	} else if (t <= 2.05e+23) {
		tmp = (x / y) + (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 <= (-1500000.0d0)) then
        tmp = t_1
    else if (t <= 2.7d-104) then
        tmp = (2.0d0 + (2.0d0 / z)) / t
    else if (t <= 2.05d+23) then
        tmp = (x / y) + (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 <= -1500000.0) {
		tmp = t_1;
	} else if (t <= 2.7e-104) {
		tmp = (2.0 + (2.0 / z)) / t;
	} else if (t <= 2.05e+23) {
		tmp = (x / y) + (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 <= -1500000.0:
		tmp = t_1
	elif t <= 2.7e-104:
		tmp = (2.0 + (2.0 / z)) / t
	elif t <= 2.05e+23:
		tmp = (x / y) + (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 <= -1500000.0)
		tmp = t_1;
	elseif (t <= 2.7e-104)
		tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t);
	elseif (t <= 2.05e+23)
		tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(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 <= -1500000.0)
		tmp = t_1;
	elseif (t <= 2.7e-104)
		tmp = (2.0 + (2.0 / z)) / t;
	elseif (t <= 2.05e+23)
		tmp = (x / y) + (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, -1500000.0], t$95$1, If[LessEqual[t, 2.7e-104], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 2.05e+23], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -1500000:\\
\;\;\;\;t_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.5e6 or 2.04999999999999998e23 < t

    1. Initial program 69.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 inf 95.8%

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

    if -1.5e6 < t < 2.6999999999999998e-104

    1. Initial program 98.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 83.9%

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

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

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

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

    if 2.6999999999999998e-104 < t < 2.04999999999999998e23

    1. Initial program 96.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 z around 0 85.4%

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

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

Alternative 6: 81.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} - 2\\ \mathbf{if}\;t \leq -7500:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-104}:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{+19}:\\ \;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (/ x y) 2.0)))
   (if (<= t -7500.0)
     t_1
     (if (<= t 3.2e-104)
       (/ (+ 2.0 (/ 2.0 z)) t)
       (if (<= t 1.6e+19) (+ (/ x y) (/ (/ 2.0 t) z)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = (x / y) - 2.0;
	double tmp;
	if (t <= -7500.0) {
		tmp = t_1;
	} else if (t <= 3.2e-104) {
		tmp = (2.0 + (2.0 / z)) / t;
	} else if (t <= 1.6e+19) {
		tmp = (x / y) + ((2.0 / t) / z);
	} 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 <= (-7500.0d0)) then
        tmp = t_1
    else if (t <= 3.2d-104) then
        tmp = (2.0d0 + (2.0d0 / z)) / t
    else if (t <= 1.6d+19) then
        tmp = (x / y) + ((2.0d0 / t) / z)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / y) - 2.0;
	double tmp;
	if (t <= -7500.0) {
		tmp = t_1;
	} else if (t <= 3.2e-104) {
		tmp = (2.0 + (2.0 / z)) / t;
	} else if (t <= 1.6e+19) {
		tmp = (x / y) + ((2.0 / t) / z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x / y) - 2.0
	tmp = 0
	if t <= -7500.0:
		tmp = t_1
	elif t <= 3.2e-104:
		tmp = (2.0 + (2.0 / z)) / t
	elif t <= 1.6e+19:
		tmp = (x / y) + ((2.0 / t) / z)
	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 <= -7500.0)
		tmp = t_1;
	elseif (t <= 3.2e-104)
		tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t);
	elseif (t <= 1.6e+19)
		tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z));
	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 <= -7500.0)
		tmp = t_1;
	elseif (t <= 3.2e-104)
		tmp = (2.0 + (2.0 / z)) / t;
	elseif (t <= 1.6e+19)
		tmp = (x / y) + ((2.0 / t) / z);
	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, -7500.0], t$95$1, If[LessEqual[t, 3.2e-104], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 1.6e+19], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -7500:\\
\;\;\;\;t_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7500 or 1.6e19 < t

    1. Initial program 69.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 inf 95.8%

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

    if -7500 < t < 3.19999999999999989e-104

    1. Initial program 98.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 83.9%

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

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

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

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

    if 3.19999999999999989e-104 < t < 1.6e19

    1. Initial program 96.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 z around 0 85.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7500:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-104}:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{+19}:\\ \;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 92.1% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.95e-10 or 4.0000000000000002e-22 < z

    1. Initial program 73.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 z around inf 99.0%

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

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

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

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

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

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

    if -1.95e-10 < z < 4.0000000000000002e-22

    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 88.8%

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

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

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

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

Alternative 8: 47.5% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x y) < -1.45000000000000006e23 or 0.12 < (/.f64 x y)

    1. Initial program 85.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 x around inf 76.8%

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

    if -1.45000000000000006e23 < (/.f64 x y) < 0.12

    1. Initial program 84.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 0 62.8%

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

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

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

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

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

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

Alternative 9: 79.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -100000 \lor \neg \left(t \leq 1.2 \cdot 10^{-30}\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 -100000.0) (not (<= t 1.2e-30)))
   (- (/ x y) 2.0)
   (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -100000.0) || !(t <= 1.2e-30)) {
		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 <= (-100000.0d0)) .or. (.not. (t <= 1.2d-30))) 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 <= -100000.0) || !(t <= 1.2e-30)) {
		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 <= -100000.0) or not (t <= 1.2e-30):
		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 <= -100000.0) || !(t <= 1.2e-30))
		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 <= -100000.0) || ~((t <= 1.2e-30)))
		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, -100000.0], N[Not[LessEqual[t, 1.2e-30]], $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 -100000 \lor \neg \left(t \leq 1.2 \cdot 10^{-30}\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 < -1e5 or 1.19999999999999992e-30 < t

    1. Initial program 71.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.7%

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

    if -1e5 < t < 1.19999999999999992e-30

    1. Initial program 99.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 0 80.6%

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

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

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

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

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

Alternative 10: 60.5% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.5000000000000003e-80 or 2.8e-104 < t

    1. Initial program 77.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 inf 82.0%

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

    if -4.5000000000000003e-80 < t < 2.8e-104

    1. Initial program 98.7%

      \[\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 86.2%

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

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

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

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

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

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

Alternative 11: 19.2% accurate, 5.7× speedup?

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

\\
\frac{2}{t}
\end{array}
Derivation
  1. Initial program 85.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 0 44.4%

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

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

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

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

    \[\leadsto \color{blue}{\frac{2}{t}} \]
  7. Final simplification18.9%

    \[\leadsto \frac{2}{t} \]
  8. Add Preprocessing

Developer target: 99.2% 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 2024018 
(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))))