Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 10.5s
Alternatives: 16
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 0.1× speedup?

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

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

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

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

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

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

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

Alternative 2: 40.1% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ t_2 := x \cdot \left(-y\right)\\ \mathbf{if}\;y \leq -1.1 \cdot 10^{+120}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{+91}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{+56}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -245:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.75 \cdot 10^{-18}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq -3 \cdot 10^{-115}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{-126}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7.1 \cdot 10^{-99}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-24}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{+24}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))) (t_2 (* x (- y))))
   (if (<= y -1.1e+120)
     (* y t)
     (if (<= y -7.5e+91)
       t_2
       (if (<= y -3.8e+56)
         (* y t)
         (if (<= y -245.0)
           t_1
           (if (<= y -1.75e-18)
             (* z x)
             (if (<= y -3e-115)
               x
               (if (<= y 4.1e-126)
                 t_1
                 (if (<= y 7.1e-99)
                   x
                   (if (<= y 4.5e-24)
                     t_1
                     (if (<= y 2.5e+24) (* z x) t_2))))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double t_2 = x * -y;
	double tmp;
	if (y <= -1.1e+120) {
		tmp = y * t;
	} else if (y <= -7.5e+91) {
		tmp = t_2;
	} else if (y <= -3.8e+56) {
		tmp = y * t;
	} else if (y <= -245.0) {
		tmp = t_1;
	} else if (y <= -1.75e-18) {
		tmp = z * x;
	} else if (y <= -3e-115) {
		tmp = x;
	} else if (y <= 4.1e-126) {
		tmp = t_1;
	} else if (y <= 7.1e-99) {
		tmp = x;
	} else if (y <= 4.5e-24) {
		tmp = t_1;
	} else if (y <= 2.5e+24) {
		tmp = z * x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = z * -t
    t_2 = x * -y
    if (y <= (-1.1d+120)) then
        tmp = y * t
    else if (y <= (-7.5d+91)) then
        tmp = t_2
    else if (y <= (-3.8d+56)) then
        tmp = y * t
    else if (y <= (-245.0d0)) then
        tmp = t_1
    else if (y <= (-1.75d-18)) then
        tmp = z * x
    else if (y <= (-3d-115)) then
        tmp = x
    else if (y <= 4.1d-126) then
        tmp = t_1
    else if (y <= 7.1d-99) then
        tmp = x
    else if (y <= 4.5d-24) then
        tmp = t_1
    else if (y <= 2.5d+24) then
        tmp = z * x
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double t_2 = x * -y;
	double tmp;
	if (y <= -1.1e+120) {
		tmp = y * t;
	} else if (y <= -7.5e+91) {
		tmp = t_2;
	} else if (y <= -3.8e+56) {
		tmp = y * t;
	} else if (y <= -245.0) {
		tmp = t_1;
	} else if (y <= -1.75e-18) {
		tmp = z * x;
	} else if (y <= -3e-115) {
		tmp = x;
	} else if (y <= 4.1e-126) {
		tmp = t_1;
	} else if (y <= 7.1e-99) {
		tmp = x;
	} else if (y <= 4.5e-24) {
		tmp = t_1;
	} else if (y <= 2.5e+24) {
		tmp = z * x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	t_2 = x * -y
	tmp = 0
	if y <= -1.1e+120:
		tmp = y * t
	elif y <= -7.5e+91:
		tmp = t_2
	elif y <= -3.8e+56:
		tmp = y * t
	elif y <= -245.0:
		tmp = t_1
	elif y <= -1.75e-18:
		tmp = z * x
	elif y <= -3e-115:
		tmp = x
	elif y <= 4.1e-126:
		tmp = t_1
	elif y <= 7.1e-99:
		tmp = x
	elif y <= 4.5e-24:
		tmp = t_1
	elif y <= 2.5e+24:
		tmp = z * x
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	t_2 = Float64(x * Float64(-y))
	tmp = 0.0
	if (y <= -1.1e+120)
		tmp = Float64(y * t);
	elseif (y <= -7.5e+91)
		tmp = t_2;
	elseif (y <= -3.8e+56)
		tmp = Float64(y * t);
	elseif (y <= -245.0)
		tmp = t_1;
	elseif (y <= -1.75e-18)
		tmp = Float64(z * x);
	elseif (y <= -3e-115)
		tmp = x;
	elseif (y <= 4.1e-126)
		tmp = t_1;
	elseif (y <= 7.1e-99)
		tmp = x;
	elseif (y <= 4.5e-24)
		tmp = t_1;
	elseif (y <= 2.5e+24)
		tmp = Float64(z * x);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	t_2 = x * -y;
	tmp = 0.0;
	if (y <= -1.1e+120)
		tmp = y * t;
	elseif (y <= -7.5e+91)
		tmp = t_2;
	elseif (y <= -3.8e+56)
		tmp = y * t;
	elseif (y <= -245.0)
		tmp = t_1;
	elseif (y <= -1.75e-18)
		tmp = z * x;
	elseif (y <= -3e-115)
		tmp = x;
	elseif (y <= 4.1e-126)
		tmp = t_1;
	elseif (y <= 7.1e-99)
		tmp = x;
	elseif (y <= 4.5e-24)
		tmp = t_1;
	elseif (y <= 2.5e+24)
		tmp = z * x;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[y, -1.1e+120], N[(y * t), $MachinePrecision], If[LessEqual[y, -7.5e+91], t$95$2, If[LessEqual[y, -3.8e+56], N[(y * t), $MachinePrecision], If[LessEqual[y, -245.0], t$95$1, If[LessEqual[y, -1.75e-18], N[(z * x), $MachinePrecision], If[LessEqual[y, -3e-115], x, If[LessEqual[y, 4.1e-126], t$95$1, If[LessEqual[y, 7.1e-99], x, If[LessEqual[y, 4.5e-24], t$95$1, If[LessEqual[y, 2.5e+24], N[(z * x), $MachinePrecision], t$95$2]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -7.5 \cdot 10^{+91}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -3.8 \cdot 10^{+56}:\\
\;\;\;\;y \cdot t\\

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

\mathbf{elif}\;y \leq -1.75 \cdot 10^{-18}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;y \leq -3 \cdot 10^{-115}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 4.1 \cdot 10^{-126}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 7.1 \cdot 10^{-99}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 4.5 \cdot 10^{-24}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.5 \cdot 10^{+24}:\\
\;\;\;\;z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.1000000000000001e120 or -7.50000000000000033e91 < y < -3.79999999999999996e56

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+95.3%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in95.3%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+95.3%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-95.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y} \]
    10. Step-by-step derivation
      1. *-commutative66.3%

        \[\leadsto \color{blue}{y \cdot t} \]
    11. Simplified66.3%

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

    if -1.1000000000000001e120 < y < -7.50000000000000033e91 or 2.50000000000000023e24 < y

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+97.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in97.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in97.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+97.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.79999999999999996e56 < y < -245 or -3.0000000000000002e-115 < y < 4.0999999999999997e-126 or 7.09999999999999994e-99 < y < 4.4999999999999997e-24

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+95.9%

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(1 + z\right)}\right)\right)\right) \]
      8. neg-sub095.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in95.9%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in95.9%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+95.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-95.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(\left(0 - \left(y - z\right)\right) + 1\right)}\right) \]
      17. neg-sub095.9%

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

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

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

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

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

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

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

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

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

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

    if -245 < y < -1.7499999999999999e-18 or 4.4999999999999997e-24 < y < 2.50000000000000023e24

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-100.0%

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

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

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

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

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

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

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

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

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

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

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

    if -1.7499999999999999e-18 < y < -3.0000000000000002e-115 or 4.0999999999999997e-126 < y < 7.09999999999999994e-99

    1. Initial program 99.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.1 \cdot 10^{+120}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{+91}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{+56}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -245:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq -1.75 \cdot 10^{-18}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq -3 \cdot 10^{-115}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{-126}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 7.1 \cdot 10^{-99}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-24}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{+24}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 66.4% accurate, 0.3× 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 := x \cdot \left(1 - y\right)\\ \mathbf{if}\;z \leq -0.0019:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-171}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{-231}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-293}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-86}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{+122}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (- t x))) (t_2 (* z (- x t))) (t_3 (* x (- 1.0 y))))
   (if (<= z -0.0019)
     t_2
     (if (<= z -8e-171)
       t_3
       (if (<= z -3.2e-231)
         t_1
         (if (<= z 1.35e-293)
           t_3
           (if (<= z 1.05e-86)
             t_1
             (if (<= z 4.8e+122) (* (- y z) t) t_2))))))))
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 = x * (1.0 - y);
	double tmp;
	if (z <= -0.0019) {
		tmp = t_2;
	} else if (z <= -8e-171) {
		tmp = t_3;
	} else if (z <= -3.2e-231) {
		tmp = t_1;
	} else if (z <= 1.35e-293) {
		tmp = t_3;
	} else if (z <= 1.05e-86) {
		tmp = t_1;
	} else if (z <= 4.8e+122) {
		tmp = (y - z) * t;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = y * (t - x)
    t_2 = z * (x - t)
    t_3 = x * (1.0d0 - y)
    if (z <= (-0.0019d0)) then
        tmp = t_2
    else if (z <= (-8d-171)) then
        tmp = t_3
    else if (z <= (-3.2d-231)) then
        tmp = t_1
    else if (z <= 1.35d-293) then
        tmp = t_3
    else if (z <= 1.05d-86) then
        tmp = t_1
    else if (z <= 4.8d+122) then
        tmp = (y - z) * t
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double t_2 = z * (x - t);
	double t_3 = x * (1.0 - y);
	double tmp;
	if (z <= -0.0019) {
		tmp = t_2;
	} else if (z <= -8e-171) {
		tmp = t_3;
	} else if (z <= -3.2e-231) {
		tmp = t_1;
	} else if (z <= 1.35e-293) {
		tmp = t_3;
	} else if (z <= 1.05e-86) {
		tmp = t_1;
	} else if (z <= 4.8e+122) {
		tmp = (y - z) * t;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (t - x)
	t_2 = z * (x - t)
	t_3 = x * (1.0 - y)
	tmp = 0
	if z <= -0.0019:
		tmp = t_2
	elif z <= -8e-171:
		tmp = t_3
	elif z <= -3.2e-231:
		tmp = t_1
	elif z <= 1.35e-293:
		tmp = t_3
	elif z <= 1.05e-86:
		tmp = t_1
	elif z <= 4.8e+122:
		tmp = (y - z) * t
	else:
		tmp = t_2
	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(x * Float64(1.0 - y))
	tmp = 0.0
	if (z <= -0.0019)
		tmp = t_2;
	elseif (z <= -8e-171)
		tmp = t_3;
	elseif (z <= -3.2e-231)
		tmp = t_1;
	elseif (z <= 1.35e-293)
		tmp = t_3;
	elseif (z <= 1.05e-86)
		tmp = t_1;
	elseif (z <= 4.8e+122)
		tmp = Float64(Float64(y - z) * t);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (t - x);
	t_2 = z * (x - t);
	t_3 = x * (1.0 - y);
	tmp = 0.0;
	if (z <= -0.0019)
		tmp = t_2;
	elseif (z <= -8e-171)
		tmp = t_3;
	elseif (z <= -3.2e-231)
		tmp = t_1;
	elseif (z <= 1.35e-293)
		tmp = t_3;
	elseif (z <= 1.05e-86)
		tmp = t_1;
	elseif (z <= 4.8e+122)
		tmp = (y - z) * t;
	else
		tmp = t_2;
	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[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.0019], t$95$2, If[LessEqual[z, -8e-171], t$95$3, If[LessEqual[z, -3.2e-231], t$95$1, If[LessEqual[z, 1.35e-293], t$95$3, If[LessEqual[z, 1.05e-86], t$95$1, If[LessEqual[z, 4.8e+122], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -8 \cdot 10^{-171}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;z \leq -3.2 \cdot 10^{-231}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 1.35 \cdot 10^{-293}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;z \leq 1.05 \cdot 10^{-86}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -0.0019 or 4.8000000000000004e122 < z

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+96.1%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in96.1%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in96.1%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+96.1%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-96.1%

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

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

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

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

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

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

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

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

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

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

    if -0.0019 < z < -7.9999999999999999e-171 or -3.20000000000000008e-231 < z < 1.35000000000000001e-293

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+98.2%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+98.2%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-98.2%

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

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

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

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

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

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

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

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

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

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

    if -7.9999999999999999e-171 < z < -3.20000000000000008e-231 or 1.35000000000000001e-293 < z < 1.05e-86

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+94.3%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in94.3%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+94.3%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-94.3%

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

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

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

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

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

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

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

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

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

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

    if 1.05e-86 < z < 4.8000000000000004e122

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.0019:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-171}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{-231}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-293}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-86}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{+122}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 54.1% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;y - z \leq 4 \cdot 10^{-26}:\\
\;\;\;\;x\\

\mathbf{elif}\;y - z \leq 2 \cdot 10^{+234}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (-.f64 y z) < -5.0000000000000004e-19 or 4.0000000000000002e-26 < (-.f64 y z) < 2.00000000000000004e234

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+97.2%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+97.2%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-97.2%

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

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

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

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

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

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

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

    if -5.0000000000000004e-19 < (-.f64 y z) < 4.0000000000000002e-26

    1. Initial program 100.0%

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

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

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

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

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

    if 2.00000000000000004e234 < (-.f64 y z) < 3.9999999999999998e291

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+87.5%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in87.5%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in87.5%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+87.5%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-87.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999998e291 < (-.f64 y z)

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-100.0%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y - z \leq -5 \cdot 10^{-19}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y - z \leq 4 \cdot 10^{-26}:\\ \;\;\;\;x\\ \mathbf{elif}\;y - z \leq 2 \cdot 10^{+234}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y - z \leq 4 \cdot 10^{+291}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 73.3% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;y \leq -0.135:\\
\;\;\;\;\left(y - z\right) \cdot t\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -6.2000000000000004e31 or 2.05e24 < y

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+96.5%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in96.5%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in96.5%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+96.5%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-96.5%

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

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

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

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

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

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

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

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

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

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

    if -6.2000000000000004e31 < y < -0.13500000000000001

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+83.3%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in83.3%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+83.3%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-83.3%

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

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

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

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

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

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

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

    if -0.13500000000000001 < y < -1.54999999999999995e-30

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if -1.54999999999999995e-30 < y < 9e-103

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if 9e-103 < y < 2.05e24

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-100.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.2 \cdot 10^{+31}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -0.135:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq -1.55 \cdot 10^{-30}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;y \leq 9 \cdot 10^{-103}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{+24}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 37.1% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-12}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -1.5 \cdot 10^{-54}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq -3.8 \cdot 10^{-256}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 1.45 \cdot 10^{-295}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 3.6 \cdot 10^{+123}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.2e-12 or 3.59999999999999998e123 < z

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+96.2%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+96.2%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-96.2%

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

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

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

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

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

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

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

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

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

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

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

    if -7.2e-12 < z < -1.50000000000000005e-54 or -3.79999999999999977e-256 < z < 1.45000000000000008e-295

    1. Initial program 100.0%

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

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

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

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

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

    if -1.50000000000000005e-54 < z < -3.79999999999999977e-256 or 1.45000000000000008e-295 < z < 3.59999999999999998e123

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+96.8%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in96.8%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in96.8%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{x \cdot \left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      13. neg-sub096.8%

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+96.8%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-96.8%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(\left(0 - \left(y - z\right)\right) + 1\right)}\right) \]
      17. neg-sub096.8%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y} \]
    10. Step-by-step derivation
      1. *-commutative43.4%

        \[\leadsto \color{blue}{y \cdot t} \]
    11. Simplified43.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{-12}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-54}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-256}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-295}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+123}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 36.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.0116:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-120}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq -2.45 \cdot 10^{-237}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-295}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{+122}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -0.0116)
   (* z x)
   (if (<= z -3.5e-120)
     (* x (- y))
     (if (<= z -2.45e-237)
       (* y t)
       (if (<= z 3.7e-295) x (if (<= z 7.8e+122) (* y t) (* z x)))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -0.0116) {
		tmp = z * x;
	} else if (z <= -3.5e-120) {
		tmp = x * -y;
	} else if (z <= -2.45e-237) {
		tmp = y * t;
	} else if (z <= 3.7e-295) {
		tmp = x;
	} else if (z <= 7.8e+122) {
		tmp = y * t;
	} else {
		tmp = z * x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-0.0116d0)) then
        tmp = z * x
    else if (z <= (-3.5d-120)) then
        tmp = x * -y
    else if (z <= (-2.45d-237)) then
        tmp = y * t
    else if (z <= 3.7d-295) then
        tmp = x
    else if (z <= 7.8d+122) then
        tmp = y * t
    else
        tmp = z * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -0.0116) {
		tmp = z * x;
	} else if (z <= -3.5e-120) {
		tmp = x * -y;
	} else if (z <= -2.45e-237) {
		tmp = y * t;
	} else if (z <= 3.7e-295) {
		tmp = x;
	} else if (z <= 7.8e+122) {
		tmp = y * t;
	} else {
		tmp = z * x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -0.0116:
		tmp = z * x
	elif z <= -3.5e-120:
		tmp = x * -y
	elif z <= -2.45e-237:
		tmp = y * t
	elif z <= 3.7e-295:
		tmp = x
	elif z <= 7.8e+122:
		tmp = y * t
	else:
		tmp = z * x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -0.0116)
		tmp = Float64(z * x);
	elseif (z <= -3.5e-120)
		tmp = Float64(x * Float64(-y));
	elseif (z <= -2.45e-237)
		tmp = Float64(y * t);
	elseif (z <= 3.7e-295)
		tmp = x;
	elseif (z <= 7.8e+122)
		tmp = Float64(y * t);
	else
		tmp = Float64(z * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -0.0116)
		tmp = z * x;
	elseif (z <= -3.5e-120)
		tmp = x * -y;
	elseif (z <= -2.45e-237)
		tmp = y * t;
	elseif (z <= 3.7e-295)
		tmp = x;
	elseif (z <= 7.8e+122)
		tmp = y * t;
	else
		tmp = z * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -0.0116], N[(z * x), $MachinePrecision], If[LessEqual[z, -3.5e-120], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, -2.45e-237], N[(y * t), $MachinePrecision], If[LessEqual[z, 3.7e-295], x, If[LessEqual[z, 7.8e+122], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0116:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -3.5 \cdot 10^{-120}:\\
\;\;\;\;x \cdot \left(-y\right)\\

\mathbf{elif}\;z \leq -2.45 \cdot 10^{-237}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 3.7 \cdot 10^{-295}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 7.8 \cdot 10^{+122}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -0.0116 or 7.7999999999999999e122 < z

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+96.1%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in96.1%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in96.1%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+96.1%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-96.1%

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

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

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

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

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

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

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

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

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

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

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

    if -0.0116 < z < -3.5e-120

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+95.7%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in95.7%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+95.7%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-95.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \left(-x\right)} \]
    11. Simplified47.3%

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

    if -3.5e-120 < z < -2.45e-237 or 3.6999999999999999e-295 < z < 7.7999999999999999e122

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+97.2%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+97.2%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-97.2%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y} \]
    10. Step-by-step derivation
      1. *-commutative45.2%

        \[\leadsto \color{blue}{y \cdot t} \]
    11. Simplified45.2%

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

    if -2.45e-237 < z < 3.6999999999999999e-295

    1. Initial program 100.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.0116:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-120}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq -2.45 \cdot 10^{-237}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-295}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{+122}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 82.5% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -0.0116 or 4.8000000000000004e122 < z

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+96.1%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in96.1%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in96.1%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+96.1%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-96.1%

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

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

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

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

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

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

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

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

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

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

    if -0.0116 < z < 1e-99

    1. Initial program 100.0%

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

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

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

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

    if 1e-99 < z < 4.8000000000000004e122

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.0116:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq 10^{-99}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{+122}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 72.6% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.2e31 or 3.2499999999999998e24 < y

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+96.5%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in96.5%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in96.5%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+96.5%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-96.5%

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

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

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

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

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

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

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

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

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

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

    if -5.2e31 < y < 5.40000000000000031e-100

    1. Initial program 100.0%

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

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

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

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

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

      \[\leadsto x - \color{blue}{t \cdot z} \]
    7. Step-by-step derivation
      1. *-commutative73.0%

        \[\leadsto x - \color{blue}{z \cdot t} \]
    8. Simplified73.0%

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

    if 5.40000000000000031e-100 < y < 3.2499999999999998e24

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-100.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.2 \cdot 10^{+31}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{-100}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 3.25 \cdot 10^{+24}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 75.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{-8} \lor \neg \left(x \leq 2.8 \cdot 10^{+79}\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.99999999999999973e-8 or 2.8000000000000001e79 < x

    1. Initial program 100.0%

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

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

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

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

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

    if -2.99999999999999973e-8 < x < 2.8000000000000001e79

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+98.4%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in98.4%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+98.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-98.4%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3 \cdot 10^{-8} \lor \neg \left(x \leq 2.8 \cdot 10^{+79}\right):\\ \;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 80.8% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.65 \cdot 10^{+67} \lor \neg \left(x \leq 5.8 \cdot 10^{+80}\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.65e67 or 5.79999999999999971e80 < x

    1. Initial program 100.0%

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

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

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

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

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

    if -2.65e67 < x < 5.79999999999999971e80

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.65 \cdot 10^{+67} \lor \neg \left(x \leq 5.8 \cdot 10^{+80}\right):\\ \;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 84.5% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+96.5%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in96.5%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in96.5%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+96.5%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-96.5%

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

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

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

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

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

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

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

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

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

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

    if -2.0499999999999999e32 < y < 2.05e24

    1. Initial program 100.0%

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

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

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

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

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

    if 2.05e24 < y

    1. Initial program 99.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{+32}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{+24}:\\ \;\;\;\;x - z \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 62.5% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.3999999999999997e27 or 3.0000000000000001e38 < t

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+94.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in94.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in94.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+94.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-94.0%

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

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

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

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

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

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

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

    if -4.3999999999999997e27 < t < 3.0000000000000001e38

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-100.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.4 \cdot 10^{+27} \lor \neg \left(t \leq 3 \cdot 10^{+38}\right):\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 36.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-12} \lor \neg \left(z \leq 0.038\right):\\
\;\;\;\;z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.2e-12 or 0.0379999999999999991 < z

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+96.9%

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(1 + z\right)}\right)\right)\right) \]
      8. neg-sub096.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in96.9%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in96.9%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+96.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-96.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(\left(0 - \left(y - z\right)\right) + 1\right)}\right) \]
      17. neg-sub096.9%

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

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

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

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

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

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

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

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

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

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

    if -7.2e-12 < z < 0.0379999999999999991

    1. Initial program 100.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{-12} \lor \neg \left(z \leq 0.038\right):\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 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. Add Preprocessing
  3. Final simplification100.0%

    \[\leadsto x + \left(y - z\right) \cdot \left(t - x\right) \]
  4. Add Preprocessing

Alternative 16: 18.1% accurate, 9.0× speedup?

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  7. Final simplification16.9%

    \[\leadsto x \]
  8. Add Preprocessing

Developer target: 96.5% 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 2024018 
(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))))