Linear.Projection:infinitePerspective from linear-1.19.1.3, A

Percentage Accurate: 90.0% → 98.1%
Time: 10.1s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 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: 90.0% 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.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot z - z \cdot t\\ \mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 5 \cdot 10^{+157}\right):\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot x}{z \cdot \left(y - t\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* y z) (* z t))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+157)))
     (* 2.0 (/ (/ x z) (- y t)))
     (/ (* 2.0 x) (* z (- y t))))))
double code(double x, double y, double z, double t) {
	double t_1 = (y * z) - (z * t);
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+157)) {
		tmp = 2.0 * ((x / z) / (y - t));
	} else {
		tmp = (2.0 * x) / (z * (y - t));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = (y * z) - (z * t);
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+157)) {
		tmp = 2.0 * ((x / z) / (y - t));
	} else {
		tmp = (2.0 * x) / (z * (y - t));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y * z) - (z * t)
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 5e+157):
		tmp = 2.0 * ((x / z) / (y - t))
	else:
		tmp = (2.0 * x) / (z * (y - t))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y * z) - Float64(z * t))
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+157))
		tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t)));
	else
		tmp = Float64(Float64(2.0 * x) / Float64(z * Float64(y - t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y * z) - (z * t);
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 5e+157)))
		tmp = 2.0 * ((x / z) / (y - t));
	else
		tmp = (2.0 * x) / (z * (y - t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * z), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+157]], $MachinePrecision]], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * x), $MachinePrecision] / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot z - z \cdot t\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 5 \cdot 10^{+157}\right):\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\

\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot x}{z \cdot \left(y - t\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (*.f64 y z) (*.f64 t z)) < -inf.0 or 4.99999999999999976e157 < (-.f64 (*.f64 y z) (*.f64 t z))

    1. Initial program 80.4%

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

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

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 y z) (*.f64 t z)) < 4.99999999999999976e157

    1. Initial program 98.0%

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

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

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

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

Alternative 2: 72.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{2}{z} \cdot \frac{x}{y}\\ t_2 := \frac{x}{t} \cdot \frac{-2}{z}\\ \mathbf{if}\;t \leq -1.7 \cdot 10^{+31}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -180000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -5 \cdot 10^{-62}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 2900000:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-2}{z \cdot t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (/ 2.0 z) (/ x y))) (t_2 (* (/ x t) (/ -2.0 z))))
   (if (<= t -1.7e+31)
     t_2
     (if (<= t -180000.0)
       t_1
       (if (<= t -5e-62)
         t_2
         (if (<= t 2900000.0) t_1 (* x (/ -2.0 (* z t)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (2.0 / z) * (x / y);
	double t_2 = (x / t) * (-2.0 / z);
	double tmp;
	if (t <= -1.7e+31) {
		tmp = t_2;
	} else if (t <= -180000.0) {
		tmp = t_1;
	} else if (t <= -5e-62) {
		tmp = t_2;
	} else if (t <= 2900000.0) {
		tmp = t_1;
	} else {
		tmp = x * (-2.0 / (z * t));
	}
	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 = (2.0d0 / z) * (x / y)
    t_2 = (x / t) * ((-2.0d0) / z)
    if (t <= (-1.7d+31)) then
        tmp = t_2
    else if (t <= (-180000.0d0)) then
        tmp = t_1
    else if (t <= (-5d-62)) then
        tmp = t_2
    else if (t <= 2900000.0d0) then
        tmp = t_1
    else
        tmp = x * ((-2.0d0) / (z * t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (2.0 / z) * (x / y);
	double t_2 = (x / t) * (-2.0 / z);
	double tmp;
	if (t <= -1.7e+31) {
		tmp = t_2;
	} else if (t <= -180000.0) {
		tmp = t_1;
	} else if (t <= -5e-62) {
		tmp = t_2;
	} else if (t <= 2900000.0) {
		tmp = t_1;
	} else {
		tmp = x * (-2.0 / (z * t));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (2.0 / z) * (x / y)
	t_2 = (x / t) * (-2.0 / z)
	tmp = 0
	if t <= -1.7e+31:
		tmp = t_2
	elif t <= -180000.0:
		tmp = t_1
	elif t <= -5e-62:
		tmp = t_2
	elif t <= 2900000.0:
		tmp = t_1
	else:
		tmp = x * (-2.0 / (z * t))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(2.0 / z) * Float64(x / y))
	t_2 = Float64(Float64(x / t) * Float64(-2.0 / z))
	tmp = 0.0
	if (t <= -1.7e+31)
		tmp = t_2;
	elseif (t <= -180000.0)
		tmp = t_1;
	elseif (t <= -5e-62)
		tmp = t_2;
	elseif (t <= 2900000.0)
		tmp = t_1;
	else
		tmp = Float64(x * Float64(-2.0 / Float64(z * t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (2.0 / z) * (x / y);
	t_2 = (x / t) * (-2.0 / z);
	tmp = 0.0;
	if (t <= -1.7e+31)
		tmp = t_2;
	elseif (t <= -180000.0)
		tmp = t_1;
	elseif (t <= -5e-62)
		tmp = t_2;
	elseif (t <= 2900000.0)
		tmp = t_1;
	else
		tmp = x * (-2.0 / (z * t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t), $MachinePrecision] * N[(-2.0 / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.7e+31], t$95$2, If[LessEqual[t, -180000.0], t$95$1, If[LessEqual[t, -5e-62], t$95$2, If[LessEqual[t, 2900000.0], t$95$1, N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{2}{z} \cdot \frac{x}{y}\\
t_2 := \frac{x}{t} \cdot \frac{-2}{z}\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{+31}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq -180000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -5 \cdot 10^{-62}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 2900000:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.6999999999999999e31 or -1.8e5 < t < -5.0000000000000002e-62

    1. Initial program 90.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6999999999999999e31 < t < -1.8e5 or -5.0000000000000002e-62 < t < 2.9e6

    1. Initial program 94.2%

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

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

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

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

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

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

    if 2.9e6 < t

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.7 \cdot 10^{+31}:\\ \;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\ \mathbf{elif}\;t \leq -180000:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;t \leq -5 \cdot 10^{-62}:\\ \;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\ \mathbf{elif}\;t \leq 2900000:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-2}{z \cdot t}\\ \end{array} \]

Alternative 3: 72.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{if}\;t \leq -1.62 \cdot 10^{+31}:\\ \;\;\;\;\frac{\frac{x}{t}}{z} \cdot -2\\ \mathbf{elif}\;t \leq -90000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -6.6 \cdot 10^{-63}:\\ \;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\ \mathbf{elif}\;t \leq 200:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-2}{z \cdot t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (/ 2.0 z) (/ x y))))
   (if (<= t -1.62e+31)
     (* (/ (/ x t) z) -2.0)
     (if (<= t -90000.0)
       t_1
       (if (<= t -6.6e-63)
         (* (/ x t) (/ -2.0 z))
         (if (<= t 200.0) t_1 (* x (/ -2.0 (* z t)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (2.0 / z) * (x / y);
	double tmp;
	if (t <= -1.62e+31) {
		tmp = ((x / t) / z) * -2.0;
	} else if (t <= -90000.0) {
		tmp = t_1;
	} else if (t <= -6.6e-63) {
		tmp = (x / t) * (-2.0 / z);
	} else if (t <= 200.0) {
		tmp = t_1;
	} else {
		tmp = x * (-2.0 / (z * t));
	}
	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) :: tmp
    t_1 = (2.0d0 / z) * (x / y)
    if (t <= (-1.62d+31)) then
        tmp = ((x / t) / z) * (-2.0d0)
    else if (t <= (-90000.0d0)) then
        tmp = t_1
    else if (t <= (-6.6d-63)) then
        tmp = (x / t) * ((-2.0d0) / z)
    else if (t <= 200.0d0) then
        tmp = t_1
    else
        tmp = x * ((-2.0d0) / (z * t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (2.0 / z) * (x / y);
	double tmp;
	if (t <= -1.62e+31) {
		tmp = ((x / t) / z) * -2.0;
	} else if (t <= -90000.0) {
		tmp = t_1;
	} else if (t <= -6.6e-63) {
		tmp = (x / t) * (-2.0 / z);
	} else if (t <= 200.0) {
		tmp = t_1;
	} else {
		tmp = x * (-2.0 / (z * t));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (2.0 / z) * (x / y)
	tmp = 0
	if t <= -1.62e+31:
		tmp = ((x / t) / z) * -2.0
	elif t <= -90000.0:
		tmp = t_1
	elif t <= -6.6e-63:
		tmp = (x / t) * (-2.0 / z)
	elif t <= 200.0:
		tmp = t_1
	else:
		tmp = x * (-2.0 / (z * t))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(2.0 / z) * Float64(x / y))
	tmp = 0.0
	if (t <= -1.62e+31)
		tmp = Float64(Float64(Float64(x / t) / z) * -2.0);
	elseif (t <= -90000.0)
		tmp = t_1;
	elseif (t <= -6.6e-63)
		tmp = Float64(Float64(x / t) * Float64(-2.0 / z));
	elseif (t <= 200.0)
		tmp = t_1;
	else
		tmp = Float64(x * Float64(-2.0 / Float64(z * t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (2.0 / z) * (x / y);
	tmp = 0.0;
	if (t <= -1.62e+31)
		tmp = ((x / t) / z) * -2.0;
	elseif (t <= -90000.0)
		tmp = t_1;
	elseif (t <= -6.6e-63)
		tmp = (x / t) * (-2.0 / z);
	elseif (t <= 200.0)
		tmp = t_1;
	else
		tmp = x * (-2.0 / (z * t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.62e+31], N[(N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t, -90000.0], t$95$1, If[LessEqual[t, -6.6e-63], N[(N[(x / t), $MachinePrecision] * N[(-2.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 200.0], t$95$1, N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{2}{z} \cdot \frac{x}{y}\\
\mathbf{if}\;t \leq -1.62 \cdot 10^{+31}:\\
\;\;\;\;\frac{\frac{x}{t}}{z} \cdot -2\\

\mathbf{elif}\;t \leq -90000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -6.6 \cdot 10^{-63}:\\
\;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\

\mathbf{elif}\;t \leq 200:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 89.6%

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

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

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

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

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

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

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

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

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

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

    if -1.6199999999999999e31 < t < -9e4 or -6.59999999999999987e-63 < t < 200

    1. Initial program 94.2%

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

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

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

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

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

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

    if -9e4 < t < -6.59999999999999987e-63

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 200 < t

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.62 \cdot 10^{+31}:\\ \;\;\;\;\frac{\frac{x}{t}}{z} \cdot -2\\ \mathbf{elif}\;t \leq -90000:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;t \leq -6.6 \cdot 10^{-63}:\\ \;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\ \mathbf{elif}\;t \leq 200:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-2}{z \cdot t}\\ \end{array} \]

Alternative 4: 72.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{if}\;t \leq -1.86 \cdot 10^{+31}:\\ \;\;\;\;\frac{\frac{x}{t}}{z} \cdot -2\\ \mathbf{elif}\;t \leq -180000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -4.5 \cdot 10^{-62}:\\ \;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\ \mathbf{elif}\;t \leq 11000:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot -2}{z \cdot t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (/ 2.0 z) (/ x y))))
   (if (<= t -1.86e+31)
     (* (/ (/ x t) z) -2.0)
     (if (<= t -180000.0)
       t_1
       (if (<= t -4.5e-62)
         (* (/ x t) (/ -2.0 z))
         (if (<= t 11000.0) t_1 (/ (* x -2.0) (* z t))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (2.0 / z) * (x / y);
	double tmp;
	if (t <= -1.86e+31) {
		tmp = ((x / t) / z) * -2.0;
	} else if (t <= -180000.0) {
		tmp = t_1;
	} else if (t <= -4.5e-62) {
		tmp = (x / t) * (-2.0 / z);
	} else if (t <= 11000.0) {
		tmp = t_1;
	} else {
		tmp = (x * -2.0) / (z * t);
	}
	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) :: tmp
    t_1 = (2.0d0 / z) * (x / y)
    if (t <= (-1.86d+31)) then
        tmp = ((x / t) / z) * (-2.0d0)
    else if (t <= (-180000.0d0)) then
        tmp = t_1
    else if (t <= (-4.5d-62)) then
        tmp = (x / t) * ((-2.0d0) / z)
    else if (t <= 11000.0d0) then
        tmp = t_1
    else
        tmp = (x * (-2.0d0)) / (z * t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (2.0 / z) * (x / y);
	double tmp;
	if (t <= -1.86e+31) {
		tmp = ((x / t) / z) * -2.0;
	} else if (t <= -180000.0) {
		tmp = t_1;
	} else if (t <= -4.5e-62) {
		tmp = (x / t) * (-2.0 / z);
	} else if (t <= 11000.0) {
		tmp = t_1;
	} else {
		tmp = (x * -2.0) / (z * t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (2.0 / z) * (x / y)
	tmp = 0
	if t <= -1.86e+31:
		tmp = ((x / t) / z) * -2.0
	elif t <= -180000.0:
		tmp = t_1
	elif t <= -4.5e-62:
		tmp = (x / t) * (-2.0 / z)
	elif t <= 11000.0:
		tmp = t_1
	else:
		tmp = (x * -2.0) / (z * t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(2.0 / z) * Float64(x / y))
	tmp = 0.0
	if (t <= -1.86e+31)
		tmp = Float64(Float64(Float64(x / t) / z) * -2.0);
	elseif (t <= -180000.0)
		tmp = t_1;
	elseif (t <= -4.5e-62)
		tmp = Float64(Float64(x / t) * Float64(-2.0 / z));
	elseif (t <= 11000.0)
		tmp = t_1;
	else
		tmp = Float64(Float64(x * -2.0) / Float64(z * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (2.0 / z) * (x / y);
	tmp = 0.0;
	if (t <= -1.86e+31)
		tmp = ((x / t) / z) * -2.0;
	elseif (t <= -180000.0)
		tmp = t_1;
	elseif (t <= -4.5e-62)
		tmp = (x / t) * (-2.0 / z);
	elseif (t <= 11000.0)
		tmp = t_1;
	else
		tmp = (x * -2.0) / (z * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.86e+31], N[(N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t, -180000.0], t$95$1, If[LessEqual[t, -4.5e-62], N[(N[(x / t), $MachinePrecision] * N[(-2.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 11000.0], t$95$1, N[(N[(x * -2.0), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{2}{z} \cdot \frac{x}{y}\\
\mathbf{if}\;t \leq -1.86 \cdot 10^{+31}:\\
\;\;\;\;\frac{\frac{x}{t}}{z} \cdot -2\\

\mathbf{elif}\;t \leq -180000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -4.5 \cdot 10^{-62}:\\
\;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\

\mathbf{elif}\;t \leq 11000:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 89.6%

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

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

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

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

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

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

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

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

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

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

    if -1.86000000000000008e31 < t < -1.8e5 or -4.50000000000000018e-62 < t < 11000

    1. Initial program 94.2%

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

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

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

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

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

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

    if -1.8e5 < t < -4.50000000000000018e-62

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 11000 < t

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.86 \cdot 10^{+31}:\\ \;\;\;\;\frac{\frac{x}{t}}{z} \cdot -2\\ \mathbf{elif}\;t \leq -180000:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;t \leq -4.5 \cdot 10^{-62}:\\ \;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\ \mathbf{elif}\;t \leq 11000:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot -2}{z \cdot t}\\ \end{array} \]

Alternative 5: 72.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{if}\;t \leq -1.62 \cdot 10^{+31}:\\ \;\;\;\;\frac{\frac{x}{t}}{z} \cdot -2\\ \mathbf{elif}\;t \leq -92000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -9 \cdot 10^{-64}:\\ \;\;\;\;\frac{\frac{x}{z} \cdot -2}{t}\\ \mathbf{elif}\;t \leq 1960:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot -2}{z \cdot t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (/ 2.0 z) (/ x y))))
   (if (<= t -1.62e+31)
     (* (/ (/ x t) z) -2.0)
     (if (<= t -92000.0)
       t_1
       (if (<= t -9e-64)
         (/ (* (/ x z) -2.0) t)
         (if (<= t 1960.0) t_1 (/ (* x -2.0) (* z t))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (2.0 / z) * (x / y);
	double tmp;
	if (t <= -1.62e+31) {
		tmp = ((x / t) / z) * -2.0;
	} else if (t <= -92000.0) {
		tmp = t_1;
	} else if (t <= -9e-64) {
		tmp = ((x / z) * -2.0) / t;
	} else if (t <= 1960.0) {
		tmp = t_1;
	} else {
		tmp = (x * -2.0) / (z * t);
	}
	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) :: tmp
    t_1 = (2.0d0 / z) * (x / y)
    if (t <= (-1.62d+31)) then
        tmp = ((x / t) / z) * (-2.0d0)
    else if (t <= (-92000.0d0)) then
        tmp = t_1
    else if (t <= (-9d-64)) then
        tmp = ((x / z) * (-2.0d0)) / t
    else if (t <= 1960.0d0) then
        tmp = t_1
    else
        tmp = (x * (-2.0d0)) / (z * t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (2.0 / z) * (x / y);
	double tmp;
	if (t <= -1.62e+31) {
		tmp = ((x / t) / z) * -2.0;
	} else if (t <= -92000.0) {
		tmp = t_1;
	} else if (t <= -9e-64) {
		tmp = ((x / z) * -2.0) / t;
	} else if (t <= 1960.0) {
		tmp = t_1;
	} else {
		tmp = (x * -2.0) / (z * t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (2.0 / z) * (x / y)
	tmp = 0
	if t <= -1.62e+31:
		tmp = ((x / t) / z) * -2.0
	elif t <= -92000.0:
		tmp = t_1
	elif t <= -9e-64:
		tmp = ((x / z) * -2.0) / t
	elif t <= 1960.0:
		tmp = t_1
	else:
		tmp = (x * -2.0) / (z * t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(2.0 / z) * Float64(x / y))
	tmp = 0.0
	if (t <= -1.62e+31)
		tmp = Float64(Float64(Float64(x / t) / z) * -2.0);
	elseif (t <= -92000.0)
		tmp = t_1;
	elseif (t <= -9e-64)
		tmp = Float64(Float64(Float64(x / z) * -2.0) / t);
	elseif (t <= 1960.0)
		tmp = t_1;
	else
		tmp = Float64(Float64(x * -2.0) / Float64(z * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (2.0 / z) * (x / y);
	tmp = 0.0;
	if (t <= -1.62e+31)
		tmp = ((x / t) / z) * -2.0;
	elseif (t <= -92000.0)
		tmp = t_1;
	elseif (t <= -9e-64)
		tmp = ((x / z) * -2.0) / t;
	elseif (t <= 1960.0)
		tmp = t_1;
	else
		tmp = (x * -2.0) / (z * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.62e+31], N[(N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t, -92000.0], t$95$1, If[LessEqual[t, -9e-64], N[(N[(N[(x / z), $MachinePrecision] * -2.0), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 1960.0], t$95$1, N[(N[(x * -2.0), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{2}{z} \cdot \frac{x}{y}\\
\mathbf{if}\;t \leq -1.62 \cdot 10^{+31}:\\
\;\;\;\;\frac{\frac{x}{t}}{z} \cdot -2\\

\mathbf{elif}\;t \leq -92000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -9 \cdot 10^{-64}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot -2}{t}\\

\mathbf{elif}\;t \leq 1960:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 89.6%

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

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

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

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

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

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

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

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

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

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

    if -1.6199999999999999e31 < t < -92000 or -9.00000000000000019e-64 < t < 1960

    1. Initial program 94.2%

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

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

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

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

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

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

    if -92000 < t < -9.00000000000000019e-64

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1960 < t

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.62 \cdot 10^{+31}:\\ \;\;\;\;\frac{\frac{x}{t}}{z} \cdot -2\\ \mathbf{elif}\;t \leq -92000:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;t \leq -9 \cdot 10^{-64}:\\ \;\;\;\;\frac{\frac{x}{z} \cdot -2}{t}\\ \mathbf{elif}\;t \leq 1960:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot -2}{z \cdot t}\\ \end{array} \]

Alternative 6: 96.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{-27} \lor \neg \left(z \leq 1.4 \cdot 10^{-47}\right):\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y - t}}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -9.5e-27) (not (<= z 1.4e-47)))
   (* 2.0 (/ (/ x z) (- y t)))
   (* x (/ (/ 2.0 (- y t)) z))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -9.5e-27) || !(z <= 1.4e-47)) {
		tmp = 2.0 * ((x / z) / (y - t));
	} else {
		tmp = x * ((2.0 / (y - t)) / z);
	}
	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) :: tmp
    if ((z <= (-9.5d-27)) .or. (.not. (z <= 1.4d-47))) then
        tmp = 2.0d0 * ((x / z) / (y - t))
    else
        tmp = x * ((2.0d0 / (y - t)) / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -9.5e-27) || !(z <= 1.4e-47)) {
		tmp = 2.0 * ((x / z) / (y - t));
	} else {
		tmp = x * ((2.0 / (y - t)) / z);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -9.5e-27) or not (z <= 1.4e-47):
		tmp = 2.0 * ((x / z) / (y - t))
	else:
		tmp = x * ((2.0 / (y - t)) / z)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -9.5e-27) || !(z <= 1.4e-47))
		tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t)));
	else
		tmp = Float64(x * Float64(Float64(2.0 / Float64(y - t)) / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -9.5e-27) || ~((z <= 1.4e-47)))
		tmp = 2.0 * ((x / z) / (y - t));
	else
		tmp = x * ((2.0 / (y - t)) / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9.5e-27], N[Not[LessEqual[z, 1.4e-47]], $MachinePrecision]], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-27} \lor \neg \left(z \leq 1.4 \cdot 10^{-47}\right):\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.50000000000000037e-27 or 1.39999999999999996e-47 < z

    1. Initial program 89.8%

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

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

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

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

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

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

    if -9.50000000000000037e-27 < z < 1.39999999999999996e-47

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 96.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{-23}:\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+35}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y - t}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y - t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -1.1e-23)
   (* 2.0 (/ (/ x z) (- y t)))
   (if (<= z 1.5e+35)
     (* x (/ (/ 2.0 (- y t)) z))
     (* (/ 2.0 z) (/ x (- y t))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1.1e-23) {
		tmp = 2.0 * ((x / z) / (y - t));
	} else if (z <= 1.5e+35) {
		tmp = x * ((2.0 / (y - t)) / z);
	} else {
		tmp = (2.0 / z) * (x / (y - t));
	}
	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) :: tmp
    if (z <= (-1.1d-23)) then
        tmp = 2.0d0 * ((x / z) / (y - t))
    else if (z <= 1.5d+35) then
        tmp = x * ((2.0d0 / (y - t)) / z)
    else
        tmp = (2.0d0 / z) * (x / (y - t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1.1e-23) {
		tmp = 2.0 * ((x / z) / (y - t));
	} else if (z <= 1.5e+35) {
		tmp = x * ((2.0 / (y - t)) / z);
	} else {
		tmp = (2.0 / z) * (x / (y - t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -1.1e-23:
		tmp = 2.0 * ((x / z) / (y - t))
	elif z <= 1.5e+35:
		tmp = x * ((2.0 / (y - t)) / z)
	else:
		tmp = (2.0 / z) * (x / (y - t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -1.1e-23)
		tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t)));
	elseif (z <= 1.5e+35)
		tmp = Float64(x * Float64(Float64(2.0 / Float64(y - t)) / z));
	else
		tmp = Float64(Float64(2.0 / z) * Float64(x / Float64(y - t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -1.1e-23)
		tmp = 2.0 * ((x / z) / (y - t));
	elseif (z <= 1.5e+35)
		tmp = x * ((2.0 / (y - t)) / z);
	else
		tmp = (2.0 / z) * (x / (y - t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.1e-23], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+35], N[(x * N[(N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z), $MachinePrecision] * N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.1e-23

    1. Initial program 92.6%

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

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

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

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

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

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

    if -1.1e-23 < z < 1.49999999999999995e35

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.49999999999999995e35 < z

    1. Initial program 81.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{-23}:\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+35}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y - t}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y - t}\\ \end{array} \]

Alternative 8: 73.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{-63} \lor \neg \left(t \leq 2300\right):\\ \;\;\;\;x \cdot \frac{-2}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= t -1.8e-63) (not (<= t 2300.0)))
   (* x (/ -2.0 (* z t)))
   (* x (/ (/ 2.0 y) z))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -1.8e-63) || !(t <= 2300.0)) {
		tmp = x * (-2.0 / (z * t));
	} else {
		tmp = x * ((2.0 / y) / z);
	}
	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) :: tmp
    if ((t <= (-1.8d-63)) .or. (.not. (t <= 2300.0d0))) then
        tmp = x * ((-2.0d0) / (z * t))
    else
        tmp = x * ((2.0d0 / y) / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -1.8e-63) || !(t <= 2300.0)) {
		tmp = x * (-2.0 / (z * t));
	} else {
		tmp = x * ((2.0 / y) / z);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (t <= -1.8e-63) or not (t <= 2300.0):
		tmp = x * (-2.0 / (z * t))
	else:
		tmp = x * ((2.0 / y) / z)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((t <= -1.8e-63) || !(t <= 2300.0))
		tmp = Float64(x * Float64(-2.0 / Float64(z * t)));
	else
		tmp = Float64(x * Float64(Float64(2.0 / y) / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((t <= -1.8e-63) || ~((t <= 2300.0)))
		tmp = x * (-2.0 / (z * t));
	else
		tmp = x * ((2.0 / y) / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.8e-63], N[Not[LessEqual[t, 2300.0]], $MachinePrecision]], N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-63} \lor \neg \left(t \leq 2300\right):\\
\;\;\;\;x \cdot \frac{-2}{z \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.80000000000000004e-63 or 2300 < t

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.80000000000000004e-63 < t < 2300

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 72.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -3.4 \cdot 10^{-63} \lor \neg \left(t \leq 115000\right):\\ \;\;\;\;x \cdot \frac{-2}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= t -3.4e-63) (not (<= t 115000.0)))
   (* x (/ -2.0 (* z t)))
   (* (/ 2.0 z) (/ x y))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -3.4e-63) || !(t <= 115000.0)) {
		tmp = x * (-2.0 / (z * t));
	} else {
		tmp = (2.0 / z) * (x / y);
	}
	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) :: tmp
    if ((t <= (-3.4d-63)) .or. (.not. (t <= 115000.0d0))) then
        tmp = x * ((-2.0d0) / (z * t))
    else
        tmp = (2.0d0 / z) * (x / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -3.4e-63) || !(t <= 115000.0)) {
		tmp = x * (-2.0 / (z * t));
	} else {
		tmp = (2.0 / z) * (x / y);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (t <= -3.4e-63) or not (t <= 115000.0):
		tmp = x * (-2.0 / (z * t))
	else:
		tmp = (2.0 / z) * (x / y)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((t <= -3.4e-63) || !(t <= 115000.0))
		tmp = Float64(x * Float64(-2.0 / Float64(z * t)));
	else
		tmp = Float64(Float64(2.0 / z) * Float64(x / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((t <= -3.4e-63) || ~((t <= 115000.0)))
		tmp = x * (-2.0 / (z * t));
	else
		tmp = (2.0 / z) * (x / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.4e-63], N[Not[LessEqual[t, 115000.0]], $MachinePrecision]], N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{-63} \lor \neg \left(t \leq 115000\right):\\
\;\;\;\;x \cdot \frac{-2}{z \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.39999999999999998e-63 or 115000 < t

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.39999999999999998e-63 < t < 115000

    1. Initial program 95.5%

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

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

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

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

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

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

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

Alternative 10: 91.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 8.5 \cdot 10^{+149}:\\ \;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot x}{y \cdot z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y 8.5e+149) (* 2.0 (/ (/ x z) (- y t))) (/ (* 2.0 x) (* y z))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 8.5e+149) {
		tmp = 2.0 * ((x / z) / (y - t));
	} else {
		tmp = (2.0 * x) / (y * z);
	}
	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) :: tmp
    if (y <= 8.5d+149) then
        tmp = 2.0d0 * ((x / z) / (y - t))
    else
        tmp = (2.0d0 * x) / (y * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 8.5e+149) {
		tmp = 2.0 * ((x / z) / (y - t));
	} else {
		tmp = (2.0 * x) / (y * z);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= 8.5e+149:
		tmp = 2.0 * ((x / z) / (y - t))
	else:
		tmp = (2.0 * x) / (y * z)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= 8.5e+149)
		tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t)));
	else
		tmp = Float64(Float64(2.0 * x) / Float64(y * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= 8.5e+149)
		tmp = 2.0 * ((x / z) / (y - t));
	else
		tmp = (2.0 * x) / (y * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, 8.5e+149], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * x), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.5 \cdot 10^{+149}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 8.49999999999999956e149

    1. Initial program 91.9%

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

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

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

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

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

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

    if 8.49999999999999956e149 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

Alternative 11: 52.0% accurate, 1.6× speedup?

\[\begin{array}{l} \\ x \cdot \frac{-2}{z \cdot t} \end{array} \]
(FPCore (x y z t) :precision binary64 (* x (/ -2.0 (* z t))))
double code(double x, double y, double z, double t) {
	return x * (-2.0 / (z * t));
}
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) / (z * t))
end function
public static double code(double x, double y, double z, double t) {
	return x * (-2.0 / (z * t));
}
def code(x, y, z, t):
	return x * (-2.0 / (z * t))
function code(x, y, z, t)
	return Float64(x * Float64(-2.0 / Float64(z * t)))
end
function tmp = code(x, y, z, t)
	tmp = x * (-2.0 / (z * t));
end
code[x_, y_, z_, t_] := N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \frac{-2}{z \cdot t}
\end{array}
Derivation
  1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 96.8% 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 2023275 
(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))))