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

Percentage Accurate: 86.6% → 99.4%
Time: 10.8s
Alternatives: 14
Speedup: 0.8×

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 14 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.6% 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.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} + \frac{2 + \left(1 - t\right) \cdot \left(2 \cdot z\right)}{z \cdot t}\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ (/ x y) (/ (+ 2.0 (* (- 1.0 t) (* 2.0 z))) (* z t)))))
   (if (<= t_1 INFINITY) t_1 (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
	double t_1 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = (x / y) - 2.0;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = (x / y) - 2.0;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t))
	tmp = 0
	if t_1 <= math.inf:
		tmp = t_1
	else:
		tmp = (x / y) - 2.0
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(1.0 - t) * Float64(2.0 * z))) / Float64(z * t)))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(Float64(x / y) - 2.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x / y) + ((2.0 + ((1.0 - t) * (2.0 * z))) / (z * t));
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = (x / y) - 2.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(1.0 - t), $MachinePrecision] * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2 + \left(1 - t\right) \cdot \left(2 \cdot z\right)}{z \cdot t}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (/.f64 x y) (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z))) < +inf.0

    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

    if +inf.0 < (+.f64 (/.f64 x y) (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)))

    1. Initial program 0.0%

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

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

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

Alternative 2: 81.4% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;t \leq 6.1 \cdot 10^{-18}:\\
\;\;\;\;t\_2 + \frac{2}{t}\\

\mathbf{elif}\;t \leq 3.4 \cdot 10^{+103}:\\
\;\;\;\;\frac{x}{y} + t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -5.3e132 or 3.3999999999999998e103 < t

    1. Initial program 65.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 91.8%

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

    if -5.3e132 < t < -6.19999999999999962e-91

    1. Initial program 83.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 y around 0 91.9%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{2}}{t \cdot z} + \frac{x}{y} \]
      3. associate-/l/77.5%

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

        \[\leadsto \color{blue}{\frac{x}{y} + \frac{\frac{2}{z}}{t}} \]
      5. associate-/l/77.4%

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

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

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

    if -6.19999999999999962e-91 < t < 6.0999999999999999e-18

    1. Initial program 97.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 97.9%

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

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

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

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

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

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

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

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

    if 6.0999999999999999e-18 < t < 3.3999999999999998e103

    1. Initial program 95.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 y around 0 85.3%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{2}}{t \cdot z} + \frac{x}{y} \]
      3. associate-/l/85.1%

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

        \[\leadsto \color{blue}{\frac{x}{y} + \frac{\frac{2}{z}}{t}} \]
      5. associate-/l/85.0%

        \[\leadsto \frac{x}{y} + \color{blue}{\frac{2}{t \cdot z}} \]
    9. Simplified85.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.3 \cdot 10^{+132}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;t \leq -6.2 \cdot 10^{-91}:\\ \;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\ \mathbf{elif}\;t \leq 6.1 \cdot 10^{-18}:\\ \;\;\;\;\frac{2}{z \cdot t} + \frac{2}{t}\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{+103}:\\ \;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 81.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{2}{z \cdot t}\\
t_2 := \frac{x}{y} + t\_1\\
t_3 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{+134}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t \leq -3.85 \cdot 10^{-91}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq 6 \cdot 10^{-18}:\\
\;\;\;\;t\_1 + \frac{2}{t}\\

\mathbf{elif}\;t \leq 6 \cdot 10^{+103}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.5e134 or 6e103 < t

    1. Initial program 65.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 91.8%

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

    if -6.5e134 < t < -3.8499999999999999e-91 or 5.99999999999999966e-18 < t < 6e103

    1. Initial program 87.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{2}}{t \cdot z} + \frac{x}{y} \]
      3. associate-/l/80.1%

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

        \[\leadsto \color{blue}{\frac{x}{y} + \frac{\frac{2}{z}}{t}} \]
      5. associate-/l/80.1%

        \[\leadsto \frac{x}{y} + \color{blue}{\frac{2}{t \cdot z}} \]
    9. Simplified80.1%

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

    if -3.8499999999999999e-91 < t < 5.99999999999999966e-18

    1. Initial program 97.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 97.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.5 \cdot 10^{+134}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;t \leq -3.85 \cdot 10^{-91}:\\ \;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\ \mathbf{elif}\;t \leq 6 \cdot 10^{-18}:\\ \;\;\;\;\frac{2}{z \cdot t} + \frac{2}{t}\\ \mathbf{elif}\;t \leq 6 \cdot 10^{+103}:\\ \;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 98.7% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 87.5%

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

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

    if -9.99999999999999958e27 < (/.f64 x y) < 2e5

    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 0 99.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+99.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/99.9%

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

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

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

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

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

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

Alternative 5: 97.8% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x y) < -5e12 or 5.0000000000000001e-4 < (/.f64 x y)

    1. Initial program 87.3%

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

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

    if -5e12 < (/.f64 x y) < 5.0000000000000001e-4

    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 0 99.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+99.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/99.9%

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

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

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

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

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

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

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

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

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

Alternative 6: 63.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} - 2\\ \mathbf{if}\;z \leq -4 \cdot 10^{+185}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{+49}:\\ \;\;\;\;-2 + \frac{2}{t}\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-37} \lor \neg \left(z \leq 3.6 \cdot 10^{-135}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{z}}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (/ x y) 2.0)))
   (if (<= z -4e+185)
     t_1
     (if (<= z -1.65e+49)
       (+ -2.0 (/ 2.0 t))
       (if (or (<= z -1.4e-37) (not (<= z 3.6e-135))) t_1 (/ (/ 2.0 z) t))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x / y) - 2.0;
	double tmp;
	if (z <= -4e+185) {
		tmp = t_1;
	} else if (z <= -1.65e+49) {
		tmp = -2.0 + (2.0 / t);
	} else if ((z <= -1.4e-37) || !(z <= 3.6e-135)) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = (x / y) - 2.0d0
    if (z <= (-4d+185)) then
        tmp = t_1
    else if (z <= (-1.65d+49)) then
        tmp = (-2.0d0) + (2.0d0 / t)
    else if ((z <= (-1.4d-37)) .or. (.not. (z <= 3.6d-135))) then
        tmp = t_1
    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 t_1 = (x / y) - 2.0;
	double tmp;
	if (z <= -4e+185) {
		tmp = t_1;
	} else if (z <= -1.65e+49) {
		tmp = -2.0 + (2.0 / t);
	} else if ((z <= -1.4e-37) || !(z <= 3.6e-135)) {
		tmp = t_1;
	} else {
		tmp = (2.0 / z) / t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x / y) - 2.0
	tmp = 0
	if z <= -4e+185:
		tmp = t_1
	elif z <= -1.65e+49:
		tmp = -2.0 + (2.0 / t)
	elif (z <= -1.4e-37) or not (z <= 3.6e-135):
		tmp = t_1
	else:
		tmp = (2.0 / z) / t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x / y) - 2.0)
	tmp = 0.0
	if (z <= -4e+185)
		tmp = t_1;
	elseif (z <= -1.65e+49)
		tmp = Float64(-2.0 + Float64(2.0 / t));
	elseif ((z <= -1.4e-37) || !(z <= 3.6e-135))
		tmp = t_1;
	else
		tmp = Float64(Float64(2.0 / z) / t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x / y) - 2.0;
	tmp = 0.0;
	if (z <= -4e+185)
		tmp = t_1;
	elseif (z <= -1.65e+49)
		tmp = -2.0 + (2.0 / t);
	elseif ((z <= -1.4e-37) || ~((z <= 3.6e-135)))
		tmp = t_1;
	else
		tmp = (2.0 / z) / t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[z, -4e+185], t$95$1, If[LessEqual[z, -1.65e+49], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.4e-37], N[Not[LessEqual[z, 3.6e-135]], $MachinePrecision]], t$95$1, N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -1.4 \cdot 10^{-37} \lor \neg \left(z \leq 3.6 \cdot 10^{-135}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.9999999999999999e185 or -1.6499999999999999e49 < z < -1.4000000000000001e-37 or 3.59999999999999978e-135 < z

    1. Initial program 77.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 69.9%

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

    if -3.9999999999999999e185 < z < -1.6499999999999999e49

    1. Initial program 79.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4000000000000001e-37 < z < 3.59999999999999978e-135

    1. Initial program 98.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 70.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+185}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{+49}:\\ \;\;\;\;-2 + \frac{2}{t}\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-37} \lor \neg \left(z \leq 3.6 \cdot 10^{-135}\right):\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{z}}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 63.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} - 2\\ \mathbf{if}\;z \leq -5.5 \cdot 10^{+185}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{+51}:\\ \;\;\;\;-2 + \frac{2}{t}\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-60} \lor \neg \left(z \leq 7.6 \cdot 10^{-136}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (/ x y) 2.0)))
   (if (<= z -5.5e+185)
     t_1
     (if (<= z -1.8e+51)
       (+ -2.0 (/ 2.0 t))
       (if (or (<= z -3.8e-60) (not (<= z 7.6e-136))) t_1 (/ 2.0 (* z t)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x / y) - 2.0;
	double tmp;
	if (z <= -5.5e+185) {
		tmp = t_1;
	} else if (z <= -1.8e+51) {
		tmp = -2.0 + (2.0 / t);
	} else if ((z <= -3.8e-60) || !(z <= 7.6e-136)) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = (x / y) - 2.0d0
    if (z <= (-5.5d+185)) then
        tmp = t_1
    else if (z <= (-1.8d+51)) then
        tmp = (-2.0d0) + (2.0d0 / t)
    else if ((z <= (-3.8d-60)) .or. (.not. (z <= 7.6d-136))) then
        tmp = t_1
    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 t_1 = (x / y) - 2.0;
	double tmp;
	if (z <= -5.5e+185) {
		tmp = t_1;
	} else if (z <= -1.8e+51) {
		tmp = -2.0 + (2.0 / t);
	} else if ((z <= -3.8e-60) || !(z <= 7.6e-136)) {
		tmp = t_1;
	} else {
		tmp = 2.0 / (z * t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x / y) - 2.0
	tmp = 0
	if z <= -5.5e+185:
		tmp = t_1
	elif z <= -1.8e+51:
		tmp = -2.0 + (2.0 / t)
	elif (z <= -3.8e-60) or not (z <= 7.6e-136):
		tmp = t_1
	else:
		tmp = 2.0 / (z * t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x / y) - 2.0)
	tmp = 0.0
	if (z <= -5.5e+185)
		tmp = t_1;
	elseif (z <= -1.8e+51)
		tmp = Float64(-2.0 + Float64(2.0 / t));
	elseif ((z <= -3.8e-60) || !(z <= 7.6e-136))
		tmp = t_1;
	else
		tmp = Float64(2.0 / Float64(z * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x / y) - 2.0;
	tmp = 0.0;
	if (z <= -5.5e+185)
		tmp = t_1;
	elseif (z <= -1.8e+51)
		tmp = -2.0 + (2.0 / t);
	elseif ((z <= -3.8e-60) || ~((z <= 7.6e-136)))
		tmp = t_1;
	else
		tmp = 2.0 / (z * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[z, -5.5e+185], t$95$1, If[LessEqual[z, -1.8e+51], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -3.8e-60], N[Not[LessEqual[z, 7.6e-136]], $MachinePrecision]], t$95$1, N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -3.8 \cdot 10^{-60} \lor \neg \left(z \leq 7.6 \cdot 10^{-136}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.4999999999999996e185 or -1.80000000000000005e51 < z < -3.79999999999999994e-60 or 7.6000000000000005e-136 < z

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

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

    if -5.4999999999999996e185 < z < -1.80000000000000005e51

    1. Initial program 79.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.79999999999999994e-60 < z < 7.6000000000000005e-136

    1. Initial program 98.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+185}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{+51}:\\ \;\;\;\;-2 + \frac{2}{t}\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-60} \lor \neg \left(z \leq 7.6 \cdot 10^{-136}\right):\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 50.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -24500000000:\\
\;\;\;\;\frac{x}{y}\\

\mathbf{elif}\;\frac{x}{y} \leq 1.28 \cdot 10^{-200}:\\
\;\;\;\;-2\\

\mathbf{elif}\;\frac{x}{y} \leq 2.6 \cdot 10^{+55}:\\
\;\;\;\;\frac{2}{t}\\

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


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

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

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

    if -2.45e10 < (/.f64 x y) < 1.28e-200

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

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

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

    if 1.28e-200 < (/.f64 x y) < 2.6e55

    1. Initial program 97.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 inf 54.2%

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

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

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

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

Alternative 9: 91.3% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.7999999999999998e-53 or 1.0500000000000001e-30 < z

    1. Initial program 75.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 inf 97.1%

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

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

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

    if -3.7999999999999998e-53 < z < 1.0500000000000001e-30

    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 y around 0 90.3%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{2}}{t \cdot z} + \frac{x}{y} \]
      3. associate-/l/91.1%

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

        \[\leadsto \color{blue}{\frac{x}{y} + \frac{\frac{2}{z}}{t}} \]
      5. associate-/l/91.1%

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

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

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

Alternative 10: 63.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -3.5 \cdot 10^{+26} \lor \neg \left(\frac{x}{y} \leq 2.6 \cdot 10^{+55}\right):\\
\;\;\;\;\frac{x}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x y) < -3.4999999999999999e26 or 2.6e55 < (/.f64 x y)

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

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

    if -3.4999999999999999e26 < (/.f64 x y) < 2.6e55

    1. Initial program 84.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 80.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{-11} \lor \neg \left(t \leq 8 \cdot 10^{-18}\right):\\
\;\;\;\;\frac{x}{y} - 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.0999999999999999e-11 or 8.0000000000000006e-18 < t

    1. Initial program 74.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 82.0%

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

    if -2.0999999999999999e-11 < t < 8.0000000000000006e-18

    1. Initial program 98.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 82.8%

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

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

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

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

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

Alternative 12: 69.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1250000000 \lor \neg \left(t \leq 8 \cdot 10^{-18}\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 -1250000000.0) (not (<= t 8e-18)))
   (- (/ x y) 2.0)
   (+ (/ x y) (/ 2.0 t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -1250000000.0) || !(t <= 8e-18)) {
		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 <= (-1250000000.0d0)) .or. (.not. (t <= 8d-18))) 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 <= -1250000000.0) || !(t <= 8e-18)) {
		tmp = (x / y) - 2.0;
	} else {
		tmp = (x / y) + (2.0 / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (t <= -1250000000.0) or not (t <= 8e-18):
		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 <= -1250000000.0) || !(t <= 8e-18))
		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 <= -1250000000.0) || ~((t <= 8e-18)))
		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, -1250000000.0], N[Not[LessEqual[t, 8e-18]], $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 -1250000000 \lor \neg \left(t \leq 8 \cdot 10^{-18}\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.25e9 or 8.0000000000000006e-18 < t

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

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

    if -1.25e9 < t < 8.0000000000000006e-18

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

Alternative 13: 35.9% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;t \leq 8 \cdot 10^{-18}:\\
\;\;\;\;\frac{2}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.25e9 or 8.0000000000000006e-18 < t

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

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

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

    if -1.25e9 < t < 8.0000000000000006e-18

    1. Initial program 98.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 inf 62.7%

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

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

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

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

Alternative 14: 19.7% accurate, 17.0× speedup?

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

\\
-2
\end{array}
Derivation
  1. Initial program 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 inf 54.4%

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

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

Developer Target 1: 98.9% 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 2024170 
(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))))