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

Percentage Accurate: 86.7% → 99.5%
Time: 11.7s
Alternatives: 13
Speedup: 0.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 86.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} + \frac{2 + \left(1 - t\right) \cdot \left(2 \cdot z\right)}{z \cdot t}\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ (/ x y) (/ (+ 2.0 (* (- 1.0 t) (* 2.0 z))) (* z t)))))
   (if (<= t_1 INFINITY) t_1 (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
	double t_1 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = (x / y) - 2.0;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = (x / y) - 2.0;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t))
	tmp = 0
	if t_1 <= math.inf:
		tmp = t_1
	else:
		tmp = (x / y) - 2.0
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(1.0 - t) * Float64(2.0 * z))) / Float64(z * t)))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(Float64(x / y) - 2.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t));
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = (x / y) - 2.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(1.0 - t), $MachinePrecision] * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2 + \left(1 - t\right) \cdot \left(2 \cdot z\right)}{z \cdot t}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (/.f64 x y) (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z))) < +inf.0

    1. Initial program 99.8%

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

    if +inf.0 < (+.f64 (/.f64 x y) (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)))

    1. Initial program 0.0%

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

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

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

Alternative 2: 62.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} - 2\\ t_2 := -2 + \frac{2}{t}\\ \mathbf{if}\;z \leq -1.65 \cdot 10^{+192}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{+169}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{+15}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{-109}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-61}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{elif}\;z \leq 88000000000000 \lor \neg \left(z \leq 9.2 \cdot 10^{+154}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \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 (<= z -1.65e+192)
     t_2
     (if (<= z -1.3e+169)
       t_1
       (if (<= z -3.6e+15)
         t_2
         (if (<= z -6.8e-109)
           t_1
           (if (<= z 3.5e-61)
             (/ 2.0 (* z t))
             (if (or (<= z 88000000000000.0) (not (<= z 9.2e+154)))
               t_1
               t_2))))))))
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 (z <= -1.65e+192) {
		tmp = t_2;
	} else if (z <= -1.3e+169) {
		tmp = t_1;
	} else if (z <= -3.6e+15) {
		tmp = t_2;
	} else if (z <= -6.8e-109) {
		tmp = t_1;
	} else if (z <= 3.5e-61) {
		tmp = 2.0 / (z * t);
	} else if ((z <= 88000000000000.0) || !(z <= 9.2e+154)) {
		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 = (x / y) - 2.0d0
    t_2 = (-2.0d0) + (2.0d0 / t)
    if (z <= (-1.65d+192)) then
        tmp = t_2
    else if (z <= (-1.3d+169)) then
        tmp = t_1
    else if (z <= (-3.6d+15)) then
        tmp = t_2
    else if (z <= (-6.8d-109)) then
        tmp = t_1
    else if (z <= 3.5d-61) then
        tmp = 2.0d0 / (z * t)
    else if ((z <= 88000000000000.0d0) .or. (.not. (z <= 9.2d+154))) 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 = (x / y) - 2.0;
	double t_2 = -2.0 + (2.0 / t);
	double tmp;
	if (z <= -1.65e+192) {
		tmp = t_2;
	} else if (z <= -1.3e+169) {
		tmp = t_1;
	} else if (z <= -3.6e+15) {
		tmp = t_2;
	} else if (z <= -6.8e-109) {
		tmp = t_1;
	} else if (z <= 3.5e-61) {
		tmp = 2.0 / (z * t);
	} else if ((z <= 88000000000000.0) || !(z <= 9.2e+154)) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x / y) - 2.0
	t_2 = -2.0 + (2.0 / t)
	tmp = 0
	if z <= -1.65e+192:
		tmp = t_2
	elif z <= -1.3e+169:
		tmp = t_1
	elif z <= -3.6e+15:
		tmp = t_2
	elif z <= -6.8e-109:
		tmp = t_1
	elif z <= 3.5e-61:
		tmp = 2.0 / (z * t)
	elif (z <= 88000000000000.0) or not (z <= 9.2e+154):
		tmp = t_1
	else:
		tmp = t_2
	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 (z <= -1.65e+192)
		tmp = t_2;
	elseif (z <= -1.3e+169)
		tmp = t_1;
	elseif (z <= -3.6e+15)
		tmp = t_2;
	elseif (z <= -6.8e-109)
		tmp = t_1;
	elseif (z <= 3.5e-61)
		tmp = Float64(2.0 / Float64(z * t));
	elseif ((z <= 88000000000000.0) || !(z <= 9.2e+154))
		tmp = t_1;
	else
		tmp = t_2;
	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 (z <= -1.65e+192)
		tmp = t_2;
	elseif (z <= -1.3e+169)
		tmp = t_1;
	elseif (z <= -3.6e+15)
		tmp = t_2;
	elseif (z <= -6.8e-109)
		tmp = t_1;
	elseif (z <= 3.5e-61)
		tmp = 2.0 / (z * t);
	elseif ((z <= 88000000000000.0) || ~((z <= 9.2e+154)))
		tmp = t_1;
	else
		tmp = t_2;
	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[z, -1.65e+192], t$95$2, If[LessEqual[z, -1.3e+169], t$95$1, If[LessEqual[z, -3.6e+15], t$95$2, If[LessEqual[z, -6.8e-109], t$95$1, If[LessEqual[z, 3.5e-61], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 88000000000000.0], N[Not[LessEqual[z, 9.2e+154]], $MachinePrecision]], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.3 \cdot 10^{+169}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -3.6 \cdot 10^{+15}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -6.8 \cdot 10^{-109}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 88000000000000 \lor \neg \left(z \leq 9.2 \cdot 10^{+154}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.65000000000000005e192 or -1.3e169 < z < -3.6e15 or 8.8e13 < z < 9.1999999999999999e154

    1. Initial program 83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 \cdot \frac{2 + \frac{2}{z}}{t}} + -2 \]
      9. *-lft-identity79.7%

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

        \[\leadsto \color{blue}{-2 + \frac{2 + \frac{2}{z}}{t}} \]
    11. Simplified79.7%

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

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

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

        \[\leadsto \frac{\color{blue}{2}}{t} - 2 \]
      3. sub-neg79.7%

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

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

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

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

    if -1.65000000000000005e192 < z < -1.3e169 or -3.6e15 < z < -6.80000000000000023e-109 or 3.5000000000000003e-61 < z < 8.8e13 or 9.1999999999999999e154 < z

    1. Initial program 78.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 76.6%

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

    if -6.80000000000000023e-109 < z < 3.5000000000000003e-61

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.65 \cdot 10^{+192}:\\ \;\;\;\;-2 + \frac{2}{t}\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{+169}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{+15}:\\ \;\;\;\;-2 + \frac{2}{t}\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{-109}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-61}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{elif}\;z \leq 88000000000000 \lor \neg \left(z \leq 9.2 \cdot 10^{+154}\right):\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{else}:\\ \;\;\;\;-2 + \frac{2}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 50.2% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;\frac{x}{y} \leq -1 \cdot 10^{-319}:\\
\;\;\;\;-2\\

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

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

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


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

    1. Initial program 84.7%

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

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

    if -2.3500000000000001e22 < (/.f64 x y) < -9.99989e-320 or 2.29999999999999989e-272 < (/.f64 x y) < 2

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 \cdot \frac{2 + \frac{2}{z}}{t}} + -2 \]
      9. *-lft-identity99.3%

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

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

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

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

    if -9.99989e-320 < (/.f64 x y) < 2.29999999999999989e-272

    1. Initial program 99.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -2.35 \cdot 10^{+22}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq -1 \cdot 10^{-319}:\\ \;\;\;\;-2\\ \mathbf{elif}\;\frac{x}{y} \leq 2.3 \cdot 10^{-272}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;\frac{x}{y} \leq 2:\\ \;\;\;\;-2\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 98.6% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 84.4%

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

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

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

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

Alternative 5: 98.0% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 85.1%

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

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

    if -1e3 < (/.f64 x y) < 4.9999999999999999e-13

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 88.5% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2 + \color{blue}{\frac{t}{y} \cdot x}}{t} \]
      2. *-commutative60.9%

        \[\leadsto \frac{2 + \color{blue}{x \cdot \frac{t}{y}}}{t} \]
    9. Simplified60.9%

      \[\leadsto \frac{2 + \color{blue}{x \cdot \frac{t}{y}}}{t} \]
    10. Taylor expanded in x around 0 83.8%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y} + \frac{2}{t}} \]
    12. Simplified83.8%

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

    if -1.02000000000000004e24 < (/.f64 x y) < 7.50000000000000024e66

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 \cdot \frac{2 + \frac{2}{z}}{t}} + -2 \]
      9. *-lft-identity95.3%

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

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

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

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

Alternative 7: 92.6% accurate, 0.7× speedup?

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

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

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


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

    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 0 88.9%

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

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

    1. Initial program 90.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 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 \cdot \frac{2 + \frac{2}{z}}{t}} + -2 \]
      9. *-lft-identity97.7%

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

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

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

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

Alternative 8: 68.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} + \frac{2}{t}\\ \mathbf{if}\;z \leq -2.05 \cdot 10^{+46}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.05 \cdot 10^{-109}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-26}:\\ \;\;\;\;\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))))
   (if (<= z -2.05e+46)
     t_1
     (if (<= z -2.05e-109)
       (- (/ x y) 2.0)
       (if (<= z 1.4e-26) (/ 2.0 (* z t)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = (x / y) + (2.0 / t);
	double tmp;
	if (z <= -2.05e+46) {
		tmp = t_1;
	} else if (z <= -2.05e-109) {
		tmp = (x / y) - 2.0;
	} else if (z <= 1.4e-26) {
		tmp = 2.0 / (z * t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x / y) + (2.0d0 / t)
    if (z <= (-2.05d+46)) then
        tmp = t_1
    else if (z <= (-2.05d-109)) then
        tmp = (x / y) - 2.0d0
    else if (z <= 1.4d-26) 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 / t);
	double tmp;
	if (z <= -2.05e+46) {
		tmp = t_1;
	} else if (z <= -2.05e-109) {
		tmp = (x / y) - 2.0;
	} else if (z <= 1.4e-26) {
		tmp = 2.0 / (z * t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x / y) + (2.0 / t)
	tmp = 0
	if z <= -2.05e+46:
		tmp = t_1
	elif z <= -2.05e-109:
		tmp = (x / y) - 2.0
	elif z <= 1.4e-26:
		tmp = 2.0 / (z * t)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x / y) + Float64(2.0 / t))
	tmp = 0.0
	if (z <= -2.05e+46)
		tmp = t_1;
	elseif (z <= -2.05e-109)
		tmp = Float64(Float64(x / y) - 2.0);
	elseif (z <= 1.4e-26)
		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);
	tmp = 0.0;
	if (z <= -2.05e+46)
		tmp = t_1;
	elseif (z <= -2.05e-109)
		tmp = (x / y) - 2.0;
	elseif (z <= 1.4e-26)
		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] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.05e+46], t$95$1, If[LessEqual[z, -2.05e-109], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[z, 1.4e-26], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.05 \cdot 10^{-109}:\\
\;\;\;\;\frac{x}{y} - 2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.05e46 or 1.4000000000000001e-26 < z

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2 + \color{blue}{\frac{t}{y} \cdot x}}{t} \]
      2. *-commutative66.9%

        \[\leadsto \frac{2 + \color{blue}{x \cdot \frac{t}{y}}}{t} \]
    9. Simplified66.9%

      \[\leadsto \frac{2 + \color{blue}{x \cdot \frac{t}{y}}}{t} \]
    10. Taylor expanded in x around 0 78.6%

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

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

        \[\leadsto \frac{\color{blue}{2}}{t} + \frac{x}{y} \]
      3. +-commutative78.6%

        \[\leadsto \color{blue}{\frac{x}{y} + \frac{2}{t}} \]
    12. Simplified78.6%

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

    if -2.05e46 < z < -2.0500000000000001e-109

    1. Initial program 96.5%

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

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

    if -2.0500000000000001e-109 < z < 1.4000000000000001e-26

    1. Initial program 99.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 93.4%

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

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

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

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

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

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

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

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

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

Alternative 9: 64.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -3.6 \cdot 10^{+51} \lor \neg \left(\frac{x}{y} \leq 4000000\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.6e+51) (not (<= (/ x y) 4000000.0)))
   (/ x y)
   (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((x / y) <= -3.6e+51) || !((x / y) <= 4000000.0)) {
		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.6d+51)) .or. (.not. ((x / y) <= 4000000.0d0))) 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.6e+51) || !((x / y) <= 4000000.0)) {
		tmp = x / y;
	} else {
		tmp = -2.0 + (2.0 / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((x / y) <= -3.6e+51) or not ((x / y) <= 4000000.0):
		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.6e+51) || !(Float64(x / y) <= 4000000.0))
		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.6e+51) || ~(((x / y) <= 4000000.0)))
		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.6e+51], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4000000.0]], $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.6 \cdot 10^{+51} \lor \neg \left(\frac{x}{y} \leq 4000000\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.60000000000000011e51 or 4e6 < (/.f64 x y)

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

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

    if -3.60000000000000011e51 < (/.f64 x y) < 4e6

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 \cdot \frac{2 + \frac{2}{z}}{t}} + -2 \]
      9. *-lft-identity97.7%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{2}}{t} - 2 \]
      3. sub-neg59.9%

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

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

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

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

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

Alternative 10: 64.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -1.5 \cdot 10^{+54}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq 240:\\ \;\;\;\;-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.5e+54)
   (/ x y)
   (if (<= (/ x y) 240.0) (+ -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.5e+54) {
		tmp = x / y;
	} else if ((x / y) <= 240.0) {
		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.5d+54)) then
        tmp = x / y
    else if ((x / y) <= 240.0d0) 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.5e+54) {
		tmp = x / y;
	} else if ((x / y) <= 240.0) {
		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.5e+54:
		tmp = x / y
	elif (x / y) <= 240.0:
		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.5e+54)
		tmp = Float64(x / y);
	elseif (Float64(x / y) <= 240.0)
		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.5e+54)
		tmp = x / y;
	elseif ((x / y) <= 240.0)
		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.5e+54], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 240.0], 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.5 \cdot 10^{+54}:\\
\;\;\;\;\frac{x}{y}\\

\mathbf{elif}\;\frac{x}{y} \leq 240:\\
\;\;\;\;-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.4999999999999999e54

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

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

    if -1.4999999999999999e54 < (/.f64 x y) < 240

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 \cdot \frac{2 + \frac{2}{z}}{t}} + -2 \]
      9. *-lft-identity98.3%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{2}}{t} - 2 \]
      3. sub-neg60.0%

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

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

        \[\leadsto \color{blue}{-2 + \frac{2}{t}} \]
    14. Simplified60.0%

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

    if 240 < (/.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 t around inf 59.0%

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

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

Alternative 11: 80.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -6.5 \cdot 10^{+25} \lor \neg \left(t \leq 4.5 \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 -6.5e+25) (not (<= t 4.5e+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 <= -6.5e+25) || !(t <= 4.5e+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 <= (-6.5d+25)) .or. (.not. (t <= 4.5d+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 <= -6.5e+25) || !(t <= 4.5e+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 <= -6.5e+25) or not (t <= 4.5e+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 <= -6.5e+25) || !(t <= 4.5e+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 <= -6.5e+25) || ~((t <= 4.5e+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, -6.5e+25], N[Not[LessEqual[t, 4.5e+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.5 \cdot 10^{+25} \lor \neg \left(t \leq 4.5 \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 < -6.50000000000000005e25 or 4.5e17 < t

    1. Initial program 72.5%

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

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

    if -6.50000000000000005e25 < t < 4.5e17

    1. Initial program 99.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 82.1%

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

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

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

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

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

Alternative 12: 36.0% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.6e6 or 2.8e-11 < t

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 \cdot \frac{2 + \frac{2}{z}}{t}} + -2 \]
      9. *-lft-identity56.1%

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

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

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

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

    if -5.6e6 < t < 2.8e-11

    1. Initial program 99.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5600000:\\ \;\;\;\;-2\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{else}:\\ \;\;\;\;-2\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 19.0% accurate, 17.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 \cdot \frac{2 + \frac{2}{z}}{t}} + -2 \]
    9. *-lft-identity71.5%

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

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

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

    \[\leadsto \color{blue}{-2} \]
  13. Final simplification19.8%

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

Developer target: 99.1% accurate, 1.3× speedup?

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

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

Reproduce

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