Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 9.7s
Alternatives: 14
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 14 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: 67.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ t_2 := z \cdot \left(x - t\right)\\ t_3 := \left(y - z\right) \cdot t\\ \mathbf{if}\;y \leq -4.05 \cdot 10^{+34}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.42 \cdot 10^{-58}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -1.05 \cdot 10^{-106}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;y \leq 1.16 \cdot 10^{-104}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 5.9 \cdot 10^{-56}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{-26}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-6}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{+71}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+106}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (- t x))) (t_2 (* z (- x t))) (t_3 (* (- y z) t)))
   (if (<= y -4.05e+34)
     t_1
     (if (<= y -1.42e-58)
       t_3
       (if (<= y -1.05e-106)
         (+ x (* z x))
         (if (<= y 1.16e-104)
           t_2
           (if (<= y 5.9e-56)
             (- x (* z t))
             (if (<= y 1.95e-26)
               t_2
               (if (<= y 4.2e-6)
                 (+ x (* y t))
                 (if (<= y 4.7e+71) t_2 (if (<= y 1.25e+106) t_3 t_1)))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double t_2 = z * (x - t);
	double t_3 = (y - z) * t;
	double tmp;
	if (y <= -4.05e+34) {
		tmp = t_1;
	} else if (y <= -1.42e-58) {
		tmp = t_3;
	} else if (y <= -1.05e-106) {
		tmp = x + (z * x);
	} else if (y <= 1.16e-104) {
		tmp = t_2;
	} else if (y <= 5.9e-56) {
		tmp = x - (z * t);
	} else if (y <= 1.95e-26) {
		tmp = t_2;
	} else if (y <= 4.2e-6) {
		tmp = x + (y * t);
	} else if (y <= 4.7e+71) {
		tmp = t_2;
	} else if (y <= 1.25e+106) {
		tmp = t_3;
	} 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 = z * (x - t)
    t_3 = (y - z) * t
    if (y <= (-4.05d+34)) then
        tmp = t_1
    else if (y <= (-1.42d-58)) then
        tmp = t_3
    else if (y <= (-1.05d-106)) then
        tmp = x + (z * x)
    else if (y <= 1.16d-104) then
        tmp = t_2
    else if (y <= 5.9d-56) then
        tmp = x - (z * t)
    else if (y <= 1.95d-26) then
        tmp = t_2
    else if (y <= 4.2d-6) then
        tmp = x + (y * t)
    else if (y <= 4.7d+71) then
        tmp = t_2
    else if (y <= 1.25d+106) then
        tmp = t_3
    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 = z * (x - t);
	double t_3 = (y - z) * t;
	double tmp;
	if (y <= -4.05e+34) {
		tmp = t_1;
	} else if (y <= -1.42e-58) {
		tmp = t_3;
	} else if (y <= -1.05e-106) {
		tmp = x + (z * x);
	} else if (y <= 1.16e-104) {
		tmp = t_2;
	} else if (y <= 5.9e-56) {
		tmp = x - (z * t);
	} else if (y <= 1.95e-26) {
		tmp = t_2;
	} else if (y <= 4.2e-6) {
		tmp = x + (y * t);
	} else if (y <= 4.7e+71) {
		tmp = t_2;
	} else if (y <= 1.25e+106) {
		tmp = t_3;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (t - x)
	t_2 = z * (x - t)
	t_3 = (y - z) * t
	tmp = 0
	if y <= -4.05e+34:
		tmp = t_1
	elif y <= -1.42e-58:
		tmp = t_3
	elif y <= -1.05e-106:
		tmp = x + (z * x)
	elif y <= 1.16e-104:
		tmp = t_2
	elif y <= 5.9e-56:
		tmp = x - (z * t)
	elif y <= 1.95e-26:
		tmp = t_2
	elif y <= 4.2e-6:
		tmp = x + (y * t)
	elif y <= 4.7e+71:
		tmp = t_2
	elif y <= 1.25e+106:
		tmp = t_3
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(t - x))
	t_2 = Float64(z * Float64(x - t))
	t_3 = Float64(Float64(y - z) * t)
	tmp = 0.0
	if (y <= -4.05e+34)
		tmp = t_1;
	elseif (y <= -1.42e-58)
		tmp = t_3;
	elseif (y <= -1.05e-106)
		tmp = Float64(x + Float64(z * x));
	elseif (y <= 1.16e-104)
		tmp = t_2;
	elseif (y <= 5.9e-56)
		tmp = Float64(x - Float64(z * t));
	elseif (y <= 1.95e-26)
		tmp = t_2;
	elseif (y <= 4.2e-6)
		tmp = Float64(x + Float64(y * t));
	elseif (y <= 4.7e+71)
		tmp = t_2;
	elseif (y <= 1.25e+106)
		tmp = t_3;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (t - x);
	t_2 = z * (x - t);
	t_3 = (y - z) * t;
	tmp = 0.0;
	if (y <= -4.05e+34)
		tmp = t_1;
	elseif (y <= -1.42e-58)
		tmp = t_3;
	elseif (y <= -1.05e-106)
		tmp = x + (z * x);
	elseif (y <= 1.16e-104)
		tmp = t_2;
	elseif (y <= 5.9e-56)
		tmp = x - (z * t);
	elseif (y <= 1.95e-26)
		tmp = t_2;
	elseif (y <= 4.2e-6)
		tmp = x + (y * t);
	elseif (y <= 4.7e+71)
		tmp = t_2;
	elseif (y <= 1.25e+106)
		tmp = t_3;
	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[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[y, -4.05e+34], t$95$1, If[LessEqual[y, -1.42e-58], t$95$3, If[LessEqual[y, -1.05e-106], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.16e-104], t$95$2, If[LessEqual[y, 5.9e-56], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.95e-26], t$95$2, If[LessEqual[y, 4.2e-6], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.7e+71], t$95$2, If[LessEqual[y, 1.25e+106], t$95$3, t$95$1]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.42 \cdot 10^{-58}:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;y \leq 1.16 \cdot 10^{-104}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;y \leq 1.95 \cdot 10^{-26}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{-6}:\\
\;\;\;\;x + y \cdot t\\

\mathbf{elif}\;y \leq 4.7 \cdot 10^{+71}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 1.25 \cdot 10^{+106}:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -4.05e34 or 1.25e106 < y

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\frac{\left(y - z\right) \cdot \left(t \cdot t - x \cdot x\right)}{t + x}} \]
      3. cancel-sign-sub-inv85.3%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{t + x}{\mathsf{fma}\left(t, t, \left(-x\right) \cdot x\right)}}} \]
      2. distribute-lft-neg-out91.2%

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

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

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

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

    if -4.05e34 < y < -1.4199999999999999e-58 or 4.6999999999999996e71 < y < 1.25e106

    1. Initial program 99.9%

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

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

        \[\leadsto x + \color{blue}{\frac{\left(y - z\right) \cdot \left(t \cdot t - x \cdot x\right)}{t + x}} \]
      3. cancel-sign-sub-inv69.6%

        \[\leadsto x + \frac{\left(y - z\right) \cdot \color{blue}{\left(t \cdot t + \left(-x\right) \cdot x\right)}}{t + x} \]
      4. fma-def69.6%

        \[\leadsto x + \frac{\left(y - z\right) \cdot \color{blue}{\mathsf{fma}\left(t, t, \left(-x\right) \cdot x\right)}}{t + x} \]
    3. Applied egg-rr69.6%

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

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{t + x}{\mathsf{fma}\left(t, t, \left(-x\right) \cdot x\right)}}} \]
      2. distribute-lft-neg-out73.4%

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

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

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

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

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

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

    if -1.4199999999999999e-58 < y < -1.05000000000000002e-106

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \left(y - z\right)} \]
      5. *-rgt-identity83.9%

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

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

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

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

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

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

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

    if -1.05000000000000002e-106 < y < 1.16000000000000001e-104 or 5.8999999999999998e-56 < y < 1.94999999999999993e-26 or 4.1999999999999996e-6 < y < 4.6999999999999996e71

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\frac{\left(y - z\right) \cdot \left(t \cdot t - x \cdot x\right)}{t + x}} \]
      3. cancel-sign-sub-inv75.4%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{t + x}{\mathsf{fma}\left(t, t, \left(-x\right) \cdot x\right)}}} \]
      2. distribute-lft-neg-out80.5%

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

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot t - -1 \cdot x\right) \cdot z} \]
    8. Step-by-step derivation
      1. distribute-lft-out--78.2%

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

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

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

        \[\leadsto z \cdot \left(-\color{blue}{\left(t + \left(-x\right)\right)}\right) \]
      5. distribute-neg-in78.2%

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

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

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

    if 1.16000000000000001e-104 < y < 5.8999999999999998e-56

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \color{blue}{x - t \cdot z} \]
      4. *-commutative89.9%

        \[\leadsto x - \color{blue}{z \cdot t} \]
    5. Simplified89.9%

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

    if 1.94999999999999993e-26 < y < 4.1999999999999996e-6

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{y \cdot t + x} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification81.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.05 \cdot 10^{+34}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -1.42 \cdot 10^{-58}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq -1.05 \cdot 10^{-106}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;y \leq 1.16 \cdot 10^{-104}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 5.9 \cdot 10^{-56}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{-26}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-6}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{+71}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+106}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 3: 37.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ \mathbf{if}\;y \leq -2.4 \cdot 10^{-30}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -2.7 \cdot 10^{-74}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-86}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq -3.25 \cdot 10^{-105}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-250}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{-103}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq 8.4 \cdot 10^{+105}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{+167} \lor \neg \left(y \leq 2.9 \cdot 10^{+259}\right):\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))))
   (if (<= y -2.4e-30)
     (* y t)
     (if (<= y -2.7e-74)
       t_1
       (if (<= y -1.4e-86)
         (* z x)
         (if (<= y -3.25e-105)
           x
           (if (<= y 8e-250)
             t_1
             (if (<= y 2.05e-103)
               (* z x)
               (if (<= y 8.4e+105)
                 t_1
                 (if (or (<= y 1.1e+167) (not (<= y 2.9e+259)))
                   (* y (- x))
                   (* y t)))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (y <= -2.4e-30) {
		tmp = y * t;
	} else if (y <= -2.7e-74) {
		tmp = t_1;
	} else if (y <= -1.4e-86) {
		tmp = z * x;
	} else if (y <= -3.25e-105) {
		tmp = x;
	} else if (y <= 8e-250) {
		tmp = t_1;
	} else if (y <= 2.05e-103) {
		tmp = z * x;
	} else if (y <= 8.4e+105) {
		tmp = t_1;
	} else if ((y <= 1.1e+167) || !(y <= 2.9e+259)) {
		tmp = y * -x;
	} else {
		tmp = y * t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * -t
    if (y <= (-2.4d-30)) then
        tmp = y * t
    else if (y <= (-2.7d-74)) then
        tmp = t_1
    else if (y <= (-1.4d-86)) then
        tmp = z * x
    else if (y <= (-3.25d-105)) then
        tmp = x
    else if (y <= 8d-250) then
        tmp = t_1
    else if (y <= 2.05d-103) then
        tmp = z * x
    else if (y <= 8.4d+105) then
        tmp = t_1
    else if ((y <= 1.1d+167) .or. (.not. (y <= 2.9d+259))) then
        tmp = y * -x
    else
        tmp = y * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (y <= -2.4e-30) {
		tmp = y * t;
	} else if (y <= -2.7e-74) {
		tmp = t_1;
	} else if (y <= -1.4e-86) {
		tmp = z * x;
	} else if (y <= -3.25e-105) {
		tmp = x;
	} else if (y <= 8e-250) {
		tmp = t_1;
	} else if (y <= 2.05e-103) {
		tmp = z * x;
	} else if (y <= 8.4e+105) {
		tmp = t_1;
	} else if ((y <= 1.1e+167) || !(y <= 2.9e+259)) {
		tmp = y * -x;
	} else {
		tmp = y * t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	tmp = 0
	if y <= -2.4e-30:
		tmp = y * t
	elif y <= -2.7e-74:
		tmp = t_1
	elif y <= -1.4e-86:
		tmp = z * x
	elif y <= -3.25e-105:
		tmp = x
	elif y <= 8e-250:
		tmp = t_1
	elif y <= 2.05e-103:
		tmp = z * x
	elif y <= 8.4e+105:
		tmp = t_1
	elif (y <= 1.1e+167) or not (y <= 2.9e+259):
		tmp = y * -x
	else:
		tmp = y * t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	tmp = 0.0
	if (y <= -2.4e-30)
		tmp = Float64(y * t);
	elseif (y <= -2.7e-74)
		tmp = t_1;
	elseif (y <= -1.4e-86)
		tmp = Float64(z * x);
	elseif (y <= -3.25e-105)
		tmp = x;
	elseif (y <= 8e-250)
		tmp = t_1;
	elseif (y <= 2.05e-103)
		tmp = Float64(z * x);
	elseif (y <= 8.4e+105)
		tmp = t_1;
	elseif ((y <= 1.1e+167) || !(y <= 2.9e+259))
		tmp = Float64(y * Float64(-x));
	else
		tmp = Float64(y * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	tmp = 0.0;
	if (y <= -2.4e-30)
		tmp = y * t;
	elseif (y <= -2.7e-74)
		tmp = t_1;
	elseif (y <= -1.4e-86)
		tmp = z * x;
	elseif (y <= -3.25e-105)
		tmp = x;
	elseif (y <= 8e-250)
		tmp = t_1;
	elseif (y <= 2.05e-103)
		tmp = z * x;
	elseif (y <= 8.4e+105)
		tmp = t_1;
	elseif ((y <= 1.1e+167) || ~((y <= 2.9e+259)))
		tmp = y * -x;
	else
		tmp = y * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -2.4e-30], N[(y * t), $MachinePrecision], If[LessEqual[y, -2.7e-74], t$95$1, If[LessEqual[y, -1.4e-86], N[(z * x), $MachinePrecision], If[LessEqual[y, -3.25e-105], x, If[LessEqual[y, 8e-250], t$95$1, If[LessEqual[y, 2.05e-103], N[(z * x), $MachinePrecision], If[LessEqual[y, 8.4e+105], t$95$1, If[Or[LessEqual[y, 1.1e+167], N[Not[LessEqual[y, 2.9e+259]], $MachinePrecision]], N[(y * (-x)), $MachinePrecision], N[(y * t), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -2.7 \cdot 10^{-74}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -1.4 \cdot 10^{-86}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;y \leq -3.25 \cdot 10^{-105}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 8 \cdot 10^{-250}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.05 \cdot 10^{-103}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;y \leq 8.4 \cdot 10^{+105}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.1 \cdot 10^{+167} \lor \neg \left(y \leq 2.9 \cdot 10^{+259}\right):\\
\;\;\;\;y \cdot \left(-x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -2.39999999999999985e-30 or 1.10000000000000002e167 < y < 2.8999999999999999e259

    1. Initial program 100.0%

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

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

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

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

    if -2.39999999999999985e-30 < y < -2.70000000000000018e-74 or -3.25000000000000003e-105 < y < 8.0000000000000004e-250 or 2.04999999999999998e-103 < y < 8.4000000000000004e105

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -2.70000000000000018e-74 < y < -1.40000000000000005e-86 or 8.0000000000000004e-250 < y < 2.04999999999999998e-103

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \left(y - z\right)} \]
      5. *-rgt-identity72.9%

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

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

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

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

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

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

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

    if -1.40000000000000005e-86 < y < -3.25000000000000003e-105

    1. Initial program 100.0%

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

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

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

    if 8.4000000000000004e105 < y < 1.10000000000000002e167 or 2.8999999999999999e259 < y

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \left(y - z\right)} \]
      5. *-rgt-identity81.9%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot x\right)} \]
    7. Step-by-step derivation
      1. associate-*r*77.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{-30}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -2.7 \cdot 10^{-74}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-86}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq -3.25 \cdot 10^{-105}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-250}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{-103}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq 8.4 \cdot 10^{+105}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{+167} \lor \neg \left(y \leq 2.9 \cdot 10^{+259}\right):\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]

Alternative 4: 80.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot t\\ t_2 := x + y \cdot \left(t - x\right)\\ t_3 := z \cdot \left(x - t\right)\\ \mathbf{if}\;z \leq -3 \cdot 10^{+98}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -8.6 \cdot 10^{-187}:\\ \;\;\;\;x + t_1\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-84}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-58}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+31} \lor \neg \left(z \leq 9.6 \cdot 10^{+124}\right) \land z \leq 6.2 \cdot 10^{+162}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- y z) t)) (t_2 (+ x (* y (- t x)))) (t_3 (* z (- x t))))
   (if (<= z -3e+98)
     t_3
     (if (<= z -8.6e-187)
       (+ x t_1)
       (if (<= z 6.5e-84)
         t_2
         (if (<= z 1.45e-58)
           t_1
           (if (or (<= z 4.5e+31) (and (not (<= z 9.6e+124)) (<= z 6.2e+162)))
             t_2
             t_3)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * t;
	double t_2 = x + (y * (t - x));
	double t_3 = z * (x - t);
	double tmp;
	if (z <= -3e+98) {
		tmp = t_3;
	} else if (z <= -8.6e-187) {
		tmp = x + t_1;
	} else if (z <= 6.5e-84) {
		tmp = t_2;
	} else if (z <= 1.45e-58) {
		tmp = t_1;
	} else if ((z <= 4.5e+31) || (!(z <= 9.6e+124) && (z <= 6.2e+162))) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	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 - z) * t
    t_2 = x + (y * (t - x))
    t_3 = z * (x - t)
    if (z <= (-3d+98)) then
        tmp = t_3
    else if (z <= (-8.6d-187)) then
        tmp = x + t_1
    else if (z <= 6.5d-84) then
        tmp = t_2
    else if (z <= 1.45d-58) then
        tmp = t_1
    else if ((z <= 4.5d+31) .or. (.not. (z <= 9.6d+124)) .and. (z <= 6.2d+162)) then
        tmp = t_2
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * t;
	double t_2 = x + (y * (t - x));
	double t_3 = z * (x - t);
	double tmp;
	if (z <= -3e+98) {
		tmp = t_3;
	} else if (z <= -8.6e-187) {
		tmp = x + t_1;
	} else if (z <= 6.5e-84) {
		tmp = t_2;
	} else if (z <= 1.45e-58) {
		tmp = t_1;
	} else if ((z <= 4.5e+31) || (!(z <= 9.6e+124) && (z <= 6.2e+162))) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y - z) * t
	t_2 = x + (y * (t - x))
	t_3 = z * (x - t)
	tmp = 0
	if z <= -3e+98:
		tmp = t_3
	elif z <= -8.6e-187:
		tmp = x + t_1
	elif z <= 6.5e-84:
		tmp = t_2
	elif z <= 1.45e-58:
		tmp = t_1
	elif (z <= 4.5e+31) or (not (z <= 9.6e+124) and (z <= 6.2e+162)):
		tmp = t_2
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y - z) * t)
	t_2 = Float64(x + Float64(y * Float64(t - x)))
	t_3 = Float64(z * Float64(x - t))
	tmp = 0.0
	if (z <= -3e+98)
		tmp = t_3;
	elseif (z <= -8.6e-187)
		tmp = Float64(x + t_1);
	elseif (z <= 6.5e-84)
		tmp = t_2;
	elseif (z <= 1.45e-58)
		tmp = t_1;
	elseif ((z <= 4.5e+31) || (!(z <= 9.6e+124) && (z <= 6.2e+162)))
		tmp = t_2;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y - z) * t;
	t_2 = x + (y * (t - x));
	t_3 = z * (x - t);
	tmp = 0.0;
	if (z <= -3e+98)
		tmp = t_3;
	elseif (z <= -8.6e-187)
		tmp = x + t_1;
	elseif (z <= 6.5e-84)
		tmp = t_2;
	elseif (z <= 1.45e-58)
		tmp = t_1;
	elseif ((z <= 4.5e+31) || (~((z <= 9.6e+124)) && (z <= 6.2e+162)))
		tmp = t_2;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3e+98], t$95$3, If[LessEqual[z, -8.6e-187], N[(x + t$95$1), $MachinePrecision], If[LessEqual[z, 6.5e-84], t$95$2, If[LessEqual[z, 1.45e-58], t$95$1, If[Or[LessEqual[z, 4.5e+31], And[N[Not[LessEqual[z, 9.6e+124]], $MachinePrecision], LessEqual[z, 6.2e+162]]], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -8.6 \cdot 10^{-187}:\\
\;\;\;\;x + t_1\\

\mathbf{elif}\;z \leq 6.5 \cdot 10^{-84}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 1.45 \cdot 10^{-58}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 4.5 \cdot 10^{+31} \lor \neg \left(z \leq 9.6 \cdot 10^{+124}\right) \land z \leq 6.2 \cdot 10^{+162}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.0000000000000001e98 or 4.4999999999999996e31 < z < 9.60000000000000026e124 or 6.1999999999999999e162 < z

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{t + x}{\mathsf{fma}\left(t, t, \left(-x\right) \cdot x\right)}}} \]
      2. distribute-lft-neg-out90.7%

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

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot t - -1 \cdot x\right) \cdot z} \]
    8. Step-by-step derivation
      1. distribute-lft-out--86.5%

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

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

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

        \[\leadsto z \cdot \left(-\color{blue}{\left(t + \left(-x\right)\right)}\right) \]
      5. distribute-neg-in86.5%

        \[\leadsto z \cdot \color{blue}{\left(\left(-t\right) + \left(-\left(-x\right)\right)\right)} \]
      6. remove-double-neg86.5%

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

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

    if -3.0000000000000001e98 < z < -8.60000000000000001e-187

    1. Initial program 100.0%

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

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

    if -8.60000000000000001e-187 < z < 6.50000000000000022e-84 or 1.44999999999999995e-58 < z < 4.4999999999999996e31 or 9.60000000000000026e124 < z < 6.1999999999999999e162

    1. Initial program 100.0%

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

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

    if 6.50000000000000022e-84 < z < 1.44999999999999995e-58

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\frac{\left(y - z\right) \cdot \left(t \cdot t - x \cdot x\right)}{t + x}} \]
      3. cancel-sign-sub-inv53.1%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{t + x}{\mathsf{fma}\left(t, t, \left(-x\right) \cdot x\right)}}} \]
      2. distribute-lft-neg-out53.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{+98}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -8.6 \cdot 10^{-187}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-84}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-58}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+31} \lor \neg \left(z \leq 9.6 \cdot 10^{+124}\right) \land z \leq 6.2 \cdot 10^{+162}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]

Alternative 5: 35.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ \mathbf{if}\;y \leq -1.65 \cdot 10^{-30}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -3.3 \cdot 10^{-73}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{-87}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{-104}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-250}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{-105}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+166}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))))
   (if (<= y -1.65e-30)
     (* y t)
     (if (<= y -3.3e-73)
       t_1
       (if (<= y -4.8e-87)
         (* z x)
         (if (<= y -1.25e-104)
           x
           (if (<= y 6e-250)
             t_1
             (if (<= y 6.2e-105)
               (* z x)
               (if (<= y 5.2e+166) t_1 (* y t))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (y <= -1.65e-30) {
		tmp = y * t;
	} else if (y <= -3.3e-73) {
		tmp = t_1;
	} else if (y <= -4.8e-87) {
		tmp = z * x;
	} else if (y <= -1.25e-104) {
		tmp = x;
	} else if (y <= 6e-250) {
		tmp = t_1;
	} else if (y <= 6.2e-105) {
		tmp = z * x;
	} else if (y <= 5.2e+166) {
		tmp = t_1;
	} else {
		tmp = y * t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * -t
    if (y <= (-1.65d-30)) then
        tmp = y * t
    else if (y <= (-3.3d-73)) then
        tmp = t_1
    else if (y <= (-4.8d-87)) then
        tmp = z * x
    else if (y <= (-1.25d-104)) then
        tmp = x
    else if (y <= 6d-250) then
        tmp = t_1
    else if (y <= 6.2d-105) then
        tmp = z * x
    else if (y <= 5.2d+166) then
        tmp = t_1
    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 tmp;
	if (y <= -1.65e-30) {
		tmp = y * t;
	} else if (y <= -3.3e-73) {
		tmp = t_1;
	} else if (y <= -4.8e-87) {
		tmp = z * x;
	} else if (y <= -1.25e-104) {
		tmp = x;
	} else if (y <= 6e-250) {
		tmp = t_1;
	} else if (y <= 6.2e-105) {
		tmp = z * x;
	} else if (y <= 5.2e+166) {
		tmp = t_1;
	} else {
		tmp = y * t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	tmp = 0
	if y <= -1.65e-30:
		tmp = y * t
	elif y <= -3.3e-73:
		tmp = t_1
	elif y <= -4.8e-87:
		tmp = z * x
	elif y <= -1.25e-104:
		tmp = x
	elif y <= 6e-250:
		tmp = t_1
	elif y <= 6.2e-105:
		tmp = z * x
	elif y <= 5.2e+166:
		tmp = t_1
	else:
		tmp = y * t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	tmp = 0.0
	if (y <= -1.65e-30)
		tmp = Float64(y * t);
	elseif (y <= -3.3e-73)
		tmp = t_1;
	elseif (y <= -4.8e-87)
		tmp = Float64(z * x);
	elseif (y <= -1.25e-104)
		tmp = x;
	elseif (y <= 6e-250)
		tmp = t_1;
	elseif (y <= 6.2e-105)
		tmp = Float64(z * x);
	elseif (y <= 5.2e+166)
		tmp = t_1;
	else
		tmp = Float64(y * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	tmp = 0.0;
	if (y <= -1.65e-30)
		tmp = y * t;
	elseif (y <= -3.3e-73)
		tmp = t_1;
	elseif (y <= -4.8e-87)
		tmp = z * x;
	elseif (y <= -1.25e-104)
		tmp = x;
	elseif (y <= 6e-250)
		tmp = t_1;
	elseif (y <= 6.2e-105)
		tmp = z * x;
	elseif (y <= 5.2e+166)
		tmp = t_1;
	else
		tmp = y * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -1.65e-30], N[(y * t), $MachinePrecision], If[LessEqual[y, -3.3e-73], t$95$1, If[LessEqual[y, -4.8e-87], N[(z * x), $MachinePrecision], If[LessEqual[y, -1.25e-104], x, If[LessEqual[y, 6e-250], t$95$1, If[LessEqual[y, 6.2e-105], N[(z * x), $MachinePrecision], If[LessEqual[y, 5.2e+166], t$95$1, N[(y * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -3.3 \cdot 10^{-73}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq -1.25 \cdot 10^{-104}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 6 \cdot 10^{-250}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 6.2 \cdot 10^{-105}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{+166}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.6500000000000001e-30 or 5.1999999999999999e166 < y

    1. Initial program 100.0%

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

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

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

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

    if -1.6500000000000001e-30 < y < -3.30000000000000004e-73 or -1.24999999999999995e-104 < y < 6.00000000000000032e-250 or 6.20000000000000029e-105 < y < 5.1999999999999999e166

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -3.30000000000000004e-73 < y < -4.7999999999999999e-87 or 6.00000000000000032e-250 < y < 6.20000000000000029e-105

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \left(y - z\right)} \]
      5. *-rgt-identity72.9%

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

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

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

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

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

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

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

    if -4.7999999999999999e-87 < y < -1.24999999999999995e-104

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.65 \cdot 10^{-30}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -3.3 \cdot 10^{-73}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{-87}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{-104}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-250}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{-105}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+166}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]

Alternative 6: 74.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq -1.1 \cdot 10^{-241}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;y \leq 8.4 \cdot 10^{+105}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.11999999999999999e36 or 8.4000000000000004e105 < y

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\frac{\left(y - z\right) \cdot \left(t \cdot t - x \cdot x\right)}{t + x}} \]
      3. cancel-sign-sub-inv85.3%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{t + x}{\mathsf{fma}\left(t, t, \left(-x\right) \cdot x\right)}}} \]
      2. distribute-lft-neg-out91.2%

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

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

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

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

    if -1.11999999999999999e36 < y < -1.1e-241 or 4e-107 < y < 8.4000000000000004e105

    1. Initial program 99.9%

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

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

    if -1.1e-241 < y < 4e-107

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\frac{\left(y - z\right) \cdot \left(t \cdot t - x \cdot x\right)}{t + x}} \]
      3. cancel-sign-sub-inv78.4%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{t + x}{\mathsf{fma}\left(t, t, \left(-x\right) \cdot x\right)}}} \]
      2. distribute-lft-neg-out83.5%

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

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot t - -1 \cdot x\right) \cdot z} \]
    8. Step-by-step derivation
      1. distribute-lft-out--79.7%

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

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

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

        \[\leadsto z \cdot \left(-\color{blue}{\left(t + \left(-x\right)\right)}\right) \]
      5. distribute-neg-in79.7%

        \[\leadsto z \cdot \color{blue}{\left(\left(-t\right) + \left(-\left(-x\right)\right)\right)} \]
      6. remove-double-neg79.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.12 \cdot 10^{+36}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-241}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-107}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 8.4 \cdot 10^{+105}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 7: 55.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -3.2 \cdot 10^{-31}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{-250}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-101}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-15}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (- t x))))
   (if (<= y -3.2e-31)
     t_1
     (if (<= y 7.5e-250)
       (* z (- t))
       (if (<= y 6e-101) (* z x) (if (<= y 5.2e-15) x t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double tmp;
	if (y <= -3.2e-31) {
		tmp = t_1;
	} else if (y <= 7.5e-250) {
		tmp = z * -t;
	} else if (y <= 6e-101) {
		tmp = z * x;
	} else if (y <= 5.2e-15) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * (t - x)
    if (y <= (-3.2d-31)) then
        tmp = t_1
    else if (y <= 7.5d-250) then
        tmp = z * -t
    else if (y <= 6d-101) then
        tmp = z * x
    else if (y <= 5.2d-15) then
        tmp = x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double tmp;
	if (y <= -3.2e-31) {
		tmp = t_1;
	} else if (y <= 7.5e-250) {
		tmp = z * -t;
	} else if (y <= 6e-101) {
		tmp = z * x;
	} else if (y <= 5.2e-15) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (t - x)
	tmp = 0
	if y <= -3.2e-31:
		tmp = t_1
	elif y <= 7.5e-250:
		tmp = z * -t
	elif y <= 6e-101:
		tmp = z * x
	elif y <= 5.2e-15:
		tmp = x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(t - x))
	tmp = 0.0
	if (y <= -3.2e-31)
		tmp = t_1;
	elseif (y <= 7.5e-250)
		tmp = Float64(z * Float64(-t));
	elseif (y <= 6e-101)
		tmp = Float64(z * x);
	elseif (y <= 5.2e-15)
		tmp = x;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (t - x);
	tmp = 0.0;
	if (y <= -3.2e-31)
		tmp = t_1;
	elseif (y <= 7.5e-250)
		tmp = z * -t;
	elseif (y <= 6e-101)
		tmp = z * x;
	elseif (y <= 5.2e-15)
		tmp = x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.2e-31], t$95$1, If[LessEqual[y, 7.5e-250], N[(z * (-t)), $MachinePrecision], If[LessEqual[y, 6e-101], N[(z * x), $MachinePrecision], If[LessEqual[y, 5.2e-15], x, t$95$1]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;y \leq 5.2 \cdot 10^{-15}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.20000000000000018e-31 or 5.20000000000000009e-15 < y

    1. Initial program 99.9%

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

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

        \[\leadsto x + \color{blue}{\frac{\left(y - z\right) \cdot \left(t \cdot t - x \cdot x\right)}{t + x}} \]
      3. cancel-sign-sub-inv81.0%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{t + x}{\mathsf{fma}\left(t, t, \left(-x\right) \cdot x\right)}}} \]
      2. distribute-lft-neg-out86.1%

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

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

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

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

    if -3.20000000000000018e-31 < y < 7.50000000000000009e-250

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if 7.50000000000000009e-250 < y < 6.0000000000000006e-101

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \left(y - z\right)} \]
      5. *-rgt-identity71.3%

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

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

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

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

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

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

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

    if 6.0000000000000006e-101 < y < 5.20000000000000009e-15

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{-31}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{-250}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-101}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-15}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 8: 56.1% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;t \leq 1.1 \cdot 10^{-212}:\\
\;\;\;\;z \cdot x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.40000000000000011e-171 or 1.4600000000000001e41 < t

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{t + x}{\mathsf{fma}\left(t, t, \left(-x\right) \cdot x\right)}}} \]
      2. distribute-lft-neg-out80.3%

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

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

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

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

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

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

    if -1.40000000000000011e-171 < t < 1.10000000000000002e-212

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \left(y - z\right)} \]
      5. *-rgt-identity92.6%

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

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

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

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

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

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

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

    if 1.10000000000000002e-212 < t < 1.4600000000000001e41

    1. Initial program 99.9%

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

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

        \[\leadsto x + \color{blue}{\frac{\left(y - z\right) \cdot \left(t \cdot t - x \cdot x\right)}{t + x}} \]
      3. cancel-sign-sub-inv86.3%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{t + x}{\mathsf{fma}\left(t, t, \left(-x\right) \cdot x\right)}}} \]
      2. distribute-lft-neg-out89.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.4 \cdot 10^{-171}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{-212}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;t \leq 1.46 \cdot 10^{+41}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \]

Alternative 9: 62.8% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;t \leq 2.7 \cdot 10^{-202}:\\
\;\;\;\;x + z \cdot x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.3e-24 or 2.90000000000000017e40 < t

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{t + x}{\mathsf{fma}\left(t, t, \left(-x\right) \cdot x\right)}}} \]
      2. distribute-lft-neg-out78.9%

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

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

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

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

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

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

    if -1.3e-24 < t < 2.6999999999999999e-202

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \left(y - z\right)} \]
      5. *-rgt-identity80.9%

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

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

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

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

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

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

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

    if 2.6999999999999999e-202 < t < 2.90000000000000017e40

    1. Initial program 99.9%

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

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

        \[\leadsto x + \color{blue}{\frac{\left(y - z\right) \cdot \left(t \cdot t - x \cdot x\right)}{t + x}} \]
      3. cancel-sign-sub-inv86.3%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{t + x}{\mathsf{fma}\left(t, t, \left(-x\right) \cdot x\right)}}} \]
      2. distribute-lft-neg-out89.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.3 \cdot 10^{-24}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{-202}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;t \leq 2.9 \cdot 10^{+40}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \]

Alternative 10: 80.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.85 \cdot 10^{-5} \lor \neg \left(x \leq 4.1 \cdot 10^{-27}\right):\\
\;\;\;\;x + x \cdot \left(z - y\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.84999999999999991e-5 or 4.0999999999999999e-27 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -1.84999999999999991e-5 < x < 4.0999999999999999e-27

    1. Initial program 100.0%

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

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

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

Alternative 11: 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 12: 38.0% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.10000000000000003e-58 or 4.39999999999999982e-20 < y

    1. Initial program 99.9%

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

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

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

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

    if -1.10000000000000003e-58 < y < 4.39999999999999982e-20

    1. Initial program 100.0%

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

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

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

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

Alternative 13: 34.3% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x \leq 1.35 \cdot 10^{-33}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.01999999999999998e99 or 1.35e-33 < x

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \left(y - z\right)} \]
      5. *-rgt-identity90.9%

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

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

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

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

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

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

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

    if -1.01999999999999998e99 < x < 1.35e-33

    1. Initial program 100.0%

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

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

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

      \[\leadsto \color{blue}{y \cdot t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification43.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.02 \cdot 10^{+99}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{-33}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]

Alternative 14: 18.5% accurate, 9.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification13.5%

    \[\leadsto x \]

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