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

Percentage Accurate: 86.8% → 99.1%
Time: 12.9s
Alternatives: 15
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 15 alternatives:

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

Initial Program: 86.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.1% accurate, 1.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 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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-neg85.3%

      \[\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-neg85.3%

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

    \[\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. Final simplification99.9%

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

Alternative 2: 87.6% accurate, 0.7× speedup?

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

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

\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) < -2.00000000000000001e155 or 1 < (/.f64 x y)

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000001e155 < (/.f64 x y) < 1

    1. Initial program 84.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. +-commutative84.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-neg84.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-neg84.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-neg84.6%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - t\right) \cdot z + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
      10. *-commutative84.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-define84.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. *-commutative84.5%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 99.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+99.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-2 + \frac{x}{y}\right) + \frac{2 + \frac{2}{z}}{t}} \]
    8. Taylor expanded in x around 0 94.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. associate--l+94.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 92.6% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 86.4%

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

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

    if -3.99999999999999978e58 < (/.f64 x y) < 1e11

    1. Initial program 84.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. +-commutative84.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-neg84.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-neg84.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-neg84.6%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - t\right) \cdot z + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
      10. *-commutative84.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-define84.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. *-commutative84.5%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 99.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+99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 84.7% accurate, 0.7× speedup?

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

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

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

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


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

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

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

    if -2.00000000000000001e155 < (/.f64 x y) < 1e11

    1. Initial program 84.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. +-commutative84.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-neg84.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-neg84.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-neg84.5%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - t\right) \cdot z + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
      10. *-commutative84.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-define84.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. *-commutative84.4%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 99.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+99.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-2 + \frac{x}{y}\right) + \frac{2 + \frac{2}{z}}{t}} \]
    8. Taylor expanded in x around 0 93.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. associate--l+93.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e11 < (/.f64 x y)

    1. Initial program 83.2%

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

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

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

Alternative 5: 92.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -4 \cdot 10^{+58}:\\ \;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\ \mathbf{elif}\;\frac{x}{y} \leq 100000000000:\\ \;\;\;\;-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) -4e+58)
   (+ (/ x y) (/ 2.0 (* z t)))
   (if (<= (/ x y) 100000000000.0)
     (+ -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) <= -4e+58) {
		tmp = (x / y) + (2.0 / (z * t));
	} else if ((x / y) <= 100000000000.0) {
		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) <= (-4d+58)) then
        tmp = (x / y) + (2.0d0 / (z * t))
    else if ((x / y) <= 100000000000.0d0) 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) <= -4e+58) {
		tmp = (x / y) + (2.0 / (z * t));
	} else if ((x / y) <= 100000000000.0) {
		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) <= -4e+58:
		tmp = (x / y) + (2.0 / (z * t))
	elif (x / y) <= 100000000000.0:
		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) <= -4e+58)
		tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * t)));
	elseif (Float64(x / y) <= 100000000000.0)
		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) <= -4e+58)
		tmp = (x / y) + (2.0 / (z * t));
	elseif ((x / y) <= 100000000000.0)
		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], -4e+58], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 100000000000.0], 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 -4 \cdot 10^{+58}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\

\mathbf{elif}\;\frac{x}{y} \leq 100000000000:\\
\;\;\;\;-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 3 regimes
  2. if (/.f64 x y) < -3.99999999999999978e58

    1. Initial program 90.0%

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

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

    if -3.99999999999999978e58 < (/.f64 x y) < 1e11

    1. Initial program 84.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. +-commutative84.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-neg84.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-neg84.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-neg84.6%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - t\right) \cdot z + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
      10. *-commutative84.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-define84.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. *-commutative84.5%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 99.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+99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e11 < (/.f64 x y)

    1. Initial program 83.2%

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

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

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

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

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

Alternative 6: 92.6% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 90.0%

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

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

    if -3.99999999999999978e58 < (/.f64 x y) < 1e11

    1. Initial program 84.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. +-commutative84.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-neg84.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-neg84.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-neg84.6%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - t\right) \cdot z + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
      10. *-commutative84.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-define84.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. *-commutative84.5%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 99.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+99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e11 < (/.f64 x y)

    1. Initial program 83.2%

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

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

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

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

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

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

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

    Alternative 7: 98.2% accurate, 0.8× speedup?

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

      1. Initial program 69.5%

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

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

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

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

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

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

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

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

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

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

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

      if -2.4e10 < z < 5.4999999999999999e-6

      1. Initial program 99.8%

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

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

          \[\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-neg99.8%

          \[\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-neg99.8%

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - t\right) \cdot z + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
        10. *-commutative99.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-define99.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. *-commutative99.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-neg99.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-neg99.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. Simplified99.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.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+99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 8: 98.2% accurate, 0.8× speedup?

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

      1. Initial program 69.5%

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

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

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

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

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

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

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

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

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

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

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

      if -2.4e10 < z < 5.4999999999999999e-6

      1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 9: 69.6% accurate, 0.8× speedup?

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

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

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

        if -2.00000000000000001e155 < (/.f64 x y) < 1

        1. Initial program 84.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. +-commutative84.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-neg84.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-neg84.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-neg84.6%

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(1 - t\right) \cdot z + 1, \frac{2}{t \cdot z}, -\frac{-x}{y}\right)} \]
          10. *-commutative84.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-define84.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. *-commutative84.5%

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, 1 - t, 1\right), \frac{2}{z \cdot t}, \frac{x}{y}\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in t around inf 99.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+99.8%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{2 \cdot \frac{1}{t \cdot z} - 2} \]
        10. Step-by-step derivation
          1. sub-neg72.8%

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

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

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

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

            \[\leadsto \color{blue}{-2 + \frac{2}{t \cdot z}} \]
          6. associate-/l/72.8%

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

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

        if 1 < (/.f64 x y)

        1. Initial program 82.9%

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

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

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

      Alternative 10: 47.1% accurate, 1.0× speedup?

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

        1. Initial program 86.4%

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

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

        if -3.99999999999999978e58 < (/.f64 x y) < 1e11

        1. Initial program 84.6%

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

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

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

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

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

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

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

      Alternative 11: 80.4% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -9.2 \cdot 10^{-20} \lor \neg \left(t \leq 9.6\right):\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{else}:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (or (<= t -9.2e-20) (not (<= t 9.6)))
         (- (/ x y) 2.0)
         (/ (+ 2.0 (/ 2.0 z)) t)))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if ((t <= -9.2e-20) || !(t <= 9.6)) {
      		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 <= (-9.2d-20)) .or. (.not. (t <= 9.6d0))) 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 <= -9.2e-20) || !(t <= 9.6)) {
      		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 <= -9.2e-20) or not (t <= 9.6):
      		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 <= -9.2e-20) || !(t <= 9.6))
      		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 <= -9.2e-20) || ~((t <= 9.6)))
      		tmp = (x / y) - 2.0;
      	else
      		tmp = (2.0 + (2.0 / z)) / t;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := If[Or[LessEqual[t, -9.2e-20], N[Not[LessEqual[t, 9.6]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;t \leq -9.2 \cdot 10^{-20} \lor \neg \left(t \leq 9.6\right):\\
      \;\;\;\;\frac{x}{y} - 2\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < -9.1999999999999997e-20 or 9.59999999999999964 < t

        1. Initial program 72.7%

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

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

        if -9.1999999999999997e-20 < t < 9.59999999999999964

        1. Initial program 99.8%

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

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

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

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

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

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

      Alternative 12: 80.4% accurate, 1.0× speedup?

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

        1. Initial program 73.8%

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

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

        if -9.1999999999999997e-20 < t < 650

        1. Initial program 99.8%

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

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

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

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

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

        if 650 < t

        1. Initial program 71.5%

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

          \[\leadsto \color{blue}{\frac{x}{y} - 2} \]
        4. Taylor expanded in y around 0 88.7%

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

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

      Alternative 13: 59.6% accurate, 1.1× speedup?

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

        1. Initial program 75.7%

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

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

        if -1.62000000000000006e-34 < t < 6.5e-93

        1. Initial program 99.7%

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

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

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

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

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

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

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

      Alternative 14: 64.0% accurate, 1.1× speedup?

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

        1. Initial program 76.9%

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

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

        if -3.6e-75 < z < 1.30000000000000006e-85

        1. Initial program 99.8%

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

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

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

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

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

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

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

      Alternative 15: 19.8% accurate, 5.7× speedup?

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{2}{t}} \]
      7. Final simplification17.9%

        \[\leadsto \frac{2}{t} \]
      8. Add Preprocessing

      Developer target: 99.1% accurate, 1.3× speedup?

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

      Reproduce

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