Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 10.4s
Alternatives: 15
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 15 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-define100.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. Add Preprocessing

Alternative 2: 37.7% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;z \leq 5 \cdot 10^{-48}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 5 \cdot 10^{+44}:\\
\;\;\;\;y \cdot t\\

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -7.6e12 or 3.69999999999999998e210 < z

    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 60.8%

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

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

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

        \[\leadsto \color{blue}{x - t \cdot z} \]
      3. *-commutative53.5%

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

      \[\leadsto \color{blue}{x - z \cdot t} \]
    7. Taylor expanded in x around 0 53.6%

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

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

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

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

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

    if -7.6e12 < z < -2.4499999999999999e-114

    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 54.4%

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

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

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

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

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

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

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

    if -2.4499999999999999e-114 < z < 4.9999999999999999e-48

    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 83.3%

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

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

    if 4.9999999999999999e-48 < z < 4.9999999999999996e44

    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 66.1%

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

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

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

    if 4.9999999999999996e44 < z < 3.69999999999999998e210

    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 69.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7600000000000:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -2.45 \cdot 10^{-114}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-48}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+44}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+210}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 69.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(x - t\right)\\ t_2 := y \cdot \left(t - x\right)\\ \mathbf{if}\;z \leq -8200000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-278}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-49}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 10^{-6}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- x t))) (t_2 (* y (- t x))))
   (if (<= z -8200000000000.0)
     t_1
     (if (<= z -5.2e-278)
       t_2
       (if (<= z 3.8e-49) (* x (- 1.0 y)) (if (<= z 1e-6) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (x - t);
	double t_2 = y * (t - x);
	double tmp;
	if (z <= -8200000000000.0) {
		tmp = t_1;
	} else if (z <= -5.2e-278) {
		tmp = t_2;
	} else if (z <= 3.8e-49) {
		tmp = x * (1.0 - y);
	} else if (z <= 1e-6) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = z * (x - t)
    t_2 = y * (t - x)
    if (z <= (-8200000000000.0d0)) then
        tmp = t_1
    else if (z <= (-5.2d-278)) then
        tmp = t_2
    else if (z <= 3.8d-49) then
        tmp = x * (1.0d0 - y)
    else if (z <= 1d-6) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * (x - t);
	double t_2 = y * (t - x);
	double tmp;
	if (z <= -8200000000000.0) {
		tmp = t_1;
	} else if (z <= -5.2e-278) {
		tmp = t_2;
	} else if (z <= 3.8e-49) {
		tmp = x * (1.0 - y);
	} else if (z <= 1e-6) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (x - t)
	t_2 = y * (t - x)
	tmp = 0
	if z <= -8200000000000.0:
		tmp = t_1
	elif z <= -5.2e-278:
		tmp = t_2
	elif z <= 3.8e-49:
		tmp = x * (1.0 - y)
	elif z <= 1e-6:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(x - t))
	t_2 = Float64(y * Float64(t - x))
	tmp = 0.0
	if (z <= -8200000000000.0)
		tmp = t_1;
	elseif (z <= -5.2e-278)
		tmp = t_2;
	elseif (z <= 3.8e-49)
		tmp = Float64(x * Float64(1.0 - y));
	elseif (z <= 1e-6)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * (x - t);
	t_2 = y * (t - x);
	tmp = 0.0;
	if (z <= -8200000000000.0)
		tmp = t_1;
	elseif (z <= -5.2e-278)
		tmp = t_2;
	elseif (z <= 3.8e-49)
		tmp = x * (1.0 - y);
	elseif (z <= 1e-6)
		tmp = t_2;
	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]}, Block[{t$95$2 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8200000000000.0], t$95$1, If[LessEqual[z, -5.2e-278], t$95$2, If[LessEqual[z, 3.8e-49], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-6], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -5.2 \cdot 10^{-278}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq 10^{-6}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.2e12 or 9.99999999999999955e-7 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.2e12 < z < -5.1999999999999997e-278 or 3.7999999999999997e-49 < z < 9.99999999999999955e-7

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \left(1 + \left(-y\right)\right)} + \left(t \cdot \left(y + -1 \cdot z\right) + x \cdot z\right) \]
      6. sub-neg96.9%

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

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

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

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

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

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

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

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

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

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

    if -5.1999999999999997e-278 < z < 3.7999999999999997e-49

    1. Initial program 99.9%

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(1 - y\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 38.2% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq 2.35 \cdot 10^{-49}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 6.2 \cdot 10^{+44}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.9999999999999997e23 or 6.19999999999999991e44 < 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 inf 51.6%

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

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

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

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

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

    if -3.9999999999999997e23 < z < -7.4e-115

    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 51.7%

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

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

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

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

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

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

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

    if -7.4e-115 < z < 2.35000000000000011e-49

    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 83.3%

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

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

    if 2.35000000000000011e-49 < z < 6.19999999999999991e44

    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 66.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+23}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -7.4 \cdot 10^{-115}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{-49}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+44}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 38.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -4.2 \cdot 10^{-278}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 5 \cdot 10^{-48}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.6e67 or 3.6e45 < 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 inf 53.5%

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

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

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

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

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

    if -2.6e67 < z < -4.20000000000000027e-278 or 4.9999999999999999e-48 < z < 3.6e45

    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 70.0%

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

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

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

    if -4.20000000000000027e-278 < z < 4.9999999999999999e-48

    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 87.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+67}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-278}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-48}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+45}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 72.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(x - t\right)\\ \mathbf{if}\;z \leq -1.05 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{-114}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 0.015:\\ \;\;\;\;x + y \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 -1.05e+14)
     t_1
     (if (<= z -3.7e-114) (* y (- t x)) (if (<= z 0.015) (+ x (* y t)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (x - t);
	double tmp;
	if (z <= -1.05e+14) {
		tmp = t_1;
	} else if (z <= -3.7e-114) {
		tmp = y * (t - x);
	} else if (z <= 0.015) {
		tmp = x + (y * t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * (x - t)
    if (z <= (-1.05d+14)) then
        tmp = t_1
    else if (z <= (-3.7d-114)) then
        tmp = y * (t - x)
    else if (z <= 0.015d0) then
        tmp = x + (y * t)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * (x - t);
	double tmp;
	if (z <= -1.05e+14) {
		tmp = t_1;
	} else if (z <= -3.7e-114) {
		tmp = y * (t - x);
	} else if (z <= 0.015) {
		tmp = x + (y * t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (x - t)
	tmp = 0
	if z <= -1.05e+14:
		tmp = t_1
	elif z <= -3.7e-114:
		tmp = y * (t - x)
	elif z <= 0.015:
		tmp = x + (y * 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 <= -1.05e+14)
		tmp = t_1;
	elseif (z <= -3.7e-114)
		tmp = Float64(y * Float64(t - x));
	elseif (z <= 0.015)
		tmp = Float64(x + Float64(y * 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 <= -1.05e+14)
		tmp = t_1;
	elseif (z <= -3.7e-114)
		tmp = y * (t - x);
	elseif (z <= 0.015)
		tmp = x + (y * 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, -1.05e+14], t$95$1, If[LessEqual[z, -3.7e-114], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.015], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq 0.015:\\
\;\;\;\;x + y \cdot t\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.05e14 or 0.014999999999999999 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.05e14 < z < -3.69999999999999965e-114

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.69999999999999965e-114 < z < 0.014999999999999999

    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 81.8%

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

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

        \[\leadsto x + \color{blue}{y \cdot t} \]
    6. Simplified74.7%

      \[\leadsto \color{blue}{x + y \cdot t} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 81.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.8 \cdot 10^{-81} \lor \neg \left(t \leq 2.1 \cdot 10^{-97}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.7999999999999997e-81 or 2.1000000000000001e-97 < t

    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 86.0%

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

    if -8.7999999999999997e-81 < t < 2.1000000000000001e-97

    1. Initial program 99.9%

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

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

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

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

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

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

Alternative 8: 84.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7600000000000 \lor \neg \left(z \leq 0.112\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.6e12 or 0.112000000000000002 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.6e12 < z < 0.112000000000000002

    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 91.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7600000000000 \lor \neg \left(z \leq 0.112\right):\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 76.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.4 \cdot 10^{+56} \lor \neg \left(t \leq 10^{+87}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.40000000000000032e56 or 9.9999999999999996e86 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 1 + \color{blue}{\left(-x \cdot y\right)}\right) + \left(t \cdot \left(y + -1 \cdot z\right) + x \cdot z\right) \]
      4. distribute-rgt-neg-in93.6%

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

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

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

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

        \[\leadsto x \cdot \left(1 - y\right) + \left(x \cdot z + t \cdot \left(y + \color{blue}{\left(-z\right)}\right)\right) \]
      9. sub-neg93.6%

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

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

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

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

    if -4.40000000000000032e56 < t < 9.9999999999999996e86

    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 77.0%

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

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

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

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

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

Alternative 10: 81.1% accurate, 0.5× speedup?

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

\mathbf{elif}\;t \leq 4.4 \cdot 10^{-99}:\\
\;\;\;\;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 3 regimes
  2. if t < -1.15e-85

    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 86.7%

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

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

    if -1.15e-85 < t < 4.40000000000000009e-99

    1. Initial program 99.9%

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

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

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

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

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

    if 4.40000000000000009e-99 < t

    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 85.4%

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

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

Alternative 11: 63.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{-46} \lor \neg \left(t \leq 4.5 \cdot 10^{-57}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.6e-46 or 4.49999999999999973e-57 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.6e-46 < t < 4.49999999999999973e-57

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(z + 1\right)} \]
    8. Simplified65.9%

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

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

Alternative 12: 54.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{-118} \lor \neg \left(t \leq 4.4 \cdot 10^{-130}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.00000000000000018e-118 or 4.3999999999999997e-130 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.00000000000000018e-118 < t < 4.3999999999999997e-130

    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 93.3%

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

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

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

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

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

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

Alternative 13: 35.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{-140} \lor \neg \left(y \leq 4.8 \cdot 10^{-43}\right):\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.01999999999999995e-140 or 4.8000000000000004e-43 < y

    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 60.1%

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

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

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

    if -1.01999999999999995e-140 < y < 4.8000000000000004e-43

    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 74.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.02 \cdot 10^{-140} \lor \neg \left(y \leq 4.8 \cdot 10^{-43}\right):\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 100.0% accurate, 1.0× speedup?

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

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

    \[x + \left(y - z\right) \cdot \left(t - x\right) \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 15: 18.2% 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 t around inf 66.0%

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

    \[\leadsto \color{blue}{x} \]
  5. Add Preprocessing

Developer Target 1: 96.3% 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 2024157 
(FPCore (x y z t)
  :name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
  :precision binary64

  :alt
  (! :herbie-platform default (+ x (+ (* t (- y z)) (* (- x) (- y z)))))

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