Linear.Projection:infinitePerspective from linear-1.19.1.3, A

Percentage Accurate: 89.5% → 92.4%
Time: 8.3s
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: 89.5% 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: 92.4% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.29999999999999995e-144

    1. Initial program 82.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.29999999999999995e-144 < y

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 72.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+83} \lor \neg \left(y \leq 3.9 \cdot 10^{+66}\right):\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.50000000000000014e83 or 3.9000000000000004e66 < y

    1. Initial program 85.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.50000000000000014e83 < y < 3.9000000000000004e66

    1. Initial program 93.5%

      \[\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.3%

        \[\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 inf 78.8%

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

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

Alternative 3: 72.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+83} \lor \neg \left(y \leq 3.9 \cdot 10^{+66}\right):\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.79999999999999982e83 or 3.9000000000000004e66 < y

    1. Initial program 85.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.79999999999999982e83 < y < 3.9000000000000004e66

    1. Initial program 93.5%

      \[\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.3%

        \[\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 inf 79.4%

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

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

Alternative 4: 72.3% accurate, 1.0× speedup?

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

\mathbf{elif}\;y \leq 1.02 \cdot 10^{+67}:\\
\;\;\;\;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 3 regimes
  2. if y < -2.25e83

    1. Initial program 84.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.25e83 < y < 1.02000000000000002e67

    1. Initial program 93.5%

      \[\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.3%

        \[\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 inf 79.4%

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

    if 1.02000000000000002e67 < y

    1. Initial program 87.1%

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

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

        \[\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}} \]
    4. Taylor expanded in t around 0 87.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.25 \cdot 10^{+83}:\\ \;\;\;\;x \cdot \frac{2}{y \cdot z}\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{+67}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \end{array} \]

Alternative 5: 72.5% accurate, 1.0× speedup?

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

\mathbf{elif}\;y \leq 4.5 \cdot 10^{+66}:\\
\;\;\;\;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 3 regimes
  2. if y < -2.19999999999999999e83

    1. Initial program 84.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.19999999999999999e83 < y < 4.4999999999999998e66

    1. Initial program 93.5%

      \[\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.3%

        \[\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 inf 79.4%

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

    if 4.4999999999999998e66 < y

    1. Initial program 87.1%

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

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

        \[\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}} \]
    4. Taylor expanded in t around 0 87.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{+83}:\\ \;\;\;\;\frac{2 \cdot \frac{x}{y}}{z}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+66}:\\ \;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \end{array} \]

Alternative 6: 93.9% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 88.0%

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

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

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

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

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

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

    if -8.99999999999999977e-48 < z

    1. Initial program 91.8%

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

        \[\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. Simplified94.8%

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

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

Alternative 7: 94.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{-39}:\\ \;\;\;\;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 (<= z -1.05e-39)
   (* 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 <= -1.05e-39) {
		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 <= (-1.05d-39)) 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 <= -1.05e-39) {
		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 <= -1.05e-39:
		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 <= -1.05e-39)
		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 <= -1.05e-39)
		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[LessEqual[z, -1.05e-39], 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 -1.05 \cdot 10^{-39}:\\
\;\;\;\;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 < -1.04999999999999997e-39

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

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

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

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

    if -1.04999999999999997e-39 < z

    1. Initial program 91.9%

      \[\frac{x \cdot 2}{y \cdot z - t \cdot z} \]
    2. Step-by-step derivation
      1. associate-*r/91.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/95.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 94.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 88.0%

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

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

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

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

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

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

    if -1.79999999999999995e-47 < z

    1. Initial program 91.8%

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

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

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

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

Alternative 9: 92.4% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.9000000000000002e-144

    1. Initial program 82.5%

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

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

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

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

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

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

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

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

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

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

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

    if -2.9000000000000002e-144 < y

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 53.3% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 96.7% 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 2023238 
(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))))