Linear.Projection:infinitePerspective from linear-1.19.1.3, A

Percentage Accurate: 89.5% → 96.3%
Time: 12.6s
Alternatives: 12
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 12 alternatives:

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

Initial Program: 89.5% 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: 96.3% accurate, 0.7× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \cdot 2 \leq 5 \cdot 10^{-86}:\\ \;\;\;\;\frac{x\_m \cdot 2}{z \cdot \left(y - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{y - t} \cdot \frac{2}{z}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= (* x_m 2.0) 5e-86)
    (/ (* x_m 2.0) (* z (- y t)))
    (* (/ x_m (- y t)) (/ 2.0 z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((x_m * 2.0) <= 5e-86) {
		tmp = (x_m * 2.0) / (z * (y - t));
	} else {
		tmp = (x_m / (y - t)) * (2.0 / z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((x_m * 2.0d0) <= 5d-86) then
        tmp = (x_m * 2.0d0) / (z * (y - t))
    else
        tmp = (x_m / (y - t)) * (2.0d0 / z)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((x_m * 2.0) <= 5e-86) {
		tmp = (x_m * 2.0) / (z * (y - t));
	} else {
		tmp = (x_m / (y - t)) * (2.0 / z);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (x_m * 2.0) <= 5e-86:
		tmp = (x_m * 2.0) / (z * (y - t))
	else:
		tmp = (x_m / (y - t)) * (2.0 / z)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (Float64(x_m * 2.0) <= 5e-86)
		tmp = Float64(Float64(x_m * 2.0) / Float64(z * Float64(y - t)));
	else
		tmp = Float64(Float64(x_m / Float64(y - t)) * Float64(2.0 / z));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((x_m * 2.0) <= 5e-86)
		tmp = (x_m * 2.0) / (z * (y - t));
	else
		tmp = (x_m / (y - t)) * (2.0 / z);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[N[(x$95$m * 2.0), $MachinePrecision], 5e-86], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(2.0 / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \cdot 2 \leq 5 \cdot 10^{-86}:\\
\;\;\;\;\frac{x\_m \cdot 2}{z \cdot \left(y - t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x #s(literal 2 binary64)) < 4.9999999999999999e-86

    1. Initial program 91.9%

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

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

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

    if 4.9999999999999999e-86 < (*.f64 x #s(literal 2 binary64))

    1. Initial program 86.3%

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

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

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

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

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

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

Alternative 2: 73.9% accurate, 0.4× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_1 := \frac{-2}{z} \cdot \frac{x\_m}{t}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -1.08 \cdot 10^{+20}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-185}:\\ \;\;\;\;2 \cdot \frac{\frac{x\_m}{z}}{y}\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-168}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 13500000:\\ \;\;\;\;\frac{x\_m \cdot 2}{z \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{z \cdot \frac{t}{x\_m}}\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (* (/ -2.0 z) (/ x_m t))))
   (*
    x_s
    (if (<= t -1.08e+20)
      t_1
      (if (<= t 4e-185)
        (* 2.0 (/ (/ x_m z) y))
        (if (<= t 8.5e-168)
          t_1
          (if (<= t 13500000.0)
            (/ (* x_m 2.0) (* z y))
            (/ -2.0 (* z (/ t x_m))))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = (-2.0 / z) * (x_m / t);
	double tmp;
	if (t <= -1.08e+20) {
		tmp = t_1;
	} else if (t <= 4e-185) {
		tmp = 2.0 * ((x_m / z) / y);
	} else if (t <= 8.5e-168) {
		tmp = t_1;
	} else if (t <= 13500000.0) {
		tmp = (x_m * 2.0) / (z * y);
	} else {
		tmp = -2.0 / (z * (t / x_m));
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = ((-2.0d0) / z) * (x_m / t)
    if (t <= (-1.08d+20)) then
        tmp = t_1
    else if (t <= 4d-185) then
        tmp = 2.0d0 * ((x_m / z) / y)
    else if (t <= 8.5d-168) then
        tmp = t_1
    else if (t <= 13500000.0d0) then
        tmp = (x_m * 2.0d0) / (z * y)
    else
        tmp = (-2.0d0) / (z * (t / x_m))
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = (-2.0 / z) * (x_m / t);
	double tmp;
	if (t <= -1.08e+20) {
		tmp = t_1;
	} else if (t <= 4e-185) {
		tmp = 2.0 * ((x_m / z) / y);
	} else if (t <= 8.5e-168) {
		tmp = t_1;
	} else if (t <= 13500000.0) {
		tmp = (x_m * 2.0) / (z * y);
	} else {
		tmp = -2.0 / (z * (t / x_m));
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	t_1 = (-2.0 / z) * (x_m / t)
	tmp = 0
	if t <= -1.08e+20:
		tmp = t_1
	elif t <= 4e-185:
		tmp = 2.0 * ((x_m / z) / y)
	elif t <= 8.5e-168:
		tmp = t_1
	elif t <= 13500000.0:
		tmp = (x_m * 2.0) / (z * y)
	else:
		tmp = -2.0 / (z * (t / x_m))
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	t_1 = Float64(Float64(-2.0 / z) * Float64(x_m / t))
	tmp = 0.0
	if (t <= -1.08e+20)
		tmp = t_1;
	elseif (t <= 4e-185)
		tmp = Float64(2.0 * Float64(Float64(x_m / z) / y));
	elseif (t <= 8.5e-168)
		tmp = t_1;
	elseif (t <= 13500000.0)
		tmp = Float64(Float64(x_m * 2.0) / Float64(z * y));
	else
		tmp = Float64(-2.0 / Float64(z * Float64(t / x_m)));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = (-2.0 / z) * (x_m / t);
	tmp = 0.0;
	if (t <= -1.08e+20)
		tmp = t_1;
	elseif (t <= 4e-185)
		tmp = 2.0 * ((x_m / z) / y);
	elseif (t <= 8.5e-168)
		tmp = t_1;
	elseif (t <= 13500000.0)
		tmp = (x_m * 2.0) / (z * y);
	else
		tmp = -2.0 / (z * (t / x_m));
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(-2.0 / z), $MachinePrecision] * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -1.08e+20], t$95$1, If[LessEqual[t, 4e-185], N[(2.0 * N[(N[(x$95$m / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e-168], t$95$1, If[LessEqual[t, 13500000.0], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision], N[(-2.0 / N[(z * N[(t / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
\begin{array}{l}
t_1 := \frac{-2}{z} \cdot \frac{x\_m}{t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.08 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 4 \cdot 10^{-185}:\\
\;\;\;\;2 \cdot \frac{\frac{x\_m}{z}}{y}\\

\mathbf{elif}\;t \leq 8.5 \cdot 10^{-168}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 13500000:\\
\;\;\;\;\frac{x\_m \cdot 2}{z \cdot y}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.08e20 or 4e-185 < t < 8.4999999999999994e-168

    1. Initial program 89.9%

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

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot 2}{\color{blue}{z \cdot \left(-t\right)}} \]
    8. Step-by-step derivation
      1. distribute-rgt-neg-out79.9%

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

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

        \[\leadsto \color{blue}{\frac{-x \cdot 2}{z \cdot t}} \]
      4. *-commutative79.9%

        \[\leadsto \frac{-\color{blue}{2 \cdot x}}{z \cdot t} \]
      5. distribute-lft-neg-in79.9%

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

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

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

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

    if -1.08e20 < t < 4e-185

    1. Initial program 93.0%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot 2}{z \cdot \left(y - t\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 76.9%

      \[\leadsto \color{blue}{\frac{2 \cdot \frac{x}{z} + 2 \cdot \frac{t \cdot x}{y \cdot z}}{y}} \]
    6. Step-by-step derivation
      1. distribute-lft-out76.9%

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

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

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

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

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

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

    if 8.4999999999999994e-168 < t < 1.35e7

    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)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 87.1%

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

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

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

    if 1.35e7 < t

    1. Initial program 83.8%

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

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot 2}{\color{blue}{z \cdot \left(-t\right)}} \]
    8. Step-by-step derivation
      1. distribute-rgt-neg-out74.8%

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

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

        \[\leadsto \color{blue}{\frac{-x \cdot 2}{z \cdot t}} \]
      4. *-commutative74.8%

        \[\leadsto \frac{-\color{blue}{2 \cdot x}}{z \cdot t} \]
      5. distribute-lft-neg-in74.8%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 74.2% accurate, 0.4× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_1 := 2 \cdot \frac{\frac{x\_m}{z}}{y}\\ t_2 := \frac{-2}{z} \cdot \frac{x\_m}{t}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -2.4 \cdot 10^{+18}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-185}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-168}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 80000000:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{z \cdot \frac{t}{x\_m}}\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (* 2.0 (/ (/ x_m z) y))) (t_2 (* (/ -2.0 z) (/ x_m t))))
   (*
    x_s
    (if (<= t -2.4e+18)
      t_2
      (if (<= t 4e-185)
        t_1
        (if (<= t 8.5e-168)
          t_2
          (if (<= t 80000000.0) t_1 (/ -2.0 (* z (/ t x_m))))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = 2.0 * ((x_m / z) / y);
	double t_2 = (-2.0 / z) * (x_m / t);
	double tmp;
	if (t <= -2.4e+18) {
		tmp = t_2;
	} else if (t <= 4e-185) {
		tmp = t_1;
	} else if (t <= 8.5e-168) {
		tmp = t_2;
	} else if (t <= 80000000.0) {
		tmp = t_1;
	} else {
		tmp = -2.0 / (z * (t / x_m));
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    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_m / z) / y)
    t_2 = ((-2.0d0) / z) * (x_m / t)
    if (t <= (-2.4d+18)) then
        tmp = t_2
    else if (t <= 4d-185) then
        tmp = t_1
    else if (t <= 8.5d-168) then
        tmp = t_2
    else if (t <= 80000000.0d0) then
        tmp = t_1
    else
        tmp = (-2.0d0) / (z * (t / x_m))
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = 2.0 * ((x_m / z) / y);
	double t_2 = (-2.0 / z) * (x_m / t);
	double tmp;
	if (t <= -2.4e+18) {
		tmp = t_2;
	} else if (t <= 4e-185) {
		tmp = t_1;
	} else if (t <= 8.5e-168) {
		tmp = t_2;
	} else if (t <= 80000000.0) {
		tmp = t_1;
	} else {
		tmp = -2.0 / (z * (t / x_m));
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	t_1 = 2.0 * ((x_m / z) / y)
	t_2 = (-2.0 / z) * (x_m / t)
	tmp = 0
	if t <= -2.4e+18:
		tmp = t_2
	elif t <= 4e-185:
		tmp = t_1
	elif t <= 8.5e-168:
		tmp = t_2
	elif t <= 80000000.0:
		tmp = t_1
	else:
		tmp = -2.0 / (z * (t / x_m))
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	t_1 = Float64(2.0 * Float64(Float64(x_m / z) / y))
	t_2 = Float64(Float64(-2.0 / z) * Float64(x_m / t))
	tmp = 0.0
	if (t <= -2.4e+18)
		tmp = t_2;
	elseif (t <= 4e-185)
		tmp = t_1;
	elseif (t <= 8.5e-168)
		tmp = t_2;
	elseif (t <= 80000000.0)
		tmp = t_1;
	else
		tmp = Float64(-2.0 / Float64(z * Float64(t / x_m)));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = 2.0 * ((x_m / z) / y);
	t_2 = (-2.0 / z) * (x_m / t);
	tmp = 0.0;
	if (t <= -2.4e+18)
		tmp = t_2;
	elseif (t <= 4e-185)
		tmp = t_1;
	elseif (t <= 8.5e-168)
		tmp = t_2;
	elseif (t <= 80000000.0)
		tmp = t_1;
	else
		tmp = -2.0 / (z * (t / x_m));
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(N[(x$95$m / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(-2.0 / z), $MachinePrecision] * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -2.4e+18], t$95$2, If[LessEqual[t, 4e-185], t$95$1, If[LessEqual[t, 8.5e-168], t$95$2, If[LessEqual[t, 80000000.0], t$95$1, N[(-2.0 / N[(z * N[(t / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
\begin{array}{l}
t_1 := 2 \cdot \frac{\frac{x\_m}{z}}{y}\\
t_2 := \frac{-2}{z} \cdot \frac{x\_m}{t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+18}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq 4 \cdot 10^{-185}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 8.5 \cdot 10^{-168}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq 80000000:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.4e18 or 4e-185 < t < 8.4999999999999994e-168

    1. Initial program 89.9%

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

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot 2}{\color{blue}{z \cdot \left(-t\right)}} \]
    8. Step-by-step derivation
      1. distribute-rgt-neg-out79.9%

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

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

        \[\leadsto \color{blue}{\frac{-x \cdot 2}{z \cdot t}} \]
      4. *-commutative79.9%

        \[\leadsto \frac{-\color{blue}{2 \cdot x}}{z \cdot t} \]
      5. distribute-lft-neg-in79.9%

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

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

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

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

    if -2.4e18 < t < 4e-185 or 8.4999999999999994e-168 < t < 8e7

    1. Initial program 94.3%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot 2}{z \cdot \left(y - t\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 74.5%

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

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

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

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

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

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

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

    if 8e7 < t

    1. Initial program 83.8%

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

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot 2}{\color{blue}{z \cdot \left(-t\right)}} \]
    8. Step-by-step derivation
      1. distribute-rgt-neg-out74.8%

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

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

        \[\leadsto \color{blue}{\frac{-x \cdot 2}{z \cdot t}} \]
      4. *-commutative74.8%

        \[\leadsto \frac{-\color{blue}{2 \cdot x}}{z \cdot t} \]
      5. distribute-lft-neg-in74.8%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 72.7% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -3.6 \cdot 10^{+27} \lor \neg \left(y \leq 3.6 \cdot 10^{+29}\right):\\ \;\;\;\;2 \cdot \frac{\frac{x\_m}{z}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{z} \cdot \frac{x\_m}{t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= y -3.6e+27) (not (<= y 3.6e+29)))
    (* 2.0 (/ (/ x_m z) y))
    (* (/ -2.0 z) (/ x_m t)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((y <= -3.6e+27) || !(y <= 3.6e+29)) {
		tmp = 2.0 * ((x_m / z) / y);
	} else {
		tmp = (-2.0 / z) * (x_m / t);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((y <= (-3.6d+27)) .or. (.not. (y <= 3.6d+29))) then
        tmp = 2.0d0 * ((x_m / z) / y)
    else
        tmp = ((-2.0d0) / z) * (x_m / t)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((y <= -3.6e+27) || !(y <= 3.6e+29)) {
		tmp = 2.0 * ((x_m / z) / y);
	} else {
		tmp = (-2.0 / z) * (x_m / t);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (y <= -3.6e+27) or not (y <= 3.6e+29):
		tmp = 2.0 * ((x_m / z) / y)
	else:
		tmp = (-2.0 / z) * (x_m / t)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((y <= -3.6e+27) || !(y <= 3.6e+29))
		tmp = Float64(2.0 * Float64(Float64(x_m / z) / y));
	else
		tmp = Float64(Float64(-2.0 / z) * Float64(x_m / t));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((y <= -3.6e+27) || ~((y <= 3.6e+29)))
		tmp = 2.0 * ((x_m / z) / y);
	else
		tmp = (-2.0 / z) * (x_m / t);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[y, -3.6e+27], N[Not[LessEqual[y, 3.6e+29]], $MachinePrecision]], N[(2.0 * N[(N[(x$95$m / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 / z), $MachinePrecision] * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{+27} \lor \neg \left(y \leq 3.6 \cdot 10^{+29}\right):\\
\;\;\;\;2 \cdot \frac{\frac{x\_m}{z}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.59999999999999983e27 or 3.59999999999999976e29 < y

    1. Initial program 87.4%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot 2}{z \cdot \left(y - t\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 74.9%

      \[\leadsto \color{blue}{\frac{2 \cdot \frac{x}{z} + 2 \cdot \frac{t \cdot x}{y \cdot z}}{y}} \]
    6. Step-by-step derivation
      1. distribute-lft-out74.9%

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

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

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

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

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

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

    if -3.59999999999999983e27 < y < 3.59999999999999976e29

    1. Initial program 92.6%

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot 2}{\color{blue}{z \cdot \left(-t\right)}} \]
    7. Simplified73.4%

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

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

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

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

        \[\leadsto \frac{-\color{blue}{2 \cdot x}}{z \cdot t} \]
      5. distribute-lft-neg-in73.4%

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

        \[\leadsto \frac{\color{blue}{-2} \cdot x}{z \cdot t} \]
      7. times-frac77.5%

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

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

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

Alternative 5: 72.7% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -9.2 \cdot 10^{+27}:\\ \;\;\;\;\frac{x\_m}{z} \cdot \frac{2}{y}\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+27}:\\ \;\;\;\;\frac{-2}{z} \cdot \frac{x\_m}{t}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\frac{x\_m}{z}}{y}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= y -9.2e+27)
    (* (/ x_m z) (/ 2.0 y))
    (if (<= y 2.2e+27) (* (/ -2.0 z) (/ x_m t)) (* 2.0 (/ (/ x_m z) y))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (y <= -9.2e+27) {
		tmp = (x_m / z) * (2.0 / y);
	} else if (y <= 2.2e+27) {
		tmp = (-2.0 / z) * (x_m / t);
	} else {
		tmp = 2.0 * ((x_m / z) / y);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-9.2d+27)) then
        tmp = (x_m / z) * (2.0d0 / y)
    else if (y <= 2.2d+27) then
        tmp = ((-2.0d0) / z) * (x_m / t)
    else
        tmp = 2.0d0 * ((x_m / z) / y)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (y <= -9.2e+27) {
		tmp = (x_m / z) * (2.0 / y);
	} else if (y <= 2.2e+27) {
		tmp = (-2.0 / z) * (x_m / t);
	} else {
		tmp = 2.0 * ((x_m / z) / y);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if y <= -9.2e+27:
		tmp = (x_m / z) * (2.0 / y)
	elif y <= 2.2e+27:
		tmp = (-2.0 / z) * (x_m / t)
	else:
		tmp = 2.0 * ((x_m / z) / y)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (y <= -9.2e+27)
		tmp = Float64(Float64(x_m / z) * Float64(2.0 / y));
	elseif (y <= 2.2e+27)
		tmp = Float64(Float64(-2.0 / z) * Float64(x_m / t));
	else
		tmp = Float64(2.0 * Float64(Float64(x_m / z) / y));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (y <= -9.2e+27)
		tmp = (x_m / z) * (2.0 / y);
	elseif (y <= 2.2e+27)
		tmp = (-2.0 / z) * (x_m / t);
	else
		tmp = 2.0 * ((x_m / z) / y);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -9.2e+27], N[(N[(x$95$m / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e+27], N[(N[(-2.0 / z), $MachinePrecision] * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x$95$m / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{+27}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{2}{y}\\

\mathbf{elif}\;y \leq 2.2 \cdot 10^{+27}:\\
\;\;\;\;\frac{-2}{z} \cdot \frac{x\_m}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -9.2000000000000002e27

    1. Initial program 91.7%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot 2}{z \cdot \left(y - t\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 81.1%

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

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

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

        \[\leadsto \frac{x \cdot 2}{\color{blue}{z \cdot y}} \]
      4. times-frac76.5%

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

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

    if -9.2000000000000002e27 < y < 2.1999999999999999e27

    1. Initial program 92.6%

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot 2}{\color{blue}{z \cdot \left(-t\right)}} \]
    7. Simplified73.4%

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

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

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

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

        \[\leadsto \frac{-\color{blue}{2 \cdot x}}{z \cdot t} \]
      5. distribute-lft-neg-in73.4%

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

        \[\leadsto \frac{\color{blue}{-2} \cdot x}{z \cdot t} \]
      7. times-frac77.5%

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

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

    if 2.1999999999999999e27 < y

    1. Initial program 83.2%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot 2}{z \cdot \left(y - t\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 75.2%

      \[\leadsto \color{blue}{\frac{2 \cdot \frac{x}{z} + 2 \cdot \frac{t \cdot x}{y \cdot z}}{y}} \]
    6. Step-by-step derivation
      1. distribute-lft-out75.2%

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

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

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

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

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

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

Alternative 6: 74.2% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -4.8 \cdot 10^{+18}:\\ \;\;\;\;x\_m \cdot \frac{-2}{z \cdot t}\\ \mathbf{elif}\;t \leq 24000000:\\ \;\;\;\;2 \cdot \frac{\frac{x\_m}{z}}{y}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{\frac{x\_m}{z}}{t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= t -4.8e+18)
    (* x_m (/ -2.0 (* z t)))
    (if (<= t 24000000.0) (* 2.0 (/ (/ x_m z) y)) (* -2.0 (/ (/ x_m z) t))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (t <= -4.8e+18) {
		tmp = x_m * (-2.0 / (z * t));
	} else if (t <= 24000000.0) {
		tmp = 2.0 * ((x_m / z) / y);
	} else {
		tmp = -2.0 * ((x_m / z) / t);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-4.8d+18)) then
        tmp = x_m * ((-2.0d0) / (z * t))
    else if (t <= 24000000.0d0) then
        tmp = 2.0d0 * ((x_m / z) / y)
    else
        tmp = (-2.0d0) * ((x_m / z) / t)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (t <= -4.8e+18) {
		tmp = x_m * (-2.0 / (z * t));
	} else if (t <= 24000000.0) {
		tmp = 2.0 * ((x_m / z) / y);
	} else {
		tmp = -2.0 * ((x_m / z) / t);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if t <= -4.8e+18:
		tmp = x_m * (-2.0 / (z * t))
	elif t <= 24000000.0:
		tmp = 2.0 * ((x_m / z) / y)
	else:
		tmp = -2.0 * ((x_m / z) / t)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (t <= -4.8e+18)
		tmp = Float64(x_m * Float64(-2.0 / Float64(z * t)));
	elseif (t <= 24000000.0)
		tmp = Float64(2.0 * Float64(Float64(x_m / z) / y));
	else
		tmp = Float64(-2.0 * Float64(Float64(x_m / z) / t));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (t <= -4.8e+18)
		tmp = x_m * (-2.0 / (z * t));
	elseif (t <= 24000000.0)
		tmp = 2.0 * ((x_m / z) / y);
	else
		tmp = -2.0 * ((x_m / z) / t);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -4.8e+18], N[(x$95$m * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 24000000.0], N[(2.0 * N[(N[(x$95$m / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x$95$m / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+18}:\\
\;\;\;\;x\_m \cdot \frac{-2}{z \cdot t}\\

\mathbf{elif}\;t \leq 24000000:\\
\;\;\;\;2 \cdot \frac{\frac{x\_m}{z}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.8e18

    1. Initial program 90.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.8e18 < t < 2.4e7

    1. Initial program 93.8%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot 2}{z \cdot \left(y - t\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 71.0%

      \[\leadsto \color{blue}{\frac{2 \cdot \frac{x}{z} + 2 \cdot \frac{t \cdot x}{y \cdot z}}{y}} \]
    6. Step-by-step derivation
      1. distribute-lft-out71.0%

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

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

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

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

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

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

    if 2.4e7 < t

    1. Initial program 83.8%

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{x}{t \cdot z}} \]
    6. Step-by-step derivation
      1. *-commutative74.8%

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

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

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

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

Alternative 7: 74.2% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -1.08 \cdot 10^{+20}:\\ \;\;\;\;-2 \cdot \frac{x\_m}{z \cdot t}\\ \mathbf{elif}\;t \leq 370000000:\\ \;\;\;\;2 \cdot \frac{\frac{x\_m}{z}}{y}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{\frac{x\_m}{z}}{t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= t -1.08e+20)
    (* -2.0 (/ x_m (* z t)))
    (if (<= t 370000000.0) (* 2.0 (/ (/ x_m z) y)) (* -2.0 (/ (/ x_m z) t))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (t <= -1.08e+20) {
		tmp = -2.0 * (x_m / (z * t));
	} else if (t <= 370000000.0) {
		tmp = 2.0 * ((x_m / z) / y);
	} else {
		tmp = -2.0 * ((x_m / z) / t);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-1.08d+20)) then
        tmp = (-2.0d0) * (x_m / (z * t))
    else if (t <= 370000000.0d0) then
        tmp = 2.0d0 * ((x_m / z) / y)
    else
        tmp = (-2.0d0) * ((x_m / z) / t)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (t <= -1.08e+20) {
		tmp = -2.0 * (x_m / (z * t));
	} else if (t <= 370000000.0) {
		tmp = 2.0 * ((x_m / z) / y);
	} else {
		tmp = -2.0 * ((x_m / z) / t);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if t <= -1.08e+20:
		tmp = -2.0 * (x_m / (z * t))
	elif t <= 370000000.0:
		tmp = 2.0 * ((x_m / z) / y)
	else:
		tmp = -2.0 * ((x_m / z) / t)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (t <= -1.08e+20)
		tmp = Float64(-2.0 * Float64(x_m / Float64(z * t)));
	elseif (t <= 370000000.0)
		tmp = Float64(2.0 * Float64(Float64(x_m / z) / y));
	else
		tmp = Float64(-2.0 * Float64(Float64(x_m / z) / t));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (t <= -1.08e+20)
		tmp = -2.0 * (x_m / (z * t));
	elseif (t <= 370000000.0)
		tmp = 2.0 * ((x_m / z) / y);
	else
		tmp = -2.0 * ((x_m / z) / t);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -1.08e+20], N[(-2.0 * N[(x$95$m / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 370000000.0], N[(2.0 * N[(N[(x$95$m / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x$95$m / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.08 \cdot 10^{+20}:\\
\;\;\;\;-2 \cdot \frac{x\_m}{z \cdot t}\\

\mathbf{elif}\;t \leq 370000000:\\
\;\;\;\;2 \cdot \frac{\frac{x\_m}{z}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.08e20

    1. Initial program 90.6%

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

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

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

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

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

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

    if -1.08e20 < t < 3.7e8

    1. Initial program 93.8%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot 2}{z \cdot \left(y - t\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 71.0%

      \[\leadsto \color{blue}{\frac{2 \cdot \frac{x}{z} + 2 \cdot \frac{t \cdot x}{y \cdot z}}{y}} \]
    6. Step-by-step derivation
      1. distribute-lft-out71.0%

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

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

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

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

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

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

    if 3.7e8 < t

    1. Initial program 83.8%

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{x}{t \cdot z}} \]
    6. Step-by-step derivation
      1. *-commutative74.8%

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

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

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

Alternative 8: 96.3% accurate, 0.7× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \cdot 2 \leq 10^{-79}:\\ \;\;\;\;x\_m \cdot \frac{\frac{2}{z}}{y - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{y - t} \cdot \frac{2}{z}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= (* x_m 2.0) 1e-79)
    (* x_m (/ (/ 2.0 z) (- y t)))
    (* (/ x_m (- y t)) (/ 2.0 z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((x_m * 2.0) <= 1e-79) {
		tmp = x_m * ((2.0 / z) / (y - t));
	} else {
		tmp = (x_m / (y - t)) * (2.0 / z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((x_m * 2.0d0) <= 1d-79) then
        tmp = x_m * ((2.0d0 / z) / (y - t))
    else
        tmp = (x_m / (y - t)) * (2.0d0 / z)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((x_m * 2.0) <= 1e-79) {
		tmp = x_m * ((2.0 / z) / (y - t));
	} else {
		tmp = (x_m / (y - t)) * (2.0 / z);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (x_m * 2.0) <= 1e-79:
		tmp = x_m * ((2.0 / z) / (y - t))
	else:
		tmp = (x_m / (y - t)) * (2.0 / z)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (Float64(x_m * 2.0) <= 1e-79)
		tmp = Float64(x_m * Float64(Float64(2.0 / z) / Float64(y - t)));
	else
		tmp = Float64(Float64(x_m / Float64(y - t)) * Float64(2.0 / z));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((x_m * 2.0) <= 1e-79)
		tmp = x_m * ((2.0 / z) / (y - t));
	else
		tmp = (x_m / (y - t)) * (2.0 / z);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[N[(x$95$m * 2.0), $MachinePrecision], 1e-79], N[(x$95$m * N[(N[(2.0 / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(2.0 / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x #s(literal 2 binary64)) < 1e-79

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\color{blue}{\left(-y\right) + \left(-\left(-t\right)\right)}} \]
      10. add-sqr-sqrt40.0%

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

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

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

        \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \left(-\color{blue}{\sqrt{t} \cdot \sqrt{t}}\right)} \]
      14. add-sqr-sqrt61.8%

        \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \left(-\color{blue}{t}\right)} \]
      15. add-sqr-sqrt27.0%

        \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \color{blue}{\sqrt{-t} \cdot \sqrt{-t}}} \]
      16. sqrt-unprod70.8%

        \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}} \]
      17. sqr-neg70.8%

        \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \sqrt{\color{blue}{t \cdot t}}} \]
      18. sqrt-unprod51.1%

        \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \color{blue}{\sqrt{t} \cdot \sqrt{t}}} \]
      19. add-sqr-sqrt91.3%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z \cdot 0.5}}{-\left(\left(-y\right) + t\right)}} \]
      3. distribute-neg-in91.3%

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{z \cdot 0.5}}{y - t}} \]
    11. Step-by-step derivation
      1. div-inv91.2%

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

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

        \[\leadsto x \cdot \frac{\frac{1}{\color{blue}{0.5 \cdot z}}}{y - t} \]
      4. associate-/r*92.8%

        \[\leadsto x \cdot \frac{\color{blue}{\frac{\frac{1}{0.5}}{z}}}{y - t} \]
      5. metadata-eval92.8%

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

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

    if 1e-79 < (*.f64 x #s(literal 2 binary64))

    1. Initial program 86.0%

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

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

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

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

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

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

Alternative 9: 94.2% accurate, 0.8× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq 7.5 \cdot 10^{-21}:\\ \;\;\;\;x\_m \cdot \frac{\frac{2}{z}}{y - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{z} \cdot \frac{2}{y - t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= z 7.5e-21)
    (* x_m (/ (/ 2.0 z) (- y t)))
    (* (/ x_m z) (/ 2.0 (- y t))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= 7.5e-21) {
		tmp = x_m * ((2.0 / z) / (y - t));
	} else {
		tmp = (x_m / z) * (2.0 / (y - t));
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= 7.5d-21) then
        tmp = x_m * ((2.0d0 / z) / (y - t))
    else
        tmp = (x_m / z) * (2.0d0 / (y - t))
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= 7.5e-21) {
		tmp = x_m * ((2.0 / z) / (y - t));
	} else {
		tmp = (x_m / z) * (2.0 / (y - t));
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if z <= 7.5e-21:
		tmp = x_m * ((2.0 / z) / (y - t))
	else:
		tmp = (x_m / z) * (2.0 / (y - t))
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (z <= 7.5e-21)
		tmp = Float64(x_m * Float64(Float64(2.0 / z) / Float64(y - t)));
	else
		tmp = Float64(Float64(x_m / z) * Float64(2.0 / Float64(y - t)));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (z <= 7.5e-21)
		tmp = x_m * ((2.0 / z) / (y - t));
	else
		tmp = (x_m / z) * (2.0 / (y - t));
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, 7.5e-21], N[(x$95$m * N[(N[(2.0 / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / z), $MachinePrecision] * N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 7.5 \cdot 10^{-21}:\\
\;\;\;\;x\_m \cdot \frac{\frac{2}{z}}{y - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 7.50000000000000072e-21

    1. Initial program 90.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\color{blue}{\left(-y\right) + \left(-\left(-t\right)\right)}} \]
      10. add-sqr-sqrt41.1%

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

        \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \left(-\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}\right)} \]
      12. sqr-neg66.7%

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

        \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \left(-\color{blue}{\sqrt{t} \cdot \sqrt{t}}\right)} \]
      14. add-sqr-sqrt58.1%

        \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \left(-\color{blue}{t}\right)} \]
      15. add-sqr-sqrt27.6%

        \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \color{blue}{\sqrt{-t} \cdot \sqrt{-t}}} \]
      16. sqrt-unprod67.7%

        \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}} \]
      17. sqr-neg67.7%

        \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \sqrt{\color{blue}{t \cdot t}}} \]
      18. sqrt-unprod48.9%

        \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \color{blue}{\sqrt{t} \cdot \sqrt{t}}} \]
      19. add-sqr-sqrt90.1%

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

      \[\leadsto \color{blue}{\frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + t}} \]
    9. Step-by-step derivation
      1. distribute-frac-neg90.1%

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

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

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

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

        \[\leadsto \frac{\frac{x}{z \cdot 0.5}}{\color{blue}{y - t}} \]
    10. Simplified90.1%

      \[\leadsto \color{blue}{\frac{\frac{x}{z \cdot 0.5}}{y - t}} \]
    11. Step-by-step derivation
      1. div-inv89.9%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z \cdot 0.5}}{y - t}} \]
      3. *-commutative91.3%

        \[\leadsto x \cdot \frac{\frac{1}{\color{blue}{0.5 \cdot z}}}{y - t} \]
      4. associate-/r*91.3%

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

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

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

    if 7.50000000000000072e-21 < z

    1. Initial program 90.1%

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

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

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

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

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

Alternative 10: 54.6% accurate, 0.9× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq 2000000000:\\ \;\;\;\;-2 \cdot \frac{x\_m}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{\frac{x\_m}{z}}{t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= z 2000000000.0) (* -2.0 (/ x_m (* z t))) (* -2.0 (/ (/ x_m z) t)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= 2000000000.0) {
		tmp = -2.0 * (x_m / (z * t));
	} else {
		tmp = -2.0 * ((x_m / z) / t);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= 2000000000.0d0) then
        tmp = (-2.0d0) * (x_m / (z * t))
    else
        tmp = (-2.0d0) * ((x_m / z) / t)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= 2000000000.0) {
		tmp = -2.0 * (x_m / (z * t));
	} else {
		tmp = -2.0 * ((x_m / z) / t);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if z <= 2000000000.0:
		tmp = -2.0 * (x_m / (z * t))
	else:
		tmp = -2.0 * ((x_m / z) / t)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (z <= 2000000000.0)
		tmp = Float64(-2.0 * Float64(x_m / Float64(z * t)));
	else
		tmp = Float64(-2.0 * Float64(Float64(x_m / z) / t));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (z <= 2000000000.0)
		tmp = -2.0 * (x_m / (z * t));
	else
		tmp = -2.0 * ((x_m / z) / t);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, 2000000000.0], N[(-2.0 * N[(x$95$m / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x$95$m / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 2000000000:\\
\;\;\;\;-2 \cdot \frac{x\_m}{z \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 2e9

    1. Initial program 90.2%

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

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

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

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

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

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

    if 2e9 < z

    1. Initial program 89.2%

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{x}{t \cdot z}} \]
    6. Step-by-step derivation
      1. *-commutative41.2%

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

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

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

Alternative 11: 91.5% accurate, 1.2× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \left(x\_m \cdot \frac{\frac{2}{z}}{y - t}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (* x_s (* x_m (/ (/ 2.0 z) (- y t)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * (x_m * ((2.0 / z) / (y - t)));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x_s * (x_m * ((2.0d0 / z) / (y - t)))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * (x_m * ((2.0 / z) / (y - t)));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	return x_s * (x_m * ((2.0 / z) / (y - t)))
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	return Float64(x_s * Float64(x_m * Float64(Float64(2.0 / z) / Float64(y - t))))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp = code(x_s, x_m, y, z, t)
	tmp = x_s * (x_m * ((2.0 / z) / (y - t)));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(x$95$m * N[(N[(2.0 / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-\frac{x}{z \cdot \color{blue}{0.5}}}{-\left(y - t\right)} \]
    8. sub-neg91.9%

      \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{-\color{blue}{\left(y + \left(-t\right)\right)}} \]
    9. distribute-neg-in91.9%

      \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\color{blue}{\left(-y\right) + \left(-\left(-t\right)\right)}} \]
    10. add-sqr-sqrt40.3%

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

      \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \left(-\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}\right)} \]
    12. sqr-neg68.9%

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

      \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \left(-\color{blue}{\sqrt{t} \cdot \sqrt{t}}\right)} \]
    14. add-sqr-sqrt61.7%

      \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \left(-\color{blue}{t}\right)} \]
    15. add-sqr-sqrt28.4%

      \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \color{blue}{\sqrt{-t} \cdot \sqrt{-t}}} \]
    16. sqrt-unprod71.1%

      \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}} \]
    17. sqr-neg71.1%

      \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \sqrt{\color{blue}{t \cdot t}}} \]
    18. sqrt-unprod51.4%

      \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \color{blue}{\sqrt{t} \cdot \sqrt{t}}} \]
    19. add-sqr-sqrt91.9%

      \[\leadsto \frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + \color{blue}{t}} \]
  8. Applied egg-rr91.9%

    \[\leadsto \color{blue}{\frac{-\frac{x}{z \cdot 0.5}}{\left(-y\right) + t}} \]
  9. Step-by-step derivation
    1. distribute-frac-neg91.9%

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{x}{z \cdot 0.5}}{y - t}} \]
  11. Step-by-step derivation
    1. div-inv91.8%

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

      \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z \cdot 0.5}}{y - t}} \]
    3. *-commutative91.0%

      \[\leadsto x \cdot \frac{\frac{1}{\color{blue}{0.5 \cdot z}}}{y - t} \]
    4. associate-/r*91.0%

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

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

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

Alternative 12: 52.0% accurate, 1.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \left(-2 \cdot \frac{x\_m}{z \cdot t}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t) :precision binary64 (* x_s (* -2.0 (/ x_m (* z t)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * (-2.0 * (x_m / (z * t)));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x_s * ((-2.0d0) * (x_m / (z * t)))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * (-2.0 * (x_m / (z * t)));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	return x_s * (-2.0 * (x_m / (z * t)))
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	return Float64(x_s * Float64(-2.0 * Float64(x_m / Float64(z * t))))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp = code(x_s, x_m, y, z, t)
	tmp = x_s * (-2.0 * (x_m / (z * t)));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(-2.0 * N[(x$95$m / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \left(-2 \cdot \frac{x\_m}{z \cdot t}\right)
\end{array}
Derivation
  1. Initial program 90.0%

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

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

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

    \[\leadsto \color{blue}{-2 \cdot \frac{x}{t \cdot z}} \]
  6. Step-by-step derivation
    1. *-commutative51.1%

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

    \[\leadsto \color{blue}{-2 \cdot \frac{x}{z \cdot t}} \]
  8. Add Preprocessing

Developer target: 97.1% 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 2024110 
(FPCore (x y z t)
  :name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
  :precision binary64

  :alt
  (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))))