Linear.Projection:infinitePerspective from linear-1.19.1.3, A

Percentage Accurate: 90.0% → 97.8%
Time: 8.8s
Alternatives: 13
Speedup: 1.2×

Specification

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

\\
\frac{x \cdot 2}{y \cdot z - 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 13 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: 90.0% accurate, 1.0× speedup?

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

\\
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\end{array}

Alternative 1: 97.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+199}:\\
\;\;\;\;\frac{2 \cdot x}{t_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (*.f64 y z) (*.f64 t z)) < -1e222

    1. Initial program 77.8%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative77.8%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--77.7%

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

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

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

        \[\leadsto \color{blue}{\frac{2 \cdot \frac{x}{z}}{y - t}} \]
      2. *-commutative99.7%

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{2}{y - t}} \]
      4. clear-num99.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{2}{y - t} \]
      5. associate-*l/99.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{2}{y - t}}{\frac{z}{x}}} \]
      6. *-un-lft-identity99.8%

        \[\leadsto \frac{\color{blue}{\frac{2}{y - t}}}{\frac{z}{x}} \]
    5. Applied egg-rr99.8%

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

    if -1e222 < (-.f64 (*.f64 y z) (*.f64 t z)) < 2.00000000000000019e199

    1. Initial program 98.3%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]

    if 2.00000000000000019e199 < (-.f64 (*.f64 y z) (*.f64 t z))

    1. Initial program 70.8%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative70.8%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--79.1%

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

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

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

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

Alternative 2: 72.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \frac{\frac{x}{z}}{y}\\ t_2 := -2 \cdot \frac{x}{z \cdot t}\\ \mathbf{if}\;t \leq -1.68 \cdot 10^{+44}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{z}}{t}\\ \mathbf{elif}\;t \leq -3.8 \cdot 10^{-17}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -2.55 \cdot 10^{-80}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 9 \cdot 10^{-87}:\\ \;\;\;\;\frac{\frac{x}{y}}{z \cdot 0.5}\\ \mathbf{elif}\;t \leq 7.8 \cdot 10^{-37}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 7.6 \cdot 10^{+52}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{2}{z}}{-t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* 2.0 (/ (/ x z) y))) (t_2 (* -2.0 (/ x (* z t)))))
   (if (<= t -1.68e+44)
     (* x (/ (/ -2.0 z) t))
     (if (<= t -3.8e-17)
       t_1
       (if (<= t -2.55e-80)
         t_2
         (if (<= t 9e-87)
           (/ (/ x y) (* z 0.5))
           (if (<= t 7.8e-37)
             t_2
             (if (<= t 7.6e+52) t_1 (/ (* x (/ 2.0 z)) (- t))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * ((x / z) / y);
	double t_2 = -2.0 * (x / (z * t));
	double tmp;
	if (t <= -1.68e+44) {
		tmp = x * ((-2.0 / z) / t);
	} else if (t <= -3.8e-17) {
		tmp = t_1;
	} else if (t <= -2.55e-80) {
		tmp = t_2;
	} else if (t <= 9e-87) {
		tmp = (x / y) / (z * 0.5);
	} else if (t <= 7.8e-37) {
		tmp = t_2;
	} else if (t <= 7.6e+52) {
		tmp = t_1;
	} else {
		tmp = (x * (2.0 / z)) / -t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = 2.0d0 * ((x / z) / y)
    t_2 = (-2.0d0) * (x / (z * t))
    if (t <= (-1.68d+44)) then
        tmp = x * (((-2.0d0) / z) / t)
    else if (t <= (-3.8d-17)) then
        tmp = t_1
    else if (t <= (-2.55d-80)) then
        tmp = t_2
    else if (t <= 9d-87) then
        tmp = (x / y) / (z * 0.5d0)
    else if (t <= 7.8d-37) then
        tmp = t_2
    else if (t <= 7.6d+52) then
        tmp = t_1
    else
        tmp = (x * (2.0d0 / z)) / -t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * ((x / z) / y);
	double t_2 = -2.0 * (x / (z * t));
	double tmp;
	if (t <= -1.68e+44) {
		tmp = x * ((-2.0 / z) / t);
	} else if (t <= -3.8e-17) {
		tmp = t_1;
	} else if (t <= -2.55e-80) {
		tmp = t_2;
	} else if (t <= 9e-87) {
		tmp = (x / y) / (z * 0.5);
	} else if (t <= 7.8e-37) {
		tmp = t_2;
	} else if (t <= 7.6e+52) {
		tmp = t_1;
	} else {
		tmp = (x * (2.0 / z)) / -t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = 2.0 * ((x / z) / y)
	t_2 = -2.0 * (x / (z * t))
	tmp = 0
	if t <= -1.68e+44:
		tmp = x * ((-2.0 / z) / t)
	elif t <= -3.8e-17:
		tmp = t_1
	elif t <= -2.55e-80:
		tmp = t_2
	elif t <= 9e-87:
		tmp = (x / y) / (z * 0.5)
	elif t <= 7.8e-37:
		tmp = t_2
	elif t <= 7.6e+52:
		tmp = t_1
	else:
		tmp = (x * (2.0 / z)) / -t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(2.0 * Float64(Float64(x / z) / y))
	t_2 = Float64(-2.0 * Float64(x / Float64(z * t)))
	tmp = 0.0
	if (t <= -1.68e+44)
		tmp = Float64(x * Float64(Float64(-2.0 / z) / t));
	elseif (t <= -3.8e-17)
		tmp = t_1;
	elseif (t <= -2.55e-80)
		tmp = t_2;
	elseif (t <= 9e-87)
		tmp = Float64(Float64(x / y) / Float64(z * 0.5));
	elseif (t <= 7.8e-37)
		tmp = t_2;
	elseif (t <= 7.6e+52)
		tmp = t_1;
	else
		tmp = Float64(Float64(x * Float64(2.0 / z)) / Float64(-t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = 2.0 * ((x / z) / y);
	t_2 = -2.0 * (x / (z * t));
	tmp = 0.0;
	if (t <= -1.68e+44)
		tmp = x * ((-2.0 / z) / t);
	elseif (t <= -3.8e-17)
		tmp = t_1;
	elseif (t <= -2.55e-80)
		tmp = t_2;
	elseif (t <= 9e-87)
		tmp = (x / y) / (z * 0.5);
	elseif (t <= 7.8e-37)
		tmp = t_2;
	elseif (t <= 7.6e+52)
		tmp = t_1;
	else
		tmp = (x * (2.0 / z)) / -t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.68e+44], N[(x * N[(N[(-2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.8e-17], t$95$1, If[LessEqual[t, -2.55e-80], t$95$2, If[LessEqual[t, 9e-87], N[(N[(x / y), $MachinePrecision] / N[(z * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.8e-37], t$95$2, If[LessEqual[t, 7.6e+52], t$95$1, N[(N[(x * N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / (-t)), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -3.8 \cdot 10^{-17}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -2.55 \cdot 10^{-80}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 9 \cdot 10^{-87}:\\
\;\;\;\;\frac{\frac{x}{y}}{z \cdot 0.5}\\

\mathbf{elif}\;t \leq 7.8 \cdot 10^{-37}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 7.6 \cdot 10^{+52}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -1.68000000000000001e44

    1. Initial program 86.2%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative86.2%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--90.3%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified92.2%

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

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

        \[\leadsto -2 \cdot \color{blue}{\frac{\frac{x}{t}}{z}} \]
      2. clear-num86.9%

        \[\leadsto -2 \cdot \color{blue}{\frac{1}{\frac{z}{\frac{x}{t}}}} \]
      3. un-div-inv86.9%

        \[\leadsto \color{blue}{\frac{-2}{\frac{z}{\frac{x}{t}}}} \]
      4. div-inv85.8%

        \[\leadsto \frac{-2}{\color{blue}{z \cdot \frac{1}{\frac{x}{t}}}} \]
      5. clear-num85.9%

        \[\leadsto \frac{-2}{z \cdot \color{blue}{\frac{t}{x}}} \]
    6. Applied egg-rr85.9%

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

        \[\leadsto \color{blue}{\frac{\frac{-2}{z}}{\frac{t}{x}}} \]
      2. associate-/r/88.3%

        \[\leadsto \color{blue}{\frac{\frac{-2}{z}}{t} \cdot x} \]
    8. Applied egg-rr88.3%

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

    if -1.68000000000000001e44 < t < -3.8000000000000001e-17 or 7.79999999999999981e-37 < t < 7.5999999999999999e52

    1. Initial program 92.7%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative92.7%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--92.7%

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

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

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

        \[\leadsto \color{blue}{\frac{2 \cdot \frac{x}{z}}{y - t}} \]
      2. *-commutative99.7%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{2}{y - t} \]
      5. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{2}{y - t}}{\frac{z}{x}}} \]
      6. *-un-lft-identity99.7%

        \[\leadsto \frac{\color{blue}{\frac{2}{y - t}}}{\frac{z}{x}} \]
    5. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    6. Taylor expanded in y around inf 58.7%

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

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y}} \]
    8. Simplified76.1%

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

    if -3.8000000000000001e-17 < t < -2.55000000000000004e-80 or 8.99999999999999915e-87 < t < 7.79999999999999981e-37

    1. Initial program 96.4%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative96.4%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--96.3%

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

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

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

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

    if -2.55000000000000004e-80 < t < 8.99999999999999915e-87

    1. Initial program 92.5%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative92.5%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--92.5%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified92.1%

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

        \[\leadsto \color{blue}{\frac{2 \cdot \frac{x}{z}}{y - t}} \]
      2. *-commutative92.1%

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{2}{y - t}} \]
      4. clear-num92.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{2}{y - t} \]
      5. associate-*l/92.0%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{2}{y - t}}{\frac{z}{x}}} \]
      6. *-un-lft-identity92.0%

        \[\leadsto \frac{\color{blue}{\frac{2}{y - t}}}{\frac{z}{x}} \]
    5. Applied egg-rr92.0%

      \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    6. Taylor expanded in y around inf 85.5%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{2 \cdot x}{z \cdot y}} \]
      3. frac-times86.2%

        \[\leadsto \color{blue}{\frac{2}{z} \cdot \frac{x}{y}} \]
      4. clear-num86.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{2}}} \cdot \frac{x}{y} \]
      5. associate-*l/87.2%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y}}{\frac{z}{2}}} \]
      6. *-un-lft-identity87.2%

        \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{\frac{z}{2}} \]
      7. div-inv87.2%

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

        \[\leadsto \frac{\frac{x}{y}}{z \cdot \color{blue}{0.5}} \]
    10. Applied egg-rr87.2%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{z \cdot 0.5}} \]

    if 7.5999999999999999e52 < t

    1. Initial program 84.8%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative84.8%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--88.4%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified91.5%

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

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

        \[\leadsto \color{blue}{\frac{-2 \cdot x}{t \cdot z}} \]
      2. metadata-eval81.8%

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

        \[\leadsto \frac{\color{blue}{2 \cdot \left(-1 \cdot x\right)}}{t \cdot z} \]
      4. neg-mul-181.8%

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

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

        \[\leadsto \color{blue}{\frac{-x}{t} \cdot \frac{2}{z}} \]
      7. frac-2neg80.0%

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

        \[\leadsto \frac{\color{blue}{x}}{-t} \cdot \frac{2}{z} \]
      9. associate-*l/83.3%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{2}{z}}{-t}} \]
    6. Applied egg-rr83.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.68 \cdot 10^{+44}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{z}}{t}\\ \mathbf{elif}\;t \leq -3.8 \cdot 10^{-17}:\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\ \mathbf{elif}\;t \leq -2.55 \cdot 10^{-80}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{elif}\;t \leq 9 \cdot 10^{-87}:\\ \;\;\;\;\frac{\frac{x}{y}}{z \cdot 0.5}\\ \mathbf{elif}\;t \leq 7.8 \cdot 10^{-37}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{elif}\;t \leq 7.6 \cdot 10^{+52}:\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{2}{z}}{-t}\\ \end{array} \]

Alternative 3: 72.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \frac{\frac{x}{z}}{y}\\ t_2 := -2 \cdot \frac{x}{z \cdot t}\\ \mathbf{if}\;t \leq -1.6 \cdot 10^{+44}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -1.06 \cdot 10^{-18}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -6.4 \cdot 10^{-75}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-87}:\\ \;\;\;\;x \cdot \frac{2}{y \cdot z}\\ \mathbf{elif}\;t \leq 8.2 \cdot 10^{-37} \lor \neg \left(t \leq 9.6 \cdot 10^{+50}\right):\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* 2.0 (/ (/ x z) y))) (t_2 (* -2.0 (/ x (* z t)))))
   (if (<= t -1.6e+44)
     t_2
     (if (<= t -1.06e-18)
       t_1
       (if (<= t -6.4e-75)
         t_2
         (if (<= t 8.5e-87)
           (* x (/ 2.0 (* y z)))
           (if (or (<= t 8.2e-37) (not (<= t 9.6e+50))) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * ((x / z) / y);
	double t_2 = -2.0 * (x / (z * t));
	double tmp;
	if (t <= -1.6e+44) {
		tmp = t_2;
	} else if (t <= -1.06e-18) {
		tmp = t_1;
	} else if (t <= -6.4e-75) {
		tmp = t_2;
	} else if (t <= 8.5e-87) {
		tmp = x * (2.0 / (y * z));
	} else if ((t <= 8.2e-37) || !(t <= 9.6e+50)) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = 2.0d0 * ((x / z) / y)
    t_2 = (-2.0d0) * (x / (z * t))
    if (t <= (-1.6d+44)) then
        tmp = t_2
    else if (t <= (-1.06d-18)) then
        tmp = t_1
    else if (t <= (-6.4d-75)) then
        tmp = t_2
    else if (t <= 8.5d-87) then
        tmp = x * (2.0d0 / (y * z))
    else if ((t <= 8.2d-37) .or. (.not. (t <= 9.6d+50))) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * ((x / z) / y);
	double t_2 = -2.0 * (x / (z * t));
	double tmp;
	if (t <= -1.6e+44) {
		tmp = t_2;
	} else if (t <= -1.06e-18) {
		tmp = t_1;
	} else if (t <= -6.4e-75) {
		tmp = t_2;
	} else if (t <= 8.5e-87) {
		tmp = x * (2.0 / (y * z));
	} else if ((t <= 8.2e-37) || !(t <= 9.6e+50)) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = 2.0 * ((x / z) / y)
	t_2 = -2.0 * (x / (z * t))
	tmp = 0
	if t <= -1.6e+44:
		tmp = t_2
	elif t <= -1.06e-18:
		tmp = t_1
	elif t <= -6.4e-75:
		tmp = t_2
	elif t <= 8.5e-87:
		tmp = x * (2.0 / (y * z))
	elif (t <= 8.2e-37) or not (t <= 9.6e+50):
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(2.0 * Float64(Float64(x / z) / y))
	t_2 = Float64(-2.0 * Float64(x / Float64(z * t)))
	tmp = 0.0
	if (t <= -1.6e+44)
		tmp = t_2;
	elseif (t <= -1.06e-18)
		tmp = t_1;
	elseif (t <= -6.4e-75)
		tmp = t_2;
	elseif (t <= 8.5e-87)
		tmp = Float64(x * Float64(2.0 / Float64(y * z)));
	elseif ((t <= 8.2e-37) || !(t <= 9.6e+50))
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = 2.0 * ((x / z) / y);
	t_2 = -2.0 * (x / (z * t));
	tmp = 0.0;
	if (t <= -1.6e+44)
		tmp = t_2;
	elseif (t <= -1.06e-18)
		tmp = t_1;
	elseif (t <= -6.4e-75)
		tmp = t_2;
	elseif (t <= 8.5e-87)
		tmp = x * (2.0 / (y * z));
	elseif ((t <= 8.2e-37) || ~((t <= 9.6e+50)))
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.6e+44], t$95$2, If[LessEqual[t, -1.06e-18], t$95$1, If[LessEqual[t, -6.4e-75], t$95$2, If[LessEqual[t, 8.5e-87], N[(x * N[(2.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 8.2e-37], N[Not[LessEqual[t, 9.6e+50]], $MachinePrecision]], t$95$2, t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -1.06 \cdot 10^{-18}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -6.4 \cdot 10^{-75}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 8.5 \cdot 10^{-87}:\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\

\mathbf{elif}\;t \leq 8.2 \cdot 10^{-37} \lor \neg \left(t \leq 9.6 \cdot 10^{+50}\right):\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.60000000000000002e44 or -1.05999999999999994e-18 < t < -6.39999999999999953e-75 or 8.5000000000000001e-87 < t < 8.1999999999999996e-37 or 9.6000000000000007e50 < t

    1. Initial program 87.7%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative87.7%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--90.7%

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

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

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

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

    if -1.60000000000000002e44 < t < -1.05999999999999994e-18 or 8.1999999999999996e-37 < t < 9.6000000000000007e50

    1. Initial program 92.7%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative92.7%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--92.7%

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

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

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

        \[\leadsto \color{blue}{\frac{2 \cdot \frac{x}{z}}{y - t}} \]
      2. *-commutative99.7%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{2}{y - t} \]
      5. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{2}{y - t}}{\frac{z}{x}}} \]
      6. *-un-lft-identity99.7%

        \[\leadsto \frac{\color{blue}{\frac{2}{y - t}}}{\frac{z}{x}} \]
    5. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    6. Taylor expanded in y around inf 58.7%

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

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y}} \]
    8. Simplified76.1%

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

    if -6.39999999999999953e-75 < t < 8.5000000000000001e-87

    1. Initial program 92.5%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative92.5%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--92.5%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified92.1%

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{\frac{z}{\frac{2}{y - t}}}} \]
      4. associate-/l*94.7%

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

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

      \[\leadsto \color{blue}{x \cdot \frac{\frac{2}{y - t}}{z}} \]
    7. Taylor expanded in y around inf 85.4%

      \[\leadsto x \cdot \color{blue}{\frac{2}{y \cdot z}} \]
    8. Step-by-step derivation
      1. *-commutative85.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.6 \cdot 10^{+44}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{elif}\;t \leq -1.06 \cdot 10^{-18}:\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\ \mathbf{elif}\;t \leq -6.4 \cdot 10^{-75}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-87}:\\ \;\;\;\;x \cdot \frac{2}{y \cdot z}\\ \mathbf{elif}\;t \leq 8.2 \cdot 10^{-37} \lor \neg \left(t \leq 9.6 \cdot 10^{+50}\right):\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\ \end{array} \]

Alternative 4: 72.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \frac{\frac{x}{z}}{y}\\ t_2 := -2 \cdot \frac{x}{z \cdot t}\\ \mathbf{if}\;t \leq -1.68 \cdot 10^{+44}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -1.22 \cdot 10^{-17}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -7.2 \cdot 10^{-88}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 6 \cdot 10^{-89}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-38} \lor \neg \left(t \leq 1.32 \cdot 10^{+51}\right):\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* 2.0 (/ (/ x z) y))) (t_2 (* -2.0 (/ x (* z t)))))
   (if (<= t -1.68e+44)
     t_2
     (if (<= t -1.22e-17)
       t_1
       (if (<= t -7.2e-88)
         t_2
         (if (<= t 6e-89)
           (* (/ 2.0 z) (/ x y))
           (if (or (<= t 4.5e-38) (not (<= t 1.32e+51))) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * ((x / z) / y);
	double t_2 = -2.0 * (x / (z * t));
	double tmp;
	if (t <= -1.68e+44) {
		tmp = t_2;
	} else if (t <= -1.22e-17) {
		tmp = t_1;
	} else if (t <= -7.2e-88) {
		tmp = t_2;
	} else if (t <= 6e-89) {
		tmp = (2.0 / z) * (x / y);
	} else if ((t <= 4.5e-38) || !(t <= 1.32e+51)) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = 2.0d0 * ((x / z) / y)
    t_2 = (-2.0d0) * (x / (z * t))
    if (t <= (-1.68d+44)) then
        tmp = t_2
    else if (t <= (-1.22d-17)) then
        tmp = t_1
    else if (t <= (-7.2d-88)) then
        tmp = t_2
    else if (t <= 6d-89) then
        tmp = (2.0d0 / z) * (x / y)
    else if ((t <= 4.5d-38) .or. (.not. (t <= 1.32d+51))) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * ((x / z) / y);
	double t_2 = -2.0 * (x / (z * t));
	double tmp;
	if (t <= -1.68e+44) {
		tmp = t_2;
	} else if (t <= -1.22e-17) {
		tmp = t_1;
	} else if (t <= -7.2e-88) {
		tmp = t_2;
	} else if (t <= 6e-89) {
		tmp = (2.0 / z) * (x / y);
	} else if ((t <= 4.5e-38) || !(t <= 1.32e+51)) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = 2.0 * ((x / z) / y)
	t_2 = -2.0 * (x / (z * t))
	tmp = 0
	if t <= -1.68e+44:
		tmp = t_2
	elif t <= -1.22e-17:
		tmp = t_1
	elif t <= -7.2e-88:
		tmp = t_2
	elif t <= 6e-89:
		tmp = (2.0 / z) * (x / y)
	elif (t <= 4.5e-38) or not (t <= 1.32e+51):
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(2.0 * Float64(Float64(x / z) / y))
	t_2 = Float64(-2.0 * Float64(x / Float64(z * t)))
	tmp = 0.0
	if (t <= -1.68e+44)
		tmp = t_2;
	elseif (t <= -1.22e-17)
		tmp = t_1;
	elseif (t <= -7.2e-88)
		tmp = t_2;
	elseif (t <= 6e-89)
		tmp = Float64(Float64(2.0 / z) * Float64(x / y));
	elseif ((t <= 4.5e-38) || !(t <= 1.32e+51))
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = 2.0 * ((x / z) / y);
	t_2 = -2.0 * (x / (z * t));
	tmp = 0.0;
	if (t <= -1.68e+44)
		tmp = t_2;
	elseif (t <= -1.22e-17)
		tmp = t_1;
	elseif (t <= -7.2e-88)
		tmp = t_2;
	elseif (t <= 6e-89)
		tmp = (2.0 / z) * (x / y);
	elseif ((t <= 4.5e-38) || ~((t <= 1.32e+51)))
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.68e+44], t$95$2, If[LessEqual[t, -1.22e-17], t$95$1, If[LessEqual[t, -7.2e-88], t$95$2, If[LessEqual[t, 6e-89], N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 4.5e-38], N[Not[LessEqual[t, 1.32e+51]], $MachinePrecision]], t$95$2, t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -1.22 \cdot 10^{-17}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -7.2 \cdot 10^{-88}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 6 \cdot 10^{-89}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\

\mathbf{elif}\;t \leq 4.5 \cdot 10^{-38} \lor \neg \left(t \leq 1.32 \cdot 10^{+51}\right):\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.68000000000000001e44 or -1.22e-17 < t < -7.1999999999999999e-88 or 5.9999999999999999e-89 < t < 4.50000000000000009e-38 or 1.32e51 < t

    1. Initial program 87.7%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative87.7%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--90.7%

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

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

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

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

    if -1.68000000000000001e44 < t < -1.22e-17 or 4.50000000000000009e-38 < t < 1.32e51

    1. Initial program 92.7%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative92.7%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--92.7%

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

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

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

        \[\leadsto \color{blue}{\frac{2 \cdot \frac{x}{z}}{y - t}} \]
      2. *-commutative99.7%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{2}{y - t} \]
      5. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{2}{y - t}}{\frac{z}{x}}} \]
      6. *-un-lft-identity99.7%

        \[\leadsto \frac{\color{blue}{\frac{2}{y - t}}}{\frac{z}{x}} \]
    5. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    6. Taylor expanded in y around inf 58.7%

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

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y}} \]
    8. Simplified76.1%

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

    if -7.1999999999999999e-88 < t < 5.9999999999999999e-89

    1. Initial program 92.5%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative92.5%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--92.5%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified92.1%

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

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

        \[\leadsto \color{blue}{\frac{2 \cdot x}{y \cdot z}} \]
      2. *-commutative85.5%

        \[\leadsto \frac{\color{blue}{x \cdot 2}}{y \cdot z} \]
      3. times-frac86.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.68 \cdot 10^{+44}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{elif}\;t \leq -1.22 \cdot 10^{-17}:\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\ \mathbf{elif}\;t \leq -7.2 \cdot 10^{-88}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{elif}\;t \leq 6 \cdot 10^{-89}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-38} \lor \neg \left(t \leq 1.32 \cdot 10^{+51}\right):\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\ \end{array} \]

Alternative 5: 72.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \frac{\frac{x}{z}}{y}\\ t_2 := -2 \cdot \frac{x}{z \cdot t}\\ \mathbf{if}\;t \leq -1.6 \cdot 10^{+44}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{z}}{t}\\ \mathbf{elif}\;t \leq -2.75 \cdot 10^{-18}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -3 \cdot 10^{-79}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-88}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;t \leq 4.3 \cdot 10^{-38} \lor \neg \left(t \leq 3.8 \cdot 10^{+51}\right):\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* 2.0 (/ (/ x z) y))) (t_2 (* -2.0 (/ x (* z t)))))
   (if (<= t -1.6e+44)
     (* x (/ (/ -2.0 z) t))
     (if (<= t -2.75e-18)
       t_1
       (if (<= t -3e-79)
         t_2
         (if (<= t 2.1e-88)
           (* (/ 2.0 z) (/ x y))
           (if (or (<= t 4.3e-38) (not (<= t 3.8e+51))) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * ((x / z) / y);
	double t_2 = -2.0 * (x / (z * t));
	double tmp;
	if (t <= -1.6e+44) {
		tmp = x * ((-2.0 / z) / t);
	} else if (t <= -2.75e-18) {
		tmp = t_1;
	} else if (t <= -3e-79) {
		tmp = t_2;
	} else if (t <= 2.1e-88) {
		tmp = (2.0 / z) * (x / y);
	} else if ((t <= 4.3e-38) || !(t <= 3.8e+51)) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = 2.0d0 * ((x / z) / y)
    t_2 = (-2.0d0) * (x / (z * t))
    if (t <= (-1.6d+44)) then
        tmp = x * (((-2.0d0) / z) / t)
    else if (t <= (-2.75d-18)) then
        tmp = t_1
    else if (t <= (-3d-79)) then
        tmp = t_2
    else if (t <= 2.1d-88) then
        tmp = (2.0d0 / z) * (x / y)
    else if ((t <= 4.3d-38) .or. (.not. (t <= 3.8d+51))) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * ((x / z) / y);
	double t_2 = -2.0 * (x / (z * t));
	double tmp;
	if (t <= -1.6e+44) {
		tmp = x * ((-2.0 / z) / t);
	} else if (t <= -2.75e-18) {
		tmp = t_1;
	} else if (t <= -3e-79) {
		tmp = t_2;
	} else if (t <= 2.1e-88) {
		tmp = (2.0 / z) * (x / y);
	} else if ((t <= 4.3e-38) || !(t <= 3.8e+51)) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = 2.0 * ((x / z) / y)
	t_2 = -2.0 * (x / (z * t))
	tmp = 0
	if t <= -1.6e+44:
		tmp = x * ((-2.0 / z) / t)
	elif t <= -2.75e-18:
		tmp = t_1
	elif t <= -3e-79:
		tmp = t_2
	elif t <= 2.1e-88:
		tmp = (2.0 / z) * (x / y)
	elif (t <= 4.3e-38) or not (t <= 3.8e+51):
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(2.0 * Float64(Float64(x / z) / y))
	t_2 = Float64(-2.0 * Float64(x / Float64(z * t)))
	tmp = 0.0
	if (t <= -1.6e+44)
		tmp = Float64(x * Float64(Float64(-2.0 / z) / t));
	elseif (t <= -2.75e-18)
		tmp = t_1;
	elseif (t <= -3e-79)
		tmp = t_2;
	elseif (t <= 2.1e-88)
		tmp = Float64(Float64(2.0 / z) * Float64(x / y));
	elseif ((t <= 4.3e-38) || !(t <= 3.8e+51))
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = 2.0 * ((x / z) / y);
	t_2 = -2.0 * (x / (z * t));
	tmp = 0.0;
	if (t <= -1.6e+44)
		tmp = x * ((-2.0 / z) / t);
	elseif (t <= -2.75e-18)
		tmp = t_1;
	elseif (t <= -3e-79)
		tmp = t_2;
	elseif (t <= 2.1e-88)
		tmp = (2.0 / z) * (x / y);
	elseif ((t <= 4.3e-38) || ~((t <= 3.8e+51)))
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.6e+44], N[(x * N[(N[(-2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.75e-18], t$95$1, If[LessEqual[t, -3e-79], t$95$2, If[LessEqual[t, 2.1e-88], N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 4.3e-38], N[Not[LessEqual[t, 3.8e+51]], $MachinePrecision]], t$95$2, t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -2.75 \cdot 10^{-18}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -3 \cdot 10^{-79}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 2.1 \cdot 10^{-88}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\

\mathbf{elif}\;t \leq 4.3 \cdot 10^{-38} \lor \neg \left(t \leq 3.8 \cdot 10^{+51}\right):\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.60000000000000002e44

    1. Initial program 86.2%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative86.2%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--90.3%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified92.2%

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

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

        \[\leadsto -2 \cdot \color{blue}{\frac{\frac{x}{t}}{z}} \]
      2. clear-num86.9%

        \[\leadsto -2 \cdot \color{blue}{\frac{1}{\frac{z}{\frac{x}{t}}}} \]
      3. un-div-inv86.9%

        \[\leadsto \color{blue}{\frac{-2}{\frac{z}{\frac{x}{t}}}} \]
      4. div-inv85.8%

        \[\leadsto \frac{-2}{\color{blue}{z \cdot \frac{1}{\frac{x}{t}}}} \]
      5. clear-num85.9%

        \[\leadsto \frac{-2}{z \cdot \color{blue}{\frac{t}{x}}} \]
    6. Applied egg-rr85.9%

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

        \[\leadsto \color{blue}{\frac{\frac{-2}{z}}{\frac{t}{x}}} \]
      2. associate-/r/88.3%

        \[\leadsto \color{blue}{\frac{\frac{-2}{z}}{t} \cdot x} \]
    8. Applied egg-rr88.3%

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

    if -1.60000000000000002e44 < t < -2.75e-18 or 4.3000000000000002e-38 < t < 3.7999999999999997e51

    1. Initial program 92.7%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative92.7%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--92.7%

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

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

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

        \[\leadsto \color{blue}{\frac{2 \cdot \frac{x}{z}}{y - t}} \]
      2. *-commutative99.7%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{2}{y - t} \]
      5. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{2}{y - t}}{\frac{z}{x}}} \]
      6. *-un-lft-identity99.7%

        \[\leadsto \frac{\color{blue}{\frac{2}{y - t}}}{\frac{z}{x}} \]
    5. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    6. Taylor expanded in y around inf 58.7%

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

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y}} \]
    8. Simplified76.1%

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

    if -2.75e-18 < t < -3e-79 or 2.1e-88 < t < 4.3000000000000002e-38 or 3.7999999999999997e51 < t

    1. Initial program 88.6%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative88.6%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--90.9%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified90.9%

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

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

    if -3e-79 < t < 2.1e-88

    1. Initial program 92.5%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative92.5%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--92.5%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified92.1%

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

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

        \[\leadsto \color{blue}{\frac{2 \cdot x}{y \cdot z}} \]
      2. *-commutative85.5%

        \[\leadsto \frac{\color{blue}{x \cdot 2}}{y \cdot z} \]
      3. times-frac86.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.6 \cdot 10^{+44}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{z}}{t}\\ \mathbf{elif}\;t \leq -2.75 \cdot 10^{-18}:\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\ \mathbf{elif}\;t \leq -3 \cdot 10^{-79}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-88}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;t \leq 4.3 \cdot 10^{-38} \lor \neg \left(t \leq 3.8 \cdot 10^{+51}\right):\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\ \end{array} \]

Alternative 6: 72.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \frac{\frac{x}{z}}{y}\\ t_2 := -2 \cdot \frac{x}{z \cdot t}\\ \mathbf{if}\;t \leq -1.7 \cdot 10^{+44}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{z}}{t}\\ \mathbf{elif}\;t \leq -3.3 \cdot 10^{-15}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -2 \cdot 10^{-76}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-89}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{-38}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{+52}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-2}{\frac{z}{x}}}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* 2.0 (/ (/ x z) y))) (t_2 (* -2.0 (/ x (* z t)))))
   (if (<= t -1.7e+44)
     (* x (/ (/ -2.0 z) t))
     (if (<= t -3.3e-15)
       t_1
       (if (<= t -2e-76)
         t_2
         (if (<= t 8e-89)
           (* (/ 2.0 z) (/ x y))
           (if (<= t 4.6e-38)
             t_2
             (if (<= t 2.1e+52) t_1 (/ (/ -2.0 (/ z x)) t)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * ((x / z) / y);
	double t_2 = -2.0 * (x / (z * t));
	double tmp;
	if (t <= -1.7e+44) {
		tmp = x * ((-2.0 / z) / t);
	} else if (t <= -3.3e-15) {
		tmp = t_1;
	} else if (t <= -2e-76) {
		tmp = t_2;
	} else if (t <= 8e-89) {
		tmp = (2.0 / z) * (x / y);
	} else if (t <= 4.6e-38) {
		tmp = t_2;
	} else if (t <= 2.1e+52) {
		tmp = t_1;
	} else {
		tmp = (-2.0 / (z / x)) / t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = 2.0d0 * ((x / z) / y)
    t_2 = (-2.0d0) * (x / (z * t))
    if (t <= (-1.7d+44)) then
        tmp = x * (((-2.0d0) / z) / t)
    else if (t <= (-3.3d-15)) then
        tmp = t_1
    else if (t <= (-2d-76)) then
        tmp = t_2
    else if (t <= 8d-89) then
        tmp = (2.0d0 / z) * (x / y)
    else if (t <= 4.6d-38) then
        tmp = t_2
    else if (t <= 2.1d+52) then
        tmp = t_1
    else
        tmp = ((-2.0d0) / (z / x)) / t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * ((x / z) / y);
	double t_2 = -2.0 * (x / (z * t));
	double tmp;
	if (t <= -1.7e+44) {
		tmp = x * ((-2.0 / z) / t);
	} else if (t <= -3.3e-15) {
		tmp = t_1;
	} else if (t <= -2e-76) {
		tmp = t_2;
	} else if (t <= 8e-89) {
		tmp = (2.0 / z) * (x / y);
	} else if (t <= 4.6e-38) {
		tmp = t_2;
	} else if (t <= 2.1e+52) {
		tmp = t_1;
	} else {
		tmp = (-2.0 / (z / x)) / t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = 2.0 * ((x / z) / y)
	t_2 = -2.0 * (x / (z * t))
	tmp = 0
	if t <= -1.7e+44:
		tmp = x * ((-2.0 / z) / t)
	elif t <= -3.3e-15:
		tmp = t_1
	elif t <= -2e-76:
		tmp = t_2
	elif t <= 8e-89:
		tmp = (2.0 / z) * (x / y)
	elif t <= 4.6e-38:
		tmp = t_2
	elif t <= 2.1e+52:
		tmp = t_1
	else:
		tmp = (-2.0 / (z / x)) / t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(2.0 * Float64(Float64(x / z) / y))
	t_2 = Float64(-2.0 * Float64(x / Float64(z * t)))
	tmp = 0.0
	if (t <= -1.7e+44)
		tmp = Float64(x * Float64(Float64(-2.0 / z) / t));
	elseif (t <= -3.3e-15)
		tmp = t_1;
	elseif (t <= -2e-76)
		tmp = t_2;
	elseif (t <= 8e-89)
		tmp = Float64(Float64(2.0 / z) * Float64(x / y));
	elseif (t <= 4.6e-38)
		tmp = t_2;
	elseif (t <= 2.1e+52)
		tmp = t_1;
	else
		tmp = Float64(Float64(-2.0 / Float64(z / x)) / t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = 2.0 * ((x / z) / y);
	t_2 = -2.0 * (x / (z * t));
	tmp = 0.0;
	if (t <= -1.7e+44)
		tmp = x * ((-2.0 / z) / t);
	elseif (t <= -3.3e-15)
		tmp = t_1;
	elseif (t <= -2e-76)
		tmp = t_2;
	elseif (t <= 8e-89)
		tmp = (2.0 / z) * (x / y);
	elseif (t <= 4.6e-38)
		tmp = t_2;
	elseif (t <= 2.1e+52)
		tmp = t_1;
	else
		tmp = (-2.0 / (z / x)) / t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.7e+44], N[(x * N[(N[(-2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.3e-15], t$95$1, If[LessEqual[t, -2e-76], t$95$2, If[LessEqual[t, 8e-89], N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e-38], t$95$2, If[LessEqual[t, 2.1e+52], t$95$1, N[(N[(-2.0 / N[(z / x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -3.3 \cdot 10^{-15}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -2 \cdot 10^{-76}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 8 \cdot 10^{-89}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\

\mathbf{elif}\;t \leq 4.6 \cdot 10^{-38}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 2.1 \cdot 10^{+52}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -1.7e44

    1. Initial program 86.2%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative86.2%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--90.3%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified92.2%

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

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

        \[\leadsto -2 \cdot \color{blue}{\frac{\frac{x}{t}}{z}} \]
      2. clear-num86.9%

        \[\leadsto -2 \cdot \color{blue}{\frac{1}{\frac{z}{\frac{x}{t}}}} \]
      3. un-div-inv86.9%

        \[\leadsto \color{blue}{\frac{-2}{\frac{z}{\frac{x}{t}}}} \]
      4. div-inv85.8%

        \[\leadsto \frac{-2}{\color{blue}{z \cdot \frac{1}{\frac{x}{t}}}} \]
      5. clear-num85.9%

        \[\leadsto \frac{-2}{z \cdot \color{blue}{\frac{t}{x}}} \]
    6. Applied egg-rr85.9%

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

        \[\leadsto \color{blue}{\frac{\frac{-2}{z}}{\frac{t}{x}}} \]
      2. associate-/r/88.3%

        \[\leadsto \color{blue}{\frac{\frac{-2}{z}}{t} \cdot x} \]
    8. Applied egg-rr88.3%

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

    if -1.7e44 < t < -3.3e-15 or 4.60000000000000003e-38 < t < 2.1e52

    1. Initial program 92.7%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative92.7%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--92.7%

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

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

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

        \[\leadsto \color{blue}{\frac{2 \cdot \frac{x}{z}}{y - t}} \]
      2. *-commutative99.7%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{2}{y - t} \]
      5. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{2}{y - t}}{\frac{z}{x}}} \]
      6. *-un-lft-identity99.7%

        \[\leadsto \frac{\color{blue}{\frac{2}{y - t}}}{\frac{z}{x}} \]
    5. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    6. Taylor expanded in y around inf 58.7%

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

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y}} \]
    8. Simplified76.1%

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

    if -3.3e-15 < t < -1.99999999999999985e-76 or 8.00000000000000031e-89 < t < 4.60000000000000003e-38

    1. Initial program 96.4%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative96.4%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--96.3%

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

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

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

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

    if -1.99999999999999985e-76 < t < 8.00000000000000031e-89

    1. Initial program 92.5%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative92.5%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--92.5%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified92.1%

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

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

        \[\leadsto \color{blue}{\frac{2 \cdot x}{y \cdot z}} \]
      2. *-commutative85.5%

        \[\leadsto \frac{\color{blue}{x \cdot 2}}{y \cdot z} \]
      3. times-frac86.2%

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

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

    if 2.1e52 < t

    1. Initial program 84.8%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative84.8%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--88.4%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified91.5%

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

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

        \[\leadsto -2 \cdot \color{blue}{\frac{\frac{x}{t}}{z}} \]
      2. clear-num79.4%

        \[\leadsto -2 \cdot \color{blue}{\frac{1}{\frac{z}{\frac{x}{t}}}} \]
      3. un-div-inv79.4%

        \[\leadsto \color{blue}{\frac{-2}{\frac{z}{\frac{x}{t}}}} \]
      4. div-inv79.3%

        \[\leadsto \frac{-2}{\color{blue}{z \cdot \frac{1}{\frac{x}{t}}}} \]
      5. clear-num79.4%

        \[\leadsto \frac{-2}{z \cdot \color{blue}{\frac{t}{x}}} \]
    6. Applied egg-rr79.4%

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

        \[\leadsto \color{blue}{\frac{\frac{-2}{z}}{\frac{t}{x}}} \]
      2. associate-/r/81.6%

        \[\leadsto \color{blue}{\frac{\frac{-2}{z}}{t} \cdot x} \]
    8. Applied egg-rr81.6%

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

        \[\leadsto \color{blue}{\frac{-2}{t \cdot z}} \cdot x \]
      2. associate-*l/81.8%

        \[\leadsto \color{blue}{\frac{-2 \cdot x}{t \cdot z}} \]
      3. times-frac83.1%

        \[\leadsto \color{blue}{\frac{-2}{t} \cdot \frac{x}{z}} \]
      4. associate-*l/83.3%

        \[\leadsto \color{blue}{\frac{-2 \cdot \frac{x}{z}}{t}} \]
      5. metadata-eval83.3%

        \[\leadsto \frac{\color{blue}{\left(-2\right)} \cdot \frac{x}{z}}{t} \]
      6. distribute-lft-neg-in83.3%

        \[\leadsto \frac{\color{blue}{-2 \cdot \frac{x}{z}}}{t} \]
      7. clear-num83.2%

        \[\leadsto \frac{-2 \cdot \color{blue}{\frac{1}{\frac{z}{x}}}}{t} \]
      8. div-inv83.2%

        \[\leadsto \frac{-\color{blue}{\frac{2}{\frac{z}{x}}}}{t} \]
      9. distribute-neg-frac83.2%

        \[\leadsto \frac{\color{blue}{\frac{-2}{\frac{z}{x}}}}{t} \]
      10. metadata-eval83.2%

        \[\leadsto \frac{\frac{\color{blue}{-2}}{\frac{z}{x}}}{t} \]
    10. Applied egg-rr83.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.7 \cdot 10^{+44}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{z}}{t}\\ \mathbf{elif}\;t \leq -3.3 \cdot 10^{-15}:\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\ \mathbf{elif}\;t \leq -2 \cdot 10^{-76}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-89}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{-38}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{+52}:\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-2}{\frac{z}{x}}}{t}\\ \end{array} \]

Alternative 7: 72.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \frac{\frac{x}{z}}{y}\\ t_2 := -2 \cdot \frac{x}{z \cdot t}\\ \mathbf{if}\;t \leq -1.65 \cdot 10^{+44}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{z}}{t}\\ \mathbf{elif}\;t \leq -6 \cdot 10^{-15}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -3.1 \cdot 10^{-80}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{-86}:\\ \;\;\;\;\frac{\frac{x}{y}}{z \cdot 0.5}\\ \mathbf{elif}\;t \leq 9.2 \cdot 10^{-38}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 9.6 \cdot 10^{+50}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-2}{\frac{z}{x}}}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* 2.0 (/ (/ x z) y))) (t_2 (* -2.0 (/ x (* z t)))))
   (if (<= t -1.65e+44)
     (* x (/ (/ -2.0 z) t))
     (if (<= t -6e-15)
       t_1
       (if (<= t -3.1e-80)
         t_2
         (if (<= t 1.05e-86)
           (/ (/ x y) (* z 0.5))
           (if (<= t 9.2e-38)
             t_2
             (if (<= t 9.6e+50) t_1 (/ (/ -2.0 (/ z x)) t)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * ((x / z) / y);
	double t_2 = -2.0 * (x / (z * t));
	double tmp;
	if (t <= -1.65e+44) {
		tmp = x * ((-2.0 / z) / t);
	} else if (t <= -6e-15) {
		tmp = t_1;
	} else if (t <= -3.1e-80) {
		tmp = t_2;
	} else if (t <= 1.05e-86) {
		tmp = (x / y) / (z * 0.5);
	} else if (t <= 9.2e-38) {
		tmp = t_2;
	} else if (t <= 9.6e+50) {
		tmp = t_1;
	} else {
		tmp = (-2.0 / (z / x)) / t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = 2.0d0 * ((x / z) / y)
    t_2 = (-2.0d0) * (x / (z * t))
    if (t <= (-1.65d+44)) then
        tmp = x * (((-2.0d0) / z) / t)
    else if (t <= (-6d-15)) then
        tmp = t_1
    else if (t <= (-3.1d-80)) then
        tmp = t_2
    else if (t <= 1.05d-86) then
        tmp = (x / y) / (z * 0.5d0)
    else if (t <= 9.2d-38) then
        tmp = t_2
    else if (t <= 9.6d+50) then
        tmp = t_1
    else
        tmp = ((-2.0d0) / (z / x)) / t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * ((x / z) / y);
	double t_2 = -2.0 * (x / (z * t));
	double tmp;
	if (t <= -1.65e+44) {
		tmp = x * ((-2.0 / z) / t);
	} else if (t <= -6e-15) {
		tmp = t_1;
	} else if (t <= -3.1e-80) {
		tmp = t_2;
	} else if (t <= 1.05e-86) {
		tmp = (x / y) / (z * 0.5);
	} else if (t <= 9.2e-38) {
		tmp = t_2;
	} else if (t <= 9.6e+50) {
		tmp = t_1;
	} else {
		tmp = (-2.0 / (z / x)) / t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = 2.0 * ((x / z) / y)
	t_2 = -2.0 * (x / (z * t))
	tmp = 0
	if t <= -1.65e+44:
		tmp = x * ((-2.0 / z) / t)
	elif t <= -6e-15:
		tmp = t_1
	elif t <= -3.1e-80:
		tmp = t_2
	elif t <= 1.05e-86:
		tmp = (x / y) / (z * 0.5)
	elif t <= 9.2e-38:
		tmp = t_2
	elif t <= 9.6e+50:
		tmp = t_1
	else:
		tmp = (-2.0 / (z / x)) / t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(2.0 * Float64(Float64(x / z) / y))
	t_2 = Float64(-2.0 * Float64(x / Float64(z * t)))
	tmp = 0.0
	if (t <= -1.65e+44)
		tmp = Float64(x * Float64(Float64(-2.0 / z) / t));
	elseif (t <= -6e-15)
		tmp = t_1;
	elseif (t <= -3.1e-80)
		tmp = t_2;
	elseif (t <= 1.05e-86)
		tmp = Float64(Float64(x / y) / Float64(z * 0.5));
	elseif (t <= 9.2e-38)
		tmp = t_2;
	elseif (t <= 9.6e+50)
		tmp = t_1;
	else
		tmp = Float64(Float64(-2.0 / Float64(z / x)) / t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = 2.0 * ((x / z) / y);
	t_2 = -2.0 * (x / (z * t));
	tmp = 0.0;
	if (t <= -1.65e+44)
		tmp = x * ((-2.0 / z) / t);
	elseif (t <= -6e-15)
		tmp = t_1;
	elseif (t <= -3.1e-80)
		tmp = t_2;
	elseif (t <= 1.05e-86)
		tmp = (x / y) / (z * 0.5);
	elseif (t <= 9.2e-38)
		tmp = t_2;
	elseif (t <= 9.6e+50)
		tmp = t_1;
	else
		tmp = (-2.0 / (z / x)) / t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.65e+44], N[(x * N[(N[(-2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -6e-15], t$95$1, If[LessEqual[t, -3.1e-80], t$95$2, If[LessEqual[t, 1.05e-86], N[(N[(x / y), $MachinePrecision] / N[(z * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.2e-38], t$95$2, If[LessEqual[t, 9.6e+50], t$95$1, N[(N[(-2.0 / N[(z / x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -6 \cdot 10^{-15}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -3.1 \cdot 10^{-80}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 1.05 \cdot 10^{-86}:\\
\;\;\;\;\frac{\frac{x}{y}}{z \cdot 0.5}\\

\mathbf{elif}\;t \leq 9.2 \cdot 10^{-38}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 9.6 \cdot 10^{+50}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -1.65000000000000007e44

    1. Initial program 86.2%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative86.2%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--90.3%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified92.2%

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

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

        \[\leadsto -2 \cdot \color{blue}{\frac{\frac{x}{t}}{z}} \]
      2. clear-num86.9%

        \[\leadsto -2 \cdot \color{blue}{\frac{1}{\frac{z}{\frac{x}{t}}}} \]
      3. un-div-inv86.9%

        \[\leadsto \color{blue}{\frac{-2}{\frac{z}{\frac{x}{t}}}} \]
      4. div-inv85.8%

        \[\leadsto \frac{-2}{\color{blue}{z \cdot \frac{1}{\frac{x}{t}}}} \]
      5. clear-num85.9%

        \[\leadsto \frac{-2}{z \cdot \color{blue}{\frac{t}{x}}} \]
    6. Applied egg-rr85.9%

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

        \[\leadsto \color{blue}{\frac{\frac{-2}{z}}{\frac{t}{x}}} \]
      2. associate-/r/88.3%

        \[\leadsto \color{blue}{\frac{\frac{-2}{z}}{t} \cdot x} \]
    8. Applied egg-rr88.3%

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

    if -1.65000000000000007e44 < t < -6e-15 or 9.20000000000000007e-38 < t < 9.6000000000000007e50

    1. Initial program 92.7%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative92.7%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--92.7%

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

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

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

        \[\leadsto \color{blue}{\frac{2 \cdot \frac{x}{z}}{y - t}} \]
      2. *-commutative99.7%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{2}{y - t} \]
      5. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{2}{y - t}}{\frac{z}{x}}} \]
      6. *-un-lft-identity99.7%

        \[\leadsto \frac{\color{blue}{\frac{2}{y - t}}}{\frac{z}{x}} \]
    5. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    6. Taylor expanded in y around inf 58.7%

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

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y}} \]
    8. Simplified76.1%

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

    if -6e-15 < t < -3.10000000000000016e-80 or 1.05e-86 < t < 9.20000000000000007e-38

    1. Initial program 96.4%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative96.4%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--96.3%

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

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

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

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

    if -3.10000000000000016e-80 < t < 1.05e-86

    1. Initial program 92.5%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative92.5%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--92.5%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified92.1%

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

        \[\leadsto \color{blue}{\frac{2 \cdot \frac{x}{z}}{y - t}} \]
      2. *-commutative92.1%

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{2}{y - t}} \]
      4. clear-num92.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{2}{y - t} \]
      5. associate-*l/92.0%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{2}{y - t}}{\frac{z}{x}}} \]
      6. *-un-lft-identity92.0%

        \[\leadsto \frac{\color{blue}{\frac{2}{y - t}}}{\frac{z}{x}} \]
    5. Applied egg-rr92.0%

      \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    6. Taylor expanded in y around inf 85.5%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{2 \cdot x}{z \cdot y}} \]
      3. frac-times86.2%

        \[\leadsto \color{blue}{\frac{2}{z} \cdot \frac{x}{y}} \]
      4. clear-num86.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{2}}} \cdot \frac{x}{y} \]
      5. associate-*l/87.2%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y}}{\frac{z}{2}}} \]
      6. *-un-lft-identity87.2%

        \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{\frac{z}{2}} \]
      7. div-inv87.2%

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

        \[\leadsto \frac{\frac{x}{y}}{z \cdot \color{blue}{0.5}} \]
    10. Applied egg-rr87.2%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{z \cdot 0.5}} \]

    if 9.6000000000000007e50 < t

    1. Initial program 84.8%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative84.8%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--88.4%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified91.5%

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

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

        \[\leadsto -2 \cdot \color{blue}{\frac{\frac{x}{t}}{z}} \]
      2. clear-num79.4%

        \[\leadsto -2 \cdot \color{blue}{\frac{1}{\frac{z}{\frac{x}{t}}}} \]
      3. un-div-inv79.4%

        \[\leadsto \color{blue}{\frac{-2}{\frac{z}{\frac{x}{t}}}} \]
      4. div-inv79.3%

        \[\leadsto \frac{-2}{\color{blue}{z \cdot \frac{1}{\frac{x}{t}}}} \]
      5. clear-num79.4%

        \[\leadsto \frac{-2}{z \cdot \color{blue}{\frac{t}{x}}} \]
    6. Applied egg-rr79.4%

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

        \[\leadsto \color{blue}{\frac{\frac{-2}{z}}{\frac{t}{x}}} \]
      2. associate-/r/81.6%

        \[\leadsto \color{blue}{\frac{\frac{-2}{z}}{t} \cdot x} \]
    8. Applied egg-rr81.6%

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

        \[\leadsto \color{blue}{\frac{-2}{t \cdot z}} \cdot x \]
      2. associate-*l/81.8%

        \[\leadsto \color{blue}{\frac{-2 \cdot x}{t \cdot z}} \]
      3. times-frac83.1%

        \[\leadsto \color{blue}{\frac{-2}{t} \cdot \frac{x}{z}} \]
      4. associate-*l/83.3%

        \[\leadsto \color{blue}{\frac{-2 \cdot \frac{x}{z}}{t}} \]
      5. metadata-eval83.3%

        \[\leadsto \frac{\color{blue}{\left(-2\right)} \cdot \frac{x}{z}}{t} \]
      6. distribute-lft-neg-in83.3%

        \[\leadsto \frac{\color{blue}{-2 \cdot \frac{x}{z}}}{t} \]
      7. clear-num83.2%

        \[\leadsto \frac{-2 \cdot \color{blue}{\frac{1}{\frac{z}{x}}}}{t} \]
      8. div-inv83.2%

        \[\leadsto \frac{-\color{blue}{\frac{2}{\frac{z}{x}}}}{t} \]
      9. distribute-neg-frac83.2%

        \[\leadsto \frac{\color{blue}{\frac{-2}{\frac{z}{x}}}}{t} \]
      10. metadata-eval83.2%

        \[\leadsto \frac{\frac{\color{blue}{-2}}{\frac{z}{x}}}{t} \]
    10. Applied egg-rr83.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.65 \cdot 10^{+44}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{z}}{t}\\ \mathbf{elif}\;t \leq -6 \cdot 10^{-15}:\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\ \mathbf{elif}\;t \leq -3.1 \cdot 10^{-80}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{-86}:\\ \;\;\;\;\frac{\frac{x}{y}}{z \cdot 0.5}\\ \mathbf{elif}\;t \leq 9.2 \cdot 10^{-38}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{elif}\;t \leq 9.6 \cdot 10^{+50}:\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-2}{\frac{z}{x}}}{t}\\ \end{array} \]

Alternative 8: 73.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{+44} \lor \neg \left(t \leq 1.05 \cdot 10^{-86}\right) \land \left(t \leq 8.4 \cdot 10^{-38} \lor \neg \left(t \leq 1.3 \cdot 10^{+52}\right)\right):\\
\;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.65000000000000007e44 or 1.05e-86 < t < 8.40000000000000052e-38 or 1.3e52 < t

    1. Initial program 86.5%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative86.5%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--89.8%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified91.3%

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

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

    if -1.65000000000000007e44 < t < 1.05e-86 or 8.40000000000000052e-38 < t < 1.3e52

    1. Initial program 93.2%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative93.2%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--93.2%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified93.6%

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

        \[\leadsto \color{blue}{\frac{2 \cdot \frac{x}{z}}{y - t}} \]
      2. *-commutative93.6%

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{2}{y - t}} \]
      4. clear-num93.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{2}{y - t} \]
      5. associate-*l/93.6%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{2}{y - t}}{\frac{z}{x}}} \]
      6. *-un-lft-identity93.6%

        \[\leadsto \frac{\color{blue}{\frac{2}{y - t}}}{\frac{z}{x}} \]
    5. Applied egg-rr93.6%

      \[\leadsto \color{blue}{\frac{\frac{2}{y - t}}{\frac{z}{x}}} \]
    6. Taylor expanded in y around inf 75.9%

      \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z}} \]
    7. Step-by-step derivation
      1. *-commutative75.9%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y}} \]
    8. Simplified78.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.65 \cdot 10^{+44} \lor \neg \left(t \leq 1.05 \cdot 10^{-86}\right) \land \left(t \leq 8.4 \cdot 10^{-38} \lor \neg \left(t \leq 1.3 \cdot 10^{+52}\right)\right):\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\ \end{array} \]

Alternative 9: 96.6% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.8e81 or 2.2000000000000001e29 < z

    1. Initial program 80.0%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative80.0%

        \[\leadsto \frac{\color{blue}{2 \cdot x}}{y \cdot z - t \cdot z} \]
      2. distribute-rgt-out--83.5%

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

        \[\leadsto \color{blue}{\frac{2}{z} \cdot \frac{x}{y - t}} \]
    3. Simplified98.1%

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

    if -3.8e81 < z < 2.2000000000000001e29

    1. Initial program 98.0%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative98.0%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--98.0%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified91.8%

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{\frac{z}{\frac{2}{y - t}}}} \]
      4. associate-/l*87.6%

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

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

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

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

Alternative 10: 96.9% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.99999999999999998e53 or 8.7999999999999999e30 < z

    1. Initial program 80.6%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative80.6%

        \[\leadsto \frac{\color{blue}{2 \cdot x}}{y \cdot z - t \cdot z} \]
      2. distribute-rgt-out--84.1%

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

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

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

    if -2.99999999999999998e53 < z < 8.7999999999999999e30

    1. Initial program 98.0%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. distribute-rgt-out--98.0%

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

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

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

Alternative 11: 92.5% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.64999999999999984e-216

    1. Initial program 93.5%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative93.5%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--95.4%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified88.9%

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{\frac{z}{\frac{2}{y - t}}}} \]
      4. associate-/l*95.8%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{2}{y - t}}{z}} \]
    6. Simplified95.7%

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

    if -1.64999999999999984e-216 < y

    1. Initial program 87.3%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. *-commutative87.3%

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

        \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
      3. distribute-rgt-out--88.7%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
    3. Simplified95.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.65 \cdot 10^{-216}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y - t}}{z}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\ \end{array} \]

Alternative 12: 91.7% accurate, 1.2× speedup?

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

\\
2 \cdot \frac{\frac{x}{z}}{y - t}
\end{array}
Derivation
  1. Initial program 90.0%

    \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
  2. Step-by-step derivation
    1. *-commutative90.0%

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

      \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
    3. distribute-rgt-out--91.6%

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

      \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
  3. Simplified92.5%

    \[\leadsto \color{blue}{2 \cdot \frac{\frac{x}{z}}{y - t}} \]
  4. Final simplification92.5%

    \[\leadsto 2 \cdot \frac{\frac{x}{z}}{y - t} \]

Alternative 13: 53.9% accurate, 1.6× speedup?

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

\\
-2 \cdot \frac{x}{z \cdot t}
\end{array}
Derivation
  1. Initial program 90.0%

    \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
  2. Step-by-step derivation
    1. *-commutative90.0%

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

      \[\leadsto \color{blue}{2 \cdot \frac{x}{y \cdot z - t \cdot z}} \]
    3. distribute-rgt-out--91.6%

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

      \[\leadsto 2 \cdot \color{blue}{\frac{\frac{x}{z}}{y - t}} \]
  3. Simplified92.5%

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

    \[\leadsto \color{blue}{-2 \cdot \frac{x}{t \cdot z}} \]
  5. Final simplification54.1%

    \[\leadsto -2 \cdot \frac{x}{z \cdot t} \]

Developer target: 97.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{\left(y - t\right) \cdot z} \cdot 2\\ t_2 := \frac{x \cdot 2}{y \cdot z - t \cdot z}\\ \mathbf{if}\;t_2 < -2.559141628295061 \cdot 10^{-13}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 < 1.045027827330126 \cdot 10^{-269}:\\ \;\;\;\;\frac{\frac{x}{z} \cdot 2}{y - t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (/ x (* (- y t) z)) 2.0))
        (t_2 (/ (* x 2.0) (- (* y z) (* t z)))))
   (if (< t_2 -2.559141628295061e-13)
     t_1
     (if (< t_2 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = (x / ((y - t) * z)) * 2.0;
	double t_2 = (x * 2.0) / ((y * z) - (t * z));
	double tmp;
	if (t_2 < -2.559141628295061e-13) {
		tmp = t_1;
	} else if (t_2 < 1.045027827330126e-269) {
		tmp = ((x / z) * 2.0) / (y - t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (x / ((y - t) * z)) * 2.0d0
    t_2 = (x * 2.0d0) / ((y * z) - (t * z))
    if (t_2 < (-2.559141628295061d-13)) then
        tmp = t_1
    else if (t_2 < 1.045027827330126d-269) then
        tmp = ((x / z) * 2.0d0) / (y - t)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / ((y - t) * z)) * 2.0;
	double t_2 = (x * 2.0) / ((y * z) - (t * z));
	double tmp;
	if (t_2 < -2.559141628295061e-13) {
		tmp = t_1;
	} else if (t_2 < 1.045027827330126e-269) {
		tmp = ((x / z) * 2.0) / (y - t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x / ((y - t) * z)) * 2.0
	t_2 = (x * 2.0) / ((y * z) - (t * z))
	tmp = 0
	if t_2 < -2.559141628295061e-13:
		tmp = t_1
	elif t_2 < 1.045027827330126e-269:
		tmp = ((x / z) * 2.0) / (y - t)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x / Float64(Float64(y - t) * z)) * 2.0)
	t_2 = Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z)))
	tmp = 0.0
	if (t_2 < -2.559141628295061e-13)
		tmp = t_1;
	elseif (t_2 < 1.045027827330126e-269)
		tmp = Float64(Float64(Float64(x / z) * 2.0) / Float64(y - t));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x / ((y - t) * z)) * 2.0;
	t_2 = (x * 2.0) / ((y * z) - (t * z));
	tmp = 0.0;
	if (t_2 < -2.559141628295061e-13)
		tmp = t_1;
	elseif (t_2 < 1.045027827330126e-269)
		tmp = ((x / z) * 2.0) / (y - t);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -2.559141628295061e-13], t$95$1, If[Less[t$95$2, 1.045027827330126e-269], N[(N[(N[(x / z), $MachinePrecision] * 2.0), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - t\right) \cdot z} \cdot 2\\
t_2 := \frac{x \cdot 2}{y \cdot z - t \cdot z}\\
\mathbf{if}\;t_2 < -2.559141628295061 \cdot 10^{-13}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_2 < 1.045027827330126 \cdot 10^{-269}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot 2}{y - t}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023290 
(FPCore (x y z t)
  :name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
  :precision binary64

  :herbie-target
  (if (< (/ (* x 2.0) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2.0) (if (< (/ (* x 2.0) (- (* y z) (* t z))) 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) (* (/ x (* (- y t) z)) 2.0)))

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