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

Percentage Accurate: 86.4% → 99.1%
Time: 9.2s
Alternatives: 16
Speedup: 1.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 86.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.1% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

Alternative 2: 50.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -29000000000000:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq -3.2 \cdot 10^{-55}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;\frac{x}{y} \leq 0:\\ \;\;\;\;-2\\ \mathbf{elif}\;\frac{x}{y} \leq 3.8 \cdot 10^{-25}:\\ \;\;\;\;\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) -29000000000000.0)
   (/ x y)
   (if (<= (/ x y) -3.2e-55)
     (/ 2.0 t)
     (if (<= (/ x y) 0.0)
       -2.0
       (if (<= (/ x y) 3.8e-25)
         (/ 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) <= -29000000000000.0) {
		tmp = x / y;
	} else if ((x / y) <= -3.2e-55) {
		tmp = 2.0 / t;
	} else if ((x / y) <= 0.0) {
		tmp = -2.0;
	} else if ((x / y) <= 3.8e-25) {
		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) <= (-29000000000000.0d0)) then
        tmp = x / y
    else if ((x / y) <= (-3.2d-55)) then
        tmp = 2.0d0 / t
    else if ((x / y) <= 0.0d0) then
        tmp = -2.0d0
    else if ((x / y) <= 3.8d-25) 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) <= -29000000000000.0) {
		tmp = x / y;
	} else if ((x / y) <= -3.2e-55) {
		tmp = 2.0 / t;
	} else if ((x / y) <= 0.0) {
		tmp = -2.0;
	} else if ((x / y) <= 3.8e-25) {
		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) <= -29000000000000.0:
		tmp = x / y
	elif (x / y) <= -3.2e-55:
		tmp = 2.0 / t
	elif (x / y) <= 0.0:
		tmp = -2.0
	elif (x / y) <= 3.8e-25:
		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) <= -29000000000000.0)
		tmp = Float64(x / y);
	elseif (Float64(x / y) <= -3.2e-55)
		tmp = Float64(2.0 / t);
	elseif (Float64(x / y) <= 0.0)
		tmp = -2.0;
	elseif (Float64(x / y) <= 3.8e-25)
		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) <= -29000000000000.0)
		tmp = x / y;
	elseif ((x / y) <= -3.2e-55)
		tmp = 2.0 / t;
	elseif ((x / y) <= 0.0)
		tmp = -2.0;
	elseif ((x / y) <= 3.8e-25)
		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], -29000000000000.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -3.2e-55], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 0.0], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 3.8e-25], 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 -29000000000000:\\
\;\;\;\;\frac{x}{y}\\

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

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

\mathbf{elif}\;\frac{x}{y} \leq 3.8 \cdot 10^{-25}:\\
\;\;\;\;\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.9e13 or 2 < (/.f64 x y)

    1. Initial program 77.1%

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

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

    if -2.9e13 < (/.f64 x y) < -3.2000000000000001e-55 or -0.0 < (/.f64 x y) < 3.7999999999999998e-25

    1. Initial program 94.9%

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

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

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

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

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

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

    if -3.2000000000000001e-55 < (/.f64 x y) < -0.0 or 3.7999999999999998e-25 < (/.f64 x y) < 2

    1. Initial program 81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -29000000000000:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq -3.2 \cdot 10^{-55}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;\frac{x}{y} \leq 0:\\ \;\;\;\;-2\\ \mathbf{elif}\;\frac{x}{y} \leq 3.8 \cdot 10^{-25}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;\frac{x}{y} \leq 2:\\ \;\;\;\;-2\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]

Alternative 3: 92.7% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 77.5%

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

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

    if -5e20 < (/.f64 x y) < 1.99999999999999991e-6

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 88.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 76.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000003e40 < (/.f64 x y) < 1

    1. Initial program 87.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 92.7% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 77.5%

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

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

    if -5e20 < (/.f64 x y) < 1.99999999999999991e-6

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 83.4% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 74.4%

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

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

    if -1e188 < (/.f64 x y) < 1

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+188}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq 1:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]

Alternative 7: 64.5% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{+255}:\\
\;\;\;\;\frac{2}{t} + -2\\

\mathbf{elif}\;z \leq -1.7 \cdot 10^{-33} \lor \neg \left(z \leq 8.5 \cdot 10^{-151} \lor \neg \left(z \leq 1.5 \cdot 10^{-107}\right) \land z \leq 1.35 \cdot 10^{-48}\right):\\
\;\;\;\;\frac{x}{y} - 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.5999999999999992e255

    1. Initial program 57.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.5999999999999992e255 < z < -1.7e-33 or 8.49999999999999999e-151 < z < 1.4999999999999999e-107 or 1.35000000000000006e-48 < z

    1. Initial program 73.5%

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

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

    if -1.7e-33 < z < 8.49999999999999999e-151 or 1.4999999999999999e-107 < z < 1.35000000000000006e-48

    1. Initial program 97.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.6 \cdot 10^{+255}:\\ \;\;\;\;\frac{2}{t} + -2\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-33} \lor \neg \left(z \leq 8.5 \cdot 10^{-151} \lor \neg \left(z \leq 1.5 \cdot 10^{-107}\right) \land z \leq 1.35 \cdot 10^{-48}\right):\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t \cdot z}\\ \end{array} \]

Alternative 8: 64.4% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;z \leq -2.15 \cdot 10^{-33}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 2.9 \cdot 10^{-102} \lor \neg \left(z \leq 2.2 \cdot 10^{-44}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.2799999999999999e256

    1. Initial program 57.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2799999999999999e256 < z < -2.15000000000000015e-33 or 1.18e-150 < z < 2.89999999999999986e-102 or 2.20000000000000012e-44 < z

    1. Initial program 73.5%

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

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

    if -2.15000000000000015e-33 < z < 1.18e-150

    1. Initial program 97.6%

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

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

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

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

      \[\leadsto \color{blue}{\frac{2 + \frac{2}{z}}{t}} \]
    5. Taylor expanded in z around 0 69.7%

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

    if 2.89999999999999986e-102 < z < 2.20000000000000012e-44

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.28 \cdot 10^{+256}:\\ \;\;\;\;\frac{2}{t} + -2\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{-33}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;z \leq 1.18 \cdot 10^{-150}:\\ \;\;\;\;\frac{\frac{2}{z}}{t}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-102} \lor \neg \left(z \leq 2.2 \cdot 10^{-44}\right):\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t \cdot z}\\ \end{array} \]

Alternative 9: 79.9% accurate, 1.1× speedup?

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

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

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

\mathbf{elif}\;t \leq -250 \lor \neg \left(t \leq 2.15 \cdot 10^{-16}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.20000000000000016e60 or -6.8e16 < t < -250 or 2.1499999999999999e-16 < t

    1. Initial program 67.4%

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

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

    if -5.20000000000000016e60 < t < -6.8e16

    1. Initial program 91.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-2 + \frac{2 + \frac{2}{z}}{t}} \]
    8. Taylor expanded in z around 0 81.4%

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

    if -250 < t < 2.1499999999999999e-16

    1. Initial program 97.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.2 \cdot 10^{+60}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;t \leq -6.8 \cdot 10^{+16}:\\ \;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\ \mathbf{elif}\;t \leq -250 \lor \neg \left(t \leq 2.15 \cdot 10^{-16}\right):\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{else}:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \end{array} \]

Alternative 10: 97.6% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.9e8 or 2.5999999999999997e-32 < z

    1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9e8 < z < 2.5999999999999997e-32

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -190000000 \lor \neg \left(z \leq 2.6 \cdot 10^{-32}\right):\\ \;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x}{y} + -2\right) + \frac{\frac{2}{z}}{t}\\ \end{array} \]

Alternative 11: 69.1% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{+256}:\\
\;\;\;\;\frac{2}{t} + -2\\

\mathbf{elif}\;z \leq -1.16 \cdot 10^{-7} \lor \neg \left(z \leq 2.6 \cdot 10^{-32}\right):\\
\;\;\;\;\frac{x}{y} - 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.21999999999999999e256

    1. Initial program 57.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.21999999999999999e256 < z < -1.1600000000000001e-7 or 2.5999999999999997e-32 < z

    1. Initial program 70.6%

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

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

    if -1.1600000000000001e-7 < z < 2.5999999999999997e-32

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-2 + \frac{2 + \frac{2}{z}}{t}} \]
    8. Taylor expanded in z around 0 78.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.22 \cdot 10^{+256}:\\ \;\;\;\;\frac{2}{t} + -2\\ \mathbf{elif}\;z \leq -1.16 \cdot 10^{-7} \lor \neg \left(z \leq 2.6 \cdot 10^{-32}\right):\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{else}:\\ \;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\ \end{array} \]

Alternative 12: 64.8% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 77.1%

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

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

    if -1.72e16 < (/.f64 x y) < 7.2e9

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -1.72 \cdot 10^{+16} \lor \neg \left(\frac{x}{y} \leq 7200000000\right):\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t} + -2\\ \end{array} \]

Alternative 13: 64.8% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 77.4%

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

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

    if -2.05e17 < (/.f64 x y) < 8.1999999999999997e-19

    1. Initial program 87.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.1999999999999997e-19 < (/.f64 x y)

    1. Initial program 76.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -2.05 \cdot 10^{+17}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq 8.2 \cdot 10^{-19}:\\ \;\;\;\;\frac{2}{t} + -2\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \]

Alternative 14: 99.1% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 37.2% accurate, 2.4× speedup?

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

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

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

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


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

    1. Initial program 69.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.4999999999999996e-9 < t < 1

    1. Initial program 97.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.5 \cdot 10^{-9}:\\ \;\;\;\;-2\\ \mathbf{elif}\;t \leq 1:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{else}:\\ \;\;\;\;-2\\ \end{array} \]

Alternative 16: 20.6% 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 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-2} \]
  9. Final simplification20.5%

    \[\leadsto -2 \]

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

  :herbie-target
  (- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))

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