Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 8.5s
Alternatives: 13
Speedup: 1.0×

Specification

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

\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}

Alternative 1: 100.0% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y - z, t - x, x\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (fma (- y z) (- t x) x))
double code(double x, double y, double z, double t) {
	return fma((y - z), (t - x), x);
}
function code(x, y, z, t)
	return fma(Float64(y - z), Float64(t - x), x)
end
code[x_, y_, z_, t_] := N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y - z, t - x, x\right)
\end{array}
Derivation
  1. Initial program 100.0%

    \[x + \left(y - z\right) \cdot \left(t - x\right) \]
  2. Step-by-step derivation
    1. +-commutative100.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, t - x, x\right)} \]
  3. Simplified100.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, t - x, x\right)} \]
  4. Final simplification100.0%

    \[\leadsto \mathsf{fma}\left(y - z, t - x, x\right) \]

Alternative 2: 38.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(-z\right)\\ \mathbf{if}\;y \leq -1 \cdot 10^{+255}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -1:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{-146}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -1.12 \cdot 10^{-237}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-280}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-264}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (- z))))
   (if (<= y -1e+255)
     (* y t)
     (if (<= y -1.0)
       (* y (- x))
       (if (<= y -2.4e-146)
         x
         (if (<= y -1.12e-237)
           t_1
           (if (<= y -3.5e-280)
             x
             (if (<= y 2.5e-264) t_1 (if (<= y 4.8e-27) x (* y t))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * -z;
	double tmp;
	if (y <= -1e+255) {
		tmp = y * t;
	} else if (y <= -1.0) {
		tmp = y * -x;
	} else if (y <= -2.4e-146) {
		tmp = x;
	} else if (y <= -1.12e-237) {
		tmp = t_1;
	} else if (y <= -3.5e-280) {
		tmp = x;
	} else if (y <= 2.5e-264) {
		tmp = t_1;
	} else if (y <= 4.8e-27) {
		tmp = x;
	} else {
		tmp = 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) :: t_1
    real(8) :: tmp
    t_1 = t * -z
    if (y <= (-1d+255)) then
        tmp = y * t
    else if (y <= (-1.0d0)) then
        tmp = y * -x
    else if (y <= (-2.4d-146)) then
        tmp = x
    else if (y <= (-1.12d-237)) then
        tmp = t_1
    else if (y <= (-3.5d-280)) then
        tmp = x
    else if (y <= 2.5d-264) then
        tmp = t_1
    else if (y <= 4.8d-27) then
        tmp = x
    else
        tmp = y * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t * -z;
	double tmp;
	if (y <= -1e+255) {
		tmp = y * t;
	} else if (y <= -1.0) {
		tmp = y * -x;
	} else if (y <= -2.4e-146) {
		tmp = x;
	} else if (y <= -1.12e-237) {
		tmp = t_1;
	} else if (y <= -3.5e-280) {
		tmp = x;
	} else if (y <= 2.5e-264) {
		tmp = t_1;
	} else if (y <= 4.8e-27) {
		tmp = x;
	} else {
		tmp = y * t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * -z
	tmp = 0
	if y <= -1e+255:
		tmp = y * t
	elif y <= -1.0:
		tmp = y * -x
	elif y <= -2.4e-146:
		tmp = x
	elif y <= -1.12e-237:
		tmp = t_1
	elif y <= -3.5e-280:
		tmp = x
	elif y <= 2.5e-264:
		tmp = t_1
	elif y <= 4.8e-27:
		tmp = x
	else:
		tmp = y * t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(-z))
	tmp = 0.0
	if (y <= -1e+255)
		tmp = Float64(y * t);
	elseif (y <= -1.0)
		tmp = Float64(y * Float64(-x));
	elseif (y <= -2.4e-146)
		tmp = x;
	elseif (y <= -1.12e-237)
		tmp = t_1;
	elseif (y <= -3.5e-280)
		tmp = x;
	elseif (y <= 2.5e-264)
		tmp = t_1;
	elseif (y <= 4.8e-27)
		tmp = x;
	else
		tmp = Float64(y * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * -z;
	tmp = 0.0;
	if (y <= -1e+255)
		tmp = y * t;
	elseif (y <= -1.0)
		tmp = y * -x;
	elseif (y <= -2.4e-146)
		tmp = x;
	elseif (y <= -1.12e-237)
		tmp = t_1;
	elseif (y <= -3.5e-280)
		tmp = x;
	elseif (y <= 2.5e-264)
		tmp = t_1;
	elseif (y <= 4.8e-27)
		tmp = x;
	else
		tmp = y * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * (-z)), $MachinePrecision]}, If[LessEqual[y, -1e+255], N[(y * t), $MachinePrecision], If[LessEqual[y, -1.0], N[(y * (-x)), $MachinePrecision], If[LessEqual[y, -2.4e-146], x, If[LessEqual[y, -1.12e-237], t$95$1, If[LessEqual[y, -3.5e-280], x, If[LessEqual[y, 2.5e-264], t$95$1, If[LessEqual[y, 4.8e-27], x, N[(y * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \left(-z\right)\\
\mathbf{if}\;y \leq -1 \cdot 10^{+255}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq -1:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{elif}\;y \leq -2.4 \cdot 10^{-146}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -1.12 \cdot 10^{-237}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -3.5 \cdot 10^{-280}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 2.5 \cdot 10^{-264}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 4.8 \cdot 10^{-27}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;y \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -9.99999999999999988e254 or 4.80000000000000004e-27 < y

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 55.8%

      \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
    3. Taylor expanded in y around inf 48.4%

      \[\leadsto \color{blue}{y \cdot t} \]

    if -9.99999999999999988e254 < y < -1

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Step-by-step derivation
      1. *-commutative100.0%

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

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

        \[\leadsto x + \color{blue}{\frac{\left(t - x\right) \cdot \left(y \cdot y - z \cdot z\right)}{y + z}} \]
    3. Applied egg-rr66.1%

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{y + z}{y \cdot y - z \cdot z}}} \]
      2. difference-of-squares80.9%

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

        \[\leadsto x + \frac{t - x}{\color{blue}{\frac{\frac{y + z}{y + z}}{y - z}}} \]
      4. *-inverses99.5%

        \[\leadsto x + \frac{t - x}{\frac{\color{blue}{1}}{y - z}} \]
    5. Simplified99.5%

      \[\leadsto x + \color{blue}{\frac{t - x}{\frac{1}{y - z}}} \]
    6. Taylor expanded in y around inf 81.6%

      \[\leadsto x + \frac{t - x}{\color{blue}{\frac{1}{y}}} \]
    7. Taylor expanded in x around inf 53.0%

      \[\leadsto \color{blue}{\left(1 + -1 \cdot y\right) \cdot x} \]
    8. Step-by-step derivation
      1. +-commutative53.0%

        \[\leadsto \color{blue}{\left(-1 \cdot y + 1\right)} \cdot x \]
      2. distribute-rgt1-in53.0%

        \[\leadsto \color{blue}{x + \left(-1 \cdot y\right) \cdot x} \]
      3. mul-1-neg53.0%

        \[\leadsto x + \color{blue}{\left(-y\right)} \cdot x \]
      4. cancel-sign-sub-inv53.0%

        \[\leadsto \color{blue}{x - y \cdot x} \]
    9. Simplified53.0%

      \[\leadsto \color{blue}{x - y \cdot x} \]
    10. Taylor expanded in y around inf 53.0%

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot x\right)} \]
    11. Step-by-step derivation
      1. mul-1-neg53.0%

        \[\leadsto \color{blue}{-y \cdot x} \]
      2. distribute-rgt-neg-out53.0%

        \[\leadsto \color{blue}{y \cdot \left(-x\right)} \]
    12. Simplified53.0%

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

    if -1 < y < -2.4000000000000002e-146 or -1.12000000000000002e-237 < y < -3.5000000000000001e-280 or 2.5e-264 < y < 4.80000000000000004e-27

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 76.4%

      \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
    3. Taylor expanded in x around inf 44.5%

      \[\leadsto \color{blue}{x} \]

    if -2.4000000000000002e-146 < y < -1.12000000000000002e-237 or -3.5000000000000001e-280 < y < 2.5e-264

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 78.4%

      \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
    3. Taylor expanded in z around inf 59.4%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot z\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg59.4%

        \[\leadsto \color{blue}{-t \cdot z} \]
      2. *-commutative59.4%

        \[\leadsto -\color{blue}{z \cdot t} \]
      3. distribute-rgt-neg-in59.4%

        \[\leadsto \color{blue}{z \cdot \left(-t\right)} \]
    5. Simplified59.4%

      \[\leadsto \color{blue}{z \cdot \left(-t\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification49.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{+255}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -1:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{-146}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -1.12 \cdot 10^{-237}:\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-280}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-264}:\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]

Alternative 3: 56.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(-z\right)\\ t_2 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -2.4 \cdot 10^{-47}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{-147}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -9 \cdot 10^{-238}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.28 \cdot 10^{-279}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{-264}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (- z))) (t_2 (* y (- t x))))
   (if (<= y -2.4e-47)
     t_2
     (if (<= y -7.5e-147)
       x
       (if (<= y -9e-238)
         t_1
         (if (<= y -1.28e-279)
           x
           (if (<= y 7.4e-264) t_1 (if (<= y 6e-27) x t_2))))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * -z;
	double t_2 = y * (t - x);
	double tmp;
	if (y <= -2.4e-47) {
		tmp = t_2;
	} else if (y <= -7.5e-147) {
		tmp = x;
	} else if (y <= -9e-238) {
		tmp = t_1;
	} else if (y <= -1.28e-279) {
		tmp = x;
	} else if (y <= 7.4e-264) {
		tmp = t_1;
	} else if (y <= 6e-27) {
		tmp = x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t * -z
    t_2 = y * (t - x)
    if (y <= (-2.4d-47)) then
        tmp = t_2
    else if (y <= (-7.5d-147)) then
        tmp = x
    else if (y <= (-9d-238)) then
        tmp = t_1
    else if (y <= (-1.28d-279)) then
        tmp = x
    else if (y <= 7.4d-264) then
        tmp = t_1
    else if (y <= 6d-27) then
        tmp = x
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t * -z;
	double t_2 = y * (t - x);
	double tmp;
	if (y <= -2.4e-47) {
		tmp = t_2;
	} else if (y <= -7.5e-147) {
		tmp = x;
	} else if (y <= -9e-238) {
		tmp = t_1;
	} else if (y <= -1.28e-279) {
		tmp = x;
	} else if (y <= 7.4e-264) {
		tmp = t_1;
	} else if (y <= 6e-27) {
		tmp = x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * -z
	t_2 = y * (t - x)
	tmp = 0
	if y <= -2.4e-47:
		tmp = t_2
	elif y <= -7.5e-147:
		tmp = x
	elif y <= -9e-238:
		tmp = t_1
	elif y <= -1.28e-279:
		tmp = x
	elif y <= 7.4e-264:
		tmp = t_1
	elif y <= 6e-27:
		tmp = x
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(-z))
	t_2 = Float64(y * Float64(t - x))
	tmp = 0.0
	if (y <= -2.4e-47)
		tmp = t_2;
	elseif (y <= -7.5e-147)
		tmp = x;
	elseif (y <= -9e-238)
		tmp = t_1;
	elseif (y <= -1.28e-279)
		tmp = x;
	elseif (y <= 7.4e-264)
		tmp = t_1;
	elseif (y <= 6e-27)
		tmp = x;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * -z;
	t_2 = y * (t - x);
	tmp = 0.0;
	if (y <= -2.4e-47)
		tmp = t_2;
	elseif (y <= -7.5e-147)
		tmp = x;
	elseif (y <= -9e-238)
		tmp = t_1;
	elseif (y <= -1.28e-279)
		tmp = x;
	elseif (y <= 7.4e-264)
		tmp = t_1;
	elseif (y <= 6e-27)
		tmp = x;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * (-z)), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.4e-47], t$95$2, If[LessEqual[y, -7.5e-147], x, If[LessEqual[y, -9e-238], t$95$1, If[LessEqual[y, -1.28e-279], x, If[LessEqual[y, 7.4e-264], t$95$1, If[LessEqual[y, 6e-27], x, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -7.5 \cdot 10^{-147}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -9 \cdot 10^{-238}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -1.28 \cdot 10^{-279}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 7.4 \cdot 10^{-264}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 6 \cdot 10^{-27}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.3999999999999999e-47 or 6.0000000000000002e-27 < y

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Step-by-step derivation
      1. *-commutative99.9%

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

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

        \[\leadsto x + \color{blue}{\frac{\left(t - x\right) \cdot \left(y \cdot y - z \cdot z\right)}{y + z}} \]
    3. Applied egg-rr62.7%

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{y + z}{y \cdot y - z \cdot z}}} \]
      2. difference-of-squares79.7%

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

        \[\leadsto x + \frac{t - x}{\color{blue}{\frac{\frac{y + z}{y + z}}{y - z}}} \]
      4. *-inverses99.7%

        \[\leadsto x + \frac{t - x}{\frac{\color{blue}{1}}{y - z}} \]
    5. Simplified99.7%

      \[\leadsto x + \color{blue}{\frac{t - x}{\frac{1}{y - z}}} \]
    6. Taylor expanded in y around inf 81.6%

      \[\leadsto x + \frac{t - x}{\color{blue}{\frac{1}{y}}} \]
    7. Step-by-step derivation
      1. +-commutative81.6%

        \[\leadsto \color{blue}{\frac{t - x}{\frac{1}{y}} + x} \]
      2. div-sub76.9%

        \[\leadsto \color{blue}{\left(\frac{t}{\frac{1}{y}} - \frac{x}{\frac{1}{y}}\right)} + x \]
      3. div-inv76.9%

        \[\leadsto \left(\color{blue}{t \cdot \frac{1}{\frac{1}{y}}} - \frac{x}{\frac{1}{y}}\right) + x \]
      4. remove-double-div77.0%

        \[\leadsto \left(t \cdot \color{blue}{y} - \frac{x}{\frac{1}{y}}\right) + x \]
      5. *-commutative77.0%

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

        \[\leadsto \left(y \cdot t - \color{blue}{x \cdot \frac{1}{\frac{1}{y}}}\right) + x \]
      7. remove-double-div77.1%

        \[\leadsto \left(y \cdot t - x \cdot \color{blue}{y}\right) + x \]
      8. *-commutative77.1%

        \[\leadsto \left(y \cdot t - \color{blue}{y \cdot x}\right) + x \]
      9. associate-+l-77.1%

        \[\leadsto \color{blue}{y \cdot t - \left(y \cdot x - x\right)} \]
      10. *-commutative77.1%

        \[\leadsto \color{blue}{t \cdot y} - \left(y \cdot x - x\right) \]
      11. add-sqr-sqrt33.7%

        \[\leadsto t \cdot y - \left(\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot x - x\right) \]
      12. sqrt-unprod45.3%

        \[\leadsto t \cdot y - \left(\color{blue}{\sqrt{y \cdot y}} \cdot x - x\right) \]
      13. sqr-neg45.3%

        \[\leadsto t \cdot y - \left(\sqrt{\color{blue}{\left(-y\right) \cdot \left(-y\right)}} \cdot x - x\right) \]
      14. sqrt-unprod23.8%

        \[\leadsto t \cdot y - \left(\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot x - x\right) \]
      15. add-sqr-sqrt42.5%

        \[\leadsto t \cdot y - \left(\color{blue}{\left(-y\right)} \cdot x - x\right) \]
      16. *-un-lft-identity42.5%

        \[\leadsto t \cdot y - \left(\left(-y\right) \cdot x - \color{blue}{1 \cdot x}\right) \]
      17. distribute-rgt-out--42.5%

        \[\leadsto t \cdot y - \color{blue}{x \cdot \left(\left(-y\right) - 1\right)} \]
      18. add-sqr-sqrt23.8%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{\sqrt{-y} \cdot \sqrt{-y}} - 1\right) \]
      19. sqrt-unprod45.3%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} - 1\right) \]
      20. sqr-neg45.3%

        \[\leadsto t \cdot y - x \cdot \left(\sqrt{\color{blue}{y \cdot y}} - 1\right) \]
      21. sqrt-unprod33.7%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{\sqrt{y} \cdot \sqrt{y}} - 1\right) \]
      22. add-sqr-sqrt77.1%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{y} - 1\right) \]
    8. Applied egg-rr77.1%

      \[\leadsto \color{blue}{t \cdot y - x \cdot \left(y - 1\right)} \]
    9. Taylor expanded in y around inf 80.0%

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

    if -2.3999999999999999e-47 < y < -7.50000000000000047e-147 or -8.99999999999999992e-238 < y < -1.28e-279 or 7.39999999999999991e-264 < y < 6.0000000000000002e-27

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 75.0%

      \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
    3. Taylor expanded in x around inf 47.9%

      \[\leadsto \color{blue}{x} \]

    if -7.50000000000000047e-147 < y < -8.99999999999999992e-238 or -1.28e-279 < y < 7.39999999999999991e-264

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 78.4%

      \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
    3. Taylor expanded in z around inf 59.4%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot z\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg59.4%

        \[\leadsto \color{blue}{-t \cdot z} \]
      2. *-commutative59.4%

        \[\leadsto -\color{blue}{z \cdot t} \]
      3. distribute-rgt-neg-in59.4%

        \[\leadsto \color{blue}{z \cdot \left(-t\right)} \]
    5. Simplified59.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{-47}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{-147}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -9 \cdot 10^{-238}:\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{elif}\;y \leq -1.28 \cdot 10^{-279}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{-264}:\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 4: 59.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(-z\right)\\ t_2 := y \cdot \left(t - x\right)\\ t_3 := x + y \cdot t\\ \mathbf{if}\;y \leq -1.4:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.76 \cdot 10^{-147}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{-238}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.35 \cdot 10^{-279}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-264}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4200000000000:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (- z))) (t_2 (* y (- t x))) (t_3 (+ x (* y t))))
   (if (<= y -1.4)
     t_2
     (if (<= y -1.76e-147)
       t_3
       (if (<= y -9.5e-238)
         t_1
         (if (<= y -3.35e-279)
           x
           (if (<= y 1.65e-264) t_1 (if (<= y 4200000000000.0) t_3 t_2))))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * -z;
	double t_2 = y * (t - x);
	double t_3 = x + (y * t);
	double tmp;
	if (y <= -1.4) {
		tmp = t_2;
	} else if (y <= -1.76e-147) {
		tmp = t_3;
	} else if (y <= -9.5e-238) {
		tmp = t_1;
	} else if (y <= -3.35e-279) {
		tmp = x;
	} else if (y <= 1.65e-264) {
		tmp = t_1;
	} else if (y <= 4200000000000.0) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = t * -z
    t_2 = y * (t - x)
    t_3 = x + (y * t)
    if (y <= (-1.4d0)) then
        tmp = t_2
    else if (y <= (-1.76d-147)) then
        tmp = t_3
    else if (y <= (-9.5d-238)) then
        tmp = t_1
    else if (y <= (-3.35d-279)) then
        tmp = x
    else if (y <= 1.65d-264) then
        tmp = t_1
    else if (y <= 4200000000000.0d0) then
        tmp = t_3
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t * -z;
	double t_2 = y * (t - x);
	double t_3 = x + (y * t);
	double tmp;
	if (y <= -1.4) {
		tmp = t_2;
	} else if (y <= -1.76e-147) {
		tmp = t_3;
	} else if (y <= -9.5e-238) {
		tmp = t_1;
	} else if (y <= -3.35e-279) {
		tmp = x;
	} else if (y <= 1.65e-264) {
		tmp = t_1;
	} else if (y <= 4200000000000.0) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * -z
	t_2 = y * (t - x)
	t_3 = x + (y * t)
	tmp = 0
	if y <= -1.4:
		tmp = t_2
	elif y <= -1.76e-147:
		tmp = t_3
	elif y <= -9.5e-238:
		tmp = t_1
	elif y <= -3.35e-279:
		tmp = x
	elif y <= 1.65e-264:
		tmp = t_1
	elif y <= 4200000000000.0:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(-z))
	t_2 = Float64(y * Float64(t - x))
	t_3 = Float64(x + Float64(y * t))
	tmp = 0.0
	if (y <= -1.4)
		tmp = t_2;
	elseif (y <= -1.76e-147)
		tmp = t_3;
	elseif (y <= -9.5e-238)
		tmp = t_1;
	elseif (y <= -3.35e-279)
		tmp = x;
	elseif (y <= 1.65e-264)
		tmp = t_1;
	elseif (y <= 4200000000000.0)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * -z;
	t_2 = y * (t - x);
	t_3 = x + (y * t);
	tmp = 0.0;
	if (y <= -1.4)
		tmp = t_2;
	elseif (y <= -1.76e-147)
		tmp = t_3;
	elseif (y <= -9.5e-238)
		tmp = t_1;
	elseif (y <= -3.35e-279)
		tmp = x;
	elseif (y <= 1.65e-264)
		tmp = t_1;
	elseif (y <= 4200000000000.0)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * (-z)), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4], t$95$2, If[LessEqual[y, -1.76e-147], t$95$3, If[LessEqual[y, -9.5e-238], t$95$1, If[LessEqual[y, -3.35e-279], x, If[LessEqual[y, 1.65e-264], t$95$1, If[LessEqual[y, 4200000000000.0], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \left(-z\right)\\
t_2 := y \cdot \left(t - x\right)\\
t_3 := x + y \cdot t\\
\mathbf{if}\;y \leq -1.4:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -1.76 \cdot 10^{-147}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;y \leq -9.5 \cdot 10^{-238}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -3.35 \cdot 10^{-279}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.65 \cdot 10^{-264}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 4200000000000:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.3999999999999999 or 4.2e12 < y

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Step-by-step derivation
      1. *-commutative99.9%

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

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

        \[\leadsto x + \color{blue}{\frac{\left(t - x\right) \cdot \left(y \cdot y - z \cdot z\right)}{y + z}} \]
    3. Applied egg-rr58.7%

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{y + z}{y \cdot y - z \cdot z}}} \]
      2. difference-of-squares78.2%

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

        \[\leadsto x + \frac{t - x}{\color{blue}{\frac{\frac{y + z}{y + z}}{y - z}}} \]
      4. *-inverses99.7%

        \[\leadsto x + \frac{t - x}{\frac{\color{blue}{1}}{y - z}} \]
    5. Simplified99.7%

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

      \[\leadsto x + \frac{t - x}{\color{blue}{\frac{1}{y}}} \]
    7. Step-by-step derivation
      1. +-commutative84.8%

        \[\leadsto \color{blue}{\frac{t - x}{\frac{1}{y}} + x} \]
      2. div-sub79.4%

        \[\leadsto \color{blue}{\left(\frac{t}{\frac{1}{y}} - \frac{x}{\frac{1}{y}}\right)} + x \]
      3. div-inv79.5%

        \[\leadsto \left(\color{blue}{t \cdot \frac{1}{\frac{1}{y}}} - \frac{x}{\frac{1}{y}}\right) + x \]
      4. remove-double-div79.5%

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

        \[\leadsto \left(\color{blue}{y \cdot t} - \frac{x}{\frac{1}{y}}\right) + x \]
      6. div-inv79.6%

        \[\leadsto \left(y \cdot t - \color{blue}{x \cdot \frac{1}{\frac{1}{y}}}\right) + x \]
      7. remove-double-div79.7%

        \[\leadsto \left(y \cdot t - x \cdot \color{blue}{y}\right) + x \]
      8. *-commutative79.7%

        \[\leadsto \left(y \cdot t - \color{blue}{y \cdot x}\right) + x \]
      9. associate-+l-79.7%

        \[\leadsto \color{blue}{y \cdot t - \left(y \cdot x - x\right)} \]
      10. *-commutative79.7%

        \[\leadsto \color{blue}{t \cdot y} - \left(y \cdot x - x\right) \]
      11. add-sqr-sqrt35.4%

        \[\leadsto t \cdot y - \left(\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot x - x\right) \]
      12. sqrt-unprod43.6%

        \[\leadsto t \cdot y - \left(\color{blue}{\sqrt{y \cdot y}} \cdot x - x\right) \]
      13. sqr-neg43.6%

        \[\leadsto t \cdot y - \left(\sqrt{\color{blue}{\left(-y\right) \cdot \left(-y\right)}} \cdot x - x\right) \]
      14. sqrt-unprod22.1%

        \[\leadsto t \cdot y - \left(\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot x - x\right) \]
      15. add-sqr-sqrt40.3%

        \[\leadsto t \cdot y - \left(\color{blue}{\left(-y\right)} \cdot x - x\right) \]
      16. *-un-lft-identity40.3%

        \[\leadsto t \cdot y - \left(\left(-y\right) \cdot x - \color{blue}{1 \cdot x}\right) \]
      17. distribute-rgt-out--40.3%

        \[\leadsto t \cdot y - \color{blue}{x \cdot \left(\left(-y\right) - 1\right)} \]
      18. add-sqr-sqrt22.1%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{\sqrt{-y} \cdot \sqrt{-y}} - 1\right) \]
      19. sqrt-unprod43.6%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} - 1\right) \]
      20. sqr-neg43.6%

        \[\leadsto t \cdot y - x \cdot \left(\sqrt{\color{blue}{y \cdot y}} - 1\right) \]
      21. sqrt-unprod35.4%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{\sqrt{y} \cdot \sqrt{y}} - 1\right) \]
      22. add-sqr-sqrt79.7%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{y} - 1\right) \]
    8. Applied egg-rr79.7%

      \[\leadsto \color{blue}{t \cdot y - x \cdot \left(y - 1\right)} \]
    9. Taylor expanded in y around inf 85.0%

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

    if -1.3999999999999999 < y < -1.76000000000000014e-147 or 1.65000000000000006e-264 < y < 4.2e12

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 76.9%

      \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
    3. Taylor expanded in z around 0 52.7%

      \[\leadsto \color{blue}{y \cdot t + x} \]

    if -1.76000000000000014e-147 < y < -9.50000000000000059e-238 or -3.35000000000000018e-279 < y < 1.65000000000000006e-264

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 78.4%

      \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
    3. Taylor expanded in z around inf 59.4%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot z\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg59.4%

        \[\leadsto \color{blue}{-t \cdot z} \]
      2. *-commutative59.4%

        \[\leadsto -\color{blue}{z \cdot t} \]
      3. distribute-rgt-neg-in59.4%

        \[\leadsto \color{blue}{z \cdot \left(-t\right)} \]
    5. Simplified59.4%

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

    if -9.50000000000000059e-238 < y < -3.35000000000000018e-279

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 73.4%

      \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
    3. Taylor expanded in x around inf 73.4%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification70.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -1.76 \cdot 10^{-147}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{-238}:\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{elif}\;y \leq -3.35 \cdot 10^{-279}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-264}:\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{elif}\;y \leq 4200000000000:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 5: 76.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := x + \left(y - z\right) \cdot t\\
\mathbf{if}\;y \leq -225000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 5.4 \cdot 10^{-144}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 3.3 \cdot 10^{-96}:\\
\;\;\;\;x + z \cdot x\\

\mathbf{elif}\;y \leq 9 \cdot 10^{+34}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.25e8 or 9.0000000000000001e34 < y

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Step-by-step derivation
      1. *-commutative100.0%

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

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

        \[\leadsto x + \color{blue}{\frac{\left(t - x\right) \cdot \left(y \cdot y - z \cdot z\right)}{y + z}} \]
    3. Applied egg-rr58.9%

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{y + z}{y \cdot y - z \cdot z}}} \]
      2. difference-of-squares78.3%

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

        \[\leadsto x + \frac{t - x}{\color{blue}{\frac{\frac{y + z}{y + z}}{y - z}}} \]
      4. *-inverses99.7%

        \[\leadsto x + \frac{t - x}{\frac{\color{blue}{1}}{y - z}} \]
    5. Simplified99.7%

      \[\leadsto x + \color{blue}{\frac{t - x}{\frac{1}{y - z}}} \]
    6. Taylor expanded in y around inf 86.6%

      \[\leadsto x + \frac{t - x}{\color{blue}{\frac{1}{y}}} \]
    7. Step-by-step derivation
      1. +-commutative86.6%

        \[\leadsto \color{blue}{\frac{t - x}{\frac{1}{y}} + x} \]
      2. div-sub81.1%

        \[\leadsto \color{blue}{\left(\frac{t}{\frac{1}{y}} - \frac{x}{\frac{1}{y}}\right)} + x \]
      3. div-inv81.1%

        \[\leadsto \left(\color{blue}{t \cdot \frac{1}{\frac{1}{y}}} - \frac{x}{\frac{1}{y}}\right) + x \]
      4. remove-double-div81.2%

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

        \[\leadsto \left(\color{blue}{y \cdot t} - \frac{x}{\frac{1}{y}}\right) + x \]
      6. div-inv81.3%

        \[\leadsto \left(y \cdot t - \color{blue}{x \cdot \frac{1}{\frac{1}{y}}}\right) + x \]
      7. remove-double-div81.3%

        \[\leadsto \left(y \cdot t - x \cdot \color{blue}{y}\right) + x \]
      8. *-commutative81.3%

        \[\leadsto \left(y \cdot t - \color{blue}{y \cdot x}\right) + x \]
      9. associate-+l-81.3%

        \[\leadsto \color{blue}{y \cdot t - \left(y \cdot x - x\right)} \]
      10. *-commutative81.3%

        \[\leadsto \color{blue}{t \cdot y} - \left(y \cdot x - x\right) \]
      11. add-sqr-sqrt35.7%

        \[\leadsto t \cdot y - \left(\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot x - x\right) \]
      12. sqrt-unprod44.1%

        \[\leadsto t \cdot y - \left(\color{blue}{\sqrt{y \cdot y}} \cdot x - x\right) \]
      13. sqr-neg44.1%

        \[\leadsto t \cdot y - \left(\sqrt{\color{blue}{\left(-y\right) \cdot \left(-y\right)}} \cdot x - x\right) \]
      14. sqrt-unprod22.8%

        \[\leadsto t \cdot y - \left(\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot x - x\right) \]
      15. add-sqr-sqrt41.4%

        \[\leadsto t \cdot y - \left(\color{blue}{\left(-y\right)} \cdot x - x\right) \]
      16. *-un-lft-identity41.4%

        \[\leadsto t \cdot y - \left(\left(-y\right) \cdot x - \color{blue}{1 \cdot x}\right) \]
      17. distribute-rgt-out--41.4%

        \[\leadsto t \cdot y - \color{blue}{x \cdot \left(\left(-y\right) - 1\right)} \]
      18. add-sqr-sqrt22.8%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{\sqrt{-y} \cdot \sqrt{-y}} - 1\right) \]
      19. sqrt-unprod44.1%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} - 1\right) \]
      20. sqr-neg44.1%

        \[\leadsto t \cdot y - x \cdot \left(\sqrt{\color{blue}{y \cdot y}} - 1\right) \]
      21. sqrt-unprod35.7%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{\sqrt{y} \cdot \sqrt{y}} - 1\right) \]
      22. add-sqr-sqrt81.3%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{y} - 1\right) \]
    8. Applied egg-rr81.3%

      \[\leadsto \color{blue}{t \cdot y - x \cdot \left(y - 1\right)} \]
    9. Taylor expanded in y around inf 86.8%

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

    if -2.25e8 < y < 5.3999999999999995e-144 or 3.2999999999999999e-96 < y < 9.0000000000000001e34

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 78.2%

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

    if 5.3999999999999995e-144 < y < 3.2999999999999999e-96

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in y around 0 99.9%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(t - x\right) \cdot z\right) + x} \]
    3. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \color{blue}{x + -1 \cdot \left(\left(t - x\right) \cdot z\right)} \]
      2. mul-1-neg99.9%

        \[\leadsto x + \color{blue}{\left(-\left(t - x\right) \cdot z\right)} \]
      3. unsub-neg99.9%

        \[\leadsto \color{blue}{x - \left(t - x\right) \cdot z} \]
      4. *-commutative99.9%

        \[\leadsto x - \color{blue}{z \cdot \left(t - x\right)} \]
    4. Simplified99.9%

      \[\leadsto \color{blue}{x - z \cdot \left(t - x\right)} \]
    5. Taylor expanded in t around 0 89.0%

      \[\leadsto x - \color{blue}{-1 \cdot \left(z \cdot x\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg89.0%

        \[\leadsto x - \color{blue}{\left(-z \cdot x\right)} \]
      2. distribute-lft-neg-out89.0%

        \[\leadsto x - \color{blue}{\left(-z\right) \cdot x} \]
      3. *-commutative89.0%

        \[\leadsto x - \color{blue}{x \cdot \left(-z\right)} \]
    7. Simplified89.0%

      \[\leadsto x - \color{blue}{x \cdot \left(-z\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -225000000:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{-144}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-96}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;y \leq 9 \cdot 10^{+34}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 6: 76.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot t\\ t_2 := x + y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -9.2 \cdot 10^{-10}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{-144}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{-96}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+34}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (* (- y z) t))) (t_2 (+ x (* y (- t x)))))
   (if (<= y -9.2e-10)
     t_2
     (if (<= y 4.6e-144)
       t_1
       (if (<= y 1.55e-96) (+ x (* z x)) (if (<= y 9.5e+34) t_1 t_2))))))
double code(double x, double y, double z, double t) {
	double t_1 = x + ((y - z) * t);
	double t_2 = x + (y * (t - x));
	double tmp;
	if (y <= -9.2e-10) {
		tmp = t_2;
	} else if (y <= 4.6e-144) {
		tmp = t_1;
	} else if (y <= 1.55e-96) {
		tmp = x + (z * x);
	} else if (y <= 9.5e+34) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x + ((y - z) * t)
    t_2 = x + (y * (t - x))
    if (y <= (-9.2d-10)) then
        tmp = t_2
    else if (y <= 4.6d-144) then
        tmp = t_1
    else if (y <= 1.55d-96) then
        tmp = x + (z * x)
    else if (y <= 9.5d+34) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x + ((y - z) * t);
	double t_2 = x + (y * (t - x));
	double tmp;
	if (y <= -9.2e-10) {
		tmp = t_2;
	} else if (y <= 4.6e-144) {
		tmp = t_1;
	} else if (y <= 1.55e-96) {
		tmp = x + (z * x);
	} else if (y <= 9.5e+34) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + ((y - z) * t)
	t_2 = x + (y * (t - x))
	tmp = 0
	if y <= -9.2e-10:
		tmp = t_2
	elif y <= 4.6e-144:
		tmp = t_1
	elif y <= 1.55e-96:
		tmp = x + (z * x)
	elif y <= 9.5e+34:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(Float64(y - z) * t))
	t_2 = Float64(x + Float64(y * Float64(t - x)))
	tmp = 0.0
	if (y <= -9.2e-10)
		tmp = t_2;
	elseif (y <= 4.6e-144)
		tmp = t_1;
	elseif (y <= 1.55e-96)
		tmp = Float64(x + Float64(z * x));
	elseif (y <= 9.5e+34)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x + ((y - z) * t);
	t_2 = x + (y * (t - x));
	tmp = 0.0;
	if (y <= -9.2e-10)
		tmp = t_2;
	elseif (y <= 4.6e-144)
		tmp = t_1;
	elseif (y <= 1.55e-96)
		tmp = x + (z * x);
	elseif (y <= 9.5e+34)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.2e-10], t$95$2, If[LessEqual[y, 4.6e-144], t$95$1, If[LessEqual[y, 1.55e-96], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e+34], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 4.6 \cdot 10^{-144}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.55 \cdot 10^{-96}:\\
\;\;\;\;x + z \cdot x\\

\mathbf{elif}\;y \leq 9.5 \cdot 10^{+34}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -9.20000000000000028e-10 or 9.4999999999999999e34 < y

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in z around 0 86.5%

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

    if -9.20000000000000028e-10 < y < 4.6e-144 or 1.55e-96 < y < 9.4999999999999999e34

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 78.6%

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

    if 4.6e-144 < y < 1.55e-96

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in y around 0 99.9%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(t - x\right) \cdot z\right) + x} \]
    3. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \color{blue}{x + -1 \cdot \left(\left(t - x\right) \cdot z\right)} \]
      2. mul-1-neg99.9%

        \[\leadsto x + \color{blue}{\left(-\left(t - x\right) \cdot z\right)} \]
      3. unsub-neg99.9%

        \[\leadsto \color{blue}{x - \left(t - x\right) \cdot z} \]
      4. *-commutative99.9%

        \[\leadsto x - \color{blue}{z \cdot \left(t - x\right)} \]
    4. Simplified99.9%

      \[\leadsto \color{blue}{x - z \cdot \left(t - x\right)} \]
    5. Taylor expanded in t around 0 89.0%

      \[\leadsto x - \color{blue}{-1 \cdot \left(z \cdot x\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg89.0%

        \[\leadsto x - \color{blue}{\left(-z \cdot x\right)} \]
      2. distribute-lft-neg-out89.0%

        \[\leadsto x - \color{blue}{\left(-z\right) \cdot x} \]
      3. *-commutative89.0%

        \[\leadsto x - \color{blue}{x \cdot \left(-z\right)} \]
    7. Simplified89.0%

      \[\leadsto x - \color{blue}{x \cdot \left(-z\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification83.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.2 \cdot 10^{-10}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{-144}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{-96}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+34}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 7: 70.7% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 5.4 \cdot 10^{-144}:\\
\;\;\;\;x - z \cdot t\\

\mathbf{elif}\;y \leq 3.2 \cdot 10^{-27}:\\
\;\;\;\;x + z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.89999999999999981e-10 or 3.19999999999999991e-27 < y

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Step-by-step derivation
      1. *-commutative99.9%

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

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

        \[\leadsto x + \color{blue}{\frac{\left(t - x\right) \cdot \left(y \cdot y - z \cdot z\right)}{y + z}} \]
    3. Applied egg-rr61.8%

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{y + z}{y \cdot y - z \cdot z}}} \]
      2. difference-of-squares79.5%

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

        \[\leadsto x + \frac{t - x}{\color{blue}{\frac{\frac{y + z}{y + z}}{y - z}}} \]
      4. *-inverses99.7%

        \[\leadsto x + \frac{t - x}{\frac{\color{blue}{1}}{y - z}} \]
    5. Simplified99.7%

      \[\leadsto x + \color{blue}{\frac{t - x}{\frac{1}{y - z}}} \]
    6. Taylor expanded in y around inf 82.8%

      \[\leadsto x + \frac{t - x}{\color{blue}{\frac{1}{y}}} \]
    7. Step-by-step derivation
      1. +-commutative82.8%

        \[\leadsto \color{blue}{\frac{t - x}{\frac{1}{y}} + x} \]
      2. div-sub77.9%

        \[\leadsto \color{blue}{\left(\frac{t}{\frac{1}{y}} - \frac{x}{\frac{1}{y}}\right)} + x \]
      3. div-inv77.9%

        \[\leadsto \left(\color{blue}{t \cdot \frac{1}{\frac{1}{y}}} - \frac{x}{\frac{1}{y}}\right) + x \]
      4. remove-double-div78.0%

        \[\leadsto \left(t \cdot \color{blue}{y} - \frac{x}{\frac{1}{y}}\right) + x \]
      5. *-commutative78.0%

        \[\leadsto \left(\color{blue}{y \cdot t} - \frac{x}{\frac{1}{y}}\right) + x \]
      6. div-inv78.1%

        \[\leadsto \left(y \cdot t - \color{blue}{x \cdot \frac{1}{\frac{1}{y}}}\right) + x \]
      7. remove-double-div78.1%

        \[\leadsto \left(y \cdot t - x \cdot \color{blue}{y}\right) + x \]
      8. *-commutative78.1%

        \[\leadsto \left(y \cdot t - \color{blue}{y \cdot x}\right) + x \]
      9. associate-+l-78.1%

        \[\leadsto \color{blue}{y \cdot t - \left(y \cdot x - x\right)} \]
      10. *-commutative78.1%

        \[\leadsto \color{blue}{t \cdot y} - \left(y \cdot x - x\right) \]
      11. add-sqr-sqrt35.1%

        \[\leadsto t \cdot y - \left(\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot x - x\right) \]
      12. sqrt-unprod45.1%

        \[\leadsto t \cdot y - \left(\color{blue}{\sqrt{y \cdot y}} \cdot x - x\right) \]
      13. sqr-neg45.1%

        \[\leadsto t \cdot y - \left(\sqrt{\color{blue}{\left(-y\right) \cdot \left(-y\right)}} \cdot x - x\right) \]
      14. sqrt-unprod22.7%

        \[\leadsto t \cdot y - \left(\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot x - x\right) \]
      15. add-sqr-sqrt42.1%

        \[\leadsto t \cdot y - \left(\color{blue}{\left(-y\right)} \cdot x - x\right) \]
      16. *-un-lft-identity42.1%

        \[\leadsto t \cdot y - \left(\left(-y\right) \cdot x - \color{blue}{1 \cdot x}\right) \]
      17. distribute-rgt-out--42.1%

        \[\leadsto t \cdot y - \color{blue}{x \cdot \left(\left(-y\right) - 1\right)} \]
      18. add-sqr-sqrt22.7%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{\sqrt{-y} \cdot \sqrt{-y}} - 1\right) \]
      19. sqrt-unprod45.1%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} - 1\right) \]
      20. sqr-neg45.1%

        \[\leadsto t \cdot y - x \cdot \left(\sqrt{\color{blue}{y \cdot y}} - 1\right) \]
      21. sqrt-unprod35.1%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{\sqrt{y} \cdot \sqrt{y}} - 1\right) \]
      22. add-sqr-sqrt78.1%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{y} - 1\right) \]
    8. Applied egg-rr78.1%

      \[\leadsto \color{blue}{t \cdot y - x \cdot \left(y - 1\right)} \]
    9. Taylor expanded in y around inf 81.8%

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

    if -2.89999999999999981e-10 < y < 5.3999999999999995e-144

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in y around 0 95.2%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(t - x\right) \cdot z\right) + x} \]
    3. Step-by-step derivation
      1. +-commutative95.2%

        \[\leadsto \color{blue}{x + -1 \cdot \left(\left(t - x\right) \cdot z\right)} \]
      2. mul-1-neg95.2%

        \[\leadsto x + \color{blue}{\left(-\left(t - x\right) \cdot z\right)} \]
      3. unsub-neg95.2%

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

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

      \[\leadsto \color{blue}{x - z \cdot \left(t - x\right)} \]
    5. Taylor expanded in t around inf 76.3%

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

        \[\leadsto x - \color{blue}{z \cdot t} \]
    7. Simplified76.3%

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

    if 5.3999999999999995e-144 < y < 3.19999999999999991e-27

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in y around 0 90.3%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(t - x\right) \cdot z\right) + x} \]
    3. Step-by-step derivation
      1. +-commutative90.3%

        \[\leadsto \color{blue}{x + -1 \cdot \left(\left(t - x\right) \cdot z\right)} \]
      2. mul-1-neg90.3%

        \[\leadsto x + \color{blue}{\left(-\left(t - x\right) \cdot z\right)} \]
      3. unsub-neg90.3%

        \[\leadsto \color{blue}{x - \left(t - x\right) \cdot z} \]
      4. *-commutative90.3%

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

      \[\leadsto \color{blue}{x - z \cdot \left(t - x\right)} \]
    5. Taylor expanded in t around 0 74.8%

      \[\leadsto x - \color{blue}{-1 \cdot \left(z \cdot x\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg74.8%

        \[\leadsto x - \color{blue}{\left(-z \cdot x\right)} \]
      2. distribute-lft-neg-out74.8%

        \[\leadsto x - \color{blue}{\left(-z\right) \cdot x} \]
      3. *-commutative74.8%

        \[\leadsto x - \color{blue}{x \cdot \left(-z\right)} \]
    7. Simplified74.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{-10}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{-144}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-27}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 8: 83.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-43} \lor \neg \left(y \leq 1.45 \cdot 10^{+34}\right):\\
\;\;\;\;x + y \cdot \left(t - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.59999999999999992e-43 or 1.4500000000000001e34 < y

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in z around 0 85.7%

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

    if -1.59999999999999992e-43 < y < 1.4500000000000001e34

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in y around 0 92.0%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(t - x\right) \cdot z\right) + x} \]
    3. Step-by-step derivation
      1. +-commutative92.0%

        \[\leadsto \color{blue}{x + -1 \cdot \left(\left(t - x\right) \cdot z\right)} \]
      2. mul-1-neg92.0%

        \[\leadsto x + \color{blue}{\left(-\left(t - x\right) \cdot z\right)} \]
      3. unsub-neg92.0%

        \[\leadsto \color{blue}{x - \left(t - x\right) \cdot z} \]
      4. *-commutative92.0%

        \[\leadsto x - \color{blue}{z \cdot \left(t - x\right)} \]
    4. Simplified92.0%

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

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

Alternative 9: 37.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.7 \cdot 10^{+254}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq -1:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{elif}\;y \leq 4.4 \cdot 10^{-27}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;y \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.69999999999999984e254 or 4.39999999999999974e-27 < y

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 55.8%

      \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
    3. Taylor expanded in y around inf 48.4%

      \[\leadsto \color{blue}{y \cdot t} \]

    if -8.69999999999999984e254 < y < -1

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Step-by-step derivation
      1. *-commutative100.0%

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

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

        \[\leadsto x + \color{blue}{\frac{\left(t - x\right) \cdot \left(y \cdot y - z \cdot z\right)}{y + z}} \]
    3. Applied egg-rr66.1%

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{y + z}{y \cdot y - z \cdot z}}} \]
      2. difference-of-squares80.9%

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

        \[\leadsto x + \frac{t - x}{\color{blue}{\frac{\frac{y + z}{y + z}}{y - z}}} \]
      4. *-inverses99.5%

        \[\leadsto x + \frac{t - x}{\frac{\color{blue}{1}}{y - z}} \]
    5. Simplified99.5%

      \[\leadsto x + \color{blue}{\frac{t - x}{\frac{1}{y - z}}} \]
    6. Taylor expanded in y around inf 81.6%

      \[\leadsto x + \frac{t - x}{\color{blue}{\frac{1}{y}}} \]
    7. Taylor expanded in x around inf 53.0%

      \[\leadsto \color{blue}{\left(1 + -1 \cdot y\right) \cdot x} \]
    8. Step-by-step derivation
      1. +-commutative53.0%

        \[\leadsto \color{blue}{\left(-1 \cdot y + 1\right)} \cdot x \]
      2. distribute-rgt1-in53.0%

        \[\leadsto \color{blue}{x + \left(-1 \cdot y\right) \cdot x} \]
      3. mul-1-neg53.0%

        \[\leadsto x + \color{blue}{\left(-y\right)} \cdot x \]
      4. cancel-sign-sub-inv53.0%

        \[\leadsto \color{blue}{x - y \cdot x} \]
    9. Simplified53.0%

      \[\leadsto \color{blue}{x - y \cdot x} \]
    10. Taylor expanded in y around inf 53.0%

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot x\right)} \]
    11. Step-by-step derivation
      1. mul-1-neg53.0%

        \[\leadsto \color{blue}{-y \cdot x} \]
      2. distribute-rgt-neg-out53.0%

        \[\leadsto \color{blue}{y \cdot \left(-x\right)} \]
    12. Simplified53.0%

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

    if -1 < y < 4.39999999999999974e-27

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 76.9%

      \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
    3. Taylor expanded in x around inf 38.3%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification45.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.7 \cdot 10^{+254}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -1:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq 4.4 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]

Alternative 10: 71.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-10} \lor \neg \left(y \leq 1.6 \cdot 10^{-27}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3e-10 or 1.59999999999999995e-27 < y

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Step-by-step derivation
      1. *-commutative99.9%

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

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

        \[\leadsto x + \color{blue}{\frac{\left(t - x\right) \cdot \left(y \cdot y - z \cdot z\right)}{y + z}} \]
    3. Applied egg-rr61.8%

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{y + z}{y \cdot y - z \cdot z}}} \]
      2. difference-of-squares79.5%

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

        \[\leadsto x + \frac{t - x}{\color{blue}{\frac{\frac{y + z}{y + z}}{y - z}}} \]
      4. *-inverses99.7%

        \[\leadsto x + \frac{t - x}{\frac{\color{blue}{1}}{y - z}} \]
    5. Simplified99.7%

      \[\leadsto x + \color{blue}{\frac{t - x}{\frac{1}{y - z}}} \]
    6. Taylor expanded in y around inf 82.8%

      \[\leadsto x + \frac{t - x}{\color{blue}{\frac{1}{y}}} \]
    7. Step-by-step derivation
      1. +-commutative82.8%

        \[\leadsto \color{blue}{\frac{t - x}{\frac{1}{y}} + x} \]
      2. div-sub77.9%

        \[\leadsto \color{blue}{\left(\frac{t}{\frac{1}{y}} - \frac{x}{\frac{1}{y}}\right)} + x \]
      3. div-inv77.9%

        \[\leadsto \left(\color{blue}{t \cdot \frac{1}{\frac{1}{y}}} - \frac{x}{\frac{1}{y}}\right) + x \]
      4. remove-double-div78.0%

        \[\leadsto \left(t \cdot \color{blue}{y} - \frac{x}{\frac{1}{y}}\right) + x \]
      5. *-commutative78.0%

        \[\leadsto \left(\color{blue}{y \cdot t} - \frac{x}{\frac{1}{y}}\right) + x \]
      6. div-inv78.1%

        \[\leadsto \left(y \cdot t - \color{blue}{x \cdot \frac{1}{\frac{1}{y}}}\right) + x \]
      7. remove-double-div78.1%

        \[\leadsto \left(y \cdot t - x \cdot \color{blue}{y}\right) + x \]
      8. *-commutative78.1%

        \[\leadsto \left(y \cdot t - \color{blue}{y \cdot x}\right) + x \]
      9. associate-+l-78.1%

        \[\leadsto \color{blue}{y \cdot t - \left(y \cdot x - x\right)} \]
      10. *-commutative78.1%

        \[\leadsto \color{blue}{t \cdot y} - \left(y \cdot x - x\right) \]
      11. add-sqr-sqrt35.1%

        \[\leadsto t \cdot y - \left(\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot x - x\right) \]
      12. sqrt-unprod45.1%

        \[\leadsto t \cdot y - \left(\color{blue}{\sqrt{y \cdot y}} \cdot x - x\right) \]
      13. sqr-neg45.1%

        \[\leadsto t \cdot y - \left(\sqrt{\color{blue}{\left(-y\right) \cdot \left(-y\right)}} \cdot x - x\right) \]
      14. sqrt-unprod22.7%

        \[\leadsto t \cdot y - \left(\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot x - x\right) \]
      15. add-sqr-sqrt42.1%

        \[\leadsto t \cdot y - \left(\color{blue}{\left(-y\right)} \cdot x - x\right) \]
      16. *-un-lft-identity42.1%

        \[\leadsto t \cdot y - \left(\left(-y\right) \cdot x - \color{blue}{1 \cdot x}\right) \]
      17. distribute-rgt-out--42.1%

        \[\leadsto t \cdot y - \color{blue}{x \cdot \left(\left(-y\right) - 1\right)} \]
      18. add-sqr-sqrt22.7%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{\sqrt{-y} \cdot \sqrt{-y}} - 1\right) \]
      19. sqrt-unprod45.1%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} - 1\right) \]
      20. sqr-neg45.1%

        \[\leadsto t \cdot y - x \cdot \left(\sqrt{\color{blue}{y \cdot y}} - 1\right) \]
      21. sqrt-unprod35.1%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{\sqrt{y} \cdot \sqrt{y}} - 1\right) \]
      22. add-sqr-sqrt78.1%

        \[\leadsto t \cdot y - x \cdot \left(\color{blue}{y} - 1\right) \]
    8. Applied egg-rr78.1%

      \[\leadsto \color{blue}{t \cdot y - x \cdot \left(y - 1\right)} \]
    9. Taylor expanded in y around inf 81.8%

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

    if -3e-10 < y < 1.59999999999999995e-27

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in y around 0 94.0%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(t - x\right) \cdot z\right) + x} \]
    3. Step-by-step derivation
      1. +-commutative94.0%

        \[\leadsto \color{blue}{x + -1 \cdot \left(\left(t - x\right) \cdot z\right)} \]
      2. mul-1-neg94.0%

        \[\leadsto x + \color{blue}{\left(-\left(t - x\right) \cdot z\right)} \]
      3. unsub-neg94.0%

        \[\leadsto \color{blue}{x - \left(t - x\right) \cdot z} \]
      4. *-commutative94.0%

        \[\leadsto x - \color{blue}{z \cdot \left(t - x\right)} \]
    4. Simplified94.0%

      \[\leadsto \color{blue}{x - z \cdot \left(t - x\right)} \]
    5. Taylor expanded in t around inf 71.3%

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

        \[\leadsto x - \color{blue}{z \cdot t} \]
    7. Simplified71.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{-10} \lor \neg \left(y \leq 1.6 \cdot 10^{-27}\right):\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot t\\ \end{array} \]

Alternative 11: 100.0% accurate, 1.0× speedup?

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

\\
x - \left(y - z\right) \cdot \left(x - t\right)
\end{array}
Derivation
  1. Initial program 100.0%

    \[x + \left(y - z\right) \cdot \left(t - x\right) \]
  2. Final simplification100.0%

    \[\leadsto x - \left(y - z\right) \cdot \left(x - t\right) \]

Alternative 12: 37.6% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{-47}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq 1.1 \cdot 10^{-27}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;y \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.9999999999999999e-47 or 1.09999999999999993e-27 < y

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 49.9%

      \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
    3. Taylor expanded in y around inf 41.3%

      \[\leadsto \color{blue}{y \cdot t} \]

    if -3.9999999999999999e-47 < y < 1.09999999999999993e-27

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 76.0%

      \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
    3. Taylor expanded in x around inf 40.2%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification40.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{-47}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]

Alternative 13: 17.7% accurate, 9.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 100.0%

    \[x + \left(y - z\right) \cdot \left(t - x\right) \]
  2. Taylor expanded in t around inf 60.8%

    \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
  3. Taylor expanded in x around inf 19.1%

    \[\leadsto \color{blue}{x} \]
  4. Final simplification19.1%

    \[\leadsto x \]

Developer target: 96.2% accurate, 0.6× speedup?

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

\\
x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)
\end{array}

Reproduce

?
herbie shell --seed 2023224 
(FPCore (x y z t)
  :name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
  :precision binary64

  :herbie-target
  (+ x (+ (* t (- y z)) (* (- x) (- y z))))

  (+ x (* (- y z) (- t x))))