Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 10.3s
Alternatives: 16
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 16 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: 48.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ t_2 := x \cdot \left(z + 1\right)\\ \mathbf{if}\;y \leq -3.4 \cdot 10^{+208}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -1.02 \cdot 10^{+71}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq -2.6 \cdot 10^{+60}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -950000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-13}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -2.65 \cdot 10^{-92}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{-187}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+17}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))) (t_2 (* x (+ z 1.0))))
   (if (<= y -3.4e+208)
     (* y t)
     (if (<= y -1.02e+71)
       (* y (- x))
       (if (<= y -2.6e+60)
         (* y t)
         (if (<= y -950000.0)
           t_1
           (if (<= y -2.8e-13)
             (* y t)
             (if (<= y -2.65e-92)
               t_2
               (if (<= y -2.5e-187)
                 t_1
                 (if (<= y 1.05e+17) t_2 (* y t)))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double t_2 = x * (z + 1.0);
	double tmp;
	if (y <= -3.4e+208) {
		tmp = y * t;
	} else if (y <= -1.02e+71) {
		tmp = y * -x;
	} else if (y <= -2.6e+60) {
		tmp = y * t;
	} else if (y <= -950000.0) {
		tmp = t_1;
	} else if (y <= -2.8e-13) {
		tmp = y * t;
	} else if (y <= -2.65e-92) {
		tmp = t_2;
	} else if (y <= -2.5e-187) {
		tmp = t_1;
	} else if (y <= 1.05e+17) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = z * -t
    t_2 = x * (z + 1.0d0)
    if (y <= (-3.4d+208)) then
        tmp = y * t
    else if (y <= (-1.02d+71)) then
        tmp = y * -x
    else if (y <= (-2.6d+60)) then
        tmp = y * t
    else if (y <= (-950000.0d0)) then
        tmp = t_1
    else if (y <= (-2.8d-13)) then
        tmp = y * t
    else if (y <= (-2.65d-92)) then
        tmp = t_2
    else if (y <= (-2.5d-187)) then
        tmp = t_1
    else if (y <= 1.05d+17) then
        tmp = t_2
    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 = z * -t;
	double t_2 = x * (z + 1.0);
	double tmp;
	if (y <= -3.4e+208) {
		tmp = y * t;
	} else if (y <= -1.02e+71) {
		tmp = y * -x;
	} else if (y <= -2.6e+60) {
		tmp = y * t;
	} else if (y <= -950000.0) {
		tmp = t_1;
	} else if (y <= -2.8e-13) {
		tmp = y * t;
	} else if (y <= -2.65e-92) {
		tmp = t_2;
	} else if (y <= -2.5e-187) {
		tmp = t_1;
	} else if (y <= 1.05e+17) {
		tmp = t_2;
	} else {
		tmp = y * t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	t_2 = x * (z + 1.0)
	tmp = 0
	if y <= -3.4e+208:
		tmp = y * t
	elif y <= -1.02e+71:
		tmp = y * -x
	elif y <= -2.6e+60:
		tmp = y * t
	elif y <= -950000.0:
		tmp = t_1
	elif y <= -2.8e-13:
		tmp = y * t
	elif y <= -2.65e-92:
		tmp = t_2
	elif y <= -2.5e-187:
		tmp = t_1
	elif y <= 1.05e+17:
		tmp = t_2
	else:
		tmp = y * t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	t_2 = Float64(x * Float64(z + 1.0))
	tmp = 0.0
	if (y <= -3.4e+208)
		tmp = Float64(y * t);
	elseif (y <= -1.02e+71)
		tmp = Float64(y * Float64(-x));
	elseif (y <= -2.6e+60)
		tmp = Float64(y * t);
	elseif (y <= -950000.0)
		tmp = t_1;
	elseif (y <= -2.8e-13)
		tmp = Float64(y * t);
	elseif (y <= -2.65e-92)
		tmp = t_2;
	elseif (y <= -2.5e-187)
		tmp = t_1;
	elseif (y <= 1.05e+17)
		tmp = t_2;
	else
		tmp = Float64(y * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	t_2 = x * (z + 1.0);
	tmp = 0.0;
	if (y <= -3.4e+208)
		tmp = y * t;
	elseif (y <= -1.02e+71)
		tmp = y * -x;
	elseif (y <= -2.6e+60)
		tmp = y * t;
	elseif (y <= -950000.0)
		tmp = t_1;
	elseif (y <= -2.8e-13)
		tmp = y * t;
	elseif (y <= -2.65e-92)
		tmp = t_2;
	elseif (y <= -2.5e-187)
		tmp = t_1;
	elseif (y <= 1.05e+17)
		tmp = t_2;
	else
		tmp = y * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.4e+208], N[(y * t), $MachinePrecision], If[LessEqual[y, -1.02e+71], N[(y * (-x)), $MachinePrecision], If[LessEqual[y, -2.6e+60], N[(y * t), $MachinePrecision], If[LessEqual[y, -950000.0], t$95$1, If[LessEqual[y, -2.8e-13], N[(y * t), $MachinePrecision], If[LessEqual[y, -2.65e-92], t$95$2, If[LessEqual[y, -2.5e-187], t$95$1, If[LessEqual[y, 1.05e+17], t$95$2, N[(y * t), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.02 \cdot 10^{+71}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{elif}\;y \leq -2.6 \cdot 10^{+60}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq -950000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -2.8 \cdot 10^{-13}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq -2.65 \cdot 10^{-92}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;y \leq 1.05 \cdot 10^{+17}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.3999999999999998e208 or -1.02000000000000003e71 < y < -2.60000000000000008e60 or -9.5e5 < y < -2.8000000000000002e-13 or 1.05e17 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, 1 + \color{blue}{\left(-\left(y - z\right)\right)}, t \cdot y\right) \]
      4. unsub-neg88.0%

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{1 - \left(y - z\right)}, t \cdot y\right) \]
      5. *-commutative88.0%

        \[\leadsto \mathsf{fma}\left(x, 1 - \left(y - z\right), \color{blue}{y \cdot t}\right) \]
    7. Simplified88.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 - \left(y - z\right), y \cdot t\right)} \]
    8. Taylor expanded in x around 0 53.5%

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

    if -3.3999999999999998e208 < y < -1.02000000000000003e71

    1. Initial program 100.0%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
    4. Simplified65.5%

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

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

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

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

    if -2.60000000000000008e60 < y < -9.5e5 or -2.65000000000000015e-92 < y < -2.4999999999999998e-187

    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. add-sqr-sqrt54.6%

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \sqrt{t - x}\right) \cdot \sqrt{t - x}} + x \]
      4. fma-def54.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    3. Applied egg-rr54.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    4. Taylor expanded in x around 0 81.4%

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

        \[\leadsto \color{blue}{\left(y - z\right) \cdot t} \]
    6. Simplified81.4%

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot z\right)} \]
    8. Step-by-step derivation
      1. associate-*r*71.9%

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

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

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

    if -2.8000000000000002e-13 < y < -2.65000000000000015e-92 or -2.4999999999999998e-187 < y < 1.05e17

    1. Initial program 99.9%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      2. unsub-neg63.2%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(z + 1\right)} \]
    7. Simplified61.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{+208}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -1.02 \cdot 10^{+71}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq -2.6 \cdot 10^{+60}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -950000:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-13}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -2.65 \cdot 10^{-92}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{-187}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+17}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]

Alternative 3: 64.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ t_2 := x \cdot \left(z + 1\right)\\ t_3 := z \cdot \left(-t\right)\\ \mathbf{if}\;y \leq -3.8 \cdot 10^{+61}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -245000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -4.1 \cdot 10^{-13}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-93}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{-187}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-11}:\\ \;\;\;\;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 (+ z 1.0))) (t_3 (* z (- t))))
   (if (<= y -3.8e+61)
     t_1
     (if (<= y -245000.0)
       t_3
       (if (<= y -4.1e-13)
         (* y t)
         (if (<= y -4.2e-93)
           t_2
           (if (<= y -4.8e-187) t_3 (if (<= y 8e-11) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double t_2 = x * (z + 1.0);
	double t_3 = z * -t;
	double tmp;
	if (y <= -3.8e+61) {
		tmp = t_1;
	} else if (y <= -245000.0) {
		tmp = t_3;
	} else if (y <= -4.1e-13) {
		tmp = y * t;
	} else if (y <= -4.2e-93) {
		tmp = t_2;
	} else if (y <= -4.8e-187) {
		tmp = t_3;
	} else if (y <= 8e-11) {
		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) :: t_3
    real(8) :: tmp
    t_1 = y * (t - x)
    t_2 = x * (z + 1.0d0)
    t_3 = z * -t
    if (y <= (-3.8d+61)) then
        tmp = t_1
    else if (y <= (-245000.0d0)) then
        tmp = t_3
    else if (y <= (-4.1d-13)) then
        tmp = y * t
    else if (y <= (-4.2d-93)) then
        tmp = t_2
    else if (y <= (-4.8d-187)) then
        tmp = t_3
    else if (y <= 8d-11) 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 * (z + 1.0);
	double t_3 = z * -t;
	double tmp;
	if (y <= -3.8e+61) {
		tmp = t_1;
	} else if (y <= -245000.0) {
		tmp = t_3;
	} else if (y <= -4.1e-13) {
		tmp = y * t;
	} else if (y <= -4.2e-93) {
		tmp = t_2;
	} else if (y <= -4.8e-187) {
		tmp = t_3;
	} else if (y <= 8e-11) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (t - x)
	t_2 = x * (z + 1.0)
	t_3 = z * -t
	tmp = 0
	if y <= -3.8e+61:
		tmp = t_1
	elif y <= -245000.0:
		tmp = t_3
	elif y <= -4.1e-13:
		tmp = y * t
	elif y <= -4.2e-93:
		tmp = t_2
	elif y <= -4.8e-187:
		tmp = t_3
	elif y <= 8e-11:
		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(z + 1.0))
	t_3 = Float64(z * Float64(-t))
	tmp = 0.0
	if (y <= -3.8e+61)
		tmp = t_1;
	elseif (y <= -245000.0)
		tmp = t_3;
	elseif (y <= -4.1e-13)
		tmp = Float64(y * t);
	elseif (y <= -4.2e-93)
		tmp = t_2;
	elseif (y <= -4.8e-187)
		tmp = t_3;
	elseif (y <= 8e-11)
		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 * (z + 1.0);
	t_3 = z * -t;
	tmp = 0.0;
	if (y <= -3.8e+61)
		tmp = t_1;
	elseif (y <= -245000.0)
		tmp = t_3;
	elseif (y <= -4.1e-13)
		tmp = y * t;
	elseif (y <= -4.2e-93)
		tmp = t_2;
	elseif (y <= -4.8e-187)
		tmp = t_3;
	elseif (y <= 8e-11)
		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[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -3.8e+61], t$95$1, If[LessEqual[y, -245000.0], t$95$3, If[LessEqual[y, -4.1e-13], N[(y * t), $MachinePrecision], If[LessEqual[y, -4.2e-93], t$95$2, If[LessEqual[y, -4.8e-187], t$95$3, If[LessEqual[y, 8e-11], t$95$2, t$95$1]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -245000:\\
\;\;\;\;t_3\\

\mathbf{elif}\;y \leq -4.1 \cdot 10^{-13}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq -4.2 \cdot 10^{-93}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -4.8 \cdot 10^{-187}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;y \leq 8 \cdot 10^{-11}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.79999999999999995e61 or 7.99999999999999952e-11 < y

    1. Initial program 99.9%

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\left(t + \left(-x\right)\right)} \]
      2. distribute-lft-in94.1%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 + -1 \cdot \left(y - z\right), t \cdot y\right)} \]
      3. mul-1-neg91.6%

        \[\leadsto \mathsf{fma}\left(x, 1 + \color{blue}{\left(-\left(y - z\right)\right)}, t \cdot y\right) \]
      4. unsub-neg91.6%

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{1 - \left(y - z\right)}, t \cdot y\right) \]
      5. *-commutative91.6%

        \[\leadsto \mathsf{fma}\left(x, 1 - \left(y - z\right), \color{blue}{y \cdot t}\right) \]
    7. Simplified91.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 - \left(y - z\right), y \cdot t\right)} \]
    8. Taylor expanded in y around inf 83.8%

      \[\leadsto \color{blue}{y \cdot \left(t + -1 \cdot x\right)} \]
    9. Step-by-step derivation
      1. neg-mul-183.8%

        \[\leadsto y \cdot \left(t + \color{blue}{\left(-x\right)}\right) \]
      2. sub-neg83.8%

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

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

    if -3.79999999999999995e61 < y < -245000 or -4.2000000000000002e-93 < y < -4.80000000000000027e-187

    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. add-sqr-sqrt52.9%

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \sqrt{t - x}\right) \cdot \sqrt{t - x}} + x \]
      4. fma-def52.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    3. Applied egg-rr52.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    4. Taylor expanded in x around 0 78.8%

      \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
    5. Step-by-step derivation
      1. *-commutative78.8%

        \[\leadsto \color{blue}{\left(y - z\right) \cdot t} \]
    6. Simplified78.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot z\right)} \]
    8. Step-by-step derivation
      1. associate-*r*69.7%

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

        \[\leadsto \color{blue}{\left(-t\right)} \cdot z \]
    9. Simplified69.7%

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

    if -245000 < y < -4.1000000000000002e-13

    1. Initial program 100.0%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 + -1 \cdot \left(y - z\right), t \cdot y\right)} \]
      3. mul-1-neg97.7%

        \[\leadsto \mathsf{fma}\left(x, 1 + \color{blue}{\left(-\left(y - z\right)\right)}, t \cdot y\right) \]
      4. unsub-neg97.7%

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{1 - \left(y - z\right)}, t \cdot y\right) \]
      5. *-commutative97.7%

        \[\leadsto \mathsf{fma}\left(x, 1 - \left(y - z\right), \color{blue}{y \cdot t}\right) \]
    7. Simplified97.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 - \left(y - z\right), y \cdot t\right)} \]
    8. Taylor expanded in x around 0 91.4%

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

    if -4.1000000000000002e-13 < y < -4.2000000000000002e-93 or -4.80000000000000027e-187 < y < 7.99999999999999952e-11

    1. Initial program 100.0%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      2. unsub-neg63.2%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(z + 1\right)} \]
    7. Simplified63.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.8 \cdot 10^{+61}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -245000:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq -4.1 \cdot 10^{-13}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-93}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{-187}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-11}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 4: 35.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ t_2 := y \cdot \left(-x\right)\\ \mathbf{if}\;x \leq -2.7 \cdot 10^{+86}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -1.55 \cdot 10^{-279}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{-303}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.95 \cdot 10^{-175}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;x \leq 6.8 \cdot 10^{+31}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+210}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))) (t_2 (* y (- x))))
   (if (<= x -2.7e+86)
     t_2
     (if (<= x -1.55e-279)
       (* y t)
       (if (<= x 1.7e-303)
         t_1
         (if (<= x 1.95e-175)
           (* y t)
           (if (<= x 6.8e+31) t_1 (if (<= x 1.05e+210) (* z x) t_2))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double t_2 = y * -x;
	double tmp;
	if (x <= -2.7e+86) {
		tmp = t_2;
	} else if (x <= -1.55e-279) {
		tmp = y * t;
	} else if (x <= 1.7e-303) {
		tmp = t_1;
	} else if (x <= 1.95e-175) {
		tmp = y * t;
	} else if (x <= 6.8e+31) {
		tmp = t_1;
	} else if (x <= 1.05e+210) {
		tmp = z * 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 = z * -t
    t_2 = y * -x
    if (x <= (-2.7d+86)) then
        tmp = t_2
    else if (x <= (-1.55d-279)) then
        tmp = y * t
    else if (x <= 1.7d-303) then
        tmp = t_1
    else if (x <= 1.95d-175) then
        tmp = y * t
    else if (x <= 6.8d+31) then
        tmp = t_1
    else if (x <= 1.05d+210) then
        tmp = z * 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 = z * -t;
	double t_2 = y * -x;
	double tmp;
	if (x <= -2.7e+86) {
		tmp = t_2;
	} else if (x <= -1.55e-279) {
		tmp = y * t;
	} else if (x <= 1.7e-303) {
		tmp = t_1;
	} else if (x <= 1.95e-175) {
		tmp = y * t;
	} else if (x <= 6.8e+31) {
		tmp = t_1;
	} else if (x <= 1.05e+210) {
		tmp = z * x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	t_2 = y * -x
	tmp = 0
	if x <= -2.7e+86:
		tmp = t_2
	elif x <= -1.55e-279:
		tmp = y * t
	elif x <= 1.7e-303:
		tmp = t_1
	elif x <= 1.95e-175:
		tmp = y * t
	elif x <= 6.8e+31:
		tmp = t_1
	elif x <= 1.05e+210:
		tmp = z * x
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	t_2 = Float64(y * Float64(-x))
	tmp = 0.0
	if (x <= -2.7e+86)
		tmp = t_2;
	elseif (x <= -1.55e-279)
		tmp = Float64(y * t);
	elseif (x <= 1.7e-303)
		tmp = t_1;
	elseif (x <= 1.95e-175)
		tmp = Float64(y * t);
	elseif (x <= 6.8e+31)
		tmp = t_1;
	elseif (x <= 1.05e+210)
		tmp = Float64(z * x);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	t_2 = y * -x;
	tmp = 0.0;
	if (x <= -2.7e+86)
		tmp = t_2;
	elseif (x <= -1.55e-279)
		tmp = y * t;
	elseif (x <= 1.7e-303)
		tmp = t_1;
	elseif (x <= 1.95e-175)
		tmp = y * t;
	elseif (x <= 6.8e+31)
		tmp = t_1;
	elseif (x <= 1.05e+210)
		tmp = z * x;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(y * (-x)), $MachinePrecision]}, If[LessEqual[x, -2.7e+86], t$95$2, If[LessEqual[x, -1.55e-279], N[(y * t), $MachinePrecision], If[LessEqual[x, 1.7e-303], t$95$1, If[LessEqual[x, 1.95e-175], N[(y * t), $MachinePrecision], If[LessEqual[x, 6.8e+31], t$95$1, If[LessEqual[x, 1.05e+210], N[(z * x), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \leq 1.7 \cdot 10^{-303}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 1.95 \cdot 10^{-175}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;x \leq 6.8 \cdot 10^{+31}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 1.05 \cdot 10^{+210}:\\
\;\;\;\;z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -2.70000000000000018e86 or 1.0499999999999999e210 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -2.70000000000000018e86 < x < -1.55e-279 or 1.7e-303 < x < 1.94999999999999999e-175

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, 1 + \color{blue}{\left(-\left(y - z\right)\right)}, t \cdot y\right) \]
      4. unsub-neg73.2%

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{1 - \left(y - z\right)}, t \cdot y\right) \]
      5. *-commutative73.2%

        \[\leadsto \mathsf{fma}\left(x, 1 - \left(y - z\right), \color{blue}{y \cdot t}\right) \]
    7. Simplified73.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 - \left(y - z\right), y \cdot t\right)} \]
    8. Taylor expanded in x around 0 49.8%

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

    if -1.55e-279 < x < 1.7e-303 or 1.94999999999999999e-175 < x < 6.7999999999999996e31

    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. add-sqr-sqrt35.2%

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \sqrt{t - x}\right) \cdot \sqrt{t - x}} + x \]
      4. fma-def35.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    3. Applied egg-rr35.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    4. Taylor expanded in x around 0 70.3%

      \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
    5. Step-by-step derivation
      1. *-commutative70.3%

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot z\right)} \]
    8. Step-by-step derivation
      1. associate-*r*56.2%

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

        \[\leadsto \color{blue}{\left(-t\right)} \cdot z \]
    9. Simplified56.2%

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

    if 6.7999999999999996e31 < x < 1.0499999999999999e210

    1. Initial program 100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.7 \cdot 10^{+86}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;x \leq -1.55 \cdot 10^{-279}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{-303}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;x \leq 1.95 \cdot 10^{-175}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;x \leq 6.8 \cdot 10^{+31}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+210}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \end{array} \]

Alternative 5: 44.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ \mathbf{if}\;x \leq -2.66 \cdot 10^{+82}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;x \leq -3.4 \cdot 10^{-279}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;x \leq 4.3 \cdot 10^{-302}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-175}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-38}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))))
   (if (<= x -2.66e+82)
     (* x (- 1.0 y))
     (if (<= x -3.4e-279)
       (* y t)
       (if (<= x 4.3e-302)
         t_1
         (if (<= x 2.3e-175)
           (* y t)
           (if (<= x 1.2e-38) t_1 (* x (+ z 1.0)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (x <= -2.66e+82) {
		tmp = x * (1.0 - y);
	} else if (x <= -3.4e-279) {
		tmp = y * t;
	} else if (x <= 4.3e-302) {
		tmp = t_1;
	} else if (x <= 2.3e-175) {
		tmp = y * t;
	} else if (x <= 1.2e-38) {
		tmp = t_1;
	} else {
		tmp = x * (z + 1.0);
	}
	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 = z * -t
    if (x <= (-2.66d+82)) then
        tmp = x * (1.0d0 - y)
    else if (x <= (-3.4d-279)) then
        tmp = y * t
    else if (x <= 4.3d-302) then
        tmp = t_1
    else if (x <= 2.3d-175) then
        tmp = y * t
    else if (x <= 1.2d-38) then
        tmp = t_1
    else
        tmp = x * (z + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (x <= -2.66e+82) {
		tmp = x * (1.0 - y);
	} else if (x <= -3.4e-279) {
		tmp = y * t;
	} else if (x <= 4.3e-302) {
		tmp = t_1;
	} else if (x <= 2.3e-175) {
		tmp = y * t;
	} else if (x <= 1.2e-38) {
		tmp = t_1;
	} else {
		tmp = x * (z + 1.0);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	tmp = 0
	if x <= -2.66e+82:
		tmp = x * (1.0 - y)
	elif x <= -3.4e-279:
		tmp = y * t
	elif x <= 4.3e-302:
		tmp = t_1
	elif x <= 2.3e-175:
		tmp = y * t
	elif x <= 1.2e-38:
		tmp = t_1
	else:
		tmp = x * (z + 1.0)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	tmp = 0.0
	if (x <= -2.66e+82)
		tmp = Float64(x * Float64(1.0 - y));
	elseif (x <= -3.4e-279)
		tmp = Float64(y * t);
	elseif (x <= 4.3e-302)
		tmp = t_1;
	elseif (x <= 2.3e-175)
		tmp = Float64(y * t);
	elseif (x <= 1.2e-38)
		tmp = t_1;
	else
		tmp = Float64(x * Float64(z + 1.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	tmp = 0.0;
	if (x <= -2.66e+82)
		tmp = x * (1.0 - y);
	elseif (x <= -3.4e-279)
		tmp = y * t;
	elseif (x <= 4.3e-302)
		tmp = t_1;
	elseif (x <= 2.3e-175)
		tmp = y * t;
	elseif (x <= 1.2e-38)
		tmp = t_1;
	else
		tmp = x * (z + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[x, -2.66e+82], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.4e-279], N[(y * t), $MachinePrecision], If[LessEqual[x, 4.3e-302], t$95$1, If[LessEqual[x, 2.3e-175], N[(y * t), $MachinePrecision], If[LessEqual[x, 1.2e-38], t$95$1, N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \leq 4.3 \cdot 10^{-302}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 2.3 \cdot 10^{-175}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;x \leq 1.2 \cdot 10^{-38}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -2.6600000000000001e82

    1. Initial program 100.0%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
    4. Simplified93.5%

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

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

    if -2.6600000000000001e82 < x < -3.40000000000000015e-279 or 4.3000000000000002e-302 < x < 2.3e-175

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, 1 + \color{blue}{\left(-\left(y - z\right)\right)}, t \cdot y\right) \]
      4. unsub-neg73.2%

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{1 - \left(y - z\right)}, t \cdot y\right) \]
      5. *-commutative73.2%

        \[\leadsto \mathsf{fma}\left(x, 1 - \left(y - z\right), \color{blue}{y \cdot t}\right) \]
    7. Simplified73.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 - \left(y - z\right), y \cdot t\right)} \]
    8. Taylor expanded in x around 0 49.8%

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

    if -3.40000000000000015e-279 < x < 4.3000000000000002e-302 or 2.3e-175 < x < 1.20000000000000011e-38

    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. add-sqr-sqrt34.9%

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \sqrt{t - x}\right) \cdot \sqrt{t - x}} + x \]
      4. fma-def34.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    3. Applied egg-rr34.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    4. Taylor expanded in x around 0 76.9%

      \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
    5. Step-by-step derivation
      1. *-commutative76.9%

        \[\leadsto \color{blue}{\left(y - z\right) \cdot t} \]
    6. Simplified76.9%

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot z\right)} \]
    8. Step-by-step derivation
      1. associate-*r*61.3%

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

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

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

    if 1.20000000000000011e-38 < x

    1. Initial program 100.0%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      2. unsub-neg81.7%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
    4. Simplified81.7%

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

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

        \[\leadsto x \cdot \color{blue}{\left(z + 1\right)} \]
    7. Simplified54.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.66 \cdot 10^{+82}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;x \leq -3.4 \cdot 10^{-279}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;x \leq 4.3 \cdot 10^{-302}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-175}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-38}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \end{array} \]

Alternative 6: 66.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(z + 1\right)\\ t_2 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -1.55 \cdot 10^{+71}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-15}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-93}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{-187}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{-11}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ z 1.0))) (t_2 (* y (- t x))))
   (if (<= y -1.55e+71)
     t_2
     (if (<= y -8.5e-15)
       (* (- y z) t)
       (if (<= y -4.2e-93)
         t_1
         (if (<= y -2.4e-187) (* z (- t)) (if (<= y 6.4e-11) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (z + 1.0);
	double t_2 = y * (t - x);
	double tmp;
	if (y <= -1.55e+71) {
		tmp = t_2;
	} else if (y <= -8.5e-15) {
		tmp = (y - z) * t;
	} else if (y <= -4.2e-93) {
		tmp = t_1;
	} else if (y <= -2.4e-187) {
		tmp = z * -t;
	} else if (y <= 6.4e-11) {
		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 * (z + 1.0d0)
    t_2 = y * (t - x)
    if (y <= (-1.55d+71)) then
        tmp = t_2
    else if (y <= (-8.5d-15)) then
        tmp = (y - z) * t
    else if (y <= (-4.2d-93)) then
        tmp = t_1
    else if (y <= (-2.4d-187)) then
        tmp = z * -t
    else if (y <= 6.4d-11) 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 * (z + 1.0);
	double t_2 = y * (t - x);
	double tmp;
	if (y <= -1.55e+71) {
		tmp = t_2;
	} else if (y <= -8.5e-15) {
		tmp = (y - z) * t;
	} else if (y <= -4.2e-93) {
		tmp = t_1;
	} else if (y <= -2.4e-187) {
		tmp = z * -t;
	} else if (y <= 6.4e-11) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (z + 1.0)
	t_2 = y * (t - x)
	tmp = 0
	if y <= -1.55e+71:
		tmp = t_2
	elif y <= -8.5e-15:
		tmp = (y - z) * t
	elif y <= -4.2e-93:
		tmp = t_1
	elif y <= -2.4e-187:
		tmp = z * -t
	elif y <= 6.4e-11:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(z + 1.0))
	t_2 = Float64(y * Float64(t - x))
	tmp = 0.0
	if (y <= -1.55e+71)
		tmp = t_2;
	elseif (y <= -8.5e-15)
		tmp = Float64(Float64(y - z) * t);
	elseif (y <= -4.2e-93)
		tmp = t_1;
	elseif (y <= -2.4e-187)
		tmp = Float64(z * Float64(-t));
	elseif (y <= 6.4e-11)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (z + 1.0);
	t_2 = y * (t - x);
	tmp = 0.0;
	if (y <= -1.55e+71)
		tmp = t_2;
	elseif (y <= -8.5e-15)
		tmp = (y - z) * t;
	elseif (y <= -4.2e-93)
		tmp = t_1;
	elseif (y <= -2.4e-187)
		tmp = z * -t;
	elseif (y <= 6.4e-11)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.55e+71], t$95$2, If[LessEqual[y, -8.5e-15], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, -4.2e-93], t$95$1, If[LessEqual[y, -2.4e-187], N[(z * (-t)), $MachinePrecision], If[LessEqual[y, 6.4e-11], t$95$1, t$95$2]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -8.5 \cdot 10^{-15}:\\
\;\;\;\;\left(y - z\right) \cdot t\\

\mathbf{elif}\;y \leq -4.2 \cdot 10^{-93}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -2.4 \cdot 10^{-187}:\\
\;\;\;\;z \cdot \left(-t\right)\\

\mathbf{elif}\;y \leq 6.4 \cdot 10^{-11}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.55000000000000009e71 or 6.39999999999999987e-11 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 + -1 \cdot \left(y - z\right), t \cdot y\right)} \]
      3. mul-1-neg91.5%

        \[\leadsto \mathsf{fma}\left(x, 1 + \color{blue}{\left(-\left(y - z\right)\right)}, t \cdot y\right) \]
      4. unsub-neg91.5%

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{1 - \left(y - z\right)}, t \cdot y\right) \]
      5. *-commutative91.5%

        \[\leadsto \mathsf{fma}\left(x, 1 - \left(y - z\right), \color{blue}{y \cdot t}\right) \]
    7. Simplified91.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 - \left(y - z\right), y \cdot t\right)} \]
    8. Taylor expanded in y around inf 83.5%

      \[\leadsto \color{blue}{y \cdot \left(t + -1 \cdot x\right)} \]
    9. Step-by-step derivation
      1. neg-mul-183.5%

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

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

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

    if -1.55000000000000009e71 < y < -8.50000000000000007e-15

    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. add-sqr-sqrt47.5%

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \sqrt{t - x}\right) \cdot \sqrt{t - x}} + x \]
      4. fma-def47.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    3. Applied egg-rr47.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    4. Taylor expanded in x around 0 84.7%

      \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
    5. Step-by-step derivation
      1. *-commutative84.7%

        \[\leadsto \color{blue}{\left(y - z\right) \cdot t} \]
    6. Simplified84.7%

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

    if -8.50000000000000007e-15 < y < -4.2000000000000002e-93 or -2.40000000000000013e-187 < y < 6.39999999999999987e-11

    1. Initial program 100.0%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      2. unsub-neg63.2%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(z + 1\right)} \]
    7. Simplified63.1%

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

    if -4.2000000000000002e-93 < y < -2.40000000000000013e-187

    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. add-sqr-sqrt58.5%

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \sqrt{t - x}\right) \cdot \sqrt{t - x}} + x \]
      4. fma-def58.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    3. Applied egg-rr58.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    4. Taylor expanded in x around 0 77.0%

      \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
    5. Step-by-step derivation
      1. *-commutative77.0%

        \[\leadsto \color{blue}{\left(y - z\right) \cdot t} \]
    6. Simplified77.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot z\right)} \]
    8. Step-by-step derivation
      1. associate-*r*77.1%

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

        \[\leadsto \color{blue}{\left(-t\right)} \cdot z \]
    9. Simplified77.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.55 \cdot 10^{+71}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-15}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-93}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{-187}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{-11}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 7: 72.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(z + 1\right)\\ t_2 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -6.2 \cdot 10^{+71}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -5.8 \cdot 10^{-15}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-90}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 6.7 \cdot 10^{-43}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-11}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ z 1.0))) (t_2 (* y (- t x))))
   (if (<= y -6.2e+71)
     t_2
     (if (<= y -5.8e-15)
       (* (- y z) t)
       (if (<= y -6.5e-90)
         t_1
         (if (<= y 6.7e-43) (- x (* z t)) (if (<= y 7.2e-11) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (z + 1.0);
	double t_2 = y * (t - x);
	double tmp;
	if (y <= -6.2e+71) {
		tmp = t_2;
	} else if (y <= -5.8e-15) {
		tmp = (y - z) * t;
	} else if (y <= -6.5e-90) {
		tmp = t_1;
	} else if (y <= 6.7e-43) {
		tmp = x - (z * t);
	} else if (y <= 7.2e-11) {
		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 * (z + 1.0d0)
    t_2 = y * (t - x)
    if (y <= (-6.2d+71)) then
        tmp = t_2
    else if (y <= (-5.8d-15)) then
        tmp = (y - z) * t
    else if (y <= (-6.5d-90)) then
        tmp = t_1
    else if (y <= 6.7d-43) then
        tmp = x - (z * t)
    else if (y <= 7.2d-11) 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 * (z + 1.0);
	double t_2 = y * (t - x);
	double tmp;
	if (y <= -6.2e+71) {
		tmp = t_2;
	} else if (y <= -5.8e-15) {
		tmp = (y - z) * t;
	} else if (y <= -6.5e-90) {
		tmp = t_1;
	} else if (y <= 6.7e-43) {
		tmp = x - (z * t);
	} else if (y <= 7.2e-11) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (z + 1.0)
	t_2 = y * (t - x)
	tmp = 0
	if y <= -6.2e+71:
		tmp = t_2
	elif y <= -5.8e-15:
		tmp = (y - z) * t
	elif y <= -6.5e-90:
		tmp = t_1
	elif y <= 6.7e-43:
		tmp = x - (z * t)
	elif y <= 7.2e-11:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(z + 1.0))
	t_2 = Float64(y * Float64(t - x))
	tmp = 0.0
	if (y <= -6.2e+71)
		tmp = t_2;
	elseif (y <= -5.8e-15)
		tmp = Float64(Float64(y - z) * t);
	elseif (y <= -6.5e-90)
		tmp = t_1;
	elseif (y <= 6.7e-43)
		tmp = Float64(x - Float64(z * t));
	elseif (y <= 7.2e-11)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (z + 1.0);
	t_2 = y * (t - x);
	tmp = 0.0;
	if (y <= -6.2e+71)
		tmp = t_2;
	elseif (y <= -5.8e-15)
		tmp = (y - z) * t;
	elseif (y <= -6.5e-90)
		tmp = t_1;
	elseif (y <= 6.7e-43)
		tmp = x - (z * t);
	elseif (y <= 7.2e-11)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.2e+71], t$95$2, If[LessEqual[y, -5.8e-15], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, -6.5e-90], t$95$1, If[LessEqual[y, 6.7e-43], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e-11], t$95$1, t$95$2]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -5.8 \cdot 10^{-15}:\\
\;\;\;\;\left(y - z\right) \cdot t\\

\mathbf{elif}\;y \leq -6.5 \cdot 10^{-90}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 7.2 \cdot 10^{-11}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -6.20000000000000036e71 or 7.19999999999999969e-11 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 + -1 \cdot \left(y - z\right), t \cdot y\right)} \]
      3. mul-1-neg91.5%

        \[\leadsto \mathsf{fma}\left(x, 1 + \color{blue}{\left(-\left(y - z\right)\right)}, t \cdot y\right) \]
      4. unsub-neg91.5%

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{1 - \left(y - z\right)}, t \cdot y\right) \]
      5. *-commutative91.5%

        \[\leadsto \mathsf{fma}\left(x, 1 - \left(y - z\right), \color{blue}{y \cdot t}\right) \]
    7. Simplified91.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 - \left(y - z\right), y \cdot t\right)} \]
    8. Taylor expanded in y around inf 83.5%

      \[\leadsto \color{blue}{y \cdot \left(t + -1 \cdot x\right)} \]
    9. Step-by-step derivation
      1. neg-mul-183.5%

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

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

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

    if -6.20000000000000036e71 < y < -5.80000000000000037e-15

    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. add-sqr-sqrt47.5%

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \sqrt{t - x}\right) \cdot \sqrt{t - x}} + x \]
      4. fma-def47.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    3. Applied egg-rr47.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    4. Taylor expanded in x around 0 84.7%

      \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
    5. Step-by-step derivation
      1. *-commutative84.7%

        \[\leadsto \color{blue}{\left(y - z\right) \cdot t} \]
    6. Simplified84.7%

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

    if -5.80000000000000037e-15 < y < -6.4999999999999996e-90 or 6.6999999999999998e-43 < y < 7.19999999999999969e-11

    1. Initial program 100.0%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      2. unsub-neg74.7%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(z + 1\right)} \]
    7. Simplified74.5%

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

    if -6.4999999999999996e-90 < y < 6.6999999999999998e-43

    1. Initial program 100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.2 \cdot 10^{+71}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -5.8 \cdot 10^{-15}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-90}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 6.7 \cdot 10^{-43}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-11}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 8: 70.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -4.4 \cdot 10^{+70}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -8 \cdot 10^{-15}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq -1.55 \cdot 10^{-92}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-236}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-11}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (- t x))))
   (if (<= y -4.4e+70)
     t_1
     (if (<= y -8e-15)
       (* (- y z) t)
       (if (<= y -1.55e-92)
         (* x (+ z 1.0))
         (if (<= y 2.8e-236)
           (- x (* z t))
           (if (<= y 8e-11) (* z (- x t)) t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double tmp;
	if (y <= -4.4e+70) {
		tmp = t_1;
	} else if (y <= -8e-15) {
		tmp = (y - z) * t;
	} else if (y <= -1.55e-92) {
		tmp = x * (z + 1.0);
	} else if (y <= 2.8e-236) {
		tmp = x - (z * t);
	} else if (y <= 8e-11) {
		tmp = z * (x - 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) :: tmp
    t_1 = y * (t - x)
    if (y <= (-4.4d+70)) then
        tmp = t_1
    else if (y <= (-8d-15)) then
        tmp = (y - z) * t
    else if (y <= (-1.55d-92)) then
        tmp = x * (z + 1.0d0)
    else if (y <= 2.8d-236) then
        tmp = x - (z * t)
    else if (y <= 8d-11) then
        tmp = z * (x - 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 = y * (t - x);
	double tmp;
	if (y <= -4.4e+70) {
		tmp = t_1;
	} else if (y <= -8e-15) {
		tmp = (y - z) * t;
	} else if (y <= -1.55e-92) {
		tmp = x * (z + 1.0);
	} else if (y <= 2.8e-236) {
		tmp = x - (z * t);
	} else if (y <= 8e-11) {
		tmp = z * (x - t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (t - x)
	tmp = 0
	if y <= -4.4e+70:
		tmp = t_1
	elif y <= -8e-15:
		tmp = (y - z) * t
	elif y <= -1.55e-92:
		tmp = x * (z + 1.0)
	elif y <= 2.8e-236:
		tmp = x - (z * t)
	elif y <= 8e-11:
		tmp = z * (x - t)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(t - x))
	tmp = 0.0
	if (y <= -4.4e+70)
		tmp = t_1;
	elseif (y <= -8e-15)
		tmp = Float64(Float64(y - z) * t);
	elseif (y <= -1.55e-92)
		tmp = Float64(x * Float64(z + 1.0));
	elseif (y <= 2.8e-236)
		tmp = Float64(x - Float64(z * t));
	elseif (y <= 8e-11)
		tmp = Float64(z * Float64(x - t));
	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 <= -4.4e+70)
		tmp = t_1;
	elseif (y <= -8e-15)
		tmp = (y - z) * t;
	elseif (y <= -1.55e-92)
		tmp = x * (z + 1.0);
	elseif (y <= 2.8e-236)
		tmp = x - (z * t);
	elseif (y <= 8e-11)
		tmp = z * (x - t);
	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, -4.4e+70], t$95$1, If[LessEqual[y, -8e-15], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, -1.55e-92], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e-236], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e-11], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -8 \cdot 10^{-15}:\\
\;\;\;\;\left(y - z\right) \cdot t\\

\mathbf{elif}\;y \leq -1.55 \cdot 10^{-92}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\

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

\mathbf{elif}\;y \leq 8 \cdot 10^{-11}:\\
\;\;\;\;z \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -4.40000000000000001e70 or 7.99999999999999952e-11 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 + -1 \cdot \left(y - z\right), t \cdot y\right)} \]
      3. mul-1-neg91.5%

        \[\leadsto \mathsf{fma}\left(x, 1 + \color{blue}{\left(-\left(y - z\right)\right)}, t \cdot y\right) \]
      4. unsub-neg91.5%

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{1 - \left(y - z\right)}, t \cdot y\right) \]
      5. *-commutative91.5%

        \[\leadsto \mathsf{fma}\left(x, 1 - \left(y - z\right), \color{blue}{y \cdot t}\right) \]
    7. Simplified91.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 - \left(y - z\right), y \cdot t\right)} \]
    8. Taylor expanded in y around inf 83.5%

      \[\leadsto \color{blue}{y \cdot \left(t + -1 \cdot x\right)} \]
    9. Step-by-step derivation
      1. neg-mul-183.5%

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

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

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

    if -4.40000000000000001e70 < y < -8.0000000000000006e-15

    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. add-sqr-sqrt47.5%

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \sqrt{t - x}\right) \cdot \sqrt{t - x}} + x \]
      4. fma-def47.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    3. Applied egg-rr47.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    4. Taylor expanded in x around 0 84.7%

      \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
    5. Step-by-step derivation
      1. *-commutative84.7%

        \[\leadsto \color{blue}{\left(y - z\right) \cdot t} \]
    6. Simplified84.7%

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

    if -8.0000000000000006e-15 < y < -1.55e-92

    1. Initial program 100.0%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      2. unsub-neg67.6%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
    4. Simplified67.6%

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

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

        \[\leadsto x \cdot \color{blue}{\left(z + 1\right)} \]
    7. Simplified67.4%

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

    if -1.55e-92 < y < 2.79999999999999986e-236

    1. Initial program 100.0%

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

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

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

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

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

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

    if 2.79999999999999986e-236 < y < 7.99999999999999952e-11

    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. add-sqr-sqrt38.1%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    3. Applied egg-rr38.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    4. Taylor expanded in z around inf 75.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.4 \cdot 10^{+70}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -8 \cdot 10^{-15}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq -1.55 \cdot 10^{-92}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-236}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-11}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 9: 84.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -6.4 \cdot 10^{+69}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -4.65 \cdot 10^{-32}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-16}:\\ \;\;\;\;x - z \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (- t x))))
   (if (<= y -6.4e+69)
     t_1
     (if (<= y -4.65e-32)
       (+ x (* (- y z) t))
       (if (<= y 4.2e-16) (- x (* z (- t x))) (+ x t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double tmp;
	if (y <= -6.4e+69) {
		tmp = t_1;
	} else if (y <= -4.65e-32) {
		tmp = x + ((y - z) * t);
	} else if (y <= 4.2e-16) {
		tmp = x - (z * (t - x));
	} else {
		tmp = x + 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 <= (-6.4d+69)) then
        tmp = t_1
    else if (y <= (-4.65d-32)) then
        tmp = x + ((y - z) * t)
    else if (y <= 4.2d-16) then
        tmp = x - (z * (t - x))
    else
        tmp = x + 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 <= -6.4e+69) {
		tmp = t_1;
	} else if (y <= -4.65e-32) {
		tmp = x + ((y - z) * t);
	} else if (y <= 4.2e-16) {
		tmp = x - (z * (t - x));
	} else {
		tmp = x + t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (t - x)
	tmp = 0
	if y <= -6.4e+69:
		tmp = t_1
	elif y <= -4.65e-32:
		tmp = x + ((y - z) * t)
	elif y <= 4.2e-16:
		tmp = x - (z * (t - x))
	else:
		tmp = x + t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(t - x))
	tmp = 0.0
	if (y <= -6.4e+69)
		tmp = t_1;
	elseif (y <= -4.65e-32)
		tmp = Float64(x + Float64(Float64(y - z) * t));
	elseif (y <= 4.2e-16)
		tmp = Float64(x - Float64(z * Float64(t - x)));
	else
		tmp = Float64(x + t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (t - x);
	tmp = 0.0;
	if (y <= -6.4e+69)
		tmp = t_1;
	elseif (y <= -4.65e-32)
		tmp = x + ((y - z) * t);
	elseif (y <= 4.2e-16)
		tmp = x - (z * (t - x));
	else
		tmp = x + 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, -6.4e+69], t$95$1, If[LessEqual[y, -4.65e-32], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e-16], N[(x - N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -4.65 \cdot 10^{-32}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{-16}:\\
\;\;\;\;x - z \cdot \left(t - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -6.3999999999999997e69

    1. Initial program 100.0%

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\left(t + \left(-x\right)\right)} \]
      2. distribute-lft-in94.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 + -1 \cdot \left(y - z\right), t \cdot y\right)} \]
      3. mul-1-neg95.9%

        \[\leadsto \mathsf{fma}\left(x, 1 + \color{blue}{\left(-\left(y - z\right)\right)}, t \cdot y\right) \]
      4. unsub-neg95.9%

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{1 - \left(y - z\right)}, t \cdot y\right) \]
      5. *-commutative95.9%

        \[\leadsto \mathsf{fma}\left(x, 1 - \left(y - z\right), \color{blue}{y \cdot t}\right) \]
    7. Simplified95.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 - \left(y - z\right), y \cdot t\right)} \]
    8. Taylor expanded in y around inf 92.2%

      \[\leadsto \color{blue}{y \cdot \left(t + -1 \cdot x\right)} \]
    9. Step-by-step derivation
      1. neg-mul-192.2%

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

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

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

    if -6.3999999999999997e69 < y < -4.64999999999999988e-32

    1. Initial program 100.0%

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

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

    if -4.64999999999999988e-32 < y < 4.2000000000000002e-16

    1. Initial program 100.0%

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

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

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

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

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

    if 4.2000000000000002e-16 < y

    1. Initial program 99.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.4 \cdot 10^{+69}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -4.65 \cdot 10^{-32}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-16}:\\ \;\;\;\;x - z \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 10: 38.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+28}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -2.35 \cdot 10^{-275}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 2.3 \cdot 10^{-213}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 31:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.8000000000000002e28 or 31 < z

    1. Initial program 100.0%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      2. unsub-neg50.6%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
    4. Simplified50.6%

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

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

    if -5.8000000000000002e28 < z < -2.3499999999999999e-275 or 2.30000000000000003e-213 < z < 31

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, 1 + \color{blue}{\left(-\left(y - z\right)\right)}, t \cdot y\right) \]
      4. unsub-neg90.4%

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{1 - \left(y - z\right)}, t \cdot y\right) \]
      5. *-commutative90.4%

        \[\leadsto \mathsf{fma}\left(x, 1 - \left(y - z\right), \color{blue}{y \cdot t}\right) \]
    7. Simplified90.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 - \left(y - z\right), y \cdot t\right)} \]
    8. Taylor expanded in x around 0 45.7%

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

    if -2.3499999999999999e-275 < z < 2.30000000000000003e-213

    1. Initial program 99.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+28}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -2.35 \cdot 10^{-275}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-213}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 31:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]

Alternative 11: 76.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.08 \cdot 10^{+37} \lor \neg \left(x \leq 2.3 \cdot 10^{-36}\right):\\
\;\;\;\;x \cdot \left(1 - \left(y - z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.08e37 or 2.29999999999999996e-36 < x

    1. Initial program 100.0%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      2. unsub-neg84.2%

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

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

    if -1.08e37 < x < 2.29999999999999996e-36

    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. add-sqr-sqrt50.2%

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \sqrt{t - x}\right) \cdot \sqrt{t - x}} + x \]
      4. fma-def50.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    3. Applied egg-rr50.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y - z\right) \cdot \sqrt{t - x}, \sqrt{t - x}, x\right)} \]
    4. Taylor expanded in x around 0 78.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.08 \cdot 10^{+37} \lor \neg \left(x \leq 2.3 \cdot 10^{-36}\right):\\ \;\;\;\;x \cdot \left(1 - \left(y - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \]

Alternative 12: 82.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+43} \lor \neg \left(x \leq 5.2 \cdot 10^{+32}\right):\\
\;\;\;\;x \cdot \left(1 - \left(y - z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.2500000000000001e43 or 5.2000000000000004e32 < x

    1. Initial program 100.0%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      2. unsub-neg87.1%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
    4. Simplified87.1%

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

    if -1.2500000000000001e43 < x < 5.2000000000000004e32

    1. Initial program 100.0%

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

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

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

Alternative 13: 34.1% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x \leq 4 \cdot 10^{-43}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;x \leq 6.4 \cdot 10^{+208}:\\
\;\;\;\;z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.10000000000000032e82 or 6.4000000000000002e208 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -3.10000000000000032e82 < x < 4.00000000000000031e-43

    1. Initial program 100.0%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 + -1 \cdot \left(y - z\right), t \cdot y\right)} \]
      3. mul-1-neg65.3%

        \[\leadsto \mathsf{fma}\left(x, 1 + \color{blue}{\left(-\left(y - z\right)\right)}, t \cdot y\right) \]
      4. unsub-neg65.3%

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{1 - \left(y - z\right)}, t \cdot y\right) \]
      5. *-commutative65.3%

        \[\leadsto \mathsf{fma}\left(x, 1 - \left(y - z\right), \color{blue}{y \cdot t}\right) \]
    7. Simplified65.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 - \left(y - z\right), y \cdot t\right)} \]
    8. Taylor expanded in x around 0 42.2%

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

    if 4.00000000000000031e-43 < x < 6.4000000000000002e208

    1. Initial program 100.0%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      2. unsub-neg72.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.1 \cdot 10^{+82}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-43}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;x \leq 6.4 \cdot 10^{+208}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \end{array} \]

Alternative 14: 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}
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(t - x\right) \]

Alternative 15: 37.0% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{-65} \lor \neg \left(y \leq 4.15 \cdot 10^{-13}\right):\\
\;\;\;\;y \cdot t\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.5999999999999999e-65 or 4.14999999999999999e-13 < y

    1. Initial program 100.0%

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\left(t + \left(-x\right)\right)} \]
      2. distribute-lft-in94.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 + -1 \cdot \left(y - z\right), t \cdot y\right)} \]
      3. mul-1-neg87.6%

        \[\leadsto \mathsf{fma}\left(x, 1 + \color{blue}{\left(-\left(y - z\right)\right)}, t \cdot y\right) \]
      4. unsub-neg87.6%

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{1 - \left(y - z\right)}, t \cdot y\right) \]
      5. *-commutative87.6%

        \[\leadsto \mathsf{fma}\left(x, 1 - \left(y - z\right), \color{blue}{y \cdot t}\right) \]
    7. Simplified87.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 - \left(y - z\right), y \cdot t\right)} \]
    8. Taylor expanded in x around 0 45.0%

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

    if -4.5999999999999999e-65 < y < 4.14999999999999999e-13

    1. Initial program 100.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.6 \cdot 10^{-65} \lor \neg \left(y \leq 4.15 \cdot 10^{-13}\right):\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 16: 18.1% 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 y around inf 59.0%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification14.8%

    \[\leadsto x \]

Developer target: 96.4% 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 2023331 
(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))))