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

Percentage Accurate: 87.0% → 99.2%
Time: 10.9s
Alternatives: 15
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 15 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: 87.0% 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{2}{t \cdot 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(2.0 / Float64(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[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 68.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{2}{t \cdot z}\\ t_2 := \frac{x}{y} + \frac{2}{t}\\ t_3 := \frac{x}{y} - 2\\ \mathbf{if}\;t \leq -5.5 \cdot 10^{-35}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t \leq -2.8 \cdot 10^{-67}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -5.4 \cdot 10^{-299}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-199}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 0.205:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ 2.0 (* t z)))
        (t_2 (+ (/ x y) (/ 2.0 t)))
        (t_3 (- (/ x y) 2.0)))
   (if (<= t -5.5e-35)
     t_3
     (if (<= t -2.8e-67)
       t_1
       (if (<= t -5.4e-299)
         t_2
         (if (<= t 2.5e-199) t_1 (if (<= t 0.205) t_2 t_3)))))))
double code(double x, double y, double z, double t) {
	double t_1 = 2.0 / (t * z);
	double t_2 = (x / y) + (2.0 / t);
	double t_3 = (x / y) - 2.0;
	double tmp;
	if (t <= -5.5e-35) {
		tmp = t_3;
	} else if (t <= -2.8e-67) {
		tmp = t_1;
	} else if (t <= -5.4e-299) {
		tmp = t_2;
	} else if (t <= 2.5e-199) {
		tmp = t_1;
	} else if (t <= 0.205) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	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) :: t_3
    real(8) :: tmp
    t_1 = 2.0d0 / (t * z)
    t_2 = (x / y) + (2.0d0 / t)
    t_3 = (x / y) - 2.0d0
    if (t <= (-5.5d-35)) then
        tmp = t_3
    else if (t <= (-2.8d-67)) then
        tmp = t_1
    else if (t <= (-5.4d-299)) then
        tmp = t_2
    else if (t <= 2.5d-199) then
        tmp = t_1
    else if (t <= 0.205d0) then
        tmp = t_2
    else
        tmp = t_3
    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 / t);
	double t_3 = (x / y) - 2.0;
	double tmp;
	if (t <= -5.5e-35) {
		tmp = t_3;
	} else if (t <= -2.8e-67) {
		tmp = t_1;
	} else if (t <= -5.4e-299) {
		tmp = t_2;
	} else if (t <= 2.5e-199) {
		tmp = t_1;
	} else if (t <= 0.205) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = 2.0 / (t * z)
	t_2 = (x / y) + (2.0 / t)
	t_3 = (x / y) - 2.0
	tmp = 0
	if t <= -5.5e-35:
		tmp = t_3
	elif t <= -2.8e-67:
		tmp = t_1
	elif t <= -5.4e-299:
		tmp = t_2
	elif t <= 2.5e-199:
		tmp = t_1
	elif t <= 0.205:
		tmp = t_2
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t)
	t_1 = Float64(2.0 / Float64(t * z))
	t_2 = Float64(Float64(x / y) + Float64(2.0 / t))
	t_3 = Float64(Float64(x / y) - 2.0)
	tmp = 0.0
	if (t <= -5.5e-35)
		tmp = t_3;
	elseif (t <= -2.8e-67)
		tmp = t_1;
	elseif (t <= -5.4e-299)
		tmp = t_2;
	elseif (t <= 2.5e-199)
		tmp = t_1;
	elseif (t <= 0.205)
		tmp = t_2;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = 2.0 / (t * z);
	t_2 = (x / y) + (2.0 / t);
	t_3 = (x / y) - 2.0;
	tmp = 0.0;
	if (t <= -5.5e-35)
		tmp = t_3;
	elseif (t <= -2.8e-67)
		tmp = t_1;
	elseif (t <= -5.4e-299)
		tmp = t_2;
	elseif (t <= 2.5e-199)
		tmp = t_1;
	elseif (t <= 0.205)
		tmp = t_2;
	else
		tmp = t_3;
	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] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -5.5e-35], t$95$3, If[LessEqual[t, -2.8e-67], t$95$1, If[LessEqual[t, -5.4e-299], t$95$2, If[LessEqual[t, 2.5e-199], t$95$1, If[LessEqual[t, 0.205], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -2.8 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -5.4 \cdot 10^{-299}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t \leq 0.205:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.4999999999999997e-35 or 0.204999999999999988 < t

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

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

    if -5.4999999999999997e-35 < t < -2.8000000000000001e-67 or -5.40000000000000004e-299 < t < 2.4999999999999998e-199

    1. Initial program 91.8%

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

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

    if -2.8000000000000001e-67 < t < -5.40000000000000004e-299 or 2.4999999999999998e-199 < t < 0.204999999999999988

    1. Initial program 98.7%

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

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

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

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

      \[\leadsto \frac{x}{y} + \frac{\color{blue}{2}}{t} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 80.7% accurate, 0.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.8000000000000003e-32 or 5.00000000000000046e55 < t

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

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

    if -4.8000000000000003e-32 < t < 1.1e-151

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

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

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

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

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

    if 1.1e-151 < t < 5.00000000000000046e55

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 98.3% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.3999999999999999e24 < t < 1

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

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

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

Alternative 5: 98.3% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -102 or 2.49999999999999989e-7 < z

    1. Initial program 76.2%

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

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

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

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

    if -102 < z < 2.49999999999999989e-7

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 92.3% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.9e-21 or 1.36000000000000001e-13 < z

    1. Initial program 77.1%

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

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

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

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

    if -2.9e-21 < z < 1.36000000000000001e-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 t around inf 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 76.4% accurate, 0.8× speedup?

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

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

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


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

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

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

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

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

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

    if -0.0179999999999999986 < (/.f64 x y) < 1.1e30

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 61.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} - 2\\ \mathbf{if}\;t \leq -9.5 \cdot 10^{-36}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-198}:\\ \;\;\;\;\frac{\frac{2}{t}}{z}\\ \mathbf{elif}\;t \leq 3 \cdot 10^{-159}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (/ x y) 2.0)))
   (if (<= t -9.5e-36)
     t_1
     (if (<= t 7.5e-198) (/ (/ 2.0 t) z) (if (<= t 3e-159) (/ 2.0 t) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = (x / y) - 2.0;
	double tmp;
	if (t <= -9.5e-36) {
		tmp = t_1;
	} else if (t <= 7.5e-198) {
		tmp = (2.0 / t) / z;
	} else if (t <= 3e-159) {
		tmp = 2.0 / t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x / y) - 2.0d0
    if (t <= (-9.5d-36)) then
        tmp = t_1
    else if (t <= 7.5d-198) then
        tmp = (2.0d0 / t) / z
    else if (t <= 3d-159) then
        tmp = 2.0d0 / t
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / y) - 2.0;
	double tmp;
	if (t <= -9.5e-36) {
		tmp = t_1;
	} else if (t <= 7.5e-198) {
		tmp = (2.0 / t) / z;
	} else if (t <= 3e-159) {
		tmp = 2.0 / t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x / y) - 2.0
	tmp = 0
	if t <= -9.5e-36:
		tmp = t_1
	elif t <= 7.5e-198:
		tmp = (2.0 / t) / z
	elif t <= 3e-159:
		tmp = 2.0 / t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x / y) - 2.0)
	tmp = 0.0
	if (t <= -9.5e-36)
		tmp = t_1;
	elseif (t <= 7.5e-198)
		tmp = Float64(Float64(2.0 / t) / z);
	elseif (t <= 3e-159)
		tmp = Float64(2.0 / t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x / y) - 2.0;
	tmp = 0.0;
	if (t <= -9.5e-36)
		tmp = t_1;
	elseif (t <= 7.5e-198)
		tmp = (2.0 / t) / z;
	elseif (t <= 3e-159)
		tmp = 2.0 / t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -9.5e-36], t$95$1, If[LessEqual[t, 7.5e-198], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 3e-159], N[(2.0 / t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -9.5000000000000003e-36 or 3.00000000000000009e-159 < t

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

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

    if -9.5000000000000003e-36 < t < 7.50000000000000064e-198

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{2}{t}}{z}} \]
    8. Simplified53.9%

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

    if 7.50000000000000064e-198 < t < 3.00000000000000009e-159

    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 inf 92.1%

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

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

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

      \[\leadsto \color{blue}{\frac{2}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 9: 61.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} - 2\\ \mathbf{if}\;t \leq -2.1 \cdot 10^{-32}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 6.4 \cdot 10^{-196}:\\ \;\;\;\;\frac{2}{t \cdot z}\\ \mathbf{elif}\;t \leq 5.3 \cdot 10^{-160}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (/ x y) 2.0)))
   (if (<= t -2.1e-32)
     t_1
     (if (<= t 6.4e-196) (/ 2.0 (* t z)) (if (<= t 5.3e-160) (/ 2.0 t) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = (x / y) - 2.0;
	double tmp;
	if (t <= -2.1e-32) {
		tmp = t_1;
	} else if (t <= 6.4e-196) {
		tmp = 2.0 / (t * z);
	} else if (t <= 5.3e-160) {
		tmp = 2.0 / t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x / y) - 2.0d0
    if (t <= (-2.1d-32)) then
        tmp = t_1
    else if (t <= 6.4d-196) then
        tmp = 2.0d0 / (t * z)
    else if (t <= 5.3d-160) then
        tmp = 2.0d0 / t
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / y) - 2.0;
	double tmp;
	if (t <= -2.1e-32) {
		tmp = t_1;
	} else if (t <= 6.4e-196) {
		tmp = 2.0 / (t * z);
	} else if (t <= 5.3e-160) {
		tmp = 2.0 / t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x / y) - 2.0
	tmp = 0
	if t <= -2.1e-32:
		tmp = t_1
	elif t <= 6.4e-196:
		tmp = 2.0 / (t * z)
	elif t <= 5.3e-160:
		tmp = 2.0 / t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x / y) - 2.0)
	tmp = 0.0
	if (t <= -2.1e-32)
		tmp = t_1;
	elseif (t <= 6.4e-196)
		tmp = Float64(2.0 / Float64(t * z));
	elseif (t <= 5.3e-160)
		tmp = Float64(2.0 / t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x / y) - 2.0;
	tmp = 0.0;
	if (t <= -2.1e-32)
		tmp = t_1;
	elseif (t <= 6.4e-196)
		tmp = 2.0 / (t * z);
	elseif (t <= 5.3e-160)
		tmp = 2.0 / t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -2.1e-32], t$95$1, If[LessEqual[t, 6.4e-196], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.3e-160], N[(2.0 / t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.0999999999999999e-32 or 5.3000000000000001e-160 < t

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

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

    if -2.0999999999999999e-32 < t < 6.3999999999999999e-196

    1. Initial program 97.1%

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

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

    if 6.3999999999999999e-196 < t < 5.3000000000000001e-160

    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 inf 92.1%

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

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

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

      \[\leadsto \color{blue}{\frac{2}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 10: 64.3% accurate, 0.9× speedup?

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

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


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

    1. Initial program 85.0%

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

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

    if -9.5 < (/.f64 x y) < 9.79999999999999974e39

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \frac{1 - t}{t}} \]
    7. Taylor expanded in t around inf 59.8%

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

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

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

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

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

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

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

Alternative 11: 64.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -100000 \lor \neg \left(\frac{x}{y} \leq 9.8 \cdot 10^{+39}\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) -100000.0) (not (<= (/ x y) 9.8e+39)))
   (/ x y)
   (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((x / y) <= -100000.0) || !((x / y) <= 9.8e+39)) {
		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) <= (-100000.0d0)) .or. (.not. ((x / y) <= 9.8d+39))) 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) <= -100000.0) || !((x / y) <= 9.8e+39)) {
		tmp = x / y;
	} else {
		tmp = (2.0 / t) + -2.0;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((x / y) <= -100000.0) or not ((x / y) <= 9.8e+39):
		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) <= -100000.0) || !(Float64(x / y) <= 9.8e+39))
		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) <= -100000.0) || ~(((x / y) <= 9.8e+39)))
		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], -100000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 9.8e+39]], $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 -100000 \lor \neg \left(\frac{x}{y} \leq 9.8 \cdot 10^{+39}\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) < -1e5 or 9.79999999999999974e39 < (/.f64 x y)

    1. Initial program 85.0%

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

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

    if -1e5 < (/.f64 x y) < 9.79999999999999974e39

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \frac{1 - t}{t}} \]
    7. Taylor expanded in t around inf 59.8%

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

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

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

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

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

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

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

Alternative 12: 78.4% accurate, 1.0× speedup?

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

    1. Initial program 78.9%

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

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

    if -4.4e-32 < t < 2.9000000000000001e-78

    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 simplification83.0%

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

Alternative 13: 53.0% accurate, 1.0× speedup?

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

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

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


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

    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 x around inf 68.9%

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

    if -0.0850000000000000061 < (/.f64 x y) < 1.35000000000000002e-4

    1. Initial program 87.0%

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

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

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

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

Alternative 14: 36.3% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;t \leq 0.205:\\
\;\;\;\;\frac{2}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.44999999999999987e-9 or 0.204999999999999988 < t

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

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

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

    if -3.44999999999999987e-9 < t < 0.204999999999999988

    1. Initial program 97.4%

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

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

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

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

      \[\leadsto \color{blue}{\frac{2}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 20.5% 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 86.6%

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

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

    \[\leadsto \color{blue}{-2} \]
  5. Add Preprocessing

Developer Target 1: 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 2024185 
(FPCore (x y z t)
  :name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
  :precision binary64

  :alt
  (! :herbie-platform default (- (/ (+ (/ 2 z) 2) t) (- 2 (/ x y))))

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