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

Percentage Accurate: 86.2% → 99.2%
Time: 10.7s
Alternatives: 12
Speedup: 1.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 86.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.2% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 68.3% accurate, 0.6× speedup?

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

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

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

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

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


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

    1. Initial program 84.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{2}{t} - 2\right)} + \frac{x}{y} \]
      10. associate-+l-87.8%

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

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

      \[\leadsto \frac{2}{t} - \color{blue}{-1 \cdot \frac{x}{y}} \]
    10. Step-by-step derivation
      1. neg-mul-187.3%

        \[\leadsto \frac{2}{t} - \color{blue}{\left(-\frac{x}{y}\right)} \]
      2. distribute-neg-frac287.3%

        \[\leadsto \frac{2}{t} - \color{blue}{\frac{x}{-y}} \]
    11. Simplified87.3%

      \[\leadsto \frac{2}{t} - \color{blue}{\frac{x}{-y}} \]
    12. Step-by-step derivation
      1. sub-neg87.3%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y} + \frac{2}{t}} \]
    13. Applied egg-rr87.3%

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

    if -2 < (/.f64 x y) < 1.1199999999999999e-27

    1. Initial program 90.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{2}{t} - 2\right)} + \frac{x}{y} \]
      10. associate-+l-64.7%

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

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

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

    if 1.1199999999999999e-27 < (/.f64 x y) < 9.4999999999999995e105

    1. Initial program 96.5%

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

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

Alternative 3: 97.8% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 86.7%

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

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

    if -2e6 < (/.f64 x y) < 1.0000000000000001e-15

    1. Initial program 90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{t} + \left(-2 - \left(-\color{blue}{\frac{\frac{2}{t}}{z}}\right)\right) \]
      16. distribute-frac-neg99.8%

        \[\leadsto \frac{2}{t} + \left(-2 - \color{blue}{\frac{-\frac{2}{t}}{z}}\right) \]
      17. distribute-neg-frac99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -2 + \left(\color{blue}{\frac{\frac{2}{t}}{z}} + \frac{2}{t}\right) \]
      12. *-rgt-identity99.8%

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

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

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

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

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

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

Alternative 4: 64.9% accurate, 0.7× speedup?

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

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

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

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

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


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

    1. Initial program 81.2%

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

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

    if -4.9999999999999996e44 < (/.f64 x y) < 5.2000000000000004e-29

    1. Initial program 91.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{2}{t} - 2\right)} + \frac{x}{y} \]
      10. associate-+l-64.3%

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

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

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

    if 5.2000000000000004e-29 < (/.f64 x y) < 1.4500000000000001e106

    1. Initial program 96.5%

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

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

    if 1.4500000000000001e106 < (/.f64 x y)

    1. Initial program 86.1%

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

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

Alternative 5: 91.3% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{+43}:\\
\;\;\;\;-2 - \frac{2}{t} \cdot \left(-1 + \frac{-1}{z}\right)\\

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


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

    1. Initial program 81.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{2}{t} - 2\right)} + \frac{x}{y} \]
      10. associate-+l-87.1%

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

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

      \[\leadsto \frac{2}{t} - \color{blue}{-1 \cdot \frac{x}{y}} \]
    10. Step-by-step derivation
      1. neg-mul-187.1%

        \[\leadsto \frac{2}{t} - \color{blue}{\left(-\frac{x}{y}\right)} \]
      2. distribute-neg-frac287.1%

        \[\leadsto \frac{2}{t} - \color{blue}{\frac{x}{-y}} \]
    11. Simplified87.1%

      \[\leadsto \frac{2}{t} - \color{blue}{\frac{x}{-y}} \]
    12. Step-by-step derivation
      1. sub-neg87.1%

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

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

        \[\leadsto \frac{2}{t} + \color{blue}{\frac{x}{y}} \]
      4. +-commutative87.1%

        \[\leadsto \color{blue}{\frac{x}{y} + \frac{2}{t}} \]
    13. Applied egg-rr87.1%

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

    if -1e47 < (/.f64 x y) < 5.0000000000000004e43

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{t} + \left(-2 + \color{blue}{\left(-\frac{2}{-t \cdot z}\right)}\right) \]
      13. unsub-neg98.0%

        \[\leadsto \frac{2}{t} + \color{blue}{\left(-2 - \frac{2}{-t \cdot z}\right)} \]
      14. distribute-frac-neg298.0%

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

        \[\leadsto \frac{2}{t} + \left(-2 - \left(-\color{blue}{\frac{\frac{2}{t}}{z}}\right)\right) \]
      16. distribute-frac-neg98.0%

        \[\leadsto \frac{2}{t} + \left(-2 - \color{blue}{\frac{-\frac{2}{t}}{z}}\right) \]
      17. distribute-neg-frac98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -2 + \left(\color{blue}{\frac{\frac{2}{t}}{z}} + \frac{2}{t}\right) \]
      12. *-rgt-identity98.0%

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

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

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

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

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

    if 5.0000000000000004e43 < (/.f64 x y)

    1. Initial program 86.6%

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

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

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

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

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

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

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

Alternative 6: 88.4% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{+103}:\\
\;\;\;\;-2 - \frac{2}{t} \cdot \left(-1 + \frac{-1}{z}\right)\\

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


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

    1. Initial program 81.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{2}{t} - 2\right)} + \frac{x}{y} \]
      10. associate-+l-87.1%

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

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

      \[\leadsto \frac{2}{t} - \color{blue}{-1 \cdot \frac{x}{y}} \]
    10. Step-by-step derivation
      1. neg-mul-187.1%

        \[\leadsto \frac{2}{t} - \color{blue}{\left(-\frac{x}{y}\right)} \]
      2. distribute-neg-frac287.1%

        \[\leadsto \frac{2}{t} - \color{blue}{\frac{x}{-y}} \]
    11. Simplified87.1%

      \[\leadsto \frac{2}{t} - \color{blue}{\frac{x}{-y}} \]
    12. Step-by-step derivation
      1. sub-neg87.1%

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

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

        \[\leadsto \frac{2}{t} + \color{blue}{\frac{x}{y}} \]
      4. +-commutative87.1%

        \[\leadsto \color{blue}{\frac{x}{y} + \frac{2}{t}} \]
    13. Applied egg-rr87.1%

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

    if -1e47 < (/.f64 x y) < 5e103

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{t} + \left(-2 - \left(-\color{blue}{\frac{\frac{2}{t}}{z}}\right)\right) \]
      16. distribute-frac-neg95.8%

        \[\leadsto \frac{2}{t} + \left(-2 - \color{blue}{\frac{-\frac{2}{t}}{z}}\right) \]
      17. distribute-neg-frac95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -2 + \left(\color{blue}{\frac{\frac{2}{t}}{z}} + \frac{2}{t}\right) \]
      12. *-rgt-identity95.8%

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

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

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

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

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

    if 5e103 < (/.f64 x y)

    1. Initial program 86.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 81.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{-31} \lor \neg \left(t \leq 5.2 \cdot 10^{-62}\right):\\
\;\;\;\;\frac{2}{t} + \left(\frac{x}{y} - 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.7999999999999999e-31 or 5.1999999999999999e-62 < t

    1. Initial program 81.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{2}{t} - 2\right)} + \frac{x}{y} \]
      10. associate-+l-79.2%

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

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

    if -2.7999999999999999e-31 < t < 5.1999999999999999e-62

    1. Initial program 98.8%

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

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

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

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

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

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

Alternative 8: 66.0% accurate, 0.9× speedup?

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

    1. Initial program 84.4%

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

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

    if -2.9000000000000002e43 < (/.f64 x y) < 2.4e18

    1. Initial program 91.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{2}{t} - 2\right)} + \frac{x}{y} \]
      10. associate-+l-60.6%

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

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

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

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

Alternative 9: 79.9% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.8999999999999998e-25 or 5.2e7 < t

    1. Initial program 80.7%

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

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

    if -5.8999999999999998e-25 < t < 5.2e7

    1. Initial program 98.9%

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

      \[\leadsto \color{blue}{\frac{2 + 2 \cdot \frac{1}{z}}{t}} \]
    4. 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} \]
    5. Simplified82.3%

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

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

Alternative 10: 53.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -8.2 \cdot 10^{-11} \lor \neg \left(\frac{x}{y} \leq 1.36 \cdot 10^{-14}\right):\\
\;\;\;\;\frac{x}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x y) < -8.2000000000000001e-11 or 1.36e-14 < (/.f64 x y)

    1. Initial program 86.7%

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

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

    if -8.2000000000000001e-11 < (/.f64 x y) < 1.36e-14

    1. Initial program 90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{t} + \left(-2 - \left(-\color{blue}{\frac{\frac{2}{t}}{z}}\right)\right) \]
      16. distribute-frac-neg99.8%

        \[\leadsto \frac{2}{t} + \left(-2 - \color{blue}{\frac{-\frac{2}{t}}{z}}\right) \]
      17. distribute-neg-frac99.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -8.2 \cdot 10^{-11} \lor \neg \left(\frac{x}{y} \leq 1.36 \cdot 10^{-14}\right):\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;-2\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 36.9% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 79.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{t} + \left(-2 - \color{blue}{\frac{-\frac{2}{t}}{z}}\right) \]
      17. distribute-neg-frac60.7%

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

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

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

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

    if -1 < t < 310

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

Alternative 12: 20.7% 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 88.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{2}{t} + \left(-2 + \frac{2}{t \cdot z}\right)} \]
    11. remove-double-neg70.0%

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

      \[\leadsto \frac{2}{t} + \left(-2 + \color{blue}{\left(-\frac{2}{-t \cdot z}\right)}\right) \]
    13. unsub-neg70.0%

      \[\leadsto \frac{2}{t} + \color{blue}{\left(-2 - \frac{2}{-t \cdot z}\right)} \]
    14. distribute-frac-neg270.0%

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

      \[\leadsto \frac{2}{t} + \left(-2 - \left(-\color{blue}{\frac{\frac{2}{t}}{z}}\right)\right) \]
    16. distribute-frac-neg70.0%

      \[\leadsto \frac{2}{t} + \left(-2 - \color{blue}{\frac{-\frac{2}{t}}{z}}\right) \]
    17. distribute-neg-frac70.0%

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

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

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

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

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

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

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