Linear.Projection:infinitePerspective from linear-1.19.1.3, A

Percentage Accurate: 89.9% → 94.5%
Time: 7.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.9% 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: 94.5% accurate, 0.5× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) < -5e-277

    1. Initial program 99.5%

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

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

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

    if -5e-277 < (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z)))

    1. Initial program 86.8%

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

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

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

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

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

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

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

Alternative 2: 73.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{-84} \lor \neg \left(y \leq 2.7 \cdot 10^{-8}\right):\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{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.5e-84) (not (<= y 2.7e-8)))
   (* 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.5e-84) || !(y <= 2.7e-8)) {
		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.5d-84)) .or. (.not. (y <= 2.7d-8))) 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.5e-84) || !(y <= 2.7e-8)) {
		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.5e-84) or not (y <= 2.7e-8):
		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.5e-84) || !(y <= 2.7e-8))
		tmp = Float64(x * Float64(Float64(2.0 / 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.5e-84) || ~((y <= 2.7e-8)))
		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.5e-84], N[Not[LessEqual[y, 2.7e-8]], $MachinePrecision]], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{-84} \lor \neg \left(y \leq 2.7 \cdot 10^{-8}\right):\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{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.50000000000000016e-84 or 2.70000000000000002e-8 < y

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.50000000000000016e-84 < y < 2.70000000000000002e-8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 73.5% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.50000000000000016e-84

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.50000000000000016e-84 < y < 9.00000000000000057e-5

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.00000000000000057e-5 < y

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

Alternative 4: 73.6% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.50000000000000016e-84

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.50000000000000016e-84 < y < 3.9999999999999998e-7

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999998e-7 < y

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

Alternative 5: 73.6% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.19999999999999996e-84

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.19999999999999996e-84 < y < 1.3000000000000001e-9

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

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

    if 1.3000000000000001e-9 < y

    1. Initial program 89.9%

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

        \[\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 0 79.6%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{2}{z}} \]
      4. clear-num81.0%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{\frac{z}{2}}} \]
      6. div-inv81.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{-84}:\\ \;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-9}:\\ \;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{z \cdot 0.5}\\ \end{array} \]

Alternative 6: 73.6% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.50000000000000016e-84

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.50000000000000016e-84 < y < 4.5e-11

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(-2\right)} \cdot x}{t \cdot z} \]
      3. distribute-lft-neg-in82.1%

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

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

        \[\leadsto \color{blue}{\frac{\frac{-x \cdot 2}{t}}{z}} \]
      6. distribute-rgt-neg-in86.9%

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

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

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

    if 4.5e-11 < y

    1. Initial program 89.9%

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

        \[\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 0 79.6%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{2}{z}} \]
      4. clear-num81.0%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{\frac{z}{2}}} \]
      6. div-inv81.1%

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

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

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

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

Alternative 7: 92.8% accurate, 1.0× speedup?

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

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3999999999999999e-211 < z

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

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

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

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

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

Alternative 8: 91.7% 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 91.0%

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

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

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

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

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

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

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

Alternative 9: 91.7% accurate, 1.2× speedup?

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

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

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

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

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

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

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

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

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

Alternative 10: 54.1% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 11: 54.2% 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 91.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 97.1% 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 2023242 
(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))))