Linear.Projection:infinitePerspective from linear-1.19.1.3, A

Percentage Accurate: 90.2% → 98.4%
Time: 7.8s
Alternatives: 11
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 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.2% 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.4% 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 4 \cdot 10^{+195}\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 4e+195)))
     (* 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 <= 4e+195)) {
		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 <= 4e+195)) {
		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 <= 4e+195):
		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 <= 4e+195))
		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 <= 4e+195)))
		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, 4e+195]], $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 4 \cdot 10^{+195}\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 3.99999999999999991e195 < (-.f64 (*.f64 y z) (*.f64 t z))

    1. Initial program 65.6%

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

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

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

        \[\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)) < 3.99999999999999991e195

    1. Initial program 97.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z - z \cdot t \leq -\infty \lor \neg \left(y \cdot z - z \cdot t \leq 4 \cdot 10^{+195}\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: 73.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \frac{\frac{2}{y}}{z}\\
t_2 := x \cdot \frac{\frac{-2}{t}}{z}\\
\mathbf{if}\;t \leq -280000000:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq -1.4 \cdot 10^{-69}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 2.4 \cdot 10^{-67}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.8e8 or 2.4e-67 < t

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8e8 < t < -1.3999999999999999e-69 or -1.45e-98 < t < 2.4e-67

    1. Initial program 91.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999e-69 < t < -1.45e-98

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -280000000:\\ \;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\ \mathbf{elif}\;t \leq -1.4 \cdot 10^{-69}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \mathbf{elif}\;t \leq -1.45 \cdot 10^{-98}:\\ \;\;\;\;x \cdot \frac{-2}{z \cdot t}\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-67}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\ \end{array} \]

Alternative 3: 73.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{\frac{-2}{t}}{z}\\ \mathbf{if}\;t \leq -280000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -2.6 \cdot 10^{-68}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{elif}\;t \leq -8.5 \cdot 10^{-98}:\\ \;\;\;\;x \cdot \frac{-2}{z \cdot t}\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-61}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (/ (/ -2.0 t) z))))
   (if (<= t -280000000.0)
     t_1
     (if (<= t -2.6e-68)
       (* (/ x z) (/ 2.0 y))
       (if (<= t -8.5e-98)
         (* x (/ -2.0 (* z t)))
         (if (<= t 3.2e-61) (* x (/ (/ 2.0 y) z)) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * ((-2.0 / t) / z);
	double tmp;
	if (t <= -280000000.0) {
		tmp = t_1;
	} else if (t <= -2.6e-68) {
		tmp = (x / z) * (2.0 / y);
	} else if (t <= -8.5e-98) {
		tmp = x * (-2.0 / (z * t));
	} else if (t <= 3.2e-61) {
		tmp = x * ((2.0 / y) / z);
	} 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) :: tmp
    t_1 = x * (((-2.0d0) / t) / z)
    if (t <= (-280000000.0d0)) then
        tmp = t_1
    else if (t <= (-2.6d-68)) then
        tmp = (x / z) * (2.0d0 / y)
    else if (t <= (-8.5d-98)) then
        tmp = x * ((-2.0d0) / (z * t))
    else if (t <= 3.2d-61) then
        tmp = x * ((2.0d0 / y) / z)
    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 * ((-2.0 / t) / z);
	double tmp;
	if (t <= -280000000.0) {
		tmp = t_1;
	} else if (t <= -2.6e-68) {
		tmp = (x / z) * (2.0 / y);
	} else if (t <= -8.5e-98) {
		tmp = x * (-2.0 / (z * t));
	} else if (t <= 3.2e-61) {
		tmp = x * ((2.0 / y) / z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * ((-2.0 / t) / z)
	tmp = 0
	if t <= -280000000.0:
		tmp = t_1
	elif t <= -2.6e-68:
		tmp = (x / z) * (2.0 / y)
	elif t <= -8.5e-98:
		tmp = x * (-2.0 / (z * t))
	elif t <= 3.2e-61:
		tmp = x * ((2.0 / y) / z)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(Float64(-2.0 / t) / z))
	tmp = 0.0
	if (t <= -280000000.0)
		tmp = t_1;
	elseif (t <= -2.6e-68)
		tmp = Float64(Float64(x / z) * Float64(2.0 / y));
	elseif (t <= -8.5e-98)
		tmp = Float64(x * Float64(-2.0 / Float64(z * t)));
	elseif (t <= 3.2e-61)
		tmp = Float64(x * Float64(Float64(2.0 / y) / z));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * ((-2.0 / t) / z);
	tmp = 0.0;
	if (t <= -280000000.0)
		tmp = t_1;
	elseif (t <= -2.6e-68)
		tmp = (x / z) * (2.0 / y);
	elseif (t <= -8.5e-98)
		tmp = x * (-2.0 / (z * t));
	elseif (t <= 3.2e-61)
		tmp = x * ((2.0 / y) / z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -280000000.0], t$95$1, If[LessEqual[t, -2.6e-68], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -8.5e-98], N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e-61], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \frac{\frac{-2}{t}}{z}\\
\mathbf{if}\;t \leq -280000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -2.6 \cdot 10^{-68}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\

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

\mathbf{elif}\;t \leq 3.2 \cdot 10^{-61}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.8e8 or 3.2000000000000001e-61 < t

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8e8 < t < -2.5999999999999998e-68

    1. Initial program 82.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5999999999999998e-68 < t < -8.4999999999999997e-98

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.4999999999999997e-98 < t < 3.2000000000000001e-61

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -280000000:\\ \;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\ \mathbf{elif}\;t \leq -2.6 \cdot 10^{-68}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\ \mathbf{elif}\;t \leq -8.5 \cdot 10^{-98}:\\ \;\;\;\;x \cdot \frac{-2}{z \cdot t}\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-61}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\ \end{array} \]

Alternative 4: 73.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \frac{\frac{-2}{t}}{z}\\
\mathbf{if}\;t \leq -450000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -7 \cdot 10^{-71}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\

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

\mathbf{elif}\;t \leq 4.6 \cdot 10^{-59}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -4.5e8 or 4.59999999999999959e-59 < t

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.5e8 < t < -6.9999999999999998e-71

    1. Initial program 82.5%

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

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

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

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

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

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

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

    if -6.9999999999999998e-71 < t < -7.6000000000000006e-98

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.6000000000000006e-98 < t < 4.59999999999999959e-59

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -450000000:\\ \;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\ \mathbf{elif}\;t \leq -7 \cdot 10^{-71}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;t \leq -7.6 \cdot 10^{-98}:\\ \;\;\;\;x \cdot \frac{-2}{z \cdot t}\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{-59}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\ \end{array} \]

Alternative 5: 73.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \frac{\frac{-2}{t}}{z}\\
\mathbf{if}\;t \leq -10200000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -1.7 \cdot 10^{-71}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\

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

\mathbf{elif}\;t \leq 2.8 \cdot 10^{-70}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.02e10 or 2.7999999999999999e-70 < t

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.02e10 < t < -1.70000000000000002e-71

    1. Initial program 82.5%

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

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

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

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

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

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

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

    if -1.70000000000000002e-71 < t < -7.6000000000000006e-98

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.6000000000000006e-98 < t < 2.7999999999999999e-70

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -10200000000:\\ \;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\ \mathbf{elif}\;t \leq -1.7 \cdot 10^{-71}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;t \leq -7.6 \cdot 10^{-98}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{-70}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\ \end{array} \]

Alternative 6: 72.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -280000000:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -2.8e8

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8e8 < t < -1.07999999999999994e-63

    1. Initial program 82.5%

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

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

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

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

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

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

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

    if -1.07999999999999994e-63 < t < -1.64999999999999993e-99

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.64999999999999993e-99 < t < 2.64999999999999993e-117

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.64999999999999993e-117 < t

    1. Initial program 83.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -280000000:\\ \;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\ \mathbf{elif}\;t \leq -1.08 \cdot 10^{-63}:\\ \;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;t \leq -1.65 \cdot 10^{-99}:\\ \;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\ \mathbf{elif}\;t \leq 2.65 \cdot 10^{-117}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{\frac{x}{z}}{t}\\ \end{array} \]

Alternative 7: 94.3% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 91.4%

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

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

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

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

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

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

    if 2e-19 < (*.f64 x 2)

    1. Initial program 83.9%

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

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

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

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

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

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

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

Alternative 8: 92.1% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 4.8000000000000002e-114

    1. Initial program 92.5%

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

        \[\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/96.0%

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

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

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

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

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

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

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

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

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

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

    if 4.8000000000000002e-114 < t

    1. Initial program 83.5%

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

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

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

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

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

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

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

Alternative 9: 91.9% 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 89.1%

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

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

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

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

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

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

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

Alternative 10: 52.9% 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 89.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 53.1% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 97.3% accurate, 0.3× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023230 
(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))))