Linear.Projection:infinitePerspective from linear-1.19.1.3, A

Percentage Accurate: 89.3% → 96.8%
Time: 13.2s
Alternatives: 17
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 17 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.3% 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.8% accurate, 0.0× speedup?

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

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

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


\end{array}\right)
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) < -4.999999999999985e-310

    1. Initial program 98.4%

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

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

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

    if -4.999999999999985e-310 < (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z)))

    1. Initial program 84.6%

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

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

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

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

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

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

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

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

Alternative 2: 71.5% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+99} \lor \neg \left(y \leq -7.2 \cdot 10^{+51} \lor \neg \left(y \leq -9.5 \cdot 10^{-33}\right) \land \left(y \leq 4.2 \cdot 10^{-55} \lor \neg \left(y \leq 3.3 \cdot 10^{-6}\right) \land y \leq 9.6 \cdot 10^{+69}\right)\right):\\ \;\;\;\;x\_m \cdot \frac{\frac{2}{z\_m}}{y}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{x\_m}{z\_m \cdot t}\\ \end{array}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 1 x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 1 z)
(FPCore (z_s x_s x_m y z_m t)
 :precision binary64
 (*
  z_s
  (*
   x_s
   (if (or (<= y -4.8e+99)
           (not
            (or (<= y -7.2e+51)
                (and (not (<= y -9.5e-33))
                     (or (<= y 4.2e-55)
                         (and (not (<= y 3.3e-6)) (<= y 9.6e+69)))))))
     (* x_m (/ (/ 2.0 z_m) y))
     (* -2.0 (/ x_m (* z_m t)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
	double tmp;
	if ((y <= -4.8e+99) || !((y <= -7.2e+51) || (!(y <= -9.5e-33) && ((y <= 4.2e-55) || (!(y <= 3.3e-6) && (y <= 9.6e+69)))))) {
		tmp = x_m * ((2.0 / z_m) / y);
	} else {
		tmp = -2.0 * (x_m / (z_m * t));
	}
	return z_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x_s, x_m, y, z_m, t)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z_m
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((y <= (-4.8d+99)) .or. (.not. (y <= (-7.2d+51)) .or. (.not. (y <= (-9.5d-33))) .and. (y <= 4.2d-55) .or. (.not. (y <= 3.3d-6)) .and. (y <= 9.6d+69))) then
        tmp = x_m * ((2.0d0 / z_m) / y)
    else
        tmp = (-2.0d0) * (x_m / (z_m * t))
    end if
    code = z_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
	double tmp;
	if ((y <= -4.8e+99) || !((y <= -7.2e+51) || (!(y <= -9.5e-33) && ((y <= 4.2e-55) || (!(y <= 3.3e-6) && (y <= 9.6e+69)))))) {
		tmp = x_m * ((2.0 / z_m) / y);
	} else {
		tmp = -2.0 * (x_m / (z_m * t));
	}
	return z_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, x_s, x_m, y, z_m, t):
	tmp = 0
	if (y <= -4.8e+99) or not ((y <= -7.2e+51) or (not (y <= -9.5e-33) and ((y <= 4.2e-55) or (not (y <= 3.3e-6) and (y <= 9.6e+69))))):
		tmp = x_m * ((2.0 / z_m) / y)
	else:
		tmp = -2.0 * (x_m / (z_m * t))
	return z_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, x_s, x_m, y, z_m, t)
	tmp = 0.0
	if ((y <= -4.8e+99) || !((y <= -7.2e+51) || (!(y <= -9.5e-33) && ((y <= 4.2e-55) || (!(y <= 3.3e-6) && (y <= 9.6e+69))))))
		tmp = Float64(x_m * Float64(Float64(2.0 / z_m) / y));
	else
		tmp = Float64(-2.0 * Float64(x_m / Float64(z_m * t)));
	end
	return Float64(z_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, x_s, x_m, y, z_m, t)
	tmp = 0.0;
	if ((y <= -4.8e+99) || ~(((y <= -7.2e+51) || (~((y <= -9.5e-33)) && ((y <= 4.2e-55) || (~((y <= 3.3e-6)) && (y <= 9.6e+69)))))))
		tmp = x_m * ((2.0 / z_m) / y);
	else
		tmp = -2.0 * (x_m / (z_m * t));
	end
	tmp_2 = z_s * (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]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_] := N[(z$95$s * N[(x$95$s * If[Or[LessEqual[y, -4.8e+99], N[Not[Or[LessEqual[y, -7.2e+51], And[N[Not[LessEqual[y, -9.5e-33]], $MachinePrecision], Or[LessEqual[y, 4.2e-55], And[N[Not[LessEqual[y, 3.3e-6]], $MachinePrecision], LessEqual[y, 9.6e+69]]]]]], $MachinePrecision]], N[(x$95$m * N[(N[(2.0 / z$95$m), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(x$95$m / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+99} \lor \neg \left(y \leq -7.2 \cdot 10^{+51} \lor \neg \left(y \leq -9.5 \cdot 10^{-33}\right) \land \left(y \leq 4.2 \cdot 10^{-55} \lor \neg \left(y \leq 3.3 \cdot 10^{-6}\right) \land y \leq 9.6 \cdot 10^{+69}\right)\right):\\
\;\;\;\;x\_m \cdot \frac{\frac{2}{z\_m}}{y}\\

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


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.8000000000000002e99 or -7.20000000000000022e51 < y < -9.50000000000000019e-33 or 4.2000000000000003e-55 < y < 3.30000000000000017e-6 or 9.6000000000000007e69 < y

    1. Initial program 85.7%

      \[\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 x around 0 86.7%

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

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

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

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

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

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

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

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

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

    if -4.8000000000000002e99 < y < -7.20000000000000022e51 or -9.50000000000000019e-33 < y < 4.2000000000000003e-55 or 3.30000000000000017e-6 < y < 9.6000000000000007e69

    1. Initial program 92.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+99} \lor \neg \left(y \leq -7.2 \cdot 10^{+51} \lor \neg \left(y \leq -9.5 \cdot 10^{-33}\right) \land \left(y \leq 4.2 \cdot 10^{-55} \lor \neg \left(y \leq 3.3 \cdot 10^{-6}\right) \land y \leq 9.6 \cdot 10^{+69}\right)\right):\\ \;\;\;\;x \cdot \frac{\frac{2}{z}}{y}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 71.7% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ \begin{array}{l} t_1 := -2 \cdot \frac{x\_m}{z\_m \cdot t}\\ t_2 := x\_m \cdot \frac{\frac{2}{z\_m}}{y}\\ t_3 := x\_m \cdot \frac{2}{y \cdot z\_m}\\ z\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+99}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -5.8 \cdot 10^{+58}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.6 \cdot 10^{-34}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{-56}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 4.2:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq 2.16 \cdot 10^{+71}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array}\right) \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 1 x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 1 z)
(FPCore (z_s x_s x_m y z_m t)
 :precision binary64
 (let* ((t_1 (* -2.0 (/ x_m (* z_m t))))
        (t_2 (* x_m (/ (/ 2.0 z_m) y)))
        (t_3 (* x_m (/ 2.0 (* y z_m)))))
   (*
    z_s
    (*
     x_s
     (if (<= y -4.8e+99)
       t_2
       (if (<= y -5.8e+58)
         t_1
         (if (<= y -2.6e-34)
           t_3
           (if (<= y 8.2e-56)
             t_1
             (if (<= y 4.2) t_3 (if (<= y 2.16e+71) t_1 t_2))))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
	double t_1 = -2.0 * (x_m / (z_m * t));
	double t_2 = x_m * ((2.0 / z_m) / y);
	double t_3 = x_m * (2.0 / (y * z_m));
	double tmp;
	if (y <= -4.8e+99) {
		tmp = t_2;
	} else if (y <= -5.8e+58) {
		tmp = t_1;
	} else if (y <= -2.6e-34) {
		tmp = t_3;
	} else if (y <= 8.2e-56) {
		tmp = t_1;
	} else if (y <= 4.2) {
		tmp = t_3;
	} else if (y <= 2.16e+71) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return z_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x_s, x_m, y, z_m, t)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z_m
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = (-2.0d0) * (x_m / (z_m * t))
    t_2 = x_m * ((2.0d0 / z_m) / y)
    t_3 = x_m * (2.0d0 / (y * z_m))
    if (y <= (-4.8d+99)) then
        tmp = t_2
    else if (y <= (-5.8d+58)) then
        tmp = t_1
    else if (y <= (-2.6d-34)) then
        tmp = t_3
    else if (y <= 8.2d-56) then
        tmp = t_1
    else if (y <= 4.2d0) then
        tmp = t_3
    else if (y <= 2.16d+71) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = z_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
	double t_1 = -2.0 * (x_m / (z_m * t));
	double t_2 = x_m * ((2.0 / z_m) / y);
	double t_3 = x_m * (2.0 / (y * z_m));
	double tmp;
	if (y <= -4.8e+99) {
		tmp = t_2;
	} else if (y <= -5.8e+58) {
		tmp = t_1;
	} else if (y <= -2.6e-34) {
		tmp = t_3;
	} else if (y <= 8.2e-56) {
		tmp = t_1;
	} else if (y <= 4.2) {
		tmp = t_3;
	} else if (y <= 2.16e+71) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return z_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, x_s, x_m, y, z_m, t):
	t_1 = -2.0 * (x_m / (z_m * t))
	t_2 = x_m * ((2.0 / z_m) / y)
	t_3 = x_m * (2.0 / (y * z_m))
	tmp = 0
	if y <= -4.8e+99:
		tmp = t_2
	elif y <= -5.8e+58:
		tmp = t_1
	elif y <= -2.6e-34:
		tmp = t_3
	elif y <= 8.2e-56:
		tmp = t_1
	elif y <= 4.2:
		tmp = t_3
	elif y <= 2.16e+71:
		tmp = t_1
	else:
		tmp = t_2
	return z_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, x_s, x_m, y, z_m, t)
	t_1 = Float64(-2.0 * Float64(x_m / Float64(z_m * t)))
	t_2 = Float64(x_m * Float64(Float64(2.0 / z_m) / y))
	t_3 = Float64(x_m * Float64(2.0 / Float64(y * z_m)))
	tmp = 0.0
	if (y <= -4.8e+99)
		tmp = t_2;
	elseif (y <= -5.8e+58)
		tmp = t_1;
	elseif (y <= -2.6e-34)
		tmp = t_3;
	elseif (y <= 8.2e-56)
		tmp = t_1;
	elseif (y <= 4.2)
		tmp = t_3;
	elseif (y <= 2.16e+71)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return Float64(z_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, x_s, x_m, y, z_m, t)
	t_1 = -2.0 * (x_m / (z_m * t));
	t_2 = x_m * ((2.0 / z_m) / y);
	t_3 = x_m * (2.0 / (y * z_m));
	tmp = 0.0;
	if (y <= -4.8e+99)
		tmp = t_2;
	elseif (y <= -5.8e+58)
		tmp = t_1;
	elseif (y <= -2.6e-34)
		tmp = t_3;
	elseif (y <= 8.2e-56)
		tmp = t_1;
	elseif (y <= 4.2)
		tmp = t_3;
	elseif (y <= 2.16e+71)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = z_s * (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]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(-2.0 * N[(x$95$m / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x$95$m * N[(N[(2.0 / z$95$m), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x$95$m * N[(2.0 / N[(y * z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[y, -4.8e+99], t$95$2, If[LessEqual[y, -5.8e+58], t$95$1, If[LessEqual[y, -2.6e-34], t$95$3, If[LessEqual[y, 8.2e-56], t$95$1, If[LessEqual[y, 4.2], t$95$3, If[LessEqual[y, 2.16e+71], t$95$1, t$95$2]]]]]]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

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

\mathbf{elif}\;y \leq -5.8 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -2.6 \cdot 10^{-34}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq 8.2 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 4.2:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq 2.16 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\

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


\end{array}\right)
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.8000000000000002e99 or 2.16e71 < y

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.8000000000000002e99 < y < -5.80000000000000004e58 or -2.5999999999999999e-34 < y < 8.2000000000000003e-56 or 4.20000000000000018 < y < 2.16e71

    1. Initial program 92.9%

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

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

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

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

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

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

    if -5.80000000000000004e58 < y < -2.5999999999999999e-34 or 8.2000000000000003e-56 < y < 4.20000000000000018

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+99}:\\ \;\;\;\;x \cdot \frac{\frac{2}{z}}{y}\\ \mathbf{elif}\;y \leq -5.8 \cdot 10^{+58}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{elif}\;y \leq -2.6 \cdot 10^{-34}:\\ \;\;\;\;x \cdot \frac{2}{y \cdot z}\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{-56}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{elif}\;y \leq 4.2:\\ \;\;\;\;x \cdot \frac{2}{y \cdot z}\\ \mathbf{elif}\;y \leq 2.16 \cdot 10^{+71}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{2}{z}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 71.7% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ \begin{array}{l} t_1 := \frac{x\_m}{t} \cdot \frac{-2}{z\_m}\\ t_2 := x\_m \cdot \frac{\frac{2}{z\_m}}{y}\\ t_3 := x\_m \cdot \frac{2}{y \cdot z\_m}\\ z\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{+101}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -1.75 \cdot 10^{+57}:\\ \;\;\;\;-2 \cdot \frac{x\_m}{z\_m \cdot t}\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{-32}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{-56}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-8}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+70}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array}\right) \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 1 x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 1 z)
(FPCore (z_s x_s x_m y z_m t)
 :precision binary64
 (let* ((t_1 (* (/ x_m t) (/ -2.0 z_m)))
        (t_2 (* x_m (/ (/ 2.0 z_m) y)))
        (t_3 (* x_m (/ 2.0 (* y z_m)))))
   (*
    z_s
    (*
     x_s
     (if (<= y -1.25e+101)
       t_2
       (if (<= y -1.75e+57)
         (* -2.0 (/ x_m (* z_m t)))
         (if (<= y -6.6e-32)
           t_3
           (if (<= y 8.2e-56)
             t_1
             (if (<= y 5.5e-8) t_3 (if (<= y 1.15e+70) t_1 t_2))))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
	double t_1 = (x_m / t) * (-2.0 / z_m);
	double t_2 = x_m * ((2.0 / z_m) / y);
	double t_3 = x_m * (2.0 / (y * z_m));
	double tmp;
	if (y <= -1.25e+101) {
		tmp = t_2;
	} else if (y <= -1.75e+57) {
		tmp = -2.0 * (x_m / (z_m * t));
	} else if (y <= -6.6e-32) {
		tmp = t_3;
	} else if (y <= 8.2e-56) {
		tmp = t_1;
	} else if (y <= 5.5e-8) {
		tmp = t_3;
	} else if (y <= 1.15e+70) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return z_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x_s, x_m, y, z_m, t)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z_m
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = (x_m / t) * ((-2.0d0) / z_m)
    t_2 = x_m * ((2.0d0 / z_m) / y)
    t_3 = x_m * (2.0d0 / (y * z_m))
    if (y <= (-1.25d+101)) then
        tmp = t_2
    else if (y <= (-1.75d+57)) then
        tmp = (-2.0d0) * (x_m / (z_m * t))
    else if (y <= (-6.6d-32)) then
        tmp = t_3
    else if (y <= 8.2d-56) then
        tmp = t_1
    else if (y <= 5.5d-8) then
        tmp = t_3
    else if (y <= 1.15d+70) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = z_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
	double t_1 = (x_m / t) * (-2.0 / z_m);
	double t_2 = x_m * ((2.0 / z_m) / y);
	double t_3 = x_m * (2.0 / (y * z_m));
	double tmp;
	if (y <= -1.25e+101) {
		tmp = t_2;
	} else if (y <= -1.75e+57) {
		tmp = -2.0 * (x_m / (z_m * t));
	} else if (y <= -6.6e-32) {
		tmp = t_3;
	} else if (y <= 8.2e-56) {
		tmp = t_1;
	} else if (y <= 5.5e-8) {
		tmp = t_3;
	} else if (y <= 1.15e+70) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return z_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, x_s, x_m, y, z_m, t):
	t_1 = (x_m / t) * (-2.0 / z_m)
	t_2 = x_m * ((2.0 / z_m) / y)
	t_3 = x_m * (2.0 / (y * z_m))
	tmp = 0
	if y <= -1.25e+101:
		tmp = t_2
	elif y <= -1.75e+57:
		tmp = -2.0 * (x_m / (z_m * t))
	elif y <= -6.6e-32:
		tmp = t_3
	elif y <= 8.2e-56:
		tmp = t_1
	elif y <= 5.5e-8:
		tmp = t_3
	elif y <= 1.15e+70:
		tmp = t_1
	else:
		tmp = t_2
	return z_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, x_s, x_m, y, z_m, t)
	t_1 = Float64(Float64(x_m / t) * Float64(-2.0 / z_m))
	t_2 = Float64(x_m * Float64(Float64(2.0 / z_m) / y))
	t_3 = Float64(x_m * Float64(2.0 / Float64(y * z_m)))
	tmp = 0.0
	if (y <= -1.25e+101)
		tmp = t_2;
	elseif (y <= -1.75e+57)
		tmp = Float64(-2.0 * Float64(x_m / Float64(z_m * t)));
	elseif (y <= -6.6e-32)
		tmp = t_3;
	elseif (y <= 8.2e-56)
		tmp = t_1;
	elseif (y <= 5.5e-8)
		tmp = t_3;
	elseif (y <= 1.15e+70)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return Float64(z_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, x_s, x_m, y, z_m, t)
	t_1 = (x_m / t) * (-2.0 / z_m);
	t_2 = x_m * ((2.0 / z_m) / y);
	t_3 = x_m * (2.0 / (y * z_m));
	tmp = 0.0;
	if (y <= -1.25e+101)
		tmp = t_2;
	elseif (y <= -1.75e+57)
		tmp = -2.0 * (x_m / (z_m * t));
	elseif (y <= -6.6e-32)
		tmp = t_3;
	elseif (y <= 8.2e-56)
		tmp = t_1;
	elseif (y <= 5.5e-8)
		tmp = t_3;
	elseif (y <= 1.15e+70)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = z_s * (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]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(N[(x$95$m / t), $MachinePrecision] * N[(-2.0 / z$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x$95$m * N[(N[(2.0 / z$95$m), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x$95$m * N[(2.0 / N[(y * z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[y, -1.25e+101], t$95$2, If[LessEqual[y, -1.75e+57], N[(-2.0 * N[(x$95$m / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.6e-32], t$95$3, If[LessEqual[y, 8.2e-56], t$95$1, If[LessEqual[y, 5.5e-8], t$95$3, If[LessEqual[y, 1.15e+70], t$95$1, t$95$2]]]]]]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

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

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

\mathbf{elif}\;y \leq -6.6 \cdot 10^{-32}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq 8.2 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 5.5 \cdot 10^{-8}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq 1.15 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\

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


\end{array}\right)
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.24999999999999997e101 or 1.14999999999999997e70 < y

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.24999999999999997e101 < y < -1.7499999999999999e57

    1. Initial program 99.7%

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

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

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

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

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

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

    if -1.7499999999999999e57 < y < -6.60000000000000051e-32 or 8.2000000000000003e-56 < y < 5.5000000000000003e-8

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

    if -6.60000000000000051e-32 < y < 8.2000000000000003e-56 or 5.5000000000000003e-8 < y < 1.14999999999999997e70

    1. Initial program 92.3%

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{x}{z \cdot t}} \]
    8. Step-by-step derivation
      1. clear-num78.9%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{+101}:\\ \;\;\;\;x \cdot \frac{\frac{2}{z}}{y}\\ \mathbf{elif}\;y \leq -1.75 \cdot 10^{+57}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{-32}:\\ \;\;\;\;x \cdot \frac{2}{y \cdot z}\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{-56}:\\ \;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-8}:\\ \;\;\;\;x \cdot \frac{2}{y \cdot z}\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+70}:\\ \;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{2}{z}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 71.3% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;y \leq -1 \cdot 10^{-32}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq 8.2 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 4.5 \cdot 10^{-8}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\

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


\end{array}\right)
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.6499999999999999e100 or 4.20000000000000016e79 < y

    1. Initial program 82.7%

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

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

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

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

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

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

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

    if -2.6499999999999999e100 < y < -5.99999999999999996e53

    1. Initial program 99.7%

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

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

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

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

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

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

    if -5.99999999999999996e53 < y < -1.00000000000000006e-32 or 8.2000000000000003e-56 < y < 4.49999999999999993e-8

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000006e-32 < y < 8.2000000000000003e-56 or 4.49999999999999993e-8 < y < 4.20000000000000016e79

    1. Initial program 92.4%

      \[\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 0 79.2%

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{x}{z \cdot t}} \]
    8. Step-by-step derivation
      1. clear-num78.4%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.65 \cdot 10^{+100}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;y \leq -6 \cdot 10^{+53}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{elif}\;y \leq -1 \cdot 10^{-32}:\\ \;\;\;\;x \cdot \frac{2}{y \cdot z}\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{-56}:\\ \;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-8}:\\ \;\;\;\;x \cdot \frac{2}{y \cdot z}\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{+79}:\\ \;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 71.5% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;y \leq -1.1 \cdot 10^{-32}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 6.2 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 0.036:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 8 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\

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


\end{array}\right)
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.34999999999999999e100 or -8e51 < y < -1.1e-32 or 6.19999999999999975e-56 < y < 0.0359999999999999973

    1. Initial program 85.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot {\left(\sqrt{2}\right)}^{2}}{y \cdot z}} \]
    8. Step-by-step derivation
      1. associate-/r*81.6%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot {\left(\sqrt{2}\right)}^{2}}{y}}{z}} \]
      2. unpow281.6%

        \[\leadsto \frac{\frac{x \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)}}{y}}{z} \]
      3. rem-square-sqrt82.3%

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

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

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

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

    if -1.34999999999999999e100 < y < -8e51

    1. Initial program 91.2%

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

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

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

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

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

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

    if -1.1e-32 < y < 6.19999999999999975e-56 or 0.0359999999999999973 < y < 8.00000000000000007e78

    1. Initial program 92.4%

      \[\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 0 79.2%

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{x}{z \cdot t}} \]
    8. Step-by-step derivation
      1. clear-num78.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.00000000000000007e78 < y

    1. Initial program 85.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{+100}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{elif}\;y \leq -8 \cdot 10^{+51}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-32}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{-56}:\\ \;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\ \mathbf{elif}\;y \leq 0.036:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{elif}\;y \leq 8 \cdot 10^{+78}:\\ \;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 71.8% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;y \leq -9.5 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -1.3 \cdot 10^{-33}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;y \leq 1.15 \cdot 10^{-6}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 7.8 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\

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


\end{array}\right)
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -6.00000000000000029e99 or -9.4999999999999999e51 < y < -1.29999999999999997e-33 or 3.9e-55 < y < 1.15e-6

    1. Initial program 85.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot {\left(\sqrt{2}\right)}^{2}}{y \cdot z}} \]
    8. Step-by-step derivation
      1. associate-/r*81.6%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot {\left(\sqrt{2}\right)}^{2}}{y}}{z}} \]
      2. unpow281.6%

        \[\leadsto \frac{\frac{x \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)}}{y}}{z} \]
      3. rem-square-sqrt82.3%

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

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

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

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

    if -6.00000000000000029e99 < y < -9.4999999999999999e51 or 1.15e-6 < y < 7.8000000000000008e78

    1. Initial program 84.9%

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{x}{z \cdot t}} \]
    8. Step-by-step derivation
      1. clear-num70.4%

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

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

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

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

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

    if -1.29999999999999997e-33 < y < 3.9e-55

    1. Initial program 94.1%

      \[\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 0 80.8%

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{x}{z \cdot t}} \]
    8. Step-by-step derivation
      1. clear-num79.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-2}{t} \cdot \frac{1}{\frac{z}{x}}} \]
      3. clear-num81.0%

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

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

        \[\leadsto \frac{\color{blue}{x \cdot -2}}{t \cdot z} \]
      6. times-frac81.4%

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

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

    if 7.8000000000000008e78 < y

    1. Initial program 85.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6 \cdot 10^{+99}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{+51}:\\ \;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\ \mathbf{elif}\;y \leq -1.3 \cdot 10^{-33}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-55}:\\ \;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{-6}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+78}:\\ \;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 71.9% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;y \leq -3.4 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\

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

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

\mathbf{elif}\;y \leq 5.8 \cdot 10^{-8}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\

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


\end{array}\right)
\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -4.8000000000000002e99 or 4.20000000000000012e-56 < y < 5.8000000000000003e-8

    1. Initial program 82.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot {\left(\sqrt{2}\right)}^{2}}{y \cdot z}} \]
    8. Step-by-step derivation
      1. associate-/r*81.7%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot {\left(\sqrt{2}\right)}^{2}}{y}}{z}} \]
      2. unpow281.7%

        \[\leadsto \frac{\frac{x \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)}}{y}}{z} \]
      3. rem-square-sqrt82.5%

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

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

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

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

    if -4.8000000000000002e99 < y < -3.39999999999999984e51 or 5.8000000000000003e-8 < y < 4.20000000000000016e79

    1. Initial program 84.9%

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{x}{z \cdot t}} \]
    8. Step-by-step derivation
      1. clear-num70.4%

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

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

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

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

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

    if -3.39999999999999984e51 < y < -8.5000000000000003e-32

    1. Initial program 99.8%

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

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

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

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

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

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

    if -8.5000000000000003e-32 < y < 4.20000000000000012e-56

    1. Initial program 94.1%

      \[\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 0 80.8%

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{x}{z \cdot t}} \]
    8. Step-by-step derivation
      1. clear-num79.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-2}{t} \cdot \frac{1}{\frac{z}{x}}} \]
      3. clear-num81.0%

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

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

        \[\leadsto \frac{\color{blue}{x \cdot -2}}{t \cdot z} \]
      6. times-frac81.4%

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

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

    if 4.20000000000000016e79 < y

    1. Initial program 85.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+99}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{elif}\;y \leq -3.4 \cdot 10^{+51}:\\ \;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-32}:\\ \;\;\;\;\frac{x \cdot 2}{y \cdot z}\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-56}:\\ \;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{-8}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{+79}:\\ \;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 71.9% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ \begin{array}{l} t_1 := \frac{x\_m}{z\_m} \cdot \frac{2}{y}\\ z\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{+99}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{+52}:\\ \;\;\;\;\frac{\frac{-2}{\frac{z\_m}{x\_m}}}{t}\\ \mathbf{elif}\;y \leq -9.4 \cdot 10^{-32}:\\ \;\;\;\;\frac{x\_m \cdot 2}{y \cdot z\_m}\\ \mathbf{elif}\;y \leq 7.3 \cdot 10^{-56}:\\ \;\;\;\;\frac{x\_m}{t} \cdot \frac{-2}{z\_m}\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{-6}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{+79}:\\ \;\;\;\;\frac{-2}{t \cdot \frac{z\_m}{x\_m}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z\_m} \cdot \frac{x\_m}{y}\\ \end{array}\right) \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 1 x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 1 z)
(FPCore (z_s x_s x_m y z_m t)
 :precision binary64
 (let* ((t_1 (* (/ x_m z_m) (/ 2.0 y))))
   (*
    z_s
    (*
     x_s
     (if (<= y -5e+99)
       t_1
       (if (<= y -1.1e+52)
         (/ (/ -2.0 (/ z_m x_m)) t)
         (if (<= y -9.4e-32)
           (/ (* x_m 2.0) (* y z_m))
           (if (<= y 7.3e-56)
             (* (/ x_m t) (/ -2.0 z_m))
             (if (<= y 1.6e-6)
               t_1
               (if (<= y 1.8e+79)
                 (/ -2.0 (* t (/ z_m x_m)))
                 (* (/ 2.0 z_m) (/ x_m y))))))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
	double t_1 = (x_m / z_m) * (2.0 / y);
	double tmp;
	if (y <= -5e+99) {
		tmp = t_1;
	} else if (y <= -1.1e+52) {
		tmp = (-2.0 / (z_m / x_m)) / t;
	} else if (y <= -9.4e-32) {
		tmp = (x_m * 2.0) / (y * z_m);
	} else if (y <= 7.3e-56) {
		tmp = (x_m / t) * (-2.0 / z_m);
	} else if (y <= 1.6e-6) {
		tmp = t_1;
	} else if (y <= 1.8e+79) {
		tmp = -2.0 / (t * (z_m / x_m));
	} else {
		tmp = (2.0 / z_m) * (x_m / y);
	}
	return z_s * (x_s * tmp);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x_s, x_m, y, z_m, t)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z_m
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x_m / z_m) * (2.0d0 / y)
    if (y <= (-5d+99)) then
        tmp = t_1
    else if (y <= (-1.1d+52)) then
        tmp = ((-2.0d0) / (z_m / x_m)) / t
    else if (y <= (-9.4d-32)) then
        tmp = (x_m * 2.0d0) / (y * z_m)
    else if (y <= 7.3d-56) then
        tmp = (x_m / t) * ((-2.0d0) / z_m)
    else if (y <= 1.6d-6) then
        tmp = t_1
    else if (y <= 1.8d+79) then
        tmp = (-2.0d0) / (t * (z_m / x_m))
    else
        tmp = (2.0d0 / z_m) * (x_m / y)
    end if
    code = z_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m, double t) {
	double t_1 = (x_m / z_m) * (2.0 / y);
	double tmp;
	if (y <= -5e+99) {
		tmp = t_1;
	} else if (y <= -1.1e+52) {
		tmp = (-2.0 / (z_m / x_m)) / t;
	} else if (y <= -9.4e-32) {
		tmp = (x_m * 2.0) / (y * z_m);
	} else if (y <= 7.3e-56) {
		tmp = (x_m / t) * (-2.0 / z_m);
	} else if (y <= 1.6e-6) {
		tmp = t_1;
	} else if (y <= 1.8e+79) {
		tmp = -2.0 / (t * (z_m / x_m));
	} else {
		tmp = (2.0 / z_m) * (x_m / y);
	}
	return z_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, x_s, x_m, y, z_m, t):
	t_1 = (x_m / z_m) * (2.0 / y)
	tmp = 0
	if y <= -5e+99:
		tmp = t_1
	elif y <= -1.1e+52:
		tmp = (-2.0 / (z_m / x_m)) / t
	elif y <= -9.4e-32:
		tmp = (x_m * 2.0) / (y * z_m)
	elif y <= 7.3e-56:
		tmp = (x_m / t) * (-2.0 / z_m)
	elif y <= 1.6e-6:
		tmp = t_1
	elif y <= 1.8e+79:
		tmp = -2.0 / (t * (z_m / x_m))
	else:
		tmp = (2.0 / z_m) * (x_m / y)
	return z_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, x_s, x_m, y, z_m, t)
	t_1 = Float64(Float64(x_m / z_m) * Float64(2.0 / y))
	tmp = 0.0
	if (y <= -5e+99)
		tmp = t_1;
	elseif (y <= -1.1e+52)
		tmp = Float64(Float64(-2.0 / Float64(z_m / x_m)) / t);
	elseif (y <= -9.4e-32)
		tmp = Float64(Float64(x_m * 2.0) / Float64(y * z_m));
	elseif (y <= 7.3e-56)
		tmp = Float64(Float64(x_m / t) * Float64(-2.0 / z_m));
	elseif (y <= 1.6e-6)
		tmp = t_1;
	elseif (y <= 1.8e+79)
		tmp = Float64(-2.0 / Float64(t * Float64(z_m / x_m)));
	else
		tmp = Float64(Float64(2.0 / z_m) * Float64(x_m / y));
	end
	return Float64(z_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, x_s, x_m, y, z_m, t)
	t_1 = (x_m / z_m) * (2.0 / y);
	tmp = 0.0;
	if (y <= -5e+99)
		tmp = t_1;
	elseif (y <= -1.1e+52)
		tmp = (-2.0 / (z_m / x_m)) / t;
	elseif (y <= -9.4e-32)
		tmp = (x_m * 2.0) / (y * z_m);
	elseif (y <= 7.3e-56)
		tmp = (x_m / t) * (-2.0 / z_m);
	elseif (y <= 1.6e-6)
		tmp = t_1;
	elseif (y <= 1.8e+79)
		tmp = -2.0 / (t * (z_m / x_m));
	else
		tmp = (2.0 / z_m) * (x_m / y);
	end
	tmp_2 = z_s * (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]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(N[(x$95$m / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[y, -5e+99], t$95$1, If[LessEqual[y, -1.1e+52], N[(N[(-2.0 / N[(z$95$m / x$95$m), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, -9.4e-32], N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(y * z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.3e-56], N[(N[(x$95$m / t), $MachinePrecision] * N[(-2.0 / z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-6], t$95$1, If[LessEqual[y, 1.8e+79], N[(-2.0 / N[(t * N[(z$95$m / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x$95$m / y), $MachinePrecision]), $MachinePrecision]]]]]]]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
\begin{array}{l}
t_1 := \frac{x\_m}{z\_m} \cdot \frac{2}{y}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq -9.4 \cdot 10^{-32}:\\
\;\;\;\;\frac{x\_m \cdot 2}{y \cdot z\_m}\\

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

\mathbf{elif}\;y \leq 1.6 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\

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

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


\end{array}\right)
\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -5.00000000000000008e99 or 7.30000000000000045e-56 < y < 1.5999999999999999e-6

    1. Initial program 82.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot {\left(\sqrt{2}\right)}^{2}}{y \cdot z}} \]
    8. Step-by-step derivation
      1. associate-/r*81.7%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot {\left(\sqrt{2}\right)}^{2}}{y}}{z}} \]
      2. unpow281.7%

        \[\leadsto \frac{\frac{x \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)}}{y}}{z} \]
      3. rem-square-sqrt82.5%

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

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

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

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

    if -5.00000000000000008e99 < y < -1.1e52

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1e52 < y < -9.40000000000000039e-32

    1. Initial program 99.8%

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

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

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

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

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

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

    if -9.40000000000000039e-32 < y < 7.30000000000000045e-56

    1. Initial program 94.1%

      \[\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 0 80.8%

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{x}{z \cdot t}} \]
    8. Step-by-step derivation
      1. clear-num79.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-2}{t} \cdot \frac{1}{\frac{z}{x}}} \]
      3. clear-num81.0%

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

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

        \[\leadsto \frac{\color{blue}{x \cdot -2}}{t \cdot z} \]
      6. times-frac81.4%

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

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

    if 1.5999999999999999e-6 < y < 1.8e79

    1. Initial program 80.3%

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{x}{z \cdot t}} \]
    8. Step-by-step derivation
      1. clear-num67.9%

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

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

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

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

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

    if 1.8e79 < y

    1. Initial program 85.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{+99}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{+52}:\\ \;\;\;\;\frac{\frac{-2}{\frac{z}{x}}}{t}\\ \mathbf{elif}\;y \leq -9.4 \cdot 10^{-32}:\\ \;\;\;\;\frac{x \cdot 2}{y \cdot z}\\ \mathbf{elif}\;y \leq 7.3 \cdot 10^{-56}:\\ \;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{-6}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{+79}:\\ \;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 71.9% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x\_m}{z\_m} \cdot \frac{2}{y}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -4.9 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq -4.4 \cdot 10^{-32}:\\
\;\;\;\;\frac{x\_m \cdot 2}{y \cdot z\_m}\\

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

\mathbf{elif}\;y \leq 3 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\

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

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


\end{array}\right)
\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -4.8999999999999997e99 or 4.2000000000000003e-55 < y < 2.99999999999999973e-8

    1. Initial program 82.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot {\left(\sqrt{2}\right)}^{2}}{y \cdot z}} \]
    8. Step-by-step derivation
      1. associate-/r*81.7%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot {\left(\sqrt{2}\right)}^{2}}{y}}{z}} \]
      2. unpow281.7%

        \[\leadsto \frac{\frac{x \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)}}{y}}{z} \]
      3. rem-square-sqrt82.5%

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

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

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

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

    if -4.8999999999999997e99 < y < -1.25e50

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.25e50 < y < -4.4e-32

    1. Initial program 99.8%

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

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

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

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

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

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

    if -4.4e-32 < y < 4.2000000000000003e-55

    1. Initial program 94.1%

      \[\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 0 80.8%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{-x \cdot 2}{t}}{z}} \]
      7. distribute-rgt-neg-in81.4%

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

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

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

    if 2.99999999999999973e-8 < y < 2.20000000000000003e80

    1. Initial program 80.3%

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{x}{z \cdot t}} \]
    8. Step-by-step derivation
      1. clear-num67.9%

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

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

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

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

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

    if 2.20000000000000003e80 < y

    1. Initial program 85.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.9 \cdot 10^{+99}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{+50}:\\ \;\;\;\;\frac{\frac{-2}{\frac{z}{x}}}{t}\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-32}:\\ \;\;\;\;\frac{x \cdot 2}{y \cdot z}\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-55}:\\ \;\;\;\;\frac{\frac{x \cdot -2}{t}}{z}\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-8}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+80}:\\ \;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 71.9% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x\_m}{z\_m} \cdot \frac{2}{y}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq -9 \cdot 10^{-32}:\\
\;\;\;\;\frac{x\_m \cdot 2}{y \cdot z\_m}\\

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

\mathbf{elif}\;y \leq 0.0025:\\
\;\;\;\;t\_1\\

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

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


\end{array}\right)
\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -4.8000000000000002e99 or 6.19999999999999975e-56 < y < 0.00250000000000000005

    1. Initial program 82.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot {\left(\sqrt{2}\right)}^{2}}{y \cdot z}} \]
    8. Step-by-step derivation
      1. associate-/r*81.7%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot {\left(\sqrt{2}\right)}^{2}}{y}}{z}} \]
      2. unpow281.7%

        \[\leadsto \frac{\frac{x \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)}}{y}}{z} \]
      3. rem-square-sqrt82.5%

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

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

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

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

    if -4.8000000000000002e99 < y < -5.2000000000000002e51

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{-x \cdot 2}{z}}{t}} \]
      6. distribute-rgt-neg-in82.6%

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

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

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

    if -5.2000000000000002e51 < y < -9.00000000000000009e-32

    1. Initial program 99.8%

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

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

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

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

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

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

    if -9.00000000000000009e-32 < y < 6.19999999999999975e-56

    1. Initial program 94.1%

      \[\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 0 80.8%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{-x \cdot 2}{t}}{z}} \]
      7. distribute-rgt-neg-in81.4%

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

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

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

    if 0.00250000000000000005 < y < 4.6000000000000001e79

    1. Initial program 80.3%

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{x}{z \cdot t}} \]
    8. Step-by-step derivation
      1. clear-num67.9%

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

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

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

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

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

    if 4.6000000000000001e79 < y

    1. Initial program 85.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+99}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{+51}:\\ \;\;\;\;\frac{\frac{x \cdot -2}{z}}{t}\\ \mathbf{elif}\;y \leq -9 \cdot 10^{-32}:\\ \;\;\;\;\frac{x \cdot 2}{y \cdot z}\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{-56}:\\ \;\;\;\;\frac{\frac{x \cdot -2}{t}}{z}\\ \mathbf{elif}\;y \leq 0.0025:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{+79}:\\ \;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 96.6% accurate, 0.7× speedup?

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

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

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


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x 2) < 9.9999999999999996e-70

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999996e-70 < (*.f64 x 2)

    1. Initial program 89.6%

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

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

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

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

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

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

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

Alternative 13: 96.6% accurate, 0.7× speedup?

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

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

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


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x 2) < 5.00000000000000009e-88

    1. Initial program 88.6%

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

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

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

    if 5.00000000000000009e-88 < (*.f64 x 2)

    1. Initial program 90.1%

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

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

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

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

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

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

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

Alternative 14: 96.6% accurate, 0.7× speedup?

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

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

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


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x 2) < 5.00000000000000009e-88

    1. Initial program 88.6%

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

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

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

    if 5.00000000000000009e-88 < (*.f64 x 2)

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 96.6% accurate, 0.8× speedup?

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

\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 1.5 \cdot 10^{+52}:\\
\;\;\;\;x\_m \cdot \frac{\frac{2}{z\_m}}{y - t}\\

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


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.5e52

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.5e52 < z

    1. Initial program 79.7%

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

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

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

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

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

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

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

Alternative 16: 92.2% accurate, 1.2× speedup?

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{2 \cdot \frac{\frac{x}{z}}{y - t}} \]
  8. Final simplification93.9%

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

Alternative 17: 52.9% accurate, 1.6× speedup?

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-2 \cdot \frac{x}{z \cdot t}} \]
  8. Final simplification55.0%

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

Developer target: 96.9% 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 2024096 
(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))))