Linear.Projection:infinitePerspective from linear-1.19.1.3, A

Percentage Accurate: 90.1% → 95.1%
Time: 8.7s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 90.1% 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: 95.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq -1 \cdot 10^{+169} \lor \neg \left(x \cdot 2 \leq 2 \cdot 10^{-166}\right):\\
\;\;\;\;\frac{x}{y - t} \cdot \frac{2}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x 2) < -9.99999999999999934e168 or 2.00000000000000008e-166 < (*.f64 x 2)

    1. Initial program 85.0%

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

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

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

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

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

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

    if -9.99999999999999934e168 < (*.f64 x 2) < 2.00000000000000008e-166

    1. Initial program 90.4%

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

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

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

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

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

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

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

Alternative 2: 96.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.9 \cdot 10^{-31} \lor \neg \left(z \leq 4.6 \cdot 10^{-7}\right):\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.90000000000000032e-31 or 4.5999999999999999e-7 < z

    1. Initial program 83.2%

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

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

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

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

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

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

    if -5.90000000000000032e-31 < z < 4.5999999999999999e-7

    1. Initial program 93.2%

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{2}{y - t}}{z}} \]
      4. sub-neg94.8%

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

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

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-94.8%

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{\frac{\frac{2}{-1}}{t - y}}}{z} \]
      11. metadata-eval94.8%

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

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

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

Alternative 3: 73.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.6 \cdot 10^{-34} \lor \neg \left(t \leq 4.1 \cdot 10^{+34}\right):\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.59999999999999965e-34 or 4.0999999999999998e34 < t

    1. Initial program 85.5%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-89.3%

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

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

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

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

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

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

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

    if -9.59999999999999965e-34 < t < 4.0999999999999998e34

    1. Initial program 90.1%

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

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

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

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

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

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub091.7%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-91.7%

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

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

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

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

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

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

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

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

Alternative 4: 74.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{-33} \lor \neg \left(t \leq 4.2 \cdot 10^{+34}\right):\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.1e-33 or 4.20000000000000035e34 < t

    1. Initial program 85.5%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-89.3%

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

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

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

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

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

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

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

    if -2.1e-33 < t < 4.20000000000000035e34

    1. Initial program 90.1%

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

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

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

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

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

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub091.7%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-91.7%

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

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

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

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

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

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

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

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

Alternative 5: 74.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{+53} \lor \neg \left(t \leq 8.5 \cdot 10^{+34}\right):\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.99999999999999998e53 or 8.5000000000000003e34 < t

    1. Initial program 84.5%

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{2}{y - t}}{z}} \]
      4. sub-neg88.8%

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

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

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-88.8%

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

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

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

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

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

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

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

    if -2.99999999999999998e53 < t < 8.5000000000000003e34

    1. Initial program 90.4%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{0 - \left(t - y\right)}}}{z} \]
      8. sub0-neg91.9%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 73.9% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.25000000000000007e-33 or 4.0999999999999998e34 < t

    1. Initial program 85.5%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-89.3%

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

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

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

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

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

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

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

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

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

    if -1.25000000000000007e-33 < t < 4.0999999999999998e34

    1. Initial program 90.1%

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

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

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

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

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

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub091.7%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-91.7%

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

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

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

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

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

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

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

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

Alternative 7: 73.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+89} \lor \neg \left(t \leq 5.8 \cdot 10^{+34}\right):\\
\;\;\;\;\frac{x \cdot \frac{-2}{t}}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.2e89 or 5.8000000000000003e34 < t

    1. Initial program 83.9%

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

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

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

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

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

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub088.7%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-88.7%

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

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

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

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

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

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

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

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

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

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

    if -2.2e89 < t < 5.8000000000000003e34

    1. Initial program 90.4%

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

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

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

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

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

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub091.7%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-91.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 72.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.6 \cdot 10^{+89} \lor \neg \left(t \leq 4.1 \cdot 10^{+34}\right):\\
\;\;\;\;\frac{x \cdot \frac{-2}{t}}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.59999999999999948e89 or 4.0999999999999998e34 < t

    1. Initial program 83.9%

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

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

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

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

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

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub088.7%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-88.7%

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

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

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

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

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

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

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

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

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

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

    if -6.59999999999999948e89 < t < 4.0999999999999998e34

    1. Initial program 90.4%

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

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

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

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

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

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub091.7%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 72.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+89} \lor \neg \left(t \leq 7.8 \cdot 10^{+34}\right):\\
\;\;\;\;\frac{\frac{x \cdot -2}{t}}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.99999999999999983e89 or 7.80000000000000038e34 < t

    1. Initial program 83.9%

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

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

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

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

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

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub088.7%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-88.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999983e89 < t < 7.80000000000000038e34

    1. Initial program 90.4%

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

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

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

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

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

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub091.7%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 72.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t \leq 1.05 \cdot 10^{+35}:\\
\;\;\;\;\frac{\frac{x}{y}}{z \cdot 0.5}\\

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


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

    1. Initial program 82.9%

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

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

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

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

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

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

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

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

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

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

    if -2.09999999999999986e89 < t < 1.0499999999999999e35

    1. Initial program 90.4%

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

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

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

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

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

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
      6. neg-sub091.7%

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0499999999999999e35 < t

    1. Initial program 84.7%

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{2}{y - t}}{z}} \]
      4. sub-neg89.8%

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

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

        \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(0 - t\right)} + y}}{z} \]
      7. associate-+l-89.8%

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{\frac{\frac{2}{-1}}{t - y}}}{z} \]
      11. metadata-eval89.8%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 91.8% accurate, 1.2× speedup?

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

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

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

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

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

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

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

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

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

Alternative 12: 23.0% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 \cdot \left(-x\right)}{\frac{y}{2} \cdot \left(-z\right)}} \]
    5. *-un-lft-identity53.6%

      \[\leadsto \frac{\color{blue}{-x}}{\frac{y}{2} \cdot \left(-z\right)} \]
    6. add-sqr-sqrt27.4%

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

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

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

      \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{\frac{y}{2} \cdot \left(-z\right)} \]
    10. add-sqr-sqrt21.1%

      \[\leadsto \frac{\color{blue}{x}}{\frac{y}{2} \cdot \left(-z\right)} \]
    11. div-inv21.1%

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

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

    \[\leadsto \color{blue}{\frac{x}{\left(y \cdot 0.5\right) \cdot \left(-z\right)}} \]
  9. Step-by-step derivation
    1. *-commutative21.1%

      \[\leadsto \frac{x}{\color{blue}{\left(-z\right) \cdot \left(y \cdot 0.5\right)}} \]
    2. /-rgt-identity21.1%

      \[\leadsto \frac{x}{\color{blue}{\frac{\left(-z\right) \cdot \left(y \cdot 0.5\right)}{1}}} \]
    3. associate-*r*21.1%

      \[\leadsto \frac{x}{\frac{\color{blue}{\left(\left(-z\right) \cdot y\right) \cdot 0.5}}{1}} \]
    4. distribute-lft-neg-in21.1%

      \[\leadsto \frac{x}{\frac{\color{blue}{\left(-z \cdot y\right)} \cdot 0.5}{1}} \]
    5. associate-/l*21.1%

      \[\leadsto \frac{x}{\color{blue}{\frac{-z \cdot y}{\frac{1}{0.5}}}} \]
    6. metadata-eval21.1%

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

      \[\leadsto \color{blue}{\frac{x \cdot 2}{-z \cdot y}} \]
    8. distribute-rgt-neg-in21.1%

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

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

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

      \[\leadsto \frac{\color{blue}{2 \cdot \frac{x}{z}}}{-y} \]
    12. neg-mul-121.9%

      \[\leadsto \frac{2 \cdot \frac{x}{z}}{\color{blue}{-1 \cdot y}} \]
    13. times-frac21.9%

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

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

    \[\leadsto \color{blue}{-2 \cdot \frac{\frac{x}{z}}{y}} \]
  11. Final simplification21.9%

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

Alternative 13: 53.7% accurate, 1.6× speedup?

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

\\
x \cdot \frac{2}{y \cdot z}
\end{array}
Derivation
  1. Initial program 87.8%

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{\frac{2}{y - t}}{z}} \]
    4. sub-neg90.5%

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

      \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(-t\right) + y}}}{z} \]
    6. neg-sub090.5%

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

      \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{0 - \left(t - y\right)}}}{z} \]
    8. sub0-neg90.5%

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

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

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

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

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

    \[\leadsto x \cdot \color{blue}{\frac{2}{y \cdot z}} \]
  5. Final simplification53.6%

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

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 2023200 
(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))))