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

Percentage Accurate: 86.4% → 99.0%
Time: 9.0s
Alternatives: 12
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 12 alternatives:

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

Initial Program: 86.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.0% accurate, 1.3× speedup?

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

\\
\left(-2 + \frac{x}{y}\right) + \frac{2 + \frac{2}{z}}{t}
\end{array}
Derivation
  1. Initial program 89.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. +-commutative89.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-neg89.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-neg89.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-neg89.3%

      \[\leadsto \color{blue}{\frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} - \frac{-x}{y}} \]
    5. *-commutative89.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*89.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-in89.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*89.2%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - t\right) \cdot z + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
    10. *-commutative89.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-define89.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. *-commutative89.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-neg89.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-neg89.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. Simplified89.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 99.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+99.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 66.1% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
t_2 := -2 + \frac{2}{t}\\
\mathbf{if}\;\frac{x}{y} \leq -0.175:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;\frac{x}{y} \leq 2.9 \cdot 10^{-154}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;\frac{x}{y} \leq 1.55 \cdot 10^{-18}:\\
\;\;\;\;t\_2\\

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

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


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

    1. Initial program 89.6%

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

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

    if -0.17499999999999999 < (/.f64 x y) < 2.9e-154 or 3.80000000000000012e-124 < (/.f64 x y) < 1.55000000000000003e-18

    1. Initial program 88.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. +-commutative88.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-neg88.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-neg88.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-neg88.8%

        \[\leadsto \color{blue}{\frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} - \frac{-x}{y}} \]
      5. *-commutative88.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*88.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-in88.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*88.6%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - t\right) \cdot z + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
      10. *-commutative88.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-define88.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. *-commutative88.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-neg88.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-neg88.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. Simplified88.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 100.0%

      \[\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+100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.9e-154 < (/.f64 x y) < 3.80000000000000012e-124

    1. Initial program 99.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. +-commutative99.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-neg99.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-neg99.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-neg99.8%

        \[\leadsto \color{blue}{\frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} - \frac{-x}{y}} \]
      5. *-commutative99.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*99.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-in99.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*99.3%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - t\right) \cdot z + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
      10. *-commutative99.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-define99.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. *-commutative99.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-neg99.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-neg99.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. Simplified99.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 t around inf 99.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+99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.55000000000000003e-18 < (/.f64 x y) < 2.29999999999999994e40

    1. Initial program 83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -0.175:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;\frac{x}{y} \leq 2.9 \cdot 10^{-154}:\\ \;\;\;\;-2 + \frac{2}{t}\\ \mathbf{elif}\;\frac{x}{y} \leq 3.8 \cdot 10^{-124}:\\ \;\;\;\;\frac{\frac{2}{t}}{z}\\ \mathbf{elif}\;\frac{x}{y} \leq 1.55 \cdot 10^{-18}:\\ \;\;\;\;-2 + \frac{2}{t}\\ \mathbf{elif}\;\frac{x}{y} \leq 2.3 \cdot 10^{+40}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 66.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{2}{z \cdot t}\\ t_2 := \frac{x}{y} - 2\\ t_3 := -2 + \frac{2}{t}\\ \mathbf{if}\;\frac{x}{y} \leq -0.012:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;\frac{x}{y} \leq 7 \cdot 10^{-151}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;\frac{x}{y} \leq 2.7 \cdot 10^{-124}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{x}{y} \leq 1.55 \cdot 10^{-18}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;\frac{x}{y} \leq 1.45 \cdot 10^{+38}:\\ \;\;\;\;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 (- (/ x y) 2.0)) (t_3 (+ -2.0 (/ 2.0 t))))
   (if (<= (/ x y) -0.012)
     t_2
     (if (<= (/ x y) 7e-151)
       t_3
       (if (<= (/ x y) 2.7e-124)
         t_1
         (if (<= (/ x y) 1.55e-18) t_3 (if (<= (/ x y) 1.45e+38) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
	double t_1 = 2.0 / (z * t);
	double t_2 = (x / y) - 2.0;
	double t_3 = -2.0 + (2.0 / t);
	double tmp;
	if ((x / y) <= -0.012) {
		tmp = t_2;
	} else if ((x / y) <= 7e-151) {
		tmp = t_3;
	} else if ((x / y) <= 2.7e-124) {
		tmp = t_1;
	} else if ((x / y) <= 1.55e-18) {
		tmp = t_3;
	} else if ((x / y) <= 1.45e+38) {
		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) :: t_3
    real(8) :: tmp
    t_1 = 2.0d0 / (z * t)
    t_2 = (x / y) - 2.0d0
    t_3 = (-2.0d0) + (2.0d0 / t)
    if ((x / y) <= (-0.012d0)) then
        tmp = t_2
    else if ((x / y) <= 7d-151) then
        tmp = t_3
    else if ((x / y) <= 2.7d-124) then
        tmp = t_1
    else if ((x / y) <= 1.55d-18) then
        tmp = t_3
    else if ((x / y) <= 1.45d+38) 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 = (x / y) - 2.0;
	double t_3 = -2.0 + (2.0 / t);
	double tmp;
	if ((x / y) <= -0.012) {
		tmp = t_2;
	} else if ((x / y) <= 7e-151) {
		tmp = t_3;
	} else if ((x / y) <= 2.7e-124) {
		tmp = t_1;
	} else if ((x / y) <= 1.55e-18) {
		tmp = t_3;
	} else if ((x / y) <= 1.45e+38) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = 2.0 / (z * t)
	t_2 = (x / y) - 2.0
	t_3 = -2.0 + (2.0 / t)
	tmp = 0
	if (x / y) <= -0.012:
		tmp = t_2
	elif (x / y) <= 7e-151:
		tmp = t_3
	elif (x / y) <= 2.7e-124:
		tmp = t_1
	elif (x / y) <= 1.55e-18:
		tmp = t_3
	elif (x / y) <= 1.45e+38:
		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(Float64(x / y) - 2.0)
	t_3 = Float64(-2.0 + Float64(2.0 / t))
	tmp = 0.0
	if (Float64(x / y) <= -0.012)
		tmp = t_2;
	elseif (Float64(x / y) <= 7e-151)
		tmp = t_3;
	elseif (Float64(x / y) <= 2.7e-124)
		tmp = t_1;
	elseif (Float64(x / y) <= 1.55e-18)
		tmp = t_3;
	elseif (Float64(x / y) <= 1.45e+38)
		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 = (x / y) - 2.0;
	t_3 = -2.0 + (2.0 / t);
	tmp = 0.0;
	if ((x / y) <= -0.012)
		tmp = t_2;
	elseif ((x / y) <= 7e-151)
		tmp = t_3;
	elseif ((x / y) <= 2.7e-124)
		tmp = t_1;
	elseif ((x / y) <= 1.55e-18)
		tmp = t_3;
	elseif ((x / y) <= 1.45e+38)
		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[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, Block[{t$95$3 = N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -0.012], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], 7e-151], t$95$3, If[LessEqual[N[(x / y), $MachinePrecision], 2.7e-124], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 1.55e-18], t$95$3, If[LessEqual[N[(x / y), $MachinePrecision], 1.45e+38], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;\frac{x}{y} \leq 7 \cdot 10^{-151}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;\frac{x}{y} \leq 2.7 \cdot 10^{-124}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;\frac{x}{y} \leq 1.55 \cdot 10^{-18}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;\frac{x}{y} \leq 1.45 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 89.6%

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

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

    if -0.012 < (/.f64 x y) < 6.99999999999999991e-151 or 2.70000000000000018e-124 < (/.f64 x y) < 1.55000000000000003e-18

    1. Initial program 88.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. +-commutative88.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-neg88.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-neg88.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-neg88.8%

        \[\leadsto \color{blue}{\frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} - \frac{-x}{y}} \]
      5. *-commutative88.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*88.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-in88.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*88.6%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - t\right) \cdot z + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
      10. *-commutative88.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-define88.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. *-commutative88.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-neg88.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-neg88.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. Simplified88.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 100.0%

      \[\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+100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.99999999999999991e-151 < (/.f64 x y) < 2.70000000000000018e-124 or 1.55000000000000003e-18 < (/.f64 x y) < 1.45000000000000003e38

    1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - t\right) \cdot z + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
      10. *-commutative91.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-define91.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. *-commutative91.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-neg91.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-neg91.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. Simplified91.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.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+99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -0.012:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;\frac{x}{y} \leq 7 \cdot 10^{-151}:\\ \;\;\;\;-2 + \frac{2}{t}\\ \mathbf{elif}\;\frac{x}{y} \leq 2.7 \cdot 10^{-124}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{elif}\;\frac{x}{y} \leq 1.55 \cdot 10^{-18}:\\ \;\;\;\;-2 + \frac{2}{t}\\ \mathbf{elif}\;\frac{x}{y} \leq 1.45 \cdot 10^{+38}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 90.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;\frac{x}{y} \leq -100000000000:\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\

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

\mathbf{elif}\;\frac{x}{y} \leq 10^{+254}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 x y) < -1.9999999999999999e107 or 1e51 < (/.f64 x y) < 9.9999999999999994e253

    1. Initial program 90.5%

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

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

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

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

    if -1.9999999999999999e107 < (/.f64 x y) < -1e11

    1. Initial program 93.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 83.1%

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

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

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

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

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

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

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

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

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

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

    if -1e11 < (/.f64 x y) < 1e51

    1. Initial program 89.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. +-commutative89.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-neg89.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-neg89.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-neg89.5%

        \[\leadsto \color{blue}{\frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} - \frac{-x}{y}} \]
      5. *-commutative89.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*89.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-in89.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*89.3%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - t\right) \cdot z + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
      10. *-commutative89.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-define89.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. *-commutative89.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-neg89.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-neg89.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. Simplified89.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 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 98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999994e253 < (/.f64 x y)

    1. Initial program 80.0%

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{2}}{z} + \frac{t \cdot x}{y}}{t} \]
      3. +-commutative99.8%

        \[\leadsto \frac{\color{blue}{\frac{t \cdot x}{y} + \frac{2}{z}}}{t} \]
      4. associate-/l*95.0%

        \[\leadsto \frac{\color{blue}{t \cdot \frac{x}{y}} + \frac{2}{z}}{t} \]
    8. Simplified95.0%

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

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

Alternative 5: 91.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;\frac{x}{y} \leq -100000000000:\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 x y) < -1.9999999999999999e107 or 5.00000000000000028e-33 < (/.f64 x y)

    1. Initial program 87.5%

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

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

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

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

    if -1.9999999999999999e107 < (/.f64 x y) < -1e11

    1. Initial program 93.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 83.1%

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

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

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

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

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

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

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

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

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

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

    if -1e11 < (/.f64 x y) < 5.00000000000000028e-33

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 81.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t \leq -1.45 \cdot 10^{-246}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 1.8 \cdot 10^{-94}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.30000000000000001e-11 or 1.8e-94 < t

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

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

    if -4.30000000000000001e-11 < t < -1.45e-246 or -1.4e-246 < t < 1.8e-94

    1. Initial program 98.0%

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

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

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

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

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

    if -1.45e-246 < t < -1.4e-246

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{-11}:\\ \;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\ \mathbf{elif}\;t \leq -1.45 \cdot 10^{-246}:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \mathbf{elif}\;t \leq -1.4 \cdot 10^{-246}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{-94}:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 89.4% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.35e-123 or 6.4000000000000002e-52 < z

    1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

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

    if -1.35e-123 < z < 6.4000000000000002e-52

    1. Initial program 97.7%

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

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

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

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

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

Alternative 8: 63.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -3.5 \cdot 10^{+132} \lor \neg \left(\frac{x}{y} \leq 1.55 \cdot 10^{-18}\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) -3.5e+132) (not (<= (/ x y) 1.55e-18)))
   (/ x y)
   (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((x / y) <= -3.5e+132) || !((x / y) <= 1.55e-18)) {
		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) <= (-3.5d+132)) .or. (.not. ((x / y) <= 1.55d-18))) 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) <= -3.5e+132) || !((x / y) <= 1.55e-18)) {
		tmp = x / y;
	} else {
		tmp = -2.0 + (2.0 / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((x / y) <= -3.5e+132) or not ((x / y) <= 1.55e-18):
		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) <= -3.5e+132) || !(Float64(x / y) <= 1.55e-18))
		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) <= -3.5e+132) || ~(((x / y) <= 1.55e-18)))
		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], -3.5e+132], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1.55e-18]], $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 -3.5 \cdot 10^{+132} \lor \neg \left(\frac{x}{y} \leq 1.55 \cdot 10^{-18}\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) < -3.5000000000000002e132 or 1.55000000000000003e-18 < (/.f64 x y)

    1. Initial program 88.8%

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

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

    if -3.5000000000000002e132 < (/.f64 x y) < 1.55000000000000003e-18

    1. Initial program 89.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. +-commutative89.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-neg89.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-neg89.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-neg89.6%

        \[\leadsto \color{blue}{\frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} - \frac{-x}{y}} \]
      5. *-commutative89.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*89.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-in89.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*89.5%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - t\right) \cdot z + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
      10. *-commutative89.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-define89.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. *-commutative89.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-neg89.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-neg89.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. Simplified89.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 100.0%

      \[\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+100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 63.6% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 95.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 86.1%

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

    if -1.2999999999999999e133 < (/.f64 x y) < 2.8e-33

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.8e-33 < (/.f64 x y)

    1. Initial program 83.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 60.1%

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

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

Alternative 10: 80.6% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6e-10 or 1.30000000000000002e-17 < t

    1. Initial program 81.3%

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

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

    if -6e-10 < t < 1.30000000000000002e-17

    1. Initial program 98.2%

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

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

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

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

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

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

Alternative 11: 44.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -3.5 \cdot 10^{+132} \lor \neg \left(\frac{x}{y} \leq 7.6 \cdot 10^{-71}\right):\\
\;\;\;\;\frac{x}{y}\\

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


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

    1. Initial program 87.1%

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

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

    if -3.5000000000000002e132 < (/.f64 x y) < 7.59999999999999984e-71

    1. Initial program 91.0%

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

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

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

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

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

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

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

Alternative 12: 19.5% accurate, 5.7× speedup?

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

\\
\frac{2}{t}
\end{array}
Derivation
  1. Initial program 89.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 48.7%

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

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

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

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

    \[\leadsto \color{blue}{\frac{2}{t}} \]
  7. Add Preprocessing

Developer target: 99.0% accurate, 1.3× speedup?

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

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

Reproduce

?
herbie shell --seed 2024107 
(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))))