Linear.Projection:infinitePerspective from linear-1.19.1.3, A

Percentage Accurate: 89.7% → 96.7%
Time: 11.1s
Alternatives: 9
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 9 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: 96.7% 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 5 \cdot 10^{+36}:\\ \;\;\;\;\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 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
 :precision binary64
 (*
  z_s
  (if (<= z_m 5e+36)
    (/ (* 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 <= 5e+36) {
		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 <= 5d+36) 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 <= 5e+36) {
		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 <= 5e+36:
		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 <= 5e+36)
		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 <= 5e+36)
		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, 5e+36], 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 5 \cdot 10^{+36}:\\
\;\;\;\;\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 < 4.99999999999999977e36

    1. Initial program 92.3%

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

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

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

    if 4.99999999999999977e36 < z

    1. Initial program 87.0%

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

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

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

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

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

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

Alternative 2: 73.4% accurate, 0.6× 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 -580000000000:\\ \;\;\;\;\frac{2}{z\_m} \cdot \frac{x}{y}\\ \mathbf{elif}\;y \leq 74000000:\\ \;\;\;\;\frac{x \cdot 2}{z\_m \cdot \left(-t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{2}{z\_m \cdot y}\\ \end{array} \end{array} \]
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
 :precision binary64
 (*
  z_s
  (if (<= y -580000000000.0)
    (* (/ 2.0 z_m) (/ x y))
    (if (<= y 74000000.0)
      (/ (* x 2.0) (* z_m (- t)))
      (* x (/ 2.0 (* z_m 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 <= -580000000000.0) {
		tmp = (2.0 / z_m) * (x / y);
	} else if (y <= 74000000.0) {
		tmp = (x * 2.0) / (z_m * -t);
	} else {
		tmp = x * (2.0 / (z_m * 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 <= (-580000000000.0d0)) then
        tmp = (2.0d0 / z_m) * (x / y)
    else if (y <= 74000000.0d0) then
        tmp = (x * 2.0d0) / (z_m * -t)
    else
        tmp = x * (2.0d0 / (z_m * 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 <= -580000000000.0) {
		tmp = (2.0 / z_m) * (x / y);
	} else if (y <= 74000000.0) {
		tmp = (x * 2.0) / (z_m * -t);
	} else {
		tmp = x * (2.0 / (z_m * 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 <= -580000000000.0:
		tmp = (2.0 / z_m) * (x / y)
	elif y <= 74000000.0:
		tmp = (x * 2.0) / (z_m * -t)
	else:
		tmp = x * (2.0 / (z_m * 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 <= -580000000000.0)
		tmp = Float64(Float64(2.0 / z_m) * Float64(x / y));
	elseif (y <= 74000000.0)
		tmp = Float64(Float64(x * 2.0) / Float64(z_m * Float64(-t)));
	else
		tmp = Float64(x * Float64(2.0 / Float64(z_m * 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 <= -580000000000.0)
		tmp = (2.0 / z_m) * (x / y);
	elseif (y <= 74000000.0)
		tmp = (x * 2.0) / (z_m * -t);
	else
		tmp = x * (2.0 / (z_m * 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, -580000000000.0], N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 74000000.0], N[(N[(x * 2.0), $MachinePrecision] / N[(z$95$m * (-t)), $MachinePrecision]), $MachinePrecision], N[(x * N[(2.0 / N[(z$95$m * y), $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}\;y \leq -580000000000:\\
\;\;\;\;\frac{2}{z\_m} \cdot \frac{x}{y}\\

\mathbf{elif}\;y \leq 74000000:\\
\;\;\;\;\frac{x \cdot 2}{z\_m \cdot \left(-t\right)}\\

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


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

    1. Initial program 89.4%

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

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

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

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

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

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

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

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

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

    if -5.8e11 < y < 7.4e7

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

    if 7.4e7 < y

    1. Initial program 89.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{2}{z \cdot \left(y - t\right)} \cdot x} \]
    7. Step-by-step derivation
      1. div-inv93.9%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{2}{y}}{z}} \cdot x \]
    14. Taylor expanded in y around 0 77.2%

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

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

Alternative 3: 73.6% accurate, 0.6× 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^{+15} \lor \neg \left(y \leq 16000\right):\\ \;\;\;\;x \cdot \frac{2}{z\_m \cdot y}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\ \end{array} \end{array} \]
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
 :precision binary64
 (*
  z_s
  (if (or (<= y -4.2e+15) (not (<= y 16000.0)))
    (* x (/ 2.0 (* z_m y)))
    (* -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) {
	double tmp;
	if ((y <= -4.2e+15) || !(y <= 16000.0)) {
		tmp = x * (2.0 / (z_m * y));
	} else {
		tmp = -2.0 * (x / (z_m * 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 ((y <= (-4.2d+15)) .or. (.not. (y <= 16000.0d0))) then
        tmp = x * (2.0d0 / (z_m * y))
    else
        tmp = (-2.0d0) * (x / (z_m * 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 ((y <= -4.2e+15) || !(y <= 16000.0)) {
		tmp = x * (2.0 / (z_m * y));
	} else {
		tmp = -2.0 * (x / (z_m * 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 (y <= -4.2e+15) or not (y <= 16000.0):
		tmp = x * (2.0 / (z_m * y))
	else:
		tmp = -2.0 * (x / (z_m * 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 ((y <= -4.2e+15) || !(y <= 16000.0))
		tmp = Float64(x * Float64(2.0 / Float64(z_m * y)));
	else
		tmp = Float64(-2.0 * Float64(x / Float64(z_m * 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 ((y <= -4.2e+15) || ~((y <= 16000.0)))
		tmp = x * (2.0 / (z_m * y));
	else
		tmp = -2.0 * (x / (z_m * 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[Or[LessEqual[y, -4.2e+15], N[Not[LessEqual[y, 16000.0]], $MachinePrecision]], N[(x * N[(2.0 / N[(z$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 \begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+15} \lor \neg \left(y \leq 16000\right):\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.2e15 or 16000 < y

    1. Initial program 89.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{2}{z \cdot \left(y - t\right)} \cdot x} \]
    7. Step-by-step derivation
      1. div-inv92.8%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{2}{y}}{z}} \cdot x \]
    14. Taylor expanded in y around 0 75.4%

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

    if -4.2e15 < y < 16000

    1. Initial program 92.5%

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

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

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

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

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

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

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

Alternative 4: 73.4% accurate, 0.6× 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 -4500000000000:\\ \;\;\;\;\frac{2}{z\_m} \cdot \frac{x}{y}\\ \mathbf{elif}\;y \leq 29500000:\\ \;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{2}{z\_m \cdot y}\\ \end{array} \end{array} \]
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
 :precision binary64
 (*
  z_s
  (if (<= y -4500000000000.0)
    (* (/ 2.0 z_m) (/ x y))
    (if (<= y 29500000.0) (* -2.0 (/ x (* z_m t))) (* x (/ 2.0 (* z_m 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 <= -4500000000000.0) {
		tmp = (2.0 / z_m) * (x / y);
	} else if (y <= 29500000.0) {
		tmp = -2.0 * (x / (z_m * t));
	} else {
		tmp = x * (2.0 / (z_m * 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 <= (-4500000000000.0d0)) then
        tmp = (2.0d0 / z_m) * (x / y)
    else if (y <= 29500000.0d0) then
        tmp = (-2.0d0) * (x / (z_m * t))
    else
        tmp = x * (2.0d0 / (z_m * 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 <= -4500000000000.0) {
		tmp = (2.0 / z_m) * (x / y);
	} else if (y <= 29500000.0) {
		tmp = -2.0 * (x / (z_m * t));
	} else {
		tmp = x * (2.0 / (z_m * 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 <= -4500000000000.0:
		tmp = (2.0 / z_m) * (x / y)
	elif y <= 29500000.0:
		tmp = -2.0 * (x / (z_m * t))
	else:
		tmp = x * (2.0 / (z_m * 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 <= -4500000000000.0)
		tmp = Float64(Float64(2.0 / z_m) * Float64(x / y));
	elseif (y <= 29500000.0)
		tmp = Float64(-2.0 * Float64(x / Float64(z_m * t)));
	else
		tmp = Float64(x * Float64(2.0 / Float64(z_m * 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 <= -4500000000000.0)
		tmp = (2.0 / z_m) * (x / y);
	elseif (y <= 29500000.0)
		tmp = -2.0 * (x / (z_m * t));
	else
		tmp = x * (2.0 / (z_m * 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, -4500000000000.0], N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 29500000.0], N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(2.0 / N[(z$95$m * y), $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}\;y \leq -4500000000000:\\
\;\;\;\;\frac{2}{z\_m} \cdot \frac{x}{y}\\

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

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


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

    1. Initial program 89.4%

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

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

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

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

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

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

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

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

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

    if -4.5e12 < y < 2.95e7

    1. Initial program 92.5%

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

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

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

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

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

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

    if 2.95e7 < y

    1. Initial program 89.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{2}{z \cdot \left(y - t\right)} \cdot x} \]
    7. Step-by-step derivation
      1. div-inv93.9%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{2}{y}}{z}} \cdot x \]
    14. Taylor expanded in y around 0 77.2%

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

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

Alternative 5: 96.6% 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 1450:\\ \;\;\;\;x \cdot \frac{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 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
 :precision binary64
 (*
  z_s
  (if (<= z_m 1450.0)
    (* 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 <= 1450.0) {
		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 <= 1450.0d0) 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 <= 1450.0) {
		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 <= 1450.0:
		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 <= 1450.0)
		tmp = Float64(x * Float64(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 <= 1450.0)
		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, 1450.0], N[(x * N[(2.0 / N[(z$95$m * N[(y - t), $MachinePrecision]), $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 1450:\\
\;\;\;\;x \cdot \frac{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 < 1450

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

    if 1450 < z

    1. Initial program 88.5%

      \[\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. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative90.0%

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

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

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

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

Alternative 6: 57.0% accurate, 0.9× 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.5 \cdot 10^{+35}:\\ \;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{t} \cdot \frac{x}{z\_m}\\ \end{array} \end{array} \]
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
 :precision binary64
 (*
  z_s
  (if (<= z_m 2.5e+35) (* -2.0 (/ x (* z_m t))) (* (/ -2.0 t) (/ 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 tmp;
	if (z_m <= 2.5e+35) {
		tmp = -2.0 * (x / (z_m * t));
	} else {
		tmp = (-2.0 / t) * (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) :: tmp
    if (z_m <= 2.5d+35) then
        tmp = (-2.0d0) * (x / (z_m * t))
    else
        tmp = ((-2.0d0) / t) * (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 tmp;
	if (z_m <= 2.5e+35) {
		tmp = -2.0 * (x / (z_m * t));
	} else {
		tmp = (-2.0 / t) * (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):
	tmp = 0
	if z_m <= 2.5e+35:
		tmp = -2.0 * (x / (z_m * t))
	else:
		tmp = (-2.0 / t) * (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)
	tmp = 0.0
	if (z_m <= 2.5e+35)
		tmp = Float64(-2.0 * Float64(x / Float64(z_m * t)));
	else
		tmp = Float64(Float64(-2.0 / t) * 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)
	tmp = 0.0;
	if (z_m <= 2.5e+35)
		tmp = -2.0 * (x / (z_m * t));
	else
		tmp = (-2.0 / t) * (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_] := N[(z$95$s * If[LessEqual[z$95$m, 2.5e+35], N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 / t), $MachinePrecision] * N[(x / 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.5 \cdot 10^{+35}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\

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


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

    1. Initial program 92.3%

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

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

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

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

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

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

    if 2.50000000000000011e35 < z

    1. Initial program 87.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 57.0% accurate, 0.9× 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.7 \cdot 10^{-46}:\\ \;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{\frac{x}{z\_m}}{t}\\ \end{array} \end{array} \]
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
 :precision binary64
 (*
  z_s
  (if (<= z_m 2.7e-46) (* -2.0 (/ x (* z_m t))) (* -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) {
	double tmp;
	if (z_m <= 2.7e-46) {
		tmp = -2.0 * (x / (z_m * t));
	} else {
		tmp = -2.0 * ((x / z_m) / 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 <= 2.7d-46) then
        tmp = (-2.0d0) * (x / (z_m * t))
    else
        tmp = (-2.0d0) * ((x / z_m) / 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 <= 2.7e-46) {
		tmp = -2.0 * (x / (z_m * t));
	} else {
		tmp = -2.0 * ((x / z_m) / 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 <= 2.7e-46:
		tmp = -2.0 * (x / (z_m * t))
	else:
		tmp = -2.0 * ((x / z_m) / 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 <= 2.7e-46)
		tmp = Float64(-2.0 * Float64(x / Float64(z_m * t)));
	else
		tmp = Float64(-2.0 * Float64(Float64(x / z_m) / 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 <= 2.7e-46)
		tmp = -2.0 * (x / (z_m * t));
	else
		tmp = -2.0 * ((x / z_m) / 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, 2.7e-46], N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x / z$95$m), $MachinePrecision] / 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}\;z\_m \leq 2.7 \cdot 10^{-46}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\

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


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

    1. Initial program 91.5%

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

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

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

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

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

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

    if 2.7e-46 < z

    1. Initial program 89.9%

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

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

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

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

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

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

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

Alternative 8: 91.5% 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{2}{z\_m \cdot \left(y - t\right)}\right) \end{array} \]
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
 :precision binary64
 (* z_s (* x (/ 2.0 (* z_m (- 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) {
	return z_s * (x * (2.0 / (z_m * (y - 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 * (x * (2.0d0 / (z_m * (y - 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 * (x * (2.0 / (z_m * (y - 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 * (x * (2.0 / (z_m * (y - 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(x * Float64(2.0 / Float64(z_m * Float64(y - 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 * (x * (2.0 / (z_m * (y - 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[(x * N[(2.0 / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $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{2}{z\_m \cdot \left(y - t\right)}\right)
\end{array}
Derivation
  1. Initial program 91.0%

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

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

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

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

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

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

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

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

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

Alternative 9: 52.2% 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 #s(literal 1 binary64) 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 91.0%

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

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

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

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

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

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

Developer Target 1: 97.0% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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

  :alt
  (! :herbie-platform default (if (< (/ (* x 2) (- (* y z) (* t z))) -2559141628295061/10000000000000000000000000000) (* (/ x (* (- y t) z)) 2) (if (< (/ (* x 2) (- (* y z) (* t z))) 522513913665063/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (* (/ x z) 2) (- y t)) (* (/ x (* (- y t) z)) 2))))

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