Linear.Projection:infinitePerspective from linear-1.19.1.3, A

Percentage Accurate: 89.8% → 97.1%
Time: 9.2s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 89.8% accurate, 1.0× speedup?

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

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

Alternative 1: 97.1% accurate, 1.0× speedup?

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

\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 9 \cdot 10^{-37}:\\
\;\;\;\;\frac{x \cdot 2}{z_m \cdot \left(y - t\right)}\\

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


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

    1. Initial program 90.2%

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

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

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

    if 9.00000000000000081e-37 < z

    1. Initial program 82.9%

      \[\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. Step-by-step derivation
      1. *-commutative84.2%

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

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

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

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

Alternative 2: 74.1% accurate, 0.8× speedup?

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

\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.65 \cdot 10^{+241}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z_m}{x}}\\

\mathbf{elif}\;t \leq -2.7 \cdot 10^{-37}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\

\mathbf{elif}\;t \leq 2.5 \cdot 10^{+54}:\\
\;\;\;\;\frac{x}{z_m} \cdot \frac{2}{y}\\

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


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

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.6500000000000001e241 < t < -2.70000000000000016e-37

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

    if -2.70000000000000016e-37 < t < 2.50000000000000003e54

    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.4%

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

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

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

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

    if 2.50000000000000003e54 < t

    1. Initial program 87.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t}} \cdot \frac{2}{z} \]
      2. neg-mul-181.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.65 \cdot 10^{+241}:\\ \;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\ \mathbf{elif}\;t \leq -2.7 \cdot 10^{-37}:\\ \;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z}\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{+54}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{-x}{t}\\ \end{array} \]

Alternative 3: 74.3% accurate, 0.8× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ z_s = \mathsf{copysign}\left(1, z\right) \\ z_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -3.65 \cdot 10^{+241}:\\ \;\;\;\;\frac{x}{z_m} \cdot \frac{-2}{t}\\ \mathbf{elif}\;t \leq -2.6 \cdot 10^{-37} \lor \neg \left(t \leq 6 \cdot 10^{-23}\right):\\ \;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z_m} \cdot \frac{x}{y}\\ \end{array} \end{array} \]
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
 :precision binary64
 (*
  z_s
  (if (<= t -3.65e+241)
    (* (/ x z_m) (/ -2.0 t))
    (if (or (<= t -2.6e-37) (not (<= t 6e-23)))
      (* -2.0 (/ (/ x t) z_m))
      (* (/ 2.0 z_m) (/ x y))))))
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
	double tmp;
	if (t <= -3.65e+241) {
		tmp = (x / z_m) * (-2.0 / t);
	} else if ((t <= -2.6e-37) || !(t <= 6e-23)) {
		tmp = -2.0 * ((x / t) / z_m);
	} else {
		tmp = (2.0 / z_m) * (x / y);
	}
	return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z_m
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-3.65d+241)) then
        tmp = (x / z_m) * ((-2.0d0) / t)
    else if ((t <= (-2.6d-37)) .or. (.not. (t <= 6d-23))) then
        tmp = (-2.0d0) * ((x / t) / z_m)
    else
        tmp = (2.0d0 / z_m) * (x / y)
    end if
    code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
	double tmp;
	if (t <= -3.65e+241) {
		tmp = (x / z_m) * (-2.0 / t);
	} else if ((t <= -2.6e-37) || !(t <= 6e-23)) {
		tmp = -2.0 * ((x / t) / z_m);
	} else {
		tmp = (2.0 / z_m) * (x / y);
	}
	return z_s * tmp;
}
z_m = math.fabs(z)
z_s = math.copysign(1.0, z)
def code(z_s, x, y, z_m, t):
	tmp = 0
	if t <= -3.65e+241:
		tmp = (x / z_m) * (-2.0 / t)
	elif (t <= -2.6e-37) or not (t <= 6e-23):
		tmp = -2.0 * ((x / t) / z_m)
	else:
		tmp = (2.0 / z_m) * (x / y)
	return z_s * tmp
z_m = abs(z)
z_s = copysign(1.0, z)
function code(z_s, x, y, z_m, t)
	tmp = 0.0
	if (t <= -3.65e+241)
		tmp = Float64(Float64(x / z_m) * Float64(-2.0 / t));
	elseif ((t <= -2.6e-37) || !(t <= 6e-23))
		tmp = Float64(-2.0 * Float64(Float64(x / t) / z_m));
	else
		tmp = Float64(Float64(2.0 / z_m) * Float64(x / y));
	end
	return Float64(z_s * tmp)
end
z_m = abs(z);
z_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, x, y, z_m, t)
	tmp = 0.0;
	if (t <= -3.65e+241)
		tmp = (x / z_m) * (-2.0 / t);
	elseif ((t <= -2.6e-37) || ~((t <= 6e-23)))
		tmp = -2.0 * ((x / t) / z_m);
	else
		tmp = (2.0 / z_m) * (x / y);
	end
	tmp_2 = z_s * tmp;
end
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_, y_, z$95$m_, t_] := N[(z$95$s * If[LessEqual[t, -3.65e+241], N[(N[(x / z$95$m), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -2.6e-37], N[Not[LessEqual[t, 6e-23]], $MachinePrecision]], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)

\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.65 \cdot 10^{+241}:\\
\;\;\;\;\frac{x}{z_m} \cdot \frac{-2}{t}\\

\mathbf{elif}\;t \leq -2.6 \cdot 10^{-37} \lor \neg \left(t \leq 6 \cdot 10^{-23}\right):\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\

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


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

    1. Initial program 71.8%

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

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

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

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

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

    if -3.6500000000000001e241 < t < -2.5999999999999998e-37 or 6.00000000000000006e-23 < t

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

    if -2.5999999999999998e-37 < t < 6.00000000000000006e-23

    1. Initial program 87.7%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.65 \cdot 10^{+241}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{-2}{t}\\ \mathbf{elif}\;t \leq -2.6 \cdot 10^{-37} \lor \neg \left(t \leq 6 \cdot 10^{-23}\right):\\ \;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \end{array} \]

Alternative 4: 73.9% accurate, 0.8× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ z_s = \mathsf{copysign}\left(1, z\right) \\ z_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -3.65 \cdot 10^{+241}:\\ \;\;\;\;\frac{x}{z_m} \cdot \frac{-2}{t}\\ \mathbf{elif}\;t \leq -2.05 \cdot 10^{-37} \lor \neg \left(t \leq 6.8 \cdot 10^{+64}\right):\\ \;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z_m} \cdot \frac{2}{y}\\ \end{array} \end{array} \]
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
 :precision binary64
 (*
  z_s
  (if (<= t -3.65e+241)
    (* (/ x z_m) (/ -2.0 t))
    (if (or (<= t -2.05e-37) (not (<= t 6.8e+64)))
      (* -2.0 (/ (/ x t) z_m))
      (* (/ x z_m) (/ 2.0 y))))))
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
	double tmp;
	if (t <= -3.65e+241) {
		tmp = (x / z_m) * (-2.0 / t);
	} else if ((t <= -2.05e-37) || !(t <= 6.8e+64)) {
		tmp = -2.0 * ((x / t) / z_m);
	} else {
		tmp = (x / z_m) * (2.0 / y);
	}
	return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z_m
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-3.65d+241)) then
        tmp = (x / z_m) * ((-2.0d0) / t)
    else if ((t <= (-2.05d-37)) .or. (.not. (t <= 6.8d+64))) then
        tmp = (-2.0d0) * ((x / t) / z_m)
    else
        tmp = (x / z_m) * (2.0d0 / y)
    end if
    code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
	double tmp;
	if (t <= -3.65e+241) {
		tmp = (x / z_m) * (-2.0 / t);
	} else if ((t <= -2.05e-37) || !(t <= 6.8e+64)) {
		tmp = -2.0 * ((x / t) / z_m);
	} else {
		tmp = (x / z_m) * (2.0 / y);
	}
	return z_s * tmp;
}
z_m = math.fabs(z)
z_s = math.copysign(1.0, z)
def code(z_s, x, y, z_m, t):
	tmp = 0
	if t <= -3.65e+241:
		tmp = (x / z_m) * (-2.0 / t)
	elif (t <= -2.05e-37) or not (t <= 6.8e+64):
		tmp = -2.0 * ((x / t) / z_m)
	else:
		tmp = (x / z_m) * (2.0 / y)
	return z_s * tmp
z_m = abs(z)
z_s = copysign(1.0, z)
function code(z_s, x, y, z_m, t)
	tmp = 0.0
	if (t <= -3.65e+241)
		tmp = Float64(Float64(x / z_m) * Float64(-2.0 / t));
	elseif ((t <= -2.05e-37) || !(t <= 6.8e+64))
		tmp = Float64(-2.0 * Float64(Float64(x / t) / z_m));
	else
		tmp = Float64(Float64(x / z_m) * Float64(2.0 / y));
	end
	return Float64(z_s * tmp)
end
z_m = abs(z);
z_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, x, y, z_m, t)
	tmp = 0.0;
	if (t <= -3.65e+241)
		tmp = (x / z_m) * (-2.0 / t);
	elseif ((t <= -2.05e-37) || ~((t <= 6.8e+64)))
		tmp = -2.0 * ((x / t) / z_m);
	else
		tmp = (x / z_m) * (2.0 / y);
	end
	tmp_2 = z_s * tmp;
end
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_, y_, z$95$m_, t_] := N[(z$95$s * If[LessEqual[t, -3.65e+241], N[(N[(x / z$95$m), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -2.05e-37], N[Not[LessEqual[t, 6.8e+64]], $MachinePrecision]], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)

\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.65 \cdot 10^{+241}:\\
\;\;\;\;\frac{x}{z_m} \cdot \frac{-2}{t}\\

\mathbf{elif}\;t \leq -2.05 \cdot 10^{-37} \lor \neg \left(t \leq 6.8 \cdot 10^{+64}\right):\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\

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


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

    1. Initial program 71.8%

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

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

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

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

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

    if -3.6500000000000001e241 < t < -2.0499999999999999e-37 or 6.8000000000000003e64 < t

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

    if -2.0499999999999999e-37 < t < 6.8000000000000003e64

    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.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.65 \cdot 10^{+241}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{-2}{t}\\ \mathbf{elif}\;t \leq -2.05 \cdot 10^{-37} \lor \neg \left(t \leq 6.8 \cdot 10^{+64}\right):\\ \;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \end{array} \]

Alternative 5: 73.9% accurate, 0.8× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ z_s = \mathsf{copysign}\left(1, z\right) \\ z_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -3.65 \cdot 10^{+241}:\\ \;\;\;\;\frac{-2}{t \cdot \frac{z_m}{x}}\\ \mathbf{elif}\;t \leq -3.3 \cdot 10^{-37} \lor \neg \left(t \leq 1.1 \cdot 10^{+65}\right):\\ \;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z_m} \cdot \frac{2}{y}\\ \end{array} \end{array} \]
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
 :precision binary64
 (*
  z_s
  (if (<= t -3.65e+241)
    (/ -2.0 (* t (/ z_m x)))
    (if (or (<= t -3.3e-37) (not (<= t 1.1e+65)))
      (* -2.0 (/ (/ x t) z_m))
      (* (/ x z_m) (/ 2.0 y))))))
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
	double tmp;
	if (t <= -3.65e+241) {
		tmp = -2.0 / (t * (z_m / x));
	} else if ((t <= -3.3e-37) || !(t <= 1.1e+65)) {
		tmp = -2.0 * ((x / t) / z_m);
	} else {
		tmp = (x / z_m) * (2.0 / y);
	}
	return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z_m
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-3.65d+241)) then
        tmp = (-2.0d0) / (t * (z_m / x))
    else if ((t <= (-3.3d-37)) .or. (.not. (t <= 1.1d+65))) then
        tmp = (-2.0d0) * ((x / t) / z_m)
    else
        tmp = (x / z_m) * (2.0d0 / y)
    end if
    code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
	double tmp;
	if (t <= -3.65e+241) {
		tmp = -2.0 / (t * (z_m / x));
	} else if ((t <= -3.3e-37) || !(t <= 1.1e+65)) {
		tmp = -2.0 * ((x / t) / z_m);
	} else {
		tmp = (x / z_m) * (2.0 / y);
	}
	return z_s * tmp;
}
z_m = math.fabs(z)
z_s = math.copysign(1.0, z)
def code(z_s, x, y, z_m, t):
	tmp = 0
	if t <= -3.65e+241:
		tmp = -2.0 / (t * (z_m / x))
	elif (t <= -3.3e-37) or not (t <= 1.1e+65):
		tmp = -2.0 * ((x / t) / z_m)
	else:
		tmp = (x / z_m) * (2.0 / y)
	return z_s * tmp
z_m = abs(z)
z_s = copysign(1.0, z)
function code(z_s, x, y, z_m, t)
	tmp = 0.0
	if (t <= -3.65e+241)
		tmp = Float64(-2.0 / Float64(t * Float64(z_m / x)));
	elseif ((t <= -3.3e-37) || !(t <= 1.1e+65))
		tmp = Float64(-2.0 * Float64(Float64(x / t) / z_m));
	else
		tmp = Float64(Float64(x / z_m) * Float64(2.0 / y));
	end
	return Float64(z_s * tmp)
end
z_m = abs(z);
z_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, x, y, z_m, t)
	tmp = 0.0;
	if (t <= -3.65e+241)
		tmp = -2.0 / (t * (z_m / x));
	elseif ((t <= -3.3e-37) || ~((t <= 1.1e+65)))
		tmp = -2.0 * ((x / t) / z_m);
	else
		tmp = (x / z_m) * (2.0 / y);
	end
	tmp_2 = z_s * tmp;
end
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_, y_, z$95$m_, t_] := N[(z$95$s * If[LessEqual[t, -3.65e+241], N[(-2.0 / N[(t * N[(z$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -3.3e-37], N[Not[LessEqual[t, 1.1e+65]], $MachinePrecision]], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)

\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.65 \cdot 10^{+241}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z_m}{x}}\\

\mathbf{elif}\;t \leq -3.3 \cdot 10^{-37} \lor \neg \left(t \leq 1.1 \cdot 10^{+65}\right):\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\

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


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

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.6500000000000001e241 < t < -3.29999999999999982e-37 or 1.0999999999999999e65 < t

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

    if -3.29999999999999982e-37 < t < 1.0999999999999999e65

    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.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.65 \cdot 10^{+241}:\\ \;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\ \mathbf{elif}\;t \leq -3.3 \cdot 10^{-37} \lor \neg \left(t \leq 1.1 \cdot 10^{+65}\right):\\ \;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \end{array} \]

Alternative 6: 74.1% accurate, 0.8× speedup?

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

\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.65 \cdot 10^{+241}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z_m}{x}}\\

\mathbf{elif}\;t \leq -3.15 \cdot 10^{-37}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\

\mathbf{elif}\;t \leq 6.2 \cdot 10^{+49}:\\
\;\;\;\;\frac{x}{z_m} \cdot \frac{2}{y}\\

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


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

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.6500000000000001e241 < t < -3.15000000000000011e-37

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

    if -3.15000000000000011e-37 < t < 6.19999999999999985e49

    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.4%

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

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

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

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

    if 6.19999999999999985e49 < t

    1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.65 \cdot 10^{+241}:\\ \;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\ \mathbf{elif}\;t \leq -3.15 \cdot 10^{-37}:\\ \;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z}\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{+49}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x \cdot -2}{t}}{z}\\ \end{array} \]

Alternative 7: 74.5% accurate, 1.0× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ z_s = \mathsf{copysign}\left(1, z\right) \\ z_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -3.2 \cdot 10^{-37} \lor \neg \left(t \leq 7 \cdot 10^{-23}\right):\\ \;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z_m}\\ \end{array} \end{array} \]
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
 :precision binary64
 (*
  z_s
  (if (or (<= t -3.2e-37) (not (<= t 7e-23)))
    (* -2.0 (/ (/ x t) z_m))
    (* x (/ (/ 2.0 y) z_m)))))
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
	double tmp;
	if ((t <= -3.2e-37) || !(t <= 7e-23)) {
		tmp = -2.0 * ((x / t) / z_m);
	} else {
		tmp = x * ((2.0 / y) / z_m);
	}
	return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z_m
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((t <= (-3.2d-37)) .or. (.not. (t <= 7d-23))) then
        tmp = (-2.0d0) * ((x / t) / z_m)
    else
        tmp = x * ((2.0d0 / y) / z_m)
    end if
    code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
	double tmp;
	if ((t <= -3.2e-37) || !(t <= 7e-23)) {
		tmp = -2.0 * ((x / t) / z_m);
	} else {
		tmp = x * ((2.0 / y) / z_m);
	}
	return z_s * tmp;
}
z_m = math.fabs(z)
z_s = math.copysign(1.0, z)
def code(z_s, x, y, z_m, t):
	tmp = 0
	if (t <= -3.2e-37) or not (t <= 7e-23):
		tmp = -2.0 * ((x / t) / z_m)
	else:
		tmp = x * ((2.0 / y) / z_m)
	return z_s * tmp
z_m = abs(z)
z_s = copysign(1.0, z)
function code(z_s, x, y, z_m, t)
	tmp = 0.0
	if ((t <= -3.2e-37) || !(t <= 7e-23))
		tmp = Float64(-2.0 * Float64(Float64(x / t) / z_m));
	else
		tmp = Float64(x * Float64(Float64(2.0 / y) / z_m));
	end
	return Float64(z_s * tmp)
end
z_m = abs(z);
z_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, x, y, z_m, t)
	tmp = 0.0;
	if ((t <= -3.2e-37) || ~((t <= 7e-23)))
		tmp = -2.0 * ((x / t) / z_m);
	else
		tmp = x * ((2.0 / y) / z_m);
	end
	tmp_2 = z_s * tmp;
end
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_, y_, z$95$m_, t_] := N[(z$95$s * If[Or[LessEqual[t, -3.2e-37], N[Not[LessEqual[t, 7e-23]], $MachinePrecision]], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)

\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{-37} \lor \neg \left(t \leq 7 \cdot 10^{-23}\right):\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.1999999999999999e-37 or 6.99999999999999987e-23 < t

    1. Initial program 87.9%

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

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

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

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

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

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

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

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

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

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

    if -3.1999999999999999e-37 < t < 6.99999999999999987e-23

    1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 74.4% accurate, 1.0× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ z_s = \mathsf{copysign}\left(1, z\right) \\ z_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -1.9 \cdot 10^{-37} \lor \neg \left(t \leq 4.3 \cdot 10^{-23}\right):\\ \;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z_m} \cdot \frac{x}{y}\\ \end{array} \end{array} \]
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
 :precision binary64
 (*
  z_s
  (if (or (<= t -1.9e-37) (not (<= t 4.3e-23)))
    (* -2.0 (/ (/ x t) z_m))
    (* (/ 2.0 z_m) (/ x y)))))
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
	double tmp;
	if ((t <= -1.9e-37) || !(t <= 4.3e-23)) {
		tmp = -2.0 * ((x / t) / z_m);
	} else {
		tmp = (2.0 / z_m) * (x / y);
	}
	return z_s * tmp;
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z_m
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((t <= (-1.9d-37)) .or. (.not. (t <= 4.3d-23))) then
        tmp = (-2.0d0) * ((x / t) / z_m)
    else
        tmp = (2.0d0 / z_m) * (x / y)
    end if
    code = z_s * tmp
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
	double tmp;
	if ((t <= -1.9e-37) || !(t <= 4.3e-23)) {
		tmp = -2.0 * ((x / t) / z_m);
	} else {
		tmp = (2.0 / z_m) * (x / y);
	}
	return z_s * tmp;
}
z_m = math.fabs(z)
z_s = math.copysign(1.0, z)
def code(z_s, x, y, z_m, t):
	tmp = 0
	if (t <= -1.9e-37) or not (t <= 4.3e-23):
		tmp = -2.0 * ((x / t) / z_m)
	else:
		tmp = (2.0 / z_m) * (x / y)
	return z_s * tmp
z_m = abs(z)
z_s = copysign(1.0, z)
function code(z_s, x, y, z_m, t)
	tmp = 0.0
	if ((t <= -1.9e-37) || !(t <= 4.3e-23))
		tmp = Float64(-2.0 * Float64(Float64(x / t) / z_m));
	else
		tmp = Float64(Float64(2.0 / z_m) * Float64(x / y));
	end
	return Float64(z_s * tmp)
end
z_m = abs(z);
z_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, x, y, z_m, t)
	tmp = 0.0;
	if ((t <= -1.9e-37) || ~((t <= 4.3e-23)))
		tmp = -2.0 * ((x / t) / z_m);
	else
		tmp = (2.0 / z_m) * (x / y);
	end
	tmp_2 = z_s * tmp;
end
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_, y_, z$95$m_, t_] := N[(z$95$s * If[Or[LessEqual[t, -1.9e-37], N[Not[LessEqual[t, 4.3e-23]], $MachinePrecision]], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)

\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{-37} \lor \neg \left(t \leq 4.3 \cdot 10^{-23}\right):\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z_m}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.9000000000000002e-37 or 4.30000000000000002e-23 < t

    1. Initial program 87.9%

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

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

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

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

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

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

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

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

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

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

    if -1.9000000000000002e-37 < t < 4.30000000000000002e-23

    1. Initial program 87.7%

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

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

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

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

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

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

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

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

Alternative 9: 92.4% accurate, 1.0× speedup?

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

\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+252}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z_m}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.4e252

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.4e252 < t

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

Alternative 10: 97.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{2}{y - t}\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 7.5 \cdot 10^{-51}:\\
\;\;\;\;x \cdot \frac{t_1}{z_m}\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \frac{x}{z_m}\\


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

    1. Initial program 90.1%

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

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

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

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

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

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

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

    if 7.49999999999999976e-51 < z

    1. Initial program 83.3%

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

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

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

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

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

Alternative 11: 97.0% accurate, 1.0× speedup?

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

\\
z_s \cdot \begin{array}{l}
\mathbf{if}\;z_m \leq 2.3 \cdot 10^{-37}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y - t}}{z_m}\\

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

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

    if 2.3e-37 < z

    1. Initial program 82.9%

      \[\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. Step-by-step derivation
      1. *-commutative84.2%

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

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

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

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

Alternative 12: 53.7% accurate, 1.6× speedup?

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

\\
z_s \cdot \left(-2 \cdot \frac{x}{z_m \cdot t}\right)
\end{array}
Derivation
  1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

Alternative 13: 53.9% accurate, 1.6× speedup?

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

\\
z_s \cdot \left(-2 \cdot \frac{\frac{x}{t}}{z_m}\right)
\end{array}
Derivation
  1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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