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

Percentage Accurate: 87.0% → 99.2%
Time: 11.7s
Alternatives: 18
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 18 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: 87.0% 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.3× speedup?

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
    14. remove-double-neg87.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. Simplified87.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 77.4% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 91.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. +-commutative91.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-neg91.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-neg91.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-neg91.2%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      14. remove-double-neg91.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. Simplified91.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999946e48 < (/.f64 x y)

    1. Initial program 72.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 77.8% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 88.2%

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

      \[\leadsto \frac{x}{y} + \color{blue}{\frac{2 + 2 \cdot z}{t \cdot z}} \]
    4. Taylor expanded in z around inf 82.8%

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

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

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

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

    if -1.3500000000000001e22 < (/.f64 x y)

    1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      14. remove-double-neg87.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. Simplified87.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 77.5% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 91.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. +-commutative91.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-neg91.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-neg91.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-neg91.2%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      14. remove-double-neg91.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. Simplified91.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.47999999999999999e57 < (/.f64 x y)

    1. Initial program 72.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 80.0% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 90.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. +-commutative90.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-neg90.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-neg90.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-neg90.9%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      14. remove-double-neg90.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. Simplified90.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.1e19 < (/.f64 x y)

    1. Initial program 76.2%

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

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

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

Alternative 6: 80.0% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 90.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. +-commutative90.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-neg90.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-neg90.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-neg90.9%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      14. remove-double-neg90.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. Simplified90.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.15e20 < (/.f64 x y)

    1. Initial program 76.2%

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

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

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

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

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

Alternative 7: 77.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq 10^{+49}:\\ \;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\ \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+49)
   (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))
   (/ (+ x (* 2.0 (/ y t))) y)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x / y) <= 1e+49) {
		tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
	} 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+49) then
        tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
    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+49) {
		tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
	} else {
		tmp = (x + (2.0 * (y / t))) / y;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x / y) <= 1e+49:
		tmp = -2.0 + ((2.0 + (2.0 / z)) / t)
	else:
		tmp = (x + (2.0 * (y / t))) / y
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(x / y) <= 1e+49)
		tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t));
	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+49)
		tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
	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+49], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $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 10^{+49}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\

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


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

    1. Initial program 91.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. +-commutative91.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-neg91.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-neg91.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-neg91.2%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      14. remove-double-neg91.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. Simplified91.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999946e48 < (/.f64 x y)

    1. Initial program 72.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 51.3% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 88.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 71.8%

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

    if -3.55e21 < (/.f64 x y)

    1. Initial program 87.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 z around inf 66.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{t} + \color{blue}{-2} \]
    8. Simplified47.4%

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

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

Alternative 9: 57.5% accurate, 1.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.1200000000000001e-11

    1. Initial program 78.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{t} + \color{blue}{-2} \]
    8. Simplified66.4%

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

    if -1.1200000000000001e-11 < z

    1. Initial program 91.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. +-commutative91.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-neg91.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-neg91.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-neg91.5%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      14. remove-double-neg91.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. Simplified91.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 58.0% accurate, 1.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 3.69999999999999997e59

    1. Initial program 91.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. +-commutative91.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-neg91.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-neg91.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-neg91.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.69999999999999997e59 < z

    1. Initial program 72.1%

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

      \[\leadsto \frac{x}{y} + \color{blue}{\frac{2 + 2 \cdot z}{t \cdot z}} \]
    4. Taylor expanded in z around inf 79.1%

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

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

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

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

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

Alternative 11: 63.9% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -7.2 \cdot 10^{-27}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{else}:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -7.2e-27) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -7.2e-27) {
		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 <= (-7.2d-27)) 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 <= -7.2e-27) {
		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 <= -7.2e-27:
		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 <= -7.2e-27)
		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 <= -7.2e-27)
		tmp = (x / y) - 2.0;
	else
		tmp = (2.0 + (2.0 / z)) / t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -7.2e-27], 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 -7.2 \cdot 10^{-27}:\\
\;\;\;\;\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 < -7.1999999999999997e-27

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

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

    if -7.1999999999999997e-27 < t

    1. Initial program 91.0%

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

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

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

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

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

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

Alternative 12: 33.8% accurate, 1.7× speedup?

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

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

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


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

    1. Initial program 91.0%

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

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

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

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

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

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

    if 4.2000000000000003e24 < (/.f64 x y)

    1. Initial program 75.3%

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

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

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

Alternative 13: 52.5% accurate, 1.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.2000000000000003e23

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{t} + \color{blue}{-2} \]
    8. Simplified70.2%

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

    if -4.2000000000000003e23 < z

    1. Initial program 92.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 46.5%

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

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

Alternative 14: 45.6% accurate, 1.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.7999999999999999e-27

    1. Initial program 79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.7999999999999999e-27 < z

    1. Initial program 91.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. +-commutative91.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-neg91.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-neg91.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-neg91.5%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{\color{blue}{z \cdot t}}, -\frac{-x}{y}\right) \]
      13. distribute-frac-neg91.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) \]
      14. remove-double-neg91.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. Simplified91.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. Add Preprocessing
    5. Taylor expanded in t around inf 98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{-27}:\\ \;\;\;\;-2 + \frac{2}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 45.7% accurate, 1.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.5000000000000003e-28

    1. Initial program 79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.5000000000000003e-28 < z

    1. Initial program 91.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. +-commutative91.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-neg91.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-neg91.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-neg91.5%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{\color{blue}{z \cdot t}}, -\frac{-x}{y}\right) \]
      13. distribute-frac-neg91.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) \]
      14. remove-double-neg91.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. Simplified91.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. Add Preprocessing
    5. Taylor expanded in t around inf 98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{2}{t}}{z}} \]
    10. Simplified45.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{-28}:\\ \;\;\;\;-2 + \frac{2}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{t}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 45.6% accurate, 1.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.60000000000000017e-27

    1. Initial program 79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.60000000000000017e-27 < z

    1. Initial program 91.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{-27}:\\ \;\;\;\;-2 + \frac{2}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{z}}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 28.4% accurate, 2.1× speedup?

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

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

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


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

    1. Initial program 74.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. +-commutative74.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-neg74.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-neg74.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-neg74.5%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      14. remove-double-neg74.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. Simplified74.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.5e6 < t

    1. Initial program 91.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7500000:\\ \;\;\;\;-2\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 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 87.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. +-commutative87.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-neg87.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-neg87.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-neg87.7%

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, -\color{blue}{\left(-\frac{x}{y}\right)}\right) \]
    14. remove-double-neg87.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. Simplified87.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  :alt
  (- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))

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