Linear.Projection:infinitePerspective from linear-1.19.1.3, A

Percentage Accurate: 89.6% → 96.5%
Time: 11.8s
Alternatives: 12
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 12 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.6% 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: 96.5% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 96.3%

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

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

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

    if -2.0000000000019e-312 < (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) < 1e-203

    1. Initial program 77.5%

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

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

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

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

    if 1e-203 < (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z)))

    1. Initial program 85.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot \frac{2}{y - t}}{z}} \]
    6. Step-by-step derivation
      1. frac-2neg95.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x \cdot -2}{\left(0 - \color{blue}{\sqrt{t} \cdot \sqrt{t}}\right) - y}}{z} \]
      12. add-sqr-sqrt53.9%

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

        \[\leadsto \frac{\frac{x \cdot -2}{\color{blue}{\left(-t\right)} - y}}{z} \]
      14. add-sqr-sqrt25.8%

        \[\leadsto \frac{\frac{x \cdot -2}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}} - y}}{z} \]
      15. sqrt-unprod73.2%

        \[\leadsto \frac{\frac{x \cdot -2}{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}} - y}}{z} \]
      16. sqr-neg73.2%

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

        \[\leadsto \frac{\frac{x \cdot -2}{\color{blue}{\sqrt{t} \cdot \sqrt{t}} - y}}{z} \]
      18. add-sqr-sqrt96.1%

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

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

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

Alternative 2: 96.4% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x 2) < -9.9999999999999998e-20 or 5.0000000000000001e-128 < (*.f64 x 2)

    1. Initial program 84.5%

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

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

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

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

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

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

    if -9.9999999999999998e-20 < (*.f64 x 2) < 5.0000000000000001e-128

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 96.7% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.4e68

    1. Initial program 72.6%

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

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

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

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

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

    if -1.4e68 < z < 1.0999999999999999e-34

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0999999999999999e-34 < z

    1. Initial program 85.5%

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

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

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

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

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

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

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

Alternative 4: 97.0% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq 1.1 \cdot 10^{-34}:\\
\;\;\;\;\frac{x \cdot 2}{z \cdot \left(y - t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.7000000000000002e46

    1. Initial program 74.4%

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

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

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

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

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

    if -2.7000000000000002e46 < z < 1.0999999999999999e-34

    1. Initial program 93.6%

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

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

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

    if 1.0999999999999999e-34 < z

    1. Initial program 85.5%

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

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

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

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

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

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

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

Alternative 5: 97.0% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq 1.05 \cdot 10^{-34}:\\
\;\;\;\;\frac{x \cdot 2}{z \cdot \left(y - t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.50000000000000012e46

    1. Initial program 74.4%

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

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

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

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

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

    if -1.50000000000000012e46 < z < 1.05e-34

    1. Initial program 93.6%

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

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

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

    if 1.05e-34 < z

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x \cdot -2}{\left(0 - \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}\right) - y}}{z} \]
      10. sqr-neg78.6%

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

        \[\leadsto \frac{\frac{x \cdot -2}{\left(0 - \color{blue}{\sqrt{t} \cdot \sqrt{t}}\right) - y}}{z} \]
      12. add-sqr-sqrt64.5%

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

        \[\leadsto \frac{\frac{x \cdot -2}{\color{blue}{\left(-t\right)} - y}}{z} \]
      14. add-sqr-sqrt29.8%

        \[\leadsto \frac{\frac{x \cdot -2}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}} - y}}{z} \]
      15. sqrt-unprod73.8%

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

        \[\leadsto \frac{\frac{x \cdot -2}{\sqrt{\color{blue}{t \cdot t}} - y}}{z} \]
      17. sqrt-unprod51.5%

        \[\leadsto \frac{\frac{x \cdot -2}{\color{blue}{\sqrt{t} \cdot \sqrt{t}} - y}}{z} \]
      18. add-sqr-sqrt99.8%

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

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

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

Alternative 6: 73.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-54} \lor \neg \left(y \leq 180000000\right):\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.8000000000000002e-54 or 1.8e8 < y

    1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

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

    if -2.8000000000000002e-54 < y < 1.8e8

    1. Initial program 88.9%

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

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

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

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

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

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

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

Alternative 7: 73.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -600000000000 \lor \neg \left(y \leq 45000\right):\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6e11 or 45000 < y

    1. Initial program 84.9%

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

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

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

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

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

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

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

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

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

    if -6e11 < y < 45000

    1. Initial program 88.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 75.2% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.5e-33

    1. Initial program 82.9%

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

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

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

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

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

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

    if -5.5e-33 < t < 6.49999999999999957e-13

    1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

    if 6.49999999999999957e-13 < t

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 73.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 680000:\\
\;\;\;\;\frac{-2 \cdot \frac{x}{t}}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.65e7

    1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.65e7 < y < 6.8e5

    1. Initial program 88.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.8e5 < y

    1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 73.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 2750000:\\
\;\;\;\;\frac{-2 \cdot \frac{x}{t}}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.55e10

    1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.55e10 < y < 2.75e6

    1. Initial program 88.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.75e6 < y

    1. Initial program 87.8%

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

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

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

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

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

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

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

Alternative 11: 92.2% accurate, 1.2× speedup?

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

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

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

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

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

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

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

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

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

Alternative 12: 54.5% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 97.0% 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 2023301 
(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))))