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

Percentage Accurate: 86.4% → 99.2%
Time: 11.0s
Alternatives: 13
Speedup: 1.3×

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 13 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.4% 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.2% accurate, 1.1× speedup?

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

\\
\frac{x}{y} + \left(\frac{\frac{2}{t}}{z} + \left(\frac{2}{t} + -2\right)\right)
\end{array}
Derivation
  1. Initial program 84.6%

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

    \[\leadsto \frac{x}{y} + \color{blue}{\left(\left(2 \cdot \frac{1}{t \cdot z} + \frac{2}{t}\right) - 2\right)} \]
  3. Step-by-step derivation
    1. associate--l+99.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 63.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{2}{t \cdot z}\\ t_2 := \frac{x}{y} - 2\\ \mathbf{if}\;t \leq -1.7 \cdot 10^{-6}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -1.3 \cdot 10^{-130}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -1.75 \cdot 10^{-158}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq -7.4 \cdot 10^{-283}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{-212}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq 6500000000:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ 2.0 (* t z))) (t_2 (- (/ x y) 2.0)))
   (if (<= t -1.7e-6)
     t_2
     (if (<= t -1.3e-130)
       t_1
       (if (<= t -1.75e-158)
         (/ 2.0 t)
         (if (<= t -7.4e-283)
           t_1
           (if (<= t 6.8e-212)
             (/ 2.0 t)
             (if (<= t 6500000000.0) t_1 t_2))))))))
double code(double x, double y, double z, double t) {
	double t_1 = 2.0 / (t * z);
	double t_2 = (x / y) - 2.0;
	double tmp;
	if (t <= -1.7e-6) {
		tmp = t_2;
	} else if (t <= -1.3e-130) {
		tmp = t_1;
	} else if (t <= -1.75e-158) {
		tmp = 2.0 / t;
	} else if (t <= -7.4e-283) {
		tmp = t_1;
	} else if (t <= 6.8e-212) {
		tmp = 2.0 / t;
	} else if (t <= 6500000000.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 / (t * z)
    t_2 = (x / y) - 2.0d0
    if (t <= (-1.7d-6)) then
        tmp = t_2
    else if (t <= (-1.3d-130)) then
        tmp = t_1
    else if (t <= (-1.75d-158)) then
        tmp = 2.0d0 / t
    else if (t <= (-7.4d-283)) then
        tmp = t_1
    else if (t <= 6.8d-212) then
        tmp = 2.0d0 / t
    else if (t <= 6500000000.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 / (t * z);
	double t_2 = (x / y) - 2.0;
	double tmp;
	if (t <= -1.7e-6) {
		tmp = t_2;
	} else if (t <= -1.3e-130) {
		tmp = t_1;
	} else if (t <= -1.75e-158) {
		tmp = 2.0 / t;
	} else if (t <= -7.4e-283) {
		tmp = t_1;
	} else if (t <= 6.8e-212) {
		tmp = 2.0 / t;
	} else if (t <= 6500000000.0) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = 2.0 / (t * z)
	t_2 = (x / y) - 2.0
	tmp = 0
	if t <= -1.7e-6:
		tmp = t_2
	elif t <= -1.3e-130:
		tmp = t_1
	elif t <= -1.75e-158:
		tmp = 2.0 / t
	elif t <= -7.4e-283:
		tmp = t_1
	elif t <= 6.8e-212:
		tmp = 2.0 / t
	elif t <= 6500000000.0:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(2.0 / Float64(t * z))
	t_2 = Float64(Float64(x / y) - 2.0)
	tmp = 0.0
	if (t <= -1.7e-6)
		tmp = t_2;
	elseif (t <= -1.3e-130)
		tmp = t_1;
	elseif (t <= -1.75e-158)
		tmp = Float64(2.0 / t);
	elseif (t <= -7.4e-283)
		tmp = t_1;
	elseif (t <= 6.8e-212)
		tmp = Float64(2.0 / t);
	elseif (t <= 6500000000.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = 2.0 / (t * z);
	t_2 = (x / y) - 2.0;
	tmp = 0.0;
	if (t <= -1.7e-6)
		tmp = t_2;
	elseif (t <= -1.3e-130)
		tmp = t_1;
	elseif (t <= -1.75e-158)
		tmp = 2.0 / t;
	elseif (t <= -7.4e-283)
		tmp = t_1;
	elseif (t <= 6.8e-212)
		tmp = 2.0 / t;
	elseif (t <= 6500000000.0)
		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[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -1.7e-6], t$95$2, If[LessEqual[t, -1.3e-130], t$95$1, If[LessEqual[t, -1.75e-158], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, -7.4e-283], t$95$1, If[LessEqual[t, 6.8e-212], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, 6500000000.0], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -1.3 \cdot 10^{-130}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -1.75 \cdot 10^{-158}:\\
\;\;\;\;\frac{2}{t}\\

\mathbf{elif}\;t \leq -7.4 \cdot 10^{-283}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 6.8 \cdot 10^{-212}:\\
\;\;\;\;\frac{2}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.70000000000000003e-6 or 6.5e9 < t

    1. Initial program 70.0%

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

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

    if -1.70000000000000003e-6 < t < -1.3e-130 or -1.75000000000000006e-158 < t < -7.4000000000000001e-283 or 6.79999999999999995e-212 < t < 6.5e9

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3e-130 < t < -1.75000000000000006e-158 or -7.4000000000000001e-283 < t < 6.79999999999999995e-212

    1. Initial program 96.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.7 \cdot 10^{-6}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;t \leq -1.3 \cdot 10^{-130}:\\ \;\;\;\;\frac{2}{t \cdot z}\\ \mathbf{elif}\;t \leq -1.75 \cdot 10^{-158}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq -7.4 \cdot 10^{-283}:\\ \;\;\;\;\frac{2}{t \cdot z}\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{-212}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq 6500000000:\\ \;\;\;\;\frac{2}{t \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \]

Alternative 3: 63.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t \leq -2.1 \cdot 10^{-134}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq -8.5 \cdot 10^{-286}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 3.5 \cdot 10^{-211}:\\
\;\;\;\;\frac{2}{t}\\

\mathbf{elif}\;t \leq 7200000000:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.80000000000000005e-5 or 7.2e9 < t

    1. Initial program 70.0%

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

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

    if -1.80000000000000005e-5 < t < -2.0999999999999999e-134 or -7.00000000000000005e-159 < t < -8.4999999999999998e-286

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0999999999999999e-134 < t < -7.00000000000000005e-159 or -8.4999999999999998e-286 < t < 3.5e-211

    1. Initial program 96.8%

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

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

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

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

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

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

    if 3.5e-211 < t < 7.2e9

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{2}{t \cdot z}} \]
    9. Step-by-step derivation
      1. associate-/l/62.0%

        \[\leadsto \color{blue}{\frac{\frac{2}{z}}{t}} \]
    10. Simplified62.0%

      \[\leadsto \color{blue}{\frac{\frac{2}{z}}{t}} \]
    11. Taylor expanded in z around 0 62.1%

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

        \[\leadsto \color{blue}{\frac{\frac{2}{t}}{z}} \]
    13. Simplified62.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{-5}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;t \leq -2.1 \cdot 10^{-134}:\\ \;\;\;\;\frac{2}{t \cdot z}\\ \mathbf{elif}\;t \leq -7 \cdot 10^{-159}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq -8.5 \cdot 10^{-286}:\\ \;\;\;\;\frac{2}{t \cdot z}\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{-211}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq 7200000000:\\ \;\;\;\;\frac{\frac{2}{t}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \]

Alternative 4: 63.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} - 2\\ \mathbf{if}\;t \leq -4.4 \cdot 10^{-7}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -3.8 \cdot 10^{-134}:\\ \;\;\;\;\frac{\frac{2}{z}}{t}\\ \mathbf{elif}\;t \leq -2 \cdot 10^{-158}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq -2.05 \cdot 10^{-281}:\\ \;\;\;\;\frac{2}{t \cdot z}\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-203}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq 7200000000:\\ \;\;\;\;\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 -4.4e-7)
     t_1
     (if (<= t -3.8e-134)
       (/ (/ 2.0 z) t)
       (if (<= t -2e-158)
         (/ 2.0 t)
         (if (<= t -2.05e-281)
           (/ 2.0 (* t z))
           (if (<= t 2.5e-203)
             (/ 2.0 t)
             (if (<= t 7200000000.0) (/ (/ 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 <= -4.4e-7) {
		tmp = t_1;
	} else if (t <= -3.8e-134) {
		tmp = (2.0 / z) / t;
	} else if (t <= -2e-158) {
		tmp = 2.0 / t;
	} else if (t <= -2.05e-281) {
		tmp = 2.0 / (t * z);
	} else if (t <= 2.5e-203) {
		tmp = 2.0 / t;
	} else if (t <= 7200000000.0) {
		tmp = (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 <= (-4.4d-7)) then
        tmp = t_1
    else if (t <= (-3.8d-134)) then
        tmp = (2.0d0 / z) / t
    else if (t <= (-2d-158)) then
        tmp = 2.0d0 / t
    else if (t <= (-2.05d-281)) then
        tmp = 2.0d0 / (t * z)
    else if (t <= 2.5d-203) then
        tmp = 2.0d0 / t
    else if (t <= 7200000000.0d0) then
        tmp = (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 <= -4.4e-7) {
		tmp = t_1;
	} else if (t <= -3.8e-134) {
		tmp = (2.0 / z) / t;
	} else if (t <= -2e-158) {
		tmp = 2.0 / t;
	} else if (t <= -2.05e-281) {
		tmp = 2.0 / (t * z);
	} else if (t <= 2.5e-203) {
		tmp = 2.0 / t;
	} else if (t <= 7200000000.0) {
		tmp = (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 <= -4.4e-7:
		tmp = t_1
	elif t <= -3.8e-134:
		tmp = (2.0 / z) / t
	elif t <= -2e-158:
		tmp = 2.0 / t
	elif t <= -2.05e-281:
		tmp = 2.0 / (t * z)
	elif t <= 2.5e-203:
		tmp = 2.0 / t
	elif t <= 7200000000.0:
		tmp = (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 <= -4.4e-7)
		tmp = t_1;
	elseif (t <= -3.8e-134)
		tmp = Float64(Float64(2.0 / z) / t);
	elseif (t <= -2e-158)
		tmp = Float64(2.0 / t);
	elseif (t <= -2.05e-281)
		tmp = Float64(2.0 / Float64(t * z));
	elseif (t <= 2.5e-203)
		tmp = Float64(2.0 / t);
	elseif (t <= 7200000000.0)
		tmp = 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 <= -4.4e-7)
		tmp = t_1;
	elseif (t <= -3.8e-134)
		tmp = (2.0 / z) / t;
	elseif (t <= -2e-158)
		tmp = 2.0 / t;
	elseif (t <= -2.05e-281)
		tmp = 2.0 / (t * z);
	elseif (t <= 2.5e-203)
		tmp = 2.0 / t;
	elseif (t <= 7200000000.0)
		tmp = (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, -4.4e-7], t$95$1, If[LessEqual[t, -3.8e-134], N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, -2e-158], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, -2.05e-281], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e-203], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, 7200000000.0], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

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

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

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

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

\mathbf{elif}\;t \leq 2.5 \cdot 10^{-203}:\\
\;\;\;\;\frac{2}{t}\\

\mathbf{elif}\;t \leq 7200000000:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -4.4000000000000002e-7 or 7.2e9 < t

    1. Initial program 70.0%

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

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

    if -4.4000000000000002e-7 < t < -3.80000000000000003e-134

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{2}{t \cdot z}} \]
    9. Step-by-step derivation
      1. associate-/l/59.5%

        \[\leadsto \color{blue}{\frac{\frac{2}{z}}{t}} \]
    10. Simplified59.5%

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

    if -3.80000000000000003e-134 < t < -2.00000000000000013e-158 or -2.05e-281 < t < 2.5000000000000001e-203

    1. Initial program 96.8%

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

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

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

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

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

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

    if -2.00000000000000013e-158 < t < -2.05e-281

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.5000000000000001e-203 < t < 7.2e9

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{2}{t \cdot z}} \]
    9. Step-by-step derivation
      1. associate-/l/62.0%

        \[\leadsto \color{blue}{\frac{\frac{2}{z}}{t}} \]
    10. Simplified62.0%

      \[\leadsto \color{blue}{\frac{\frac{2}{z}}{t}} \]
    11. Taylor expanded in z around 0 62.1%

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

        \[\leadsto \color{blue}{\frac{\frac{2}{t}}{z}} \]
    13. Simplified62.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.4 \cdot 10^{-7}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;t \leq -3.8 \cdot 10^{-134}:\\ \;\;\;\;\frac{\frac{2}{z}}{t}\\ \mathbf{elif}\;t \leq -2 \cdot 10^{-158}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq -2.05 \cdot 10^{-281}:\\ \;\;\;\;\frac{2}{t \cdot z}\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-203}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq 7200000000:\\ \;\;\;\;\frac{\frac{2}{t}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \]

Alternative 5: 65.3% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x y) < -3.0500000000000001e26 or 3500 < (/.f64 x y)

    1. Initial program 82.8%

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

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

    if -3.0500000000000001e26 < (/.f64 x y) < 3500

    1. Initial program 86.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \frac{1}{t} - 2} \]
    9. Step-by-step derivation
      1. sub-neg59.1%

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

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

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

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

        \[\leadsto \color{blue}{-2 + \frac{2}{t}} \]
    10. Simplified59.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -3.05 \cdot 10^{+26} \lor \neg \left(\frac{x}{y} \leq 3500\right):\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t} + -2\\ \end{array} \]

Alternative 6: 92.2% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6.8 \cdot 10^{-15} \lor \neg \left(z \leq 7.5 \cdot 10^{-30}\right):\\ \;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} + \frac{2}{t \cdot z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -6.8e-15) (not (<= z 7.5e-30)))
   (+ (/ 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 <= -6.8e-15) || !(z <= 7.5e-30)) {
		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 <= (-6.8d-15)) .or. (.not. (z <= 7.5d-30))) 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 <= -6.8e-15) || !(z <= 7.5e-30)) {
		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 <= -6.8e-15) or not (z <= 7.5e-30):
		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 <= -6.8e-15) || !(z <= 7.5e-30))
		tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0));
	else
		tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(t * z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -6.8e-15) || ~((z <= 7.5e-30)))
		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, -6.8e-15], N[Not[LessEqual[z, 7.5e-30]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{-15} \lor \neg \left(z \leq 7.5 \cdot 10^{-30}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.8000000000000001e-15 or 7.5000000000000006e-30 < z

    1. Initial program 73.1%

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

      \[\leadsto \frac{x}{y} + \color{blue}{\left(\left(2 \cdot \frac{1}{t \cdot z} + \frac{2}{t}\right) - 2\right)} \]
    3. Step-by-step derivation
      1. associate--l+100.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{y} + \color{blue}{\left(\frac{\frac{2}{t}}{z} + \left(\frac{2}{t} + -2\right)\right)} \]
    5. Taylor expanded in z around inf 98.8%

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

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

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

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

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

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

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

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

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

    if -6.8000000000000001e-15 < z < 7.5000000000000006e-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. Taylor expanded in z around 0 86.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.8 \cdot 10^{-15} \lor \neg \left(z \leq 7.5 \cdot 10^{-30}\right):\\ \;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} + \frac{2}{t \cdot z}\\ \end{array} \]

Alternative 7: 52.4% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 83.8%

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

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

    if -2 < (/.f64 x y) < 2

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 81.6% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -0.0031 \lor \neg \left(t \leq 7200000000\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 -0.0031) (not (<= t 7200000000.0)))
   (- (/ x y) 2.0)
   (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -0.0031) || !(t <= 7200000000.0)) {
		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 <= (-0.0031d0)) .or. (.not. (t <= 7200000000.0d0))) 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 <= -0.0031) || !(t <= 7200000000.0)) {
		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 <= -0.0031) or not (t <= 7200000000.0):
		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 <= -0.0031) || !(t <= 7200000000.0))
		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 <= -0.0031) || ~((t <= 7200000000.0)))
		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, -0.0031], N[Not[LessEqual[t, 7200000000.0]], $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 -0.0031 \lor \neg \left(t \leq 7200000000\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 < -0.00309999999999999989 or 7.2e9 < t

    1. Initial program 69.8%

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

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

    if -0.00309999999999999989 < t < 7.2e9

    1. Initial program 99.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.0031 \lor \neg \left(t \leq 7200000000\right):\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{else}:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \end{array} \]

Alternative 9: 81.5% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;t \leq 6200000000:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\

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


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

    1. Initial program 66.1%

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

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

    if -6.40000000000000052e-4 < t < 6.2e9

    1. Initial program 99.0%

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

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

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

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

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

    if 6.2e9 < t

    1. Initial program 73.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{1}{y}, \frac{\mathsf{fma}\left(z, 2 \cdot \left(1 - t\right), 2\right)}{z \cdot t}\right)} \]
    4. Step-by-step derivation
      1. fma-udef73.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x + -2 \cdot y}{y}} \]
    7. Step-by-step derivation
      1. *-commutative89.2%

        \[\leadsto \frac{x + \color{blue}{y \cdot -2}}{y} \]
    8. Simplified89.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.00064:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;t \leq 6200000000:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + y \cdot -2}{y}\\ \end{array} \]

Alternative 10: 81.8% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;t \leq 6200000000:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\

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


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

    1. Initial program 66.6%

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

      \[\leadsto \frac{x}{y} + \color{blue}{\left(\left(2 \cdot \frac{1}{t \cdot z} + \frac{2}{t}\right) - 2\right)} \]
    3. Step-by-step derivation
      1. associate--l+100.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{y} + \color{blue}{\left(\frac{\frac{2}{t}}{z} + \left(\frac{2}{t} + -2\right)\right)} \]
    5. Taylor expanded in z around inf 85.3%

      \[\leadsto \color{blue}{\left(2 \cdot \frac{1}{t} + \frac{x}{y}\right) - 2} \]
    6. Step-by-step derivation
      1. sub-neg85.3%

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

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

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

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

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

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

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

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

    if -1.6500000000000001e-5 < t < 6.2e9

    1. Initial program 99.0%

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

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

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

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

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

    if 6.2e9 < t

    1. Initial program 73.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{1}{y}, \frac{\mathsf{fma}\left(z, 2 \cdot \left(1 - t\right), 2\right)}{z \cdot t}\right)} \]
    4. Step-by-step derivation
      1. fma-udef73.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x + -2 \cdot y}{y}} \]
    7. Step-by-step derivation
      1. *-commutative89.2%

        \[\leadsto \frac{x + \color{blue}{y \cdot -2}}{y} \]
    8. Simplified89.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.65 \cdot 10^{-5}:\\ \;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\ \mathbf{elif}\;t \leq 6200000000:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + y \cdot -2}{y}\\ \end{array} \]

Alternative 11: 61.0% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 75.3%

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

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

    if -5.1999999999999999e-20 < t < 5.3000000000000004e-84

    1. Initial program 98.7%

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

      \[\leadsto \frac{x}{y} + \color{blue}{\left(\left(2 \cdot \frac{1}{t \cdot z} + \frac{2}{t}\right) - 2\right)} \]
    3. Step-by-step derivation
      1. associate--l+98.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \frac{1}{t} - 2} \]
    9. Step-by-step derivation
      1. sub-neg44.7%

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

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

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

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

        \[\leadsto \color{blue}{-2 + \frac{2}{t}} \]
    10. Simplified44.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.2 \cdot 10^{-20} \lor \neg \left(t \leq 5.3 \cdot 10^{-84}\right):\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t} + -2\\ \end{array} \]

Alternative 12: 36.7% accurate, 2.4× speedup?

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

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

\mathbf{elif}\;t \leq 9.5 \cdot 10^{-38}:\\
\;\;\;\;\frac{2}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.0040000000000000001 or 9.5000000000000009e-38 < t

    1. Initial program 72.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0040000000000000001 < t < 9.5000000000000009e-38

    1. Initial program 98.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.004:\\ \;\;\;\;-2\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{-38}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{else}:\\ \;\;\;\;-2\\ \end{array} \]

Alternative 13: 19.9% accurate, 17.0× speedup?

\[\begin{array}{l} \\ -2 \end{array} \]
(FPCore (x y z t) :precision binary64 -2.0)
double code(double x, double y, double z, double t) {
	return -2.0;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = -2.0d0
end function
public static double code(double x, double y, double z, double t) {
	return -2.0;
}
def code(x, y, z, t):
	return -2.0
function code(x, y, z, t)
	return -2.0
end
function tmp = code(x, y, z, t)
	tmp = -2.0;
end
code[x_, y_, z_, t_] := -2.0
\begin{array}{l}

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

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

    \[\leadsto \frac{x}{y} + \color{blue}{\left(\left(2 \cdot \frac{1}{t \cdot z} + \frac{2}{t}\right) - 2\right)} \]
  3. Step-by-step derivation
    1. associate--l+99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-2} \]
  9. Final simplification22.0%

    \[\leadsto -2 \]

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 2023336 
(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))))