Linear.Projection:infinitePerspective from linear-1.19.1.3, A

Percentage Accurate: 89.7% → 98.7%
Time: 11.7s
Alternatives: 12
Speedup: 1.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 89.7% 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: 98.7% accurate, 0.2× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ z_s = \mathsf{copysign}\left(1, z\right) \\ \begin{array}{l} t_1 := \frac{x \cdot 2}{z\_m \cdot \left(y - t\right)}\\ t_2 := \frac{x \cdot 2}{y \cdot z\_m - z\_m \cdot t}\\ z\_s \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq -1 \cdot 10^{-294}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{-293}:\\ \;\;\;\;\frac{\frac{x}{z\_m}}{\left(y - t\right) \cdot 0.5}\\ \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+212}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{2}{y - t}}{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 (/ (* x 2.0) (* z_m (- y t))))
        (t_2 (/ (* x 2.0) (- (* y z_m) (* z_m t)))))
   (*
    z_s
    (if (<= t_2 -1e-294)
      t_1
      (if (<= t_2 1e-293)
        (/ (/ x z_m) (* (- y t) 0.5))
        (if (<= t_2 4e+212) t_1 (/ (* 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 t_1 = (x * 2.0) / (z_m * (y - t));
	double t_2 = (x * 2.0) / ((y * z_m) - (z_m * t));
	double tmp;
	if (t_2 <= -1e-294) {
		tmp = t_1;
	} else if (t_2 <= 1e-293) {
		tmp = (x / z_m) / ((y - t) * 0.5);
	} else if (t_2 <= 4e+212) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (x * 2.0d0) / (z_m * (y - t))
    t_2 = (x * 2.0d0) / ((y * z_m) - (z_m * t))
    if (t_2 <= (-1d-294)) then
        tmp = t_1
    else if (t_2 <= 1d-293) then
        tmp = (x / z_m) / ((y - t) * 0.5d0)
    else if (t_2 <= 4d+212) then
        tmp = t_1
    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 t_1 = (x * 2.0) / (z_m * (y - t));
	double t_2 = (x * 2.0) / ((y * z_m) - (z_m * t));
	double tmp;
	if (t_2 <= -1e-294) {
		tmp = t_1;
	} else if (t_2 <= 1e-293) {
		tmp = (x / z_m) / ((y - t) * 0.5);
	} else if (t_2 <= 4e+212) {
		tmp = t_1;
	} 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):
	t_1 = (x * 2.0) / (z_m * (y - t))
	t_2 = (x * 2.0) / ((y * z_m) - (z_m * t))
	tmp = 0
	if t_2 <= -1e-294:
		tmp = t_1
	elif t_2 <= 1e-293:
		tmp = (x / z_m) / ((y - t) * 0.5)
	elif t_2 <= 4e+212:
		tmp = t_1
	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)
	t_1 = Float64(Float64(x * 2.0) / Float64(z_m * Float64(y - t)))
	t_2 = Float64(Float64(x * 2.0) / Float64(Float64(y * z_m) - Float64(z_m * t)))
	tmp = 0.0
	if (t_2 <= -1e-294)
		tmp = t_1;
	elseif (t_2 <= 1e-293)
		tmp = Float64(Float64(x / z_m) / Float64(Float64(y - t) * 0.5));
	elseif (t_2 <= 4e+212)
		tmp = t_1;
	else
		tmp = Float64(Float64(x * 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)
	t_1 = (x * 2.0) / (z_m * (y - t));
	t_2 = (x * 2.0) / ((y * z_m) - (z_m * t));
	tmp = 0.0;
	if (t_2 <= -1e-294)
		tmp = t_1;
	elseif (t_2 <= 1e-293)
		tmp = (x / z_m) / ((y - t) * 0.5);
	elseif (t_2 <= 4e+212)
		tmp = t_1;
	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_] := Block[{t$95$1 = N[(N[(x * 2.0), $MachinePrecision] / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z$95$m), $MachinePrecision] - N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * If[LessEqual[t$95$2, -1e-294], t$95$1, If[LessEqual[t$95$2, 1e-293], N[(N[(x / z$95$m), $MachinePrecision] / N[(N[(y - t), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+212], t$95$1, N[(N[(x * N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)

\\
\begin{array}{l}
t_1 := \frac{x \cdot 2}{z\_m \cdot \left(y - t\right)}\\
t_2 := \frac{x \cdot 2}{y \cdot z\_m - z\_m \cdot t}\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-294}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{-293}:\\
\;\;\;\;\frac{\frac{x}{z\_m}}{\left(y - t\right) \cdot 0.5}\\

\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+212}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) < -1.00000000000000002e-294 or 1.0000000000000001e-293 < (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) < 3.9999999999999996e212

    1. Initial program 97.1%

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

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

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

    if -1.00000000000000002e-294 < (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) < 1.0000000000000001e-293

    1. Initial program 80.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{\frac{y - t}{2}}} \]
      5. div-inv99.9%

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

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

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

    if 3.9999999999999996e212 < (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z)))

    1. Initial program 58.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x \cdot 2}{y \cdot z - z \cdot t} \leq -1 \cdot 10^{-294}:\\ \;\;\;\;\frac{x \cdot 2}{z \cdot \left(y - t\right)}\\ \mathbf{elif}\;\frac{x \cdot 2}{y \cdot z - z \cdot t} \leq 10^{-293}:\\ \;\;\;\;\frac{\frac{x}{z}}{\left(y - t\right) \cdot 0.5}\\ \mathbf{elif}\;\frac{x \cdot 2}{y \cdot z - z \cdot t} \leq 4 \cdot 10^{+212}:\\ \;\;\;\;\frac{x \cdot 2}{z \cdot \left(y - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{2}{y - t}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 73.8% accurate, 0.5× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ z_s = \mathsf{copysign}\left(1, z\right) \\ \begin{array}{l} t_1 := x \cdot \frac{\frac{2}{y}}{z\_m}\\ z\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -3.8 \cdot 10^{-9}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 4.4 \cdot 10^{-283}:\\ \;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z\_m}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-85}:\\ \;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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 (* x (/ (/ 2.0 y) z_m))))
   (*
    z_s
    (if (<= y -3.8e-9)
      t_1
      (if (<= y 4.4e-283)
        (* -2.0 (/ (/ x t) z_m))
        (if (<= y 7.2e-85) (* -2.0 (/ x (* z_m t))) t_1))))))
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 = x * ((2.0 / y) / z_m);
	double tmp;
	if (y <= -3.8e-9) {
		tmp = t_1;
	} else if (y <= 4.4e-283) {
		tmp = -2.0 * ((x / t) / z_m);
	} else if (y <= 7.2e-85) {
		tmp = -2.0 * (x / (z_m * t));
	} else {
		tmp = t_1;
	}
	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 = x * ((2.0d0 / y) / z_m)
    if (y <= (-3.8d-9)) then
        tmp = t_1
    else if (y <= 4.4d-283) then
        tmp = (-2.0d0) * ((x / t) / z_m)
    else if (y <= 7.2d-85) then
        tmp = (-2.0d0) * (x / (z_m * t))
    else
        tmp = t_1
    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 = x * ((2.0 / y) / z_m);
	double tmp;
	if (y <= -3.8e-9) {
		tmp = t_1;
	} else if (y <= 4.4e-283) {
		tmp = -2.0 * ((x / t) / z_m);
	} else if (y <= 7.2e-85) {
		tmp = -2.0 * (x / (z_m * t));
	} else {
		tmp = t_1;
	}
	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 = x * ((2.0 / y) / z_m)
	tmp = 0
	if y <= -3.8e-9:
		tmp = t_1
	elif y <= 4.4e-283:
		tmp = -2.0 * ((x / t) / z_m)
	elif y <= 7.2e-85:
		tmp = -2.0 * (x / (z_m * t))
	else:
		tmp = t_1
	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(x * Float64(Float64(2.0 / y) / z_m))
	tmp = 0.0
	if (y <= -3.8e-9)
		tmp = t_1;
	elseif (y <= 4.4e-283)
		tmp = Float64(-2.0 * Float64(Float64(x / t) / z_m));
	elseif (y <= 7.2e-85)
		tmp = Float64(-2.0 * Float64(x / Float64(z_m * t)));
	else
		tmp = t_1;
	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 = x * ((2.0 / y) / z_m);
	tmp = 0.0;
	if (y <= -3.8e-9)
		tmp = t_1;
	elseif (y <= 4.4e-283)
		tmp = -2.0 * ((x / t) / z_m);
	elseif (y <= 7.2e-85)
		tmp = -2.0 * (x / (z_m * t));
	else
		tmp = t_1;
	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[(x * N[(N[(2.0 / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * If[LessEqual[y, -3.8e-9], t$95$1, If[LessEqual[y, 4.4e-283], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e-85], N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)

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

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

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.80000000000000011e-9 or 7.1999999999999996e-85 < y

    1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

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

    if -3.80000000000000011e-9 < y < 4.3999999999999996e-283

    1. Initial program 85.2%

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

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

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

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

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

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

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

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

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

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

    if 4.3999999999999996e-283 < y < 7.1999999999999996e-85

    1. Initial program 97.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.8 \cdot 10^{-9}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \mathbf{elif}\;y \leq 4.4 \cdot 10^{-283}:\\ \;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-85}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 73.9% accurate, 0.5× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ z_s = \mathsf{copysign}\left(1, z\right) \\ \begin{array}{l} t_1 := x \cdot \frac{\frac{2}{y}}{z\_m}\\ z\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -1.26 \cdot 10^{-8}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -5.8 \cdot 10^{-205}:\\ \;\;\;\;\frac{x}{z\_m} \cdot \frac{-2}{t}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-85}:\\ \;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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 (* x (/ (/ 2.0 y) z_m))))
   (*
    z_s
    (if (<= y -1.26e-8)
      t_1
      (if (<= y -5.8e-205)
        (* (/ x z_m) (/ -2.0 t))
        (if (<= y 7.2e-85) (* -2.0 (/ x (* z_m t))) t_1))))))
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 = x * ((2.0 / y) / z_m);
	double tmp;
	if (y <= -1.26e-8) {
		tmp = t_1;
	} else if (y <= -5.8e-205) {
		tmp = (x / z_m) * (-2.0 / t);
	} else if (y <= 7.2e-85) {
		tmp = -2.0 * (x / (z_m * t));
	} else {
		tmp = t_1;
	}
	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 = x * ((2.0d0 / y) / z_m)
    if (y <= (-1.26d-8)) then
        tmp = t_1
    else if (y <= (-5.8d-205)) then
        tmp = (x / z_m) * ((-2.0d0) / t)
    else if (y <= 7.2d-85) then
        tmp = (-2.0d0) * (x / (z_m * t))
    else
        tmp = t_1
    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 = x * ((2.0 / y) / z_m);
	double tmp;
	if (y <= -1.26e-8) {
		tmp = t_1;
	} else if (y <= -5.8e-205) {
		tmp = (x / z_m) * (-2.0 / t);
	} else if (y <= 7.2e-85) {
		tmp = -2.0 * (x / (z_m * t));
	} else {
		tmp = t_1;
	}
	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 = x * ((2.0 / y) / z_m)
	tmp = 0
	if y <= -1.26e-8:
		tmp = t_1
	elif y <= -5.8e-205:
		tmp = (x / z_m) * (-2.0 / t)
	elif y <= 7.2e-85:
		tmp = -2.0 * (x / (z_m * t))
	else:
		tmp = t_1
	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(x * Float64(Float64(2.0 / y) / z_m))
	tmp = 0.0
	if (y <= -1.26e-8)
		tmp = t_1;
	elseif (y <= -5.8e-205)
		tmp = Float64(Float64(x / z_m) * Float64(-2.0 / t));
	elseif (y <= 7.2e-85)
		tmp = Float64(-2.0 * Float64(x / Float64(z_m * t)));
	else
		tmp = t_1;
	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 = x * ((2.0 / y) / z_m);
	tmp = 0.0;
	if (y <= -1.26e-8)
		tmp = t_1;
	elseif (y <= -5.8e-205)
		tmp = (x / z_m) * (-2.0 / t);
	elseif (y <= 7.2e-85)
		tmp = -2.0 * (x / (z_m * t));
	else
		tmp = t_1;
	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[(x * N[(N[(2.0 / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * If[LessEqual[y, -1.26e-8], t$95$1, If[LessEqual[y, -5.8e-205], N[(N[(x / z$95$m), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e-85], N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]), $MachinePrecision]]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)

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

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

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.26e-8 or 7.1999999999999996e-85 < y

    1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

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

    if -1.26e-8 < y < -5.80000000000000036e-205

    1. Initial program 80.7%

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

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

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

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

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

    if -5.80000000000000036e-205 < y < 7.1999999999999996e-85

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.26 \cdot 10^{-8}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \mathbf{elif}\;y \leq -5.8 \cdot 10^{-205}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{-2}{t}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-85}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 73.7% accurate, 0.5× 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}\;y \leq -4.2 \cdot 10^{-12}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z\_m}\\ \mathbf{elif}\;y \leq -1.5 \cdot 10^{-203}:\\ \;\;\;\;\frac{x}{z\_m} \cdot \frac{-2}{t}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-117}:\\ \;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\ \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 (<= y -4.2e-12)
    (* x (/ (/ 2.0 y) z_m))
    (if (<= y -1.5e-203)
      (* (/ x z_m) (/ -2.0 t))
      (if (<= y 1.05e-117)
        (* -2.0 (/ x (* z_m t)))
        (* (/ 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 (y <= -4.2e-12) {
		tmp = x * ((2.0 / y) / z_m);
	} else if (y <= -1.5e-203) {
		tmp = (x / z_m) * (-2.0 / t);
	} else if (y <= 1.05e-117) {
		tmp = -2.0 * (x / (z_m * t));
	} 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 (y <= (-4.2d-12)) then
        tmp = x * ((2.0d0 / y) / z_m)
    else if (y <= (-1.5d-203)) then
        tmp = (x / z_m) * ((-2.0d0) / t)
    else if (y <= 1.05d-117) then
        tmp = (-2.0d0) * (x / (z_m * t))
    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 (y <= -4.2e-12) {
		tmp = x * ((2.0 / y) / z_m);
	} else if (y <= -1.5e-203) {
		tmp = (x / z_m) * (-2.0 / t);
	} else if (y <= 1.05e-117) {
		tmp = -2.0 * (x / (z_m * t));
	} 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 y <= -4.2e-12:
		tmp = x * ((2.0 / y) / z_m)
	elif y <= -1.5e-203:
		tmp = (x / z_m) * (-2.0 / t)
	elif y <= 1.05e-117:
		tmp = -2.0 * (x / (z_m * t))
	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 (y <= -4.2e-12)
		tmp = Float64(x * Float64(Float64(2.0 / y) / z_m));
	elseif (y <= -1.5e-203)
		tmp = Float64(Float64(x / z_m) * Float64(-2.0 / t));
	elseif (y <= 1.05e-117)
		tmp = Float64(-2.0 * Float64(x / Float64(z_m * t)));
	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 (y <= -4.2e-12)
		tmp = x * ((2.0 / y) / z_m);
	elseif (y <= -1.5e-203)
		tmp = (x / z_m) * (-2.0 / t);
	elseif (y <= 1.05e-117)
		tmp = -2.0 * (x / (z_m * t));
	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[y, -4.2e-12], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.5e-203], N[(N[(x / z$95$m), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e-117], N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $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}\;y \leq -4.2 \cdot 10^{-12}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z\_m}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -4.19999999999999988e-12

    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--90.0%

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

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

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

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

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

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

    if -4.19999999999999988e-12 < y < -1.5000000000000001e-203

    1. Initial program 80.7%

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

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

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

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

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

    if -1.5000000000000001e-203 < y < 1.05e-117

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

    if 1.05e-117 < y

    1. Initial program 79.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{-12}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \mathbf{elif}\;y \leq -1.5 \cdot 10^{-203}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{-2}{t}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-117}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 73.7% accurate, 0.5× 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}\;y \leq -1.35 \cdot 10^{-8}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z\_m}\\ \mathbf{elif}\;y \leq -3.7 \cdot 10^{-208}:\\ \;\;\;\;\frac{\frac{x}{z\_m}}{t \cdot -0.5}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-116}:\\ \;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\ \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 (<= y -1.35e-8)
    (* x (/ (/ 2.0 y) z_m))
    (if (<= y -3.7e-208)
      (/ (/ x z_m) (* t -0.5))
      (if (<= y 1.1e-116) (* -2.0 (/ x (* z_m t))) (* (/ 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 (y <= -1.35e-8) {
		tmp = x * ((2.0 / y) / z_m);
	} else if (y <= -3.7e-208) {
		tmp = (x / z_m) / (t * -0.5);
	} else if (y <= 1.1e-116) {
		tmp = -2.0 * (x / (z_m * t));
	} 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 (y <= (-1.35d-8)) then
        tmp = x * ((2.0d0 / y) / z_m)
    else if (y <= (-3.7d-208)) then
        tmp = (x / z_m) / (t * (-0.5d0))
    else if (y <= 1.1d-116) then
        tmp = (-2.0d0) * (x / (z_m * t))
    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 (y <= -1.35e-8) {
		tmp = x * ((2.0 / y) / z_m);
	} else if (y <= -3.7e-208) {
		tmp = (x / z_m) / (t * -0.5);
	} else if (y <= 1.1e-116) {
		tmp = -2.0 * (x / (z_m * t));
	} 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 y <= -1.35e-8:
		tmp = x * ((2.0 / y) / z_m)
	elif y <= -3.7e-208:
		tmp = (x / z_m) / (t * -0.5)
	elif y <= 1.1e-116:
		tmp = -2.0 * (x / (z_m * t))
	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 (y <= -1.35e-8)
		tmp = Float64(x * Float64(Float64(2.0 / y) / z_m));
	elseif (y <= -3.7e-208)
		tmp = Float64(Float64(x / z_m) / Float64(t * -0.5));
	elseif (y <= 1.1e-116)
		tmp = Float64(-2.0 * Float64(x / Float64(z_m * t)));
	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 (y <= -1.35e-8)
		tmp = x * ((2.0 / y) / z_m);
	elseif (y <= -3.7e-208)
		tmp = (x / z_m) / (t * -0.5);
	elseif (y <= 1.1e-116)
		tmp = -2.0 * (x / (z_m * t));
	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[y, -1.35e-8], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.7e-208], N[(N[(x / z$95$m), $MachinePrecision] / N[(t * -0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e-116], N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $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}\;y \leq -1.35 \cdot 10^{-8}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z\_m}\\

\mathbf{elif}\;y \leq -3.7 \cdot 10^{-208}:\\
\;\;\;\;\frac{\frac{x}{z\_m}}{t \cdot -0.5}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.35000000000000001e-8

    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--90.0%

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

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

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

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

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

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

    if -1.35000000000000001e-8 < y < -3.7000000000000002e-208

    1. Initial program 80.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.7000000000000002e-208 < y < 1.10000000000000005e-116

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

    if 1.10000000000000005e-116 < y

    1. Initial program 79.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{-8}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \mathbf{elif}\;y \leq -3.7 \cdot 10^{-208}:\\ \;\;\;\;\frac{\frac{x}{z}}{t \cdot -0.5}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-116}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 73.6% accurate, 0.5× 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}\;y \leq -1.25 \cdot 10^{-10}:\\ \;\;\;\;\frac{\frac{x}{z\_m \cdot 0.5}}{y}\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{-207}:\\ \;\;\;\;\frac{\frac{x}{z\_m}}{t \cdot -0.5}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-116}:\\ \;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\ \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 (<= y -1.25e-10)
    (/ (/ x (* z_m 0.5)) y)
    (if (<= y -5.5e-207)
      (/ (/ x z_m) (* t -0.5))
      (if (<= y 1.1e-116) (* -2.0 (/ x (* z_m t))) (* (/ 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 (y <= -1.25e-10) {
		tmp = (x / (z_m * 0.5)) / y;
	} else if (y <= -5.5e-207) {
		tmp = (x / z_m) / (t * -0.5);
	} else if (y <= 1.1e-116) {
		tmp = -2.0 * (x / (z_m * t));
	} 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 (y <= (-1.25d-10)) then
        tmp = (x / (z_m * 0.5d0)) / y
    else if (y <= (-5.5d-207)) then
        tmp = (x / z_m) / (t * (-0.5d0))
    else if (y <= 1.1d-116) then
        tmp = (-2.0d0) * (x / (z_m * t))
    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 (y <= -1.25e-10) {
		tmp = (x / (z_m * 0.5)) / y;
	} else if (y <= -5.5e-207) {
		tmp = (x / z_m) / (t * -0.5);
	} else if (y <= 1.1e-116) {
		tmp = -2.0 * (x / (z_m * t));
	} 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 y <= -1.25e-10:
		tmp = (x / (z_m * 0.5)) / y
	elif y <= -5.5e-207:
		tmp = (x / z_m) / (t * -0.5)
	elif y <= 1.1e-116:
		tmp = -2.0 * (x / (z_m * t))
	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 (y <= -1.25e-10)
		tmp = Float64(Float64(x / Float64(z_m * 0.5)) / y);
	elseif (y <= -5.5e-207)
		tmp = Float64(Float64(x / z_m) / Float64(t * -0.5));
	elseif (y <= 1.1e-116)
		tmp = Float64(-2.0 * Float64(x / Float64(z_m * t)));
	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 (y <= -1.25e-10)
		tmp = (x / (z_m * 0.5)) / y;
	elseif (y <= -5.5e-207)
		tmp = (x / z_m) / (t * -0.5);
	elseif (y <= 1.1e-116)
		tmp = -2.0 * (x / (z_m * t));
	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[y, -1.25e-10], N[(N[(x / N[(z$95$m * 0.5), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, -5.5e-207], N[(N[(x / z$95$m), $MachinePrecision] / N[(t * -0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e-116], N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $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}\;y \leq -1.25 \cdot 10^{-10}:\\
\;\;\;\;\frac{\frac{x}{z\_m \cdot 0.5}}{y}\\

\mathbf{elif}\;y \leq -5.5 \cdot 10^{-207}:\\
\;\;\;\;\frac{\frac{x}{z\_m}}{t \cdot -0.5}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.25000000000000008e-10

    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--90.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{\color{blue}{z \cdot \frac{1}{2}}}}{y} \]
      9. metadata-eval74.4%

        \[\leadsto \frac{\frac{x}{z \cdot \color{blue}{0.5}}}{y} \]
    9. Applied egg-rr74.4%

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

    if -1.25000000000000008e-10 < y < -5.4999999999999997e-207

    1. Initial program 80.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.4999999999999997e-207 < y < 1.10000000000000005e-116

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

    if 1.10000000000000005e-116 < y

    1. Initial program 79.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{-10}:\\ \;\;\;\;\frac{\frac{x}{z \cdot 0.5}}{y}\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{-207}:\\ \;\;\;\;\frac{\frac{x}{z}}{t \cdot -0.5}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-116}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 94.4% accurate, 0.7× 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}\;x \cdot 2 \leq 2 \cdot 10^{+80}:\\ \;\;\;\;\frac{x \cdot 2}{z\_m \cdot \left(y - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \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 (<= (* x 2.0) 2e+80)
    (/ (* x 2.0) (* z_m (- y t)))
    (/ (* 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 ((x * 2.0) <= 2e+80) {
		tmp = (x * 2.0) / (z_m * (y - t));
	} 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 ((x * 2.0d0) <= 2d+80) then
        tmp = (x * 2.0d0) / (z_m * (y - t))
    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 ((x * 2.0) <= 2e+80) {
		tmp = (x * 2.0) / (z_m * (y - t));
	} 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 (x * 2.0) <= 2e+80:
		tmp = (x * 2.0) / (z_m * (y - t))
	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 (Float64(x * 2.0) <= 2e+80)
		tmp = Float64(Float64(x * 2.0) / Float64(z_m * Float64(y - t)));
	else
		tmp = Float64(Float64(x * 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 ((x * 2.0) <= 2e+80)
		tmp = (x * 2.0) / (z_m * (y - t));
	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[N[(x * 2.0), $MachinePrecision], 2e+80], N[(N[(x * 2.0), $MachinePrecision] / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision]), $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}\;x \cdot 2 \leq 2 \cdot 10^{+80}:\\
\;\;\;\;\frac{x \cdot 2}{z\_m \cdot \left(y - t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x 2) < 2e80

    1. Initial program 89.3%

      \[\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)}} \]
    4. Add Preprocessing

    if 2e80 < (*.f64 x 2)

    1. Initial program 78.1%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 97.1% accurate, 0.8× 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 5 \cdot 10^{-6}:\\ \;\;\;\;x \cdot \frac{t\_1}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z\_m} \cdot t\_1\\ \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 5e-6) (* x (/ t_1 z_m)) (* (/ x z_m) t_1)))))
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 <= 5e-6) {
		tmp = x * (t_1 / z_m);
	} else {
		tmp = (x / z_m) * t_1;
	}
	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 <= 5d-6) then
        tmp = x * (t_1 / z_m)
    else
        tmp = (x / z_m) * t_1
    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 <= 5e-6) {
		tmp = x * (t_1 / z_m);
	} else {
		tmp = (x / z_m) * t_1;
	}
	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 <= 5e-6:
		tmp = x * (t_1 / z_m)
	else:
		tmp = (x / z_m) * t_1
	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 <= 5e-6)
		tmp = Float64(x * Float64(t_1 / z_m));
	else
		tmp = Float64(Float64(x / z_m) * t_1);
	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 <= 5e-6)
		tmp = x * (t_1 / z_m);
	else
		tmp = (x / z_m) * t_1;
	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, 5e-6], N[(x * N[(t$95$1 / z$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(x / z$95$m), $MachinePrecision] * t$95$1), $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 5 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \frac{t\_1}{z\_m}\\

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


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

    1. Initial program 90.9%

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

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

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

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

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

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

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

    if 5.00000000000000041e-6 < z

    1. Initial program 74.5%

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

        \[\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. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification93.2%

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

Alternative 9: 97.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}\;z\_m \leq 52000:\\ \;\;\;\;\frac{x \cdot 2}{z\_m \cdot \left(y - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z\_m} \cdot \frac{2}{y - 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 (<= z_m 52000.0)
    (/ (* x 2.0) (* z_m (- y t)))
    (* (/ x z_m) (/ 2.0 (- y 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 (z_m <= 52000.0) {
		tmp = (x * 2.0) / (z_m * (y - t));
	} else {
		tmp = (x / z_m) * (2.0 / (y - 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 (z_m <= 52000.0d0) then
        tmp = (x * 2.0d0) / (z_m * (y - t))
    else
        tmp = (x / z_m) * (2.0d0 / (y - 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 (z_m <= 52000.0) {
		tmp = (x * 2.0) / (z_m * (y - t));
	} else {
		tmp = (x / z_m) * (2.0 / (y - 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 z_m <= 52000.0:
		tmp = (x * 2.0) / (z_m * (y - t))
	else:
		tmp = (x / z_m) * (2.0 / (y - 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 (z_m <= 52000.0)
		tmp = Float64(Float64(x * 2.0) / Float64(z_m * Float64(y - t)));
	else
		tmp = Float64(Float64(x / z_m) * Float64(2.0 / Float64(y - 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 (z_m <= 52000.0)
		tmp = (x * 2.0) / (z_m * (y - t));
	else
		tmp = (x / z_m) * (2.0 / (y - 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[z$95$m, 52000.0], N[(N[(x * 2.0), $MachinePrecision] / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / N[(y - t), $MachinePrecision]), $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 52000:\\
\;\;\;\;\frac{x \cdot 2}{z\_m \cdot \left(y - t\right)}\\

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


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

    1. Initial program 91.0%

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

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

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

    if 52000 < z

    1. Initial program 74.1%

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

        \[\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. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification93.2%

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

Alternative 10: 92.1% accurate, 1.2× speedup?

\[\begin{array}{l} z_m = \left|z\right| \\ z_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(x \cdot \frac{\frac{2}{y - 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 (* 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) {
	return z_s * (x * ((2.0 / (y - 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 * (x * ((2.0d0 / (y - 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 * (x * ((2.0 / (y - 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 * (x * ((2.0 / (y - 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(x * Float64(Float64(2.0 / Float64(y - 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 * (x * ((2.0 / (y - 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[(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 \left(x \cdot \frac{\frac{2}{y - t}}{z\_m}\right)
\end{array}
Derivation
  1. Initial program 87.0%

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

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

      \[\leadsto \color{blue}{\frac{2}{y \cdot z - t \cdot z} \cdot x} \]
    3. *-commutative86.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.0%

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

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

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

Alternative 11: 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.0%

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

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

      \[\leadsto \color{blue}{\frac{2}{y \cdot z - t \cdot z} \cdot x} \]
    3. *-commutative86.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.0%

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

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

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

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

Alternative 12: 53.5% 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.0%

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

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

      \[\leadsto \color{blue}{\frac{2}{y \cdot z - t \cdot z} \cdot x} \]
    3. *-commutative86.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.0%

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

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

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

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

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

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

Developer target: 97.3% 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 2024036 
(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))))