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

Percentage Accurate: 86.7% → 99.0%
Time: 12.6s
Alternatives: 11
Speedup: 1.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 86.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.0% 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 83.8%

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

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

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

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

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

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

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

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

Alternative 2: 63.6% accurate, 0.7× 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.35 \cdot 10^{-7}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -9.5 \cdot 10^{-275}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{-306}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{+17}:\\ \;\;\;\;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.35e-7)
     t_2
     (if (<= t -9.5e-275)
       t_1
       (if (<= t 2.3e-306) (/ 2.0 t) (if (<= t 1.6e+17) 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.35e-7) {
		tmp = t_2;
	} else if (t <= -9.5e-275) {
		tmp = t_1;
	} else if (t <= 2.3e-306) {
		tmp = 2.0 / t;
	} else if (t <= 1.6e+17) {
		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.35d-7)) then
        tmp = t_2
    else if (t <= (-9.5d-275)) then
        tmp = t_1
    else if (t <= 2.3d-306) then
        tmp = 2.0d0 / t
    else if (t <= 1.6d+17) 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.35e-7) {
		tmp = t_2;
	} else if (t <= -9.5e-275) {
		tmp = t_1;
	} else if (t <= 2.3e-306) {
		tmp = 2.0 / t;
	} else if (t <= 1.6e+17) {
		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.35e-7:
		tmp = t_2
	elif t <= -9.5e-275:
		tmp = t_1
	elif t <= 2.3e-306:
		tmp = 2.0 / t
	elif t <= 1.6e+17:
		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.35e-7)
		tmp = t_2;
	elseif (t <= -9.5e-275)
		tmp = t_1;
	elseif (t <= 2.3e-306)
		tmp = Float64(2.0 / t);
	elseif (t <= 1.6e+17)
		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.35e-7)
		tmp = t_2;
	elseif (t <= -9.5e-275)
		tmp = t_1;
	elseif (t <= 2.3e-306)
		tmp = 2.0 / t;
	elseif (t <= 1.6e+17)
		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.35e-7], t$95$2, If[LessEqual[t, -9.5e-275], t$95$1, If[LessEqual[t, 2.3e-306], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, 1.6e+17], 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.35 \cdot 10^{-7}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq -9.5 \cdot 10^{-275}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 1.6 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.35000000000000004e-7 or 1.6e17 < 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. Add Preprocessing
    3. Taylor expanded in t around inf 89.8%

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

    if -1.35000000000000004e-7 < t < -9.49999999999999961e-275 or 2.29999999999999989e-306 < t < 1.6e17

    1. Initial program 96.8%

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

      \[\leadsto \frac{x}{y} + \color{blue}{\left(\left(2 \cdot \frac{1}{t \cdot z} + \frac{2}{t}\right) - 2\right)} \]
    4. Step-by-step derivation
      1. associate--l+96.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/96.9%

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

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

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

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

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

    if -9.49999999999999961e-275 < t < 2.29999999999999989e-306

    1. Initial program 99.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.35 \cdot 10^{-7}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;t \leq -9.5 \cdot 10^{-275}:\\ \;\;\;\;\frac{2}{t \cdot z}\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{-306}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{+17}:\\ \;\;\;\;\frac{2}{t \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 63.5% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} - 2\\ \mathbf{if}\;t \leq -9.2 \cdot 10^{-8}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -4.6 \cdot 10^{-270}:\\ \;\;\;\;\frac{\frac{2}{t}}{z}\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-305}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{+17}:\\ \;\;\;\;\frac{2}{t \cdot 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 -9.2e-8)
     t_1
     (if (<= t -4.6e-270)
       (/ (/ 2.0 t) z)
       (if (<= t 3.8e-305)
         (/ 2.0 t)
         (if (<= t 1.6e+17) (/ 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 <= -9.2e-8) {
		tmp = t_1;
	} else if (t <= -4.6e-270) {
		tmp = (2.0 / t) / z;
	} else if (t <= 3.8e-305) {
		tmp = 2.0 / t;
	} else if (t <= 1.6e+17) {
		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 <= (-9.2d-8)) then
        tmp = t_1
    else if (t <= (-4.6d-270)) then
        tmp = (2.0d0 / t) / z
    else if (t <= 3.8d-305) then
        tmp = 2.0d0 / t
    else if (t <= 1.6d+17) 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 <= -9.2e-8) {
		tmp = t_1;
	} else if (t <= -4.6e-270) {
		tmp = (2.0 / t) / z;
	} else if (t <= 3.8e-305) {
		tmp = 2.0 / t;
	} else if (t <= 1.6e+17) {
		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 <= -9.2e-8:
		tmp = t_1
	elif t <= -4.6e-270:
		tmp = (2.0 / t) / z
	elif t <= 3.8e-305:
		tmp = 2.0 / t
	elif t <= 1.6e+17:
		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 <= -9.2e-8)
		tmp = t_1;
	elseif (t <= -4.6e-270)
		tmp = Float64(Float64(2.0 / t) / z);
	elseif (t <= 3.8e-305)
		tmp = Float64(2.0 / t);
	elseif (t <= 1.6e+17)
		tmp = Float64(2.0 / Float64(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 <= -9.2e-8)
		tmp = t_1;
	elseif (t <= -4.6e-270)
		tmp = (2.0 / t) / z;
	elseif (t <= 3.8e-305)
		tmp = 2.0 / t;
	elseif (t <= 1.6e+17)
		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, -9.2e-8], t$95$1, If[LessEqual[t, -4.6e-270], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 3.8e-305], N[(2.0 / t), $MachinePrecision], If[LessEqual[t, 1.6e+17], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -9.2000000000000003e-8 or 1.6e17 < 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. Add Preprocessing
    3. Taylor expanded in t around inf 89.8%

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

    if -9.2000000000000003e-8 < t < -4.6000000000000003e-270

    1. Initial program 99.6%

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

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

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

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

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

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

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

    if -4.6000000000000003e-270 < t < 3.8e-305

    1. Initial program 99.5%

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

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

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

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

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

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

    if 3.8e-305 < t < 1.6e17

    1. Initial program 94.4%

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

      \[\leadsto \frac{x}{y} + \color{blue}{\left(\left(2 \cdot \frac{1}{t \cdot z} + \frac{2}{t}\right) - 2\right)} \]
    4. Step-by-step derivation
      1. associate--l+94.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/94.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9.2 \cdot 10^{-8}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;t \leq -4.6 \cdot 10^{-270}:\\ \;\;\;\;\frac{\frac{2}{t}}{z}\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-305}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{+17}:\\ \;\;\;\;\frac{2}{t \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 93.0% accurate, 0.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{2}{t \cdot z} + \left(\frac{2}{t} + -2\right)\\


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

    1. Initial program 82.7%

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

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

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

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

    if -2e20 < (/.f64 x y) < 1.00000000000000004e42

    1. Initial program 84.7%

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

      \[\leadsto \frac{x}{y} + \color{blue}{\left(\left(2 \cdot \frac{1}{t \cdot z} + \frac{2}{t}\right) - 2\right)} \]
    4. 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. Simplified99.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 52.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1300000000000:\\
\;\;\;\;\frac{x}{y}\\

\mathbf{elif}\;\frac{x}{y} \leq 0.0011:\\
\;\;\;\;-2\\

\mathbf{elif}\;\frac{x}{y} \leq 5.3 \cdot 10^{+41}:\\
\;\;\;\;\frac{2}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 x y) < -1.3e12 or 5.2999999999999997e41 < (/.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. Add Preprocessing
    3. Taylor expanded in x around inf 77.4%

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

    if -1.3e12 < (/.f64 x y) < 0.00110000000000000007

    1. Initial program 86.1%

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

      \[\leadsto \color{blue}{\frac{x}{y} - 2} \]
    4. Taylor expanded in x around 0 42.7%

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

    if 0.00110000000000000007 < (/.f64 x y) < 5.2999999999999997e41

    1. Initial program 72.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -1300000000000:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq 0.0011:\\ \;\;\;\;-2\\ \mathbf{elif}\;\frac{x}{y} \leq 5.3 \cdot 10^{+41}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 91.3% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-36} \lor \neg \left(z \leq 2.5 \cdot 10^{-13}\right):\\
\;\;\;\;\frac{2}{t} + \left(\frac{x}{y} + -2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.75e-36 or 2.49999999999999995e-13 < z

    1. Initial program 71.7%

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

      \[\leadsto \frac{x}{y} + \color{blue}{\left(\left(2 \cdot \frac{1}{t \cdot z} + \frac{2}{t}\right) - 2\right)} \]
    4. 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. Simplified100.0%

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

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

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

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

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

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

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

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

    if -1.75e-36 < z < 2.49999999999999995e-13

    1. Initial program 97.3%

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

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

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

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

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

Alternative 7: 80.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -220000000 \lor \neg \left(t \leq 5 \cdot 10^{+19}\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 -220000000.0) (not (<= t 5e+19)))
   (- (/ x y) 2.0)
   (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -220000000.0) || !(t <= 5e+19)) {
		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 <= (-220000000.0d0)) .or. (.not. (t <= 5d+19))) 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 <= -220000000.0) || !(t <= 5e+19)) {
		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 <= -220000000.0) or not (t <= 5e+19):
		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 <= -220000000.0) || !(t <= 5e+19))
		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 <= -220000000.0) || ~((t <= 5e+19)))
		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, -220000000.0], N[Not[LessEqual[t, 5e+19]], $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 -220000000 \lor \neg \left(t \leq 5 \cdot 10^{+19}\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 < -2.2e8 or 5e19 < t

    1. Initial program 73.2%

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

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

    if -2.2e8 < t < 5e19

    1. Initial program 97.0%

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

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

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

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

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

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

Alternative 8: 81.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 74.6%

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

      \[\leadsto \frac{x}{y} + \color{blue}{\left(\left(2 \cdot \frac{1}{t \cdot z} + \frac{2}{t}\right) - 2\right)} \]
    4. 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. Simplified100.0%

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

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

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

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

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

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

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

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

    if -1.18e-7 < t < 5e19

    1. Initial program 97.0%

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

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

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

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

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

    if 5e19 < t

    1. Initial program 72.2%

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

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

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

Alternative 9: 60.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{-6} \lor \neg \left(t \leq 1.65 \cdot 10^{-51}\right):\\
\;\;\;\;\frac{x}{y} - 2\\

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


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

    1. Initial program 75.4%

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

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

    if -1.70000000000000003e-6 < t < 1.64999999999999986e-51

    1. Initial program 96.7%

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

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

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

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

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

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

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

Alternative 10: 36.5% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;t \leq 1.6 \cdot 10^{+17}:\\
\;\;\;\;\frac{2}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.7e20 or 1.6e17 < t

    1. Initial program 73.4%

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

      \[\leadsto \color{blue}{\frac{x}{y} - 2} \]
    4. Taylor expanded in x around 0 37.5%

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

    if -5.7e20 < t < 1.6e17

    1. Initial program 97.0%

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

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

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

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

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

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

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

Alternative 11: 20.2% 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 83.8%

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

    \[\leadsto \color{blue}{\frac{x}{y} - 2} \]
  4. Taylor expanded in x around 0 22.1%

    \[\leadsto \color{blue}{-2} \]
  5. Final simplification22.1%

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

Developer target: 99.0% 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 2024096 
(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))))