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

Percentage Accurate: 86.9% → 99.1%
Time: 9.1s
Alternatives: 12
Speedup: 1.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 86.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.1% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 69.6% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;\frac{x}{y} \leq -3.2 \cdot 10^{-129}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;\frac{x}{y} \leq 6 \cdot 10^{+120}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 x y) < -2.39999999999999998e-8 or 6e120 < (/.f64 x y)

    1. Initial program 81.6%

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

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

    if -2.39999999999999998e-8 < (/.f64 x y) < -3.2000000000000003e-129 or -1.94999999999999985e-263 < (/.f64 x y) < 6e120

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.2000000000000003e-129 < (/.f64 x y) < -1.94999999999999985e-263

    1. Initial program 84.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -2.4 \cdot 10^{-8}:\\ \;\;\;\;\frac{x}{y} + -2\\ \mathbf{elif}\;\frac{x}{y} \leq -3.2 \cdot 10^{-129}:\\ \;\;\;\;\frac{2}{z \cdot t} + -2\\ \mathbf{elif}\;\frac{x}{y} \leq -1.95 \cdot 10^{-263}:\\ \;\;\;\;\frac{2}{t} + -2\\ \mathbf{elif}\;\frac{x}{y} \leq 6 \cdot 10^{+120}:\\ \;\;\;\;\frac{2}{z \cdot t} + -2\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} + -2\\ \end{array} \]

Alternative 3: 69.6% accurate, 0.7× speedup?

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 81.6%

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

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

    if -2.4500000000000001e-8 < (/.f64 x y) < -3e-124

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3e-124 < (/.f64 x y) < -1.6e-263

    1. Initial program 84.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6e-263 < (/.f64 x y) < 1.02000000000000005e121

    1. Initial program 85.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -2.45 \cdot 10^{-8}:\\ \;\;\;\;\frac{x}{y} + -2\\ \mathbf{elif}\;\frac{x}{y} \leq -3 \cdot 10^{-124}:\\ \;\;\;\;\frac{\frac{2}{t}}{z} + -2\\ \mathbf{elif}\;\frac{x}{y} \leq -1.6 \cdot 10^{-263}:\\ \;\;\;\;\frac{2}{t} + -2\\ \mathbf{elif}\;\frac{x}{y} \leq 1.02 \cdot 10^{+121}:\\ \;\;\;\;\frac{2}{z \cdot t} + -2\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} + -2\\ \end{array} \]

Alternative 4: 78.9% accurate, 1.1× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.19999999999999995e71 or 1.05000000000000004e79 < t

    1. Initial program 63.2%

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

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

    if -2.19999999999999995e71 < t < 5.4999999999999999e-65

    1. Initial program 98.2%

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

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

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

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

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

    if 5.4999999999999999e-65 < t < 1.05000000000000004e79

    1. Initial program 91.2%

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

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

        \[\leadsto \frac{x}{y} + \color{blue}{\frac{\frac{2}{t}}{z}} \]
    4. Simplified84.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.2 \cdot 10^{+71}:\\ \;\;\;\;\frac{x}{y} + -2\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-65}:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+79}:\\ \;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} + -2\\ \end{array} \]

Alternative 5: 65.6% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -57000 \lor \neg \left(\frac{x}{y} \leq 850\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) -57000.0) (not (<= (/ x y) 850.0)))
   (/ x y)
   (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((x / y) <= -57000.0) || !((x / y) <= 850.0)) {
		tmp = x / y;
	} else {
		tmp = (2.0 / t) + -2.0;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (((x / y) <= (-57000.0d0)) .or. (.not. ((x / y) <= 850.0d0))) then
        tmp = x / y
    else
        tmp = (2.0d0 / t) + (-2.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (((x / y) <= -57000.0) || !((x / y) <= 850.0)) {
		tmp = x / y;
	} else {
		tmp = (2.0 / t) + -2.0;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((x / y) <= -57000.0) or not ((x / y) <= 850.0):
		tmp = x / y
	else:
		tmp = (2.0 / t) + -2.0
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((Float64(x / y) <= -57000.0) || !(Float64(x / y) <= 850.0))
		tmp = Float64(x / y);
	else
		tmp = Float64(Float64(2.0 / t) + -2.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (((x / y) <= -57000.0) || ~(((x / y) <= 850.0)))
		tmp = x / y;
	else
		tmp = (2.0 / t) + -2.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -57000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 850.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -57000 \lor \neg \left(\frac{x}{y} \leq 850\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) < -57000 or 850 < (/.f64 x y)

    1. Initial program 83.2%

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

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

    if -57000 < (/.f64 x y) < 850

    1. Initial program 84.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -57000 \lor \neg \left(\frac{x}{y} \leq 850\right):\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t} + -2\\ \end{array} \]

Alternative 6: 65.8% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 83.5%

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

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

    if -0.00209999999999999987 < (/.f64 x y) < 1300

    1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -0.0021 \lor \neg \left(\frac{x}{y} \leq 1300\right):\\ \;\;\;\;\frac{x}{y} + -2\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t} + -2\\ \end{array} \]

Alternative 7: 91.2% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.00000000000000026e-68 or 3.9999999999999999e-16 < z

    1. Initial program 71.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.00000000000000026e-68 < z < 3.9999999999999999e-16

    1. Initial program 99.0%

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

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

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

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

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

Alternative 8: 99.2% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 52.8% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 83.0%

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

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

    if -2 < (/.f64 x y) < 3.9e9

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 78.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.2 \cdot 10^{+71} \lor \neg \left(t \leq 4.2 \cdot 10^{-24}\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 -2.2e+71) (not (<= t 4.2e-24)))
   (+ (/ 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.2e+71) || !(t <= 4.2e-24)) {
		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 <= (-2.2d+71)) .or. (.not. (t <= 4.2d-24))) 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 <= -2.2e+71) || !(t <= 4.2e-24)) {
		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 <= -2.2e+71) or not (t <= 4.2e-24):
		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 <= -2.2e+71) || !(t <= 4.2e-24))
		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 <= -2.2e+71) || ~((t <= 4.2e-24)))
		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, -2.2e+71], N[Not[LessEqual[t, 4.2e-24]], $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 -2.2 \cdot 10^{+71} \lor \neg \left(t \leq 4.2 \cdot 10^{-24}\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 < -2.19999999999999995e71 or 4.1999999999999999e-24 < t

    1. Initial program 68.5%

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

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

    if -2.19999999999999995e71 < t < 4.1999999999999999e-24

    1. Initial program 98.3%

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

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

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

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

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

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

Alternative 11: 37.3% accurate, 2.4× speedup?

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

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

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

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


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

    1. Initial program 70.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35000000000000005e-13 < t < 1

    1. Initial program 99.0%

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

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

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

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

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

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

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

Alternative 12: 20.2% accurate, 17.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto -2 \]

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

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

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