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

Percentage Accurate: 85.8% → 99.8%
Time: 19.2s
Alternatives: 11
Speedup: 0.9×

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: 85.8% 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.8% 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}:\\ \;\;\;\;x \cdot \left(\frac{\frac{2}{t} + -2}{x} + \left(\frac{1}{y} + \frac{2}{t \cdot \left(x \cdot z\right)}\right)\right)\\ \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 (+ (/ (+ (/ 2.0 t) -2.0) x) (+ (/ 1.0 y) (/ 2.0 (* t (* x z)))))))))
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 * ((((2.0 / t) + -2.0) / x) + ((1.0 / y) + (2.0 / (t * (x * z)))));
	}
	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 * ((((2.0 / t) + -2.0) / x) + ((1.0 / y) + (2.0 / (t * (x * z)))));
	}
	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 * ((((2.0 / t) + -2.0) / x) + ((1.0 / y) + (2.0 / (t * (x * z)))))
	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(x * Float64(Float64(Float64(Float64(2.0 / t) + -2.0) / x) + Float64(Float64(1.0 / y) + Float64(2.0 / Float64(t * Float64(x * z))))));
	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 * ((((2.0 / t) + -2.0) / x) + ((1.0 / y) + (2.0 / (t * (x * z)))));
	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[(x * N[(N[(N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision] / x), $MachinePrecision] + N[(N[(1.0 / y), $MachinePrecision] + N[(2.0 / N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}:\\
\;\;\;\;x \cdot \left(\frac{\frac{2}{t} + -2}{x} + \left(\frac{1}{y} + \frac{2}{t \cdot \left(x \cdot z\right)}\right)\right)\\


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

    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

    if +inf.0 < (+.f64 (/.f64 x y) (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) 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 x around inf 96.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(\frac{\frac{2}{t} + -2}{x} + \left(\frac{1}{y} + \frac{2}{t \cdot \left(z \cdot x\right)}\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.8%

    \[\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}:\\ \;\;\;\;x \cdot \left(\frac{\frac{2}{t} + -2}{x} + \left(\frac{1}{y} + \frac{2}{t \cdot \left(x \cdot z\right)}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 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 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z))) < +inf.0

    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

    if +inf.0 < (+.f64 (/.f64 x y) (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) 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 96.6%

      \[\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 3: 80.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t \leq 8.2 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 4.8 \cdot 10^{-30}:\\
\;\;\;\;\frac{x}{y}\\

\mathbf{elif}\;t \leq 32000:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.00000000000000024e-5 or 32000 < t

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

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

    if -5.00000000000000024e-5 < t < 8.20000000000000028e-48 or 4.7999999999999997e-30 < t < 32000

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

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

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

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

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

    if 8.20000000000000028e-48 < t < 4.7999999999999997e-30

    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}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification86.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-5}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;t \leq 8.2 \cdot 10^{-48}:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-30}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;t \leq 32000:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 81.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{2 + \frac{2}{z}}{t}\\ t_2 := \frac{x}{y} + \left(\frac{2}{t} + -2\right)\\ \mathbf{if}\;t \leq -2 \cdot 10^{-5}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 10^{-87}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{-27}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 125:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (+ 2.0 (/ 2.0 z)) t)) (t_2 (+ (/ x y) (+ (/ 2.0 t) -2.0))))
   (if (<= t -2e-5)
     t_2
     (if (<= t 1e-87)
       t_1
       (if (<= t 3.6e-27) t_2 (if (<= t 125.0) t_1 (- (/ x y) 2.0)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (2.0 + (2.0 / z)) / t;
	double t_2 = (x / y) + ((2.0 / t) + -2.0);
	double tmp;
	if (t <= -2e-5) {
		tmp = t_2;
	} else if (t <= 1e-87) {
		tmp = t_1;
	} else if (t <= 3.6e-27) {
		tmp = t_2;
	} else if (t <= 125.0) {
		tmp = t_1;
	} else {
		tmp = (x / y) - 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (2.0d0 + (2.0d0 / z)) / t
    t_2 = (x / y) + ((2.0d0 / t) + (-2.0d0))
    if (t <= (-2d-5)) then
        tmp = t_2
    else if (t <= 1d-87) then
        tmp = t_1
    else if (t <= 3.6d-27) then
        tmp = t_2
    else if (t <= 125.0d0) then
        tmp = t_1
    else
        tmp = (x / y) - 2.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (2.0 + (2.0 / z)) / t;
	double t_2 = (x / y) + ((2.0 / t) + -2.0);
	double tmp;
	if (t <= -2e-5) {
		tmp = t_2;
	} else if (t <= 1e-87) {
		tmp = t_1;
	} else if (t <= 3.6e-27) {
		tmp = t_2;
	} else if (t <= 125.0) {
		tmp = t_1;
	} else {
		tmp = (x / y) - 2.0;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (2.0 + (2.0 / z)) / t
	t_2 = (x / y) + ((2.0 / t) + -2.0)
	tmp = 0
	if t <= -2e-5:
		tmp = t_2
	elif t <= 1e-87:
		tmp = t_1
	elif t <= 3.6e-27:
		tmp = t_2
	elif t <= 125.0:
		tmp = t_1
	else:
		tmp = (x / y) - 2.0
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(2.0 + Float64(2.0 / z)) / t)
	t_2 = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0))
	tmp = 0.0
	if (t <= -2e-5)
		tmp = t_2;
	elseif (t <= 1e-87)
		tmp = t_1;
	elseif (t <= 3.6e-27)
		tmp = t_2;
	elseif (t <= 125.0)
		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 = (2.0 + (2.0 / z)) / t;
	t_2 = (x / y) + ((2.0 / t) + -2.0);
	tmp = 0.0;
	if (t <= -2e-5)
		tmp = t_2;
	elseif (t <= 1e-87)
		tmp = t_1;
	elseif (t <= 3.6e-27)
		tmp = t_2;
	elseif (t <= 125.0)
		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[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2e-5], t$95$2, If[LessEqual[t, 1e-87], t$95$1, If[LessEqual[t, 3.6e-27], t$95$2, If[LessEqual[t, 125.0], t$95$1, N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{2 + \frac{2}{z}}{t}\\
t_2 := \frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{if}\;t \leq -2 \cdot 10^{-5}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq 10^{-87}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 3.6 \cdot 10^{-27}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq 125:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.00000000000000016e-5 or 1.00000000000000002e-87 < t < 3.5999999999999999e-27

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000016e-5 < t < 1.00000000000000002e-87 or 3.5999999999999999e-27 < t < 125

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

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

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

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

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

    if 125 < t

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2 \cdot 10^{-5}:\\ \;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\ \mathbf{elif}\;t \leq 10^{-87}:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{-27}:\\ \;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\ \mathbf{elif}\;t \leq 125:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 71.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -6.6 \cdot 10^{+82}:\\
\;\;\;\;\frac{x}{y}\\

\mathbf{elif}\;\frac{x}{y} \leq 1.5 \cdot 10^{+60}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 x y) < -6.5999999999999997e82

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

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

    if -6.5999999999999997e82 < (/.f64 x y) < 1.4999999999999999e60

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 \cdot \frac{1}{t} + 2 \cdot \frac{1}{t \cdot z}\right) - 2} \]
    7. Step-by-step derivation
      1. sub-neg93.5%

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

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

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

        \[\leadsto \left(\frac{1}{t} \cdot 2 + \color{blue}{\frac{\frac{1}{t}}{z}} \cdot 2\right) + \left(-2\right) \]
      5. associate-*l/93.5%

        \[\leadsto \left(\frac{1}{t} \cdot 2 + \color{blue}{\frac{\frac{1}{t} \cdot 2}{z}}\right) + \left(-2\right) \]
      6. associate-/l*93.4%

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(2 + \frac{2}{z}\right)}{t}} + \left(-2\right) \]
      9. *-lft-identity93.4%

        \[\leadsto \frac{\color{blue}{2 + \frac{2}{z}}}{t} + \left(-2\right) \]
      10. metadata-eval93.4%

        \[\leadsto \frac{2 + \frac{2}{z}}{t} + \color{blue}{-2} \]
    8. Simplified93.4%

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

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

    if 1.4999999999999999e60 < (/.f64 x y)

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

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

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

Alternative 6: 92.4% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1599999999999999e-15 < z < 1.20000000000000011e-19

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

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

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

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

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

Alternative 7: 53.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -3.95 \lor \neg \left(\frac{x}{y} \leq 560000000000\right):\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;-2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= (/ x y) -3.95) (not (<= (/ x y) 560000000000.0))) (/ x y) -2.0))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((x / y) <= -3.95) || !((x / y) <= 560000000000.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) <= (-3.95d0)) .or. (.not. ((x / y) <= 560000000000.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) <= -3.95) || !((x / y) <= 560000000000.0)) {
		tmp = x / y;
	} else {
		tmp = -2.0;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((x / y) <= -3.95) or not ((x / y) <= 560000000000.0):
		tmp = x / y
	else:
		tmp = -2.0
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((Float64(x / y) <= -3.95) || !(Float64(x / y) <= 560000000000.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) <= -3.95) || ~(((x / y) <= 560000000000.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], -3.95], N[Not[LessEqual[N[(x / y), $MachinePrecision], 560000000000.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], -2.0]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -3.95 \lor \neg \left(\frac{x}{y} \leq 560000000000\right):\\
\;\;\;\;\frac{x}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x y) < -3.9500000000000002 or 5.6e11 < (/.f64 x y)

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

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

    if -3.9500000000000002 < (/.f64 x y) < 5.6e11

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 \cdot \frac{1}{t} + 2 \cdot \frac{1}{t \cdot z}\right) - 2} \]
    7. Step-by-step derivation
      1. sub-neg98.6%

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

        \[\leadsto \left(\color{blue}{\frac{2 \cdot 1}{t}} + 2 \cdot \frac{1}{t \cdot z}\right) + \left(-2\right) \]
      3. metadata-eval98.6%

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

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

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

        \[\leadsto \left(\frac{\color{blue}{2}}{t \cdot z} + \frac{2}{t}\right) + \left(-2\right) \]
      7. metadata-eval98.6%

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

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

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

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

Alternative 8: 60.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{-68} \lor \neg \left(t \leq 1.55 \cdot 10^{-123}\right):\\
\;\;\;\;\frac{x}{y} - 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.1999999999999999e-68 or 1.54999999999999999e-123 < t

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

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

    if -6.1999999999999999e-68 < t < 1.54999999999999999e-123

    1. Initial program 97.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 0 86.9%

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

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

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

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

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

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

Alternative 9: 63.6% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-204} \lor \neg \left(z \leq 1.35 \cdot 10^{-139}\right):\\
\;\;\;\;\frac{x}{y} - 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.99999999999999948e-204 or 1.3499999999999999e-139 < z

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

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

    if -8.99999999999999948e-204 < z < 1.3499999999999999e-139

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 36.9% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{-10}:\\
\;\;\;\;-2\\

\mathbf{elif}\;t \leq 2.75 \cdot 10^{-5}:\\
\;\;\;\;\frac{2}{t}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 \cdot \frac{1}{t} + 2 \cdot \frac{1}{t \cdot z}\right) - 2} \]
    7. Step-by-step derivation
      1. sub-neg45.9%

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

        \[\leadsto \left(\color{blue}{\frac{2 \cdot 1}{t}} + 2 \cdot \frac{1}{t \cdot z}\right) + \left(-2\right) \]
      3. metadata-eval45.9%

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

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

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

        \[\leadsto \left(\frac{\color{blue}{2}}{t \cdot z} + \frac{2}{t}\right) + \left(-2\right) \]
      7. metadata-eval45.9%

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

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

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

    if -2.80000000000000015e-10 < t < 2.7500000000000001e-5

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

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

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

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

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

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

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

Alternative 11: 20.4% 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 88.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 x around inf 80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(2 \cdot \frac{1}{t} + 2 \cdot \frac{1}{t \cdot z}\right) - 2} \]
  7. Step-by-step derivation
    1. sub-neg61.6%

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

      \[\leadsto \left(\color{blue}{\frac{2 \cdot 1}{t}} + 2 \cdot \frac{1}{t \cdot z}\right) + \left(-2\right) \]
    3. metadata-eval61.6%

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

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

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

      \[\leadsto \left(\frac{\color{blue}{2}}{t \cdot z} + \frac{2}{t}\right) + \left(-2\right) \]
    7. metadata-eval61.6%

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

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

    \[\leadsto \color{blue}{-2} \]
  10. Final simplification17.8%

    \[\leadsto -2 \]
  11. 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 2024076 
(FPCore (x y z t)
  :name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
  :precision binary64

  :alt
  (- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))

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