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

Percentage Accurate: 87.0% → 99.1%
Time: 10.5s
Alternatives: 13
Speedup: 1.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 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.1% accurate, 1.3× speedup?

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

\\
\frac{2 + \frac{2}{z}}{t} + \left(-2 + \frac{x}{y}\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. Step-by-step derivation
    1. +-commutative86.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in t around inf 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 62.5% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;t \leq 4 \cdot 10^{-182}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.19999999999999975e45 or 0.014200000000000001 < t

    1. Initial program 73.5%

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

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

    if -6.19999999999999975e45 < t < 4.0000000000000002e-182 or 2.50000000000000016e-159 < t < 0.014200000000000001

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      14. remove-double-neg98.2%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.0000000000000002e-182 < t < 2.50000000000000016e-159

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.2 \cdot 10^{+45}:\\ \;\;\;\;-2 + \frac{x}{y}\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-182}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-159}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq 0.0142:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;-2 + \frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 62.5% accurate, 0.7× speedup?

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

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

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

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

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

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


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

    1. Initial program 73.5%

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

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

    if -6.00000000000000021e45 < t < 1.69999999999999991e-180

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      14. remove-double-neg98.7%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{2}{t}}{z}} \]
    10. Simplified55.3%

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

    if 1.69999999999999991e-180 < t < 3.60000000000000021e-159

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

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

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

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

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

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

    if 3.60000000000000021e-159 < t < 0.010200000000000001

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{\color{blue}{z \cdot t}}, -\frac{-x}{y}\right) \]
      13. distribute-frac-neg96.5%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      14. remove-double-neg96.5%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6 \cdot 10^{+45}:\\ \;\;\;\;-2 + \frac{x}{y}\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{-180}:\\ \;\;\;\;\frac{\frac{2}{t}}{z}\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{-159}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;t \leq 0.0102:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;-2 + \frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 88.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2.4 \cdot 10^{-6} \lor \neg \left(\frac{x}{y} \leq 6.2 \cdot 10^{+34}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\

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


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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3999999999999999e-6 < (/.f64 x y) < 6.19999999999999955e34

    1. Initial program 86.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{\color{blue}{z \cdot t}}, -\frac{-x}{y}\right) \]
      13. distribute-frac-neg86.5%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      14. remove-double-neg86.5%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 92.5% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 86.2%

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

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

    if -3.8e16 < (/.f64 x y) < 1.29999999999999994e49

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 1 - t, 1\right)}, \frac{2}{t \cdot z}, -\frac{-x}{y}\right) \]
      12. *-commutative86.8%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{\color{blue}{z \cdot t}}, -\frac{-x}{y}\right) \]
      13. distribute-frac-neg86.8%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      14. remove-double-neg86.8%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -2 + \left(2 \cdot \frac{1}{t} + \frac{\color{blue}{2}}{z} \cdot \frac{1}{t}\right) \]
      13. distribute-rgt-in97.0%

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

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

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

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

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

Alternative 6: 84.9% accurate, 0.7× speedup?

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

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

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

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


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

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

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

    if -1.2e178 < (/.f64 x y) < 1.3999999999999999e67

    1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 1 - t, 1\right)}, \frac{2}{t \cdot z}, -\frac{-x}{y}\right) \]
      12. *-commutative86.8%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{\color{blue}{z \cdot t}}, -\frac{-x}{y}\right) \]
      13. distribute-frac-neg86.8%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      14. remove-double-neg86.8%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3999999999999999e67 < (/.f64 x y)

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

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

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

Alternative 7: 92.5% accurate, 0.7× speedup?

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

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

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

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


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

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

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

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

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

    if -5.0000000000000001e26 < (/.f64 x y) < 1.99999999999999989e49

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 1 - t, 1\right)}, \frac{2}{t \cdot z}, -\frac{-x}{y}\right) \]
      12. *-commutative86.8%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{\color{blue}{z \cdot t}}, -\frac{-x}{y}\right) \]
      13. distribute-frac-neg86.8%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      14. remove-double-neg86.8%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -2 + \left(2 \cdot \frac{1}{t} + \frac{\color{blue}{2}}{z} \cdot \frac{1}{t}\right) \]
      13. distribute-rgt-in97.0%

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

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

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

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

    if 1.99999999999999989e49 < (/.f64 x y)

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

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

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

Alternative 8: 64.4% accurate, 0.9× speedup?

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

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

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


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

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

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

    if -4.4e13 < (/.f64 x y) < 2.05e49

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 65.1% accurate, 0.9× speedup?

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

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

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


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

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

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

    if -1.4500000000000001e-8 < (/.f64 x y) < 2.05e-4

    1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 52.6% accurate, 1.0× speedup?

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

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

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


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

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

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

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

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      14. remove-double-neg86.3%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 84.1%

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

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

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

Alternative 11: 79.8% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.00000000000000021e45 or 1.1000000000000001 < t

    1. Initial program 73.5%

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

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

    if -6.00000000000000021e45 < t < 1.1000000000000001

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

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

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

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

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

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

Alternative 12: 37.0% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 74.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      14. remove-double-neg74.7%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 37.5%

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

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

    if -1 < t < 1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around 0 61.3%

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

    \[\leadsto 2 \cdot \color{blue}{-1} \]
  7. Final simplification19.6%

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

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

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

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