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

Percentage Accurate: 86.4% → 99.5%
Time: 9.9s
Alternatives: 15
Speedup: 1.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 86.4% 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.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\left(1 + \frac{1}{z}\right) - t, \frac{2}{t}, \frac{x}{y}\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (fma (- (+ 1.0 (/ 1.0 z)) t) (/ 2.0 t) (/ x y)))
double code(double x, double y, double z, double t) {
	return fma(((1.0 + (1.0 / z)) - t), (2.0 / t), (x / y));
}
function code(x, y, z, t)
	return fma(Float64(Float64(1.0 + Float64(1.0 / z)) - t), Float64(2.0 / t), Float64(x / y))
end
code[x_, y_, z_, t_] := N[(N[(N[(1.0 + N[(1.0 / z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] * N[(2.0 / t), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 50.5% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;\frac{x}{y} \leq -7.8 \cdot 10^{-81}:\\
\;\;\;\;\frac{2}{t}\\

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

\mathbf{elif}\;\frac{x}{y} \leq 2.3 \cdot 10^{+24}:\\
\;\;\;\;\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.30000000000000012e39 or 2.2999999999999999e24 < (/.f64 x y)

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.30000000000000012e39 < (/.f64 x y) < -7.7999999999999997e-81 or 5.5000000000000001e-74 < (/.f64 x y) < 2.2999999999999999e24

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.7999999999999997e-81 < (/.f64 x y) < 5.5000000000000001e-74

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 + \frac{1}{z}\right) - t}, \frac{2}{t}, \frac{x}{y}\right) \]
    5. Step-by-step derivation
      1. fma-udef99.7%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -2.3 \cdot 10^{+39}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq -7.8 \cdot 10^{-81}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{elif}\;\frac{x}{y} \leq 5.5 \cdot 10^{-74}:\\ \;\;\;\;-2\\ \mathbf{elif}\;\frac{x}{y} \leq 2.3 \cdot 10^{+24}:\\ \;\;\;\;\frac{2}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]

Alternative 3: 92.2% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x y) < -4.00000000000000002e41 or 3.9999999999999999e24 < (/.f64 x y)

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000002e41 < (/.f64 x y) < 3.9999999999999999e24

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 + \frac{1}{z}\right) - t}, \frac{2}{t}, \frac{x}{y}\right) \]
    5. Step-by-step derivation
      1. fma-udef99.7%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 92.3% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x y) < -4.00000000000000002e41 or 3.9999999999999999e24 < (/.f64 x y)

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000002e41 < (/.f64 x y) < 3.9999999999999999e24

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 62.5% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{y} - 2\\ t_2 := \frac{2}{t} + -2\\ \mathbf{if}\;z \leq -2.1 \cdot 10^{+179}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{+83}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -8.6 \cdot 10^{-5}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-19}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{+154}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (/ x y) 2.0)) (t_2 (+ (/ 2.0 t) -2.0)))
   (if (<= z -2.1e+179)
     t_2
     (if (<= z -3.4e+83)
       t_1
       (if (<= z -8.6e-5)
         t_2
         (if (<= z 1.02e-19)
           (/ 2.0 (* z t))
           (if (<= z 1.08e+154) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x / y) - 2.0;
	double t_2 = (2.0 / t) + -2.0;
	double tmp;
	if (z <= -2.1e+179) {
		tmp = t_2;
	} else if (z <= -3.4e+83) {
		tmp = t_1;
	} else if (z <= -8.6e-5) {
		tmp = t_2;
	} else if (z <= 1.02e-19) {
		tmp = 2.0 / (z * t);
	} else if (z <= 1.08e+154) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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 / t) + (-2.0d0)
    if (z <= (-2.1d+179)) then
        tmp = t_2
    else if (z <= (-3.4d+83)) then
        tmp = t_1
    else if (z <= (-8.6d-5)) then
        tmp = t_2
    else if (z <= 1.02d-19) then
        tmp = 2.0d0 / (z * t)
    else if (z <= 1.08d+154) then
        tmp = t_1
    else
        tmp = t_2
    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 / t) + -2.0;
	double tmp;
	if (z <= -2.1e+179) {
		tmp = t_2;
	} else if (z <= -3.4e+83) {
		tmp = t_1;
	} else if (z <= -8.6e-5) {
		tmp = t_2;
	} else if (z <= 1.02e-19) {
		tmp = 2.0 / (z * t);
	} else if (z <= 1.08e+154) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x / y) - 2.0
	t_2 = (2.0 / t) + -2.0
	tmp = 0
	if z <= -2.1e+179:
		tmp = t_2
	elif z <= -3.4e+83:
		tmp = t_1
	elif z <= -8.6e-5:
		tmp = t_2
	elif z <= 1.02e-19:
		tmp = 2.0 / (z * t)
	elif z <= 1.08e+154:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x / y) - 2.0)
	t_2 = Float64(Float64(2.0 / t) + -2.0)
	tmp = 0.0
	if (z <= -2.1e+179)
		tmp = t_2;
	elseif (z <= -3.4e+83)
		tmp = t_1;
	elseif (z <= -8.6e-5)
		tmp = t_2;
	elseif (z <= 1.02e-19)
		tmp = Float64(2.0 / Float64(z * t));
	elseif (z <= 1.08e+154)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x / y) - 2.0;
	t_2 = (2.0 / t) + -2.0;
	tmp = 0.0;
	if (z <= -2.1e+179)
		tmp = t_2;
	elseif (z <= -3.4e+83)
		tmp = t_1;
	elseif (z <= -8.6e-5)
		tmp = t_2;
	elseif (z <= 1.02e-19)
		tmp = 2.0 / (z * t);
	elseif (z <= 1.08e+154)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[z, -2.1e+179], t$95$2, If[LessEqual[z, -3.4e+83], t$95$1, If[LessEqual[z, -8.6e-5], t$95$2, If[LessEqual[z, 1.02e-19], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.08e+154], t$95$1, t$95$2]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -3.4 \cdot 10^{+83}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -8.6 \cdot 10^{-5}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 1.02 \cdot 10^{-19}:\\
\;\;\;\;\frac{2}{z \cdot t}\\

\mathbf{elif}\;z \leq 1.08 \cdot 10^{+154}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.0999999999999999e179 or -3.3999999999999998e83 < z < -8.6000000000000003e-5 or 1.08e154 < z

    1. Initial program 76.5%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 + \frac{1}{z}\right) - t}, \frac{2}{t}, \frac{x}{y}\right) \]
    5. Step-by-step derivation
      1. fma-udef99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0999999999999999e179 < z < -3.3999999999999998e83 or 1.02000000000000004e-19 < z < 1.08e154

    1. Initial program 87.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.6000000000000003e-5 < z < 1.02000000000000004e-19

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{+179}:\\ \;\;\;\;\frac{2}{t} + -2\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{+83}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;z \leq -8.6 \cdot 10^{-5}:\\ \;\;\;\;\frac{2}{t} + -2\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-19}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{+154}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t} + -2\\ \end{array} \]

Alternative 6: 65.3% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;z \leq -1.55 \cdot 10^{+82}:\\
\;\;\;\;\frac{x}{y} - 2\\

\mathbf{elif}\;z \leq -0.00032 \lor \neg \left(z \leq 7 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{2}{t} + \frac{x}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7.6000000000000004e174

    1. Initial program 68.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 + \frac{1}{z}\right) - t}, \frac{2}{t}, \frac{x}{y}\right) \]
    5. Step-by-step derivation
      1. fma-udef99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{t} + \color{blue}{-2} \]
    12. Simplified77.6%

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

    if -7.6000000000000004e174 < z < -1.55000000000000016e82

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.55000000000000016e82 < z < -3.20000000000000026e-4 or 7.00000000000000031e-19 < z

    1. Initial program 85.6%

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

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

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

    if -3.20000000000000026e-4 < z < 7.00000000000000031e-19

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.6 \cdot 10^{+174}:\\ \;\;\;\;\frac{2}{t} + -2\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{+82}:\\ \;\;\;\;\frac{x}{y} - 2\\ \mathbf{elif}\;z \leq -0.00032 \lor \neg \left(z \leq 7 \cdot 10^{-19}\right):\\ \;\;\;\;\frac{2}{t} + \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \end{array} \]

Alternative 7: 81.0% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3900 < t < 2.3e15

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 81.2% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.79999999999999982 < t < 2.6e14

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 92.2% accurate, 1.3× speedup?

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

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


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

    1. Initial program 80.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.6000000000000004e-5 < z < 5.5999999999999999e-8

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 64.3% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x y) < -5.2e39 or 4.40000000000000003e24 < (/.f64 x y)

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.2e39 < (/.f64 x y) < 4.40000000000000003e24

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 + \frac{1}{z}\right) - t}, \frac{2}{t}, \frac{x}{y}\right) \]
    5. Step-by-step derivation
      1. fma-udef99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -5.2 \cdot 10^{+39}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq 4.4 \cdot 10^{+24}:\\ \;\;\;\;\frac{2}{t} + -2\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]

Alternative 11: 64.5% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.45000000000000009e40 < (/.f64 x y) < 6.8e-21

    1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 + \frac{1}{z}\right) - t}, \frac{2}{t}, \frac{x}{y}\right) \]
    5. Step-by-step derivation
      1. fma-udef99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{t} + \color{blue}{-2} \]
    12. Simplified56.5%

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

    if 6.8e-21 < (/.f64 x y)

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -1.45 \cdot 10^{+40}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;\frac{x}{y} \leq 6.8 \cdot 10^{-21}:\\ \;\;\;\;\frac{2}{t} + -2\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - 2\\ \end{array} \]

Alternative 12: 99.2% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 81.1% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -19 \lor \neg \left(t \leq 4 \cdot 10^{+15}\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 -19.0) (not (<= t 4e+15)))
   (- (/ x y) 2.0)
   (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -19.0) || !(t <= 4e+15)) {
		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 <= (-19.0d0)) .or. (.not. (t <= 4d+15))) 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 <= -19.0) || !(t <= 4e+15)) {
		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 <= -19.0) or not (t <= 4e+15):
		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 <= -19.0) || !(t <= 4e+15))
		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 <= -19.0) || ~((t <= 4e+15)))
		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, -19.0], N[Not[LessEqual[t, 4e+15]], $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 -19 \lor \neg \left(t \leq 4 \cdot 10^{+15}\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 < -19 or 4e15 < t

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -19 < t < 4e15

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 37.5% accurate, 2.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.64999999999999982e-12 or 2.0000000000000001e-4 < t

    1. Initial program 81.5%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 + \frac{1}{z}\right) - t}, \frac{2}{t}, \frac{x}{y}\right) \]
    5. Step-by-step derivation
      1. fma-udef99.7%

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

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

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

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

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

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

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

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

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

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

    if -2.64999999999999982e-12 < t < 2.0000000000000001e-4

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 20.6% 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 90.1%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \mathsf{fma}\left(\color{blue}{\left(1 + \frac{1}{z}\right) - t}, \frac{2}{t}, \frac{x}{y}\right) \]
  5. Step-by-step derivation
    1. fma-udef99.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-2} \]
  11. Final simplification19.6%

    \[\leadsto -2 \]

Developer target: 99.2% accurate, 1.3× speedup?

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

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

Reproduce

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

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

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