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

Percentage Accurate: 85.5% → 99.2%
Time: 11.2s
Alternatives: 12
Speedup: 1.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 85.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.2% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.5% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 70.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.71999999999999997 < t < 1

    1. Initial program 99.1%

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

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

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

Alternative 3: 98.5% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1 or 1.1600000000000001e-5 < z

    1. Initial program 72.3%

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

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

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

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

    if -1 < z < 1.1600000000000001e-5

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 89.0% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.40000000000000015e-139 or 9.4999999999999991e-47 < t

    1. Initial program 76.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 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.40000000000000015e-139 < t < 9.4999999999999991e-47

    1. Initial program 98.9%

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

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

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

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

        \[\leadsto 2 \cdot \frac{1}{t} + \frac{\color{blue}{2}}{t \cdot z} \]
      3. associate-*r/90.7%

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

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

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

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

Alternative 5: 63.9% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x y) < -5e45 or 1.00000000000000003e83 < (/.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 72.5%

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

    if -5e45 < (/.f64 x y) < 1.00000000000000003e83

    1. Initial program 84.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \frac{1 - t}{t}} \]
    10. Step-by-step derivation
      1. div-sub64.0%

        \[\leadsto 2 \cdot \color{blue}{\left(\frac{1}{t} - \frac{t}{t}\right)} \]
      2. *-inverses64.0%

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

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

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

        \[\leadsto \color{blue}{2 \cdot \frac{1}{t} + 2 \cdot -1} \]
      6. associate-*r/64.0%

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

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

        \[\leadsto \frac{2}{t} + \color{blue}{-2} \]
    11. Simplified64.0%

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

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

Alternative 6: 80.1% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;t \leq 650000:\\
\;\;\;\;\frac{2}{t \cdot z} + \frac{2}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.79999999999999995e-22

    1. Initial program 71.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x + -2 \cdot y}{y}} \]
    10. Step-by-step derivation
      1. *-commutative86.7%

        \[\leadsto \frac{x + \color{blue}{y \cdot -2}}{y} \]
    11. Simplified86.7%

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

    if -2.79999999999999995e-22 < t < 6.5e5

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

    if 6.5e5 < t

    1. Initial program 71.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 inf 94.9%

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

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

Alternative 7: 80.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{-21} \lor \neg \left(t \leq 4600000\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 < -3.0999999999999998e-21 or 4.6e6 < t

    1. Initial program 71.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 90.2%

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

    if -3.0999999999999998e-21 < t < 4.6e6

    1. Initial program 99.1%

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

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

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

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

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

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

Alternative 8: 70.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 69.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 91.6%

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

    if -1 < t < 6.5e5

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

Alternative 9: 80.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t \leq 650000:\\
\;\;\;\;\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 t < -4.20000000000000025e-21

    1. Initial program 71.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x + -2 \cdot y}{y}} \]
    10. Step-by-step derivation
      1. *-commutative86.7%

        \[\leadsto \frac{x + \color{blue}{y \cdot -2}}{y} \]
    11. Simplified86.7%

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

    if -4.20000000000000025e-21 < t < 6.5e5

    1. Initial program 99.1%

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

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

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

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

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

    if 6.5e5 < t

    1. Initial program 71.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 inf 94.9%

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

Alternative 10: 60.0% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{-138} \lor \neg \left(t \leq 2.9 \cdot 10^{-46}\right):\\
\;\;\;\;\frac{x}{y} - 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.4999999999999999e-138 or 2.90000000000000005e-46 < t

    1. Initial program 76.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.5%

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

    if -3.4999999999999999e-138 < t < 2.90000000000000005e-46

    1. Initial program 98.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \frac{1 - t}{t}} \]
    10. Step-by-step derivation
      1. div-sub50.1%

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

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

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

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

        \[\leadsto \color{blue}{2 \cdot \frac{1}{t} + 2 \cdot -1} \]
      6. associate-*r/50.1%

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

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

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

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

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

Alternative 11: 41.2% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.00000000000000007e-138 or 1.20000000000000007e-46 < t

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

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

    if -1.00000000000000007e-138 < t < 1.20000000000000007e-46

    1. Initial program 98.9%

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

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

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

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

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

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

Alternative 12: 18.7% 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.1%

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

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

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

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

    \[\leadsto \color{blue}{\frac{2}{t}} \]
  7. Add Preprocessing

Developer Target 1: 99.2% accurate, 1.3× speedup?

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

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

Reproduce

?
herbie shell --seed 2024172 
(FPCore (x y z t)
  :name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
  :precision binary64

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

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