Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 14.0s
Alternatives: 12
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 12 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, 1.0× speedup?

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

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

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

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

Alternative 2: 38.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -z \cdot t\\ t_2 := y \cdot \left(-x\right)\\ \mathbf{if}\;y \leq -1.2 \cdot 10^{+150}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -2.7 \cdot 10^{+43}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -4.1 \cdot 10^{+27}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{-44}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-248}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-204}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-14}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{+57}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* z t))) (t_2 (* y (- x))))
   (if (<= y -1.2e+150)
     t_2
     (if (<= y -2.7e+43)
       (* y t)
       (if (<= y -4.1e+27)
         t_2
         (if (<= y -2.5e-44)
           t_1
           (if (<= y -4.2e-248)
             x
             (if (<= y 5.5e-204)
               t_1
               (if (<= y 4.2e-14) x (if (<= y 6.6e+57) t_1 t_2))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = -(z * t);
	double t_2 = y * -x;
	double tmp;
	if (y <= -1.2e+150) {
		tmp = t_2;
	} else if (y <= -2.7e+43) {
		tmp = y * t;
	} else if (y <= -4.1e+27) {
		tmp = t_2;
	} else if (y <= -2.5e-44) {
		tmp = t_1;
	} else if (y <= -4.2e-248) {
		tmp = x;
	} else if (y <= 5.5e-204) {
		tmp = t_1;
	} else if (y <= 4.2e-14) {
		tmp = x;
	} else if (y <= 6.6e+57) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = -(z * t)
    t_2 = y * -x
    if (y <= (-1.2d+150)) then
        tmp = t_2
    else if (y <= (-2.7d+43)) then
        tmp = y * t
    else if (y <= (-4.1d+27)) then
        tmp = t_2
    else if (y <= (-2.5d-44)) then
        tmp = t_1
    else if (y <= (-4.2d-248)) then
        tmp = x
    else if (y <= 5.5d-204) then
        tmp = t_1
    else if (y <= 4.2d-14) then
        tmp = x
    else if (y <= 6.6d+57) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = -(z * t);
	double t_2 = y * -x;
	double tmp;
	if (y <= -1.2e+150) {
		tmp = t_2;
	} else if (y <= -2.7e+43) {
		tmp = y * t;
	} else if (y <= -4.1e+27) {
		tmp = t_2;
	} else if (y <= -2.5e-44) {
		tmp = t_1;
	} else if (y <= -4.2e-248) {
		tmp = x;
	} else if (y <= 5.5e-204) {
		tmp = t_1;
	} else if (y <= 4.2e-14) {
		tmp = x;
	} else if (y <= 6.6e+57) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = -(z * t)
	t_2 = y * -x
	tmp = 0
	if y <= -1.2e+150:
		tmp = t_2
	elif y <= -2.7e+43:
		tmp = y * t
	elif y <= -4.1e+27:
		tmp = t_2
	elif y <= -2.5e-44:
		tmp = t_1
	elif y <= -4.2e-248:
		tmp = x
	elif y <= 5.5e-204:
		tmp = t_1
	elif y <= 4.2e-14:
		tmp = x
	elif y <= 6.6e+57:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(-Float64(z * t))
	t_2 = Float64(y * Float64(-x))
	tmp = 0.0
	if (y <= -1.2e+150)
		tmp = t_2;
	elseif (y <= -2.7e+43)
		tmp = Float64(y * t);
	elseif (y <= -4.1e+27)
		tmp = t_2;
	elseif (y <= -2.5e-44)
		tmp = t_1;
	elseif (y <= -4.2e-248)
		tmp = x;
	elseif (y <= 5.5e-204)
		tmp = t_1;
	elseif (y <= 4.2e-14)
		tmp = x;
	elseif (y <= 6.6e+57)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = -(z * t);
	t_2 = y * -x;
	tmp = 0.0;
	if (y <= -1.2e+150)
		tmp = t_2;
	elseif (y <= -2.7e+43)
		tmp = y * t;
	elseif (y <= -4.1e+27)
		tmp = t_2;
	elseif (y <= -2.5e-44)
		tmp = t_1;
	elseif (y <= -4.2e-248)
		tmp = x;
	elseif (y <= 5.5e-204)
		tmp = t_1;
	elseif (y <= 4.2e-14)
		tmp = x;
	elseif (y <= 6.6e+57)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = (-N[(z * t), $MachinePrecision])}, Block[{t$95$2 = N[(y * (-x)), $MachinePrecision]}, If[LessEqual[y, -1.2e+150], t$95$2, If[LessEqual[y, -2.7e+43], N[(y * t), $MachinePrecision], If[LessEqual[y, -4.1e+27], t$95$2, If[LessEqual[y, -2.5e-44], t$95$1, If[LessEqual[y, -4.2e-248], x, If[LessEqual[y, 5.5e-204], t$95$1, If[LessEqual[y, 4.2e-14], x, If[LessEqual[y, 6.6e+57], t$95$1, t$95$2]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -2.7 \cdot 10^{+43}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq -4.1 \cdot 10^{+27}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;y \leq -4.2 \cdot 10^{-248}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 5.5 \cdot 10^{-204}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{-14}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 6.6 \cdot 10^{+57}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.20000000000000001e150 or -2.7000000000000002e43 < y < -4.1000000000000002e27 or 6.6000000000000002e57 < y

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + \left(-1 \cdot y\right) \cdot x} \]
      3. associate-*r*60.2%

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

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

        \[\leadsto \color{blue}{x - y \cdot x} \]
      6. *-commutative60.2%

        \[\leadsto x - \color{blue}{x \cdot y} \]
    7. Simplified60.2%

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

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

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

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

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

    if -1.20000000000000001e150 < y < -2.7000000000000002e43

    1. Initial program 99.8%

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

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

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

    if -4.1000000000000002e27 < y < -2.50000000000000019e-44 or -4.2e-248 < y < 5.4999999999999999e-204 or 4.1999999999999998e-14 < y < 6.6000000000000002e57

    1. Initial program 100.0%

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

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

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

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

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

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

    if -2.50000000000000019e-44 < y < -4.2e-248 or 5.4999999999999999e-204 < y < 4.1999999999999998e-14

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{+150}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq -2.7 \cdot 10^{+43}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -4.1 \cdot 10^{+27}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{-44}:\\ \;\;\;\;-z \cdot t\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-248}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-204}:\\ \;\;\;\;-z \cdot t\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-14}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{+57}:\\ \;\;\;\;-z \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \end{array} \]

Alternative 3: 68.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - x \cdot y\\ t_2 := z \cdot \left(x - t\right)\\ t_3 := y \cdot \left(t - x\right)\\ \mathbf{if}\;z \leq -8.2 \cdot 10^{+40}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-51}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-188}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-228}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-303}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-262}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{-56}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- x (* x y))) (t_2 (* z (- x t))) (t_3 (* y (- t x))))
   (if (<= z -8.2e+40)
     t_2
     (if (<= z -8.8e-51)
       t_3
       (if (<= z -1e-188)
         t_1
         (if (<= z -1.1e-228)
           t_3
           (if (<= z 5e-303)
             (+ x (* y t))
             (if (<= z 3.6e-262) t_3 (if (<= z 3.9e-56) t_1 t_2)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x - (x * y);
	double t_2 = z * (x - t);
	double t_3 = y * (t - x);
	double tmp;
	if (z <= -8.2e+40) {
		tmp = t_2;
	} else if (z <= -8.8e-51) {
		tmp = t_3;
	} else if (z <= -1e-188) {
		tmp = t_1;
	} else if (z <= -1.1e-228) {
		tmp = t_3;
	} else if (z <= 5e-303) {
		tmp = x + (y * t);
	} else if (z <= 3.6e-262) {
		tmp = t_3;
	} else if (z <= 3.9e-56) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x - (x * y)
    t_2 = z * (x - t)
    t_3 = y * (t - x)
    if (z <= (-8.2d+40)) then
        tmp = t_2
    else if (z <= (-8.8d-51)) then
        tmp = t_3
    else if (z <= (-1d-188)) then
        tmp = t_1
    else if (z <= (-1.1d-228)) then
        tmp = t_3
    else if (z <= 5d-303) then
        tmp = x + (y * t)
    else if (z <= 3.6d-262) then
        tmp = t_3
    else if (z <= 3.9d-56) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x - (x * y);
	double t_2 = z * (x - t);
	double t_3 = y * (t - x);
	double tmp;
	if (z <= -8.2e+40) {
		tmp = t_2;
	} else if (z <= -8.8e-51) {
		tmp = t_3;
	} else if (z <= -1e-188) {
		tmp = t_1;
	} else if (z <= -1.1e-228) {
		tmp = t_3;
	} else if (z <= 5e-303) {
		tmp = x + (y * t);
	} else if (z <= 3.6e-262) {
		tmp = t_3;
	} else if (z <= 3.9e-56) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x - (x * y)
	t_2 = z * (x - t)
	t_3 = y * (t - x)
	tmp = 0
	if z <= -8.2e+40:
		tmp = t_2
	elif z <= -8.8e-51:
		tmp = t_3
	elif z <= -1e-188:
		tmp = t_1
	elif z <= -1.1e-228:
		tmp = t_3
	elif z <= 5e-303:
		tmp = x + (y * t)
	elif z <= 3.6e-262:
		tmp = t_3
	elif z <= 3.9e-56:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x - Float64(x * y))
	t_2 = Float64(z * Float64(x - t))
	t_3 = Float64(y * Float64(t - x))
	tmp = 0.0
	if (z <= -8.2e+40)
		tmp = t_2;
	elseif (z <= -8.8e-51)
		tmp = t_3;
	elseif (z <= -1e-188)
		tmp = t_1;
	elseif (z <= -1.1e-228)
		tmp = t_3;
	elseif (z <= 5e-303)
		tmp = Float64(x + Float64(y * t));
	elseif (z <= 3.6e-262)
		tmp = t_3;
	elseif (z <= 3.9e-56)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x - (x * y);
	t_2 = z * (x - t);
	t_3 = y * (t - x);
	tmp = 0.0;
	if (z <= -8.2e+40)
		tmp = t_2;
	elseif (z <= -8.8e-51)
		tmp = t_3;
	elseif (z <= -1e-188)
		tmp = t_1;
	elseif (z <= -1.1e-228)
		tmp = t_3;
	elseif (z <= 5e-303)
		tmp = x + (y * t);
	elseif (z <= 3.6e-262)
		tmp = t_3;
	elseif (z <= 3.9e-56)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e+40], t$95$2, If[LessEqual[z, -8.8e-51], t$95$3, If[LessEqual[z, -1e-188], t$95$1, If[LessEqual[z, -1.1e-228], t$95$3, If[LessEqual[z, 5e-303], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e-262], t$95$3, If[LessEqual[z, 3.9e-56], t$95$1, t$95$2]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -8.8 \cdot 10^{-51}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;z \leq -1 \cdot 10^{-188}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -1.1 \cdot 10^{-228}:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;z \leq 3.6 \cdot 10^{-262}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;z \leq 3.9 \cdot 10^{-56}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.2000000000000003e40 or 3.9e-56 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.2000000000000003e40 < z < -8.8000000000000001e-51 or -9.9999999999999995e-189 < z < -1.1e-228 or 4.9999999999999998e-303 < z < 3.5999999999999998e-262

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(-t\right)} - -1 \cdot x\right) \cdot \left(-y\right) \]
      5. cancel-sign-sub-inv77.0%

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

        \[\leadsto \left(\left(-t\right) + \color{blue}{1} \cdot x\right) \cdot \left(-y\right) \]
      7. *-lft-identity77.0%

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

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

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

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

    if -8.8000000000000001e-51 < z < -9.9999999999999995e-189 or 3.5999999999999998e-262 < z < 3.9e-56

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + \left(-1 \cdot y\right) \cdot x} \]
      3. associate-*r*76.3%

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

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

        \[\leadsto \color{blue}{x - y \cdot x} \]
      6. *-commutative76.3%

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

      \[\leadsto \color{blue}{x - x \cdot y} \]

    if -1.1e-228 < z < 4.9999999999999998e-303

    1. Initial program 99.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+40}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-51}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-188}:\\ \;\;\;\;x - x \cdot y\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-228}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-303}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-262}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{-56}:\\ \;\;\;\;x - x \cdot y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]

Alternative 4: 74.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ t_2 := x + \left(y - z\right) \cdot t\\ \mathbf{if}\;y \leq -8.2 \cdot 10^{+27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.55 \cdot 10^{-307}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-198}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-119}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{-59}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{+57}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (- t x))) (t_2 (+ x (* (- y z) t))))
   (if (<= y -8.2e+27)
     t_1
     (if (<= y 2.55e-307)
       t_2
       (if (<= y 5.6e-198)
         (* z (- x t))
         (if (<= y 1.9e-119)
           t_2
           (if (<= y 3.7e-59) (+ x (* x z)) (if (<= y 4.3e+57) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double t_2 = x + ((y - z) * t);
	double tmp;
	if (y <= -8.2e+27) {
		tmp = t_1;
	} else if (y <= 2.55e-307) {
		tmp = t_2;
	} else if (y <= 5.6e-198) {
		tmp = z * (x - t);
	} else if (y <= 1.9e-119) {
		tmp = t_2;
	} else if (y <= 3.7e-59) {
		tmp = x + (x * z);
	} else if (y <= 4.3e+57) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = y * (t - x)
    t_2 = x + ((y - z) * t)
    if (y <= (-8.2d+27)) then
        tmp = t_1
    else if (y <= 2.55d-307) then
        tmp = t_2
    else if (y <= 5.6d-198) then
        tmp = z * (x - t)
    else if (y <= 1.9d-119) then
        tmp = t_2
    else if (y <= 3.7d-59) then
        tmp = x + (x * z)
    else if (y <= 4.3d+57) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double t_2 = x + ((y - z) * t);
	double tmp;
	if (y <= -8.2e+27) {
		tmp = t_1;
	} else if (y <= 2.55e-307) {
		tmp = t_2;
	} else if (y <= 5.6e-198) {
		tmp = z * (x - t);
	} else if (y <= 1.9e-119) {
		tmp = t_2;
	} else if (y <= 3.7e-59) {
		tmp = x + (x * z);
	} else if (y <= 4.3e+57) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (t - x)
	t_2 = x + ((y - z) * t)
	tmp = 0
	if y <= -8.2e+27:
		tmp = t_1
	elif y <= 2.55e-307:
		tmp = t_2
	elif y <= 5.6e-198:
		tmp = z * (x - t)
	elif y <= 1.9e-119:
		tmp = t_2
	elif y <= 3.7e-59:
		tmp = x + (x * z)
	elif y <= 4.3e+57:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(t - x))
	t_2 = Float64(x + Float64(Float64(y - z) * t))
	tmp = 0.0
	if (y <= -8.2e+27)
		tmp = t_1;
	elseif (y <= 2.55e-307)
		tmp = t_2;
	elseif (y <= 5.6e-198)
		tmp = Float64(z * Float64(x - t));
	elseif (y <= 1.9e-119)
		tmp = t_2;
	elseif (y <= 3.7e-59)
		tmp = Float64(x + Float64(x * z));
	elseif (y <= 4.3e+57)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (t - x);
	t_2 = x + ((y - z) * t);
	tmp = 0.0;
	if (y <= -8.2e+27)
		tmp = t_1;
	elseif (y <= 2.55e-307)
		tmp = t_2;
	elseif (y <= 5.6e-198)
		tmp = z * (x - t);
	elseif (y <= 1.9e-119)
		tmp = t_2;
	elseif (y <= 3.7e-59)
		tmp = x + (x * z);
	elseif (y <= 4.3e+57)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.2e+27], t$95$1, If[LessEqual[y, 2.55e-307], t$95$2, If[LessEqual[y, 5.6e-198], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e-119], t$95$2, If[LessEqual[y, 3.7e-59], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.3e+57], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 2.55 \cdot 10^{-307}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;y \leq 1.9 \cdot 10^{-119}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;y \leq 4.3 \cdot 10^{+57}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -8.2000000000000005e27 or 4.30000000000000033e57 < y

    1. Initial program 99.9%

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

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

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

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

      \[\leadsto x + \frac{\color{blue}{{y}^{2} \cdot \left(t - x\right)}}{y + z} \]
    5. Step-by-step derivation
      1. unpow253.8%

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(-t\right)} - -1 \cdot x\right) \cdot \left(-y\right) \]
      5. cancel-sign-sub-inv87.1%

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

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

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

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

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

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

    if -8.2000000000000005e27 < y < 2.55e-307 or 5.5999999999999998e-198 < y < 1.89999999999999987e-119 or 3.6999999999999999e-59 < y < 4.30000000000000033e57

    1. Initial program 100.0%

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

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

    if 2.55e-307 < y < 5.5999999999999998e-198

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.89999999999999987e-119 < y < 3.6999999999999999e-59

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.2 \cdot 10^{+27}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 2.55 \cdot 10^{-307}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-198}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-119}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{-59}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{+57}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 5: 38.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq -3.4 \cdot 10^{+43}:\\
\;\;\;\;y \cdot t\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.25000000000000002e150 or -3.40000000000000012e43 < y < -3.4e8 or 1.50000000000000003e56 < y

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + \left(-1 \cdot y\right) \cdot x} \]
      3. associate-*r*58.4%

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

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

        \[\leadsto \color{blue}{x - y \cdot x} \]
      6. *-commutative58.4%

        \[\leadsto x - \color{blue}{x \cdot y} \]
    7. Simplified58.4%

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

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

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

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

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

    if -1.25000000000000002e150 < y < -3.40000000000000012e43 or 2.29999999999999998e-14 < y < 1.50000000000000003e56

    1. Initial program 99.9%

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

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

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

    if -3.4e8 < y < 2.29999999999999998e-14

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{+150}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq -3.4 \cdot 10^{+43}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -340000000:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{-14}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+56}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \end{array} \]

Alternative 6: 69.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(x - t\right)\\ t_2 := x + y \cdot t\\ \mathbf{if}\;z \leq -5 \cdot 10^{+40}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-237}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 5.9 \cdot 10^{-187}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{-45}:\\ \;\;\;\;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 (+ x (* y t))))
   (if (<= z -5e+40)
     t_1
     (if (<= z 7e-237)
       t_2
       (if (<= z 5.9e-187) (* y (- x)) (if (<= z 2.75e-45) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (x - t);
	double t_2 = x + (y * t);
	double tmp;
	if (z <= -5e+40) {
		tmp = t_1;
	} else if (z <= 7e-237) {
		tmp = t_2;
	} else if (z <= 5.9e-187) {
		tmp = y * -x;
	} else if (z <= 2.75e-45) {
		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 = x + (y * t)
    if (z <= (-5d+40)) then
        tmp = t_1
    else if (z <= 7d-237) then
        tmp = t_2
    else if (z <= 5.9d-187) then
        tmp = y * -x
    else if (z <= 2.75d-45) 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 = x + (y * t);
	double tmp;
	if (z <= -5e+40) {
		tmp = t_1;
	} else if (z <= 7e-237) {
		tmp = t_2;
	} else if (z <= 5.9e-187) {
		tmp = y * -x;
	} else if (z <= 2.75e-45) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (x - t)
	t_2 = x + (y * t)
	tmp = 0
	if z <= -5e+40:
		tmp = t_1
	elif z <= 7e-237:
		tmp = t_2
	elif z <= 5.9e-187:
		tmp = y * -x
	elif z <= 2.75e-45:
		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(x + Float64(y * t))
	tmp = 0.0
	if (z <= -5e+40)
		tmp = t_1;
	elseif (z <= 7e-237)
		tmp = t_2;
	elseif (z <= 5.9e-187)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 2.75e-45)
		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 = x + (y * t);
	tmp = 0.0;
	if (z <= -5e+40)
		tmp = t_1;
	elseif (z <= 7e-237)
		tmp = t_2;
	elseif (z <= 5.9e-187)
		tmp = y * -x;
	elseif (z <= 2.75e-45)
		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[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e+40], t$95$1, If[LessEqual[z, 7e-237], t$95$2, If[LessEqual[z, 5.9e-187], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.75e-45], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 7 \cdot 10^{-237}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq 2.75 \cdot 10^{-45}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.00000000000000003e40 or 2.75000000000000015e-45 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000003e40 < z < 6.99999999999999966e-237 or 5.8999999999999999e-187 < z < 2.75000000000000015e-45

    1. Initial program 100.0%

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

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

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

    if 6.99999999999999966e-237 < z < 5.8999999999999999e-187

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + \left(-1 \cdot y\right) \cdot x} \]
      3. associate-*r*86.0%

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

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

        \[\leadsto \color{blue}{x - y \cdot x} \]
      6. *-commutative86.0%

        \[\leadsto x - \color{blue}{x \cdot y} \]
    7. Simplified86.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+40}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-237}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 5.9 \cdot 10^{-187}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{-45}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]

Alternative 7: 84.7% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.6000000000000001e27 or 4.30000000000000033e57 < y

    1. Initial program 99.9%

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

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

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

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

      \[\leadsto x + \frac{\color{blue}{{y}^{2} \cdot \left(t - x\right)}}{y + z} \]
    5. Step-by-step derivation
      1. unpow253.8%

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(-t\right)} - -1 \cdot x\right) \cdot \left(-y\right) \]
      5. cancel-sign-sub-inv87.1%

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

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

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

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

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

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

    if -4.6000000000000001e27 < y < 4.30000000000000033e57

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 83.5% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.8000000000000002e40

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.8000000000000002e40 < z < 3.7e-45

    1. Initial program 100.0%

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

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

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

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

    if 3.7e-45 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.8 \cdot 10^{+40}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-45}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(x - t\right)\\ \end{array} \]

Alternative 9: 53.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+84} \lor \neg \left(y \leq 2.45 \cdot 10^{+58}\right):\\
\;\;\;\;y \cdot \left(-x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.1999999999999999e84 or 2.45000000000000009e58 < y

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + \left(-1 \cdot y\right) \cdot x} \]
      3. associate-*r*58.4%

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

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

        \[\leadsto \color{blue}{x - y \cdot x} \]
      6. *-commutative58.4%

        \[\leadsto x - \color{blue}{x \cdot y} \]
    7. Simplified58.4%

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

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

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

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

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

    if -7.1999999999999999e84 < y < 2.45000000000000009e58

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+84} \lor \neg \left(y \leq 2.45 \cdot 10^{+58}\right):\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]

Alternative 10: 67.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+19} \lor \neg \left(z \leq 3.9 \cdot 10^{-56}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\

\mathbf{else}:\\
\;\;\;\;x - x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8e19 or 3.9e-56 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8e19 < z < 3.9e-56

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + \left(-1 \cdot y\right) \cdot x} \]
      3. associate-*r*65.0%

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

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

        \[\leadsto \color{blue}{x - y \cdot x} \]
      6. *-commutative65.0%

        \[\leadsto x - \color{blue}{x \cdot y} \]
    7. Simplified65.0%

      \[\leadsto \color{blue}{x - x \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification73.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+19} \lor \neg \left(z \leq 3.9 \cdot 10^{-56}\right):\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot y\\ \end{array} \]

Alternative 11: 37.9% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;y \leq 1.7 \cdot 10^{-13}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.4999999999999998e-44 or 1.70000000000000008e-13 < y

    1. Initial program 100.0%

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

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

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

    if -3.4999999999999998e-44 < y < 1.70000000000000008e-13

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{-44}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-13}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]

Alternative 12: 17.9% accurate, 9.0× speedup?

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

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

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

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

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

    \[\leadsto x \]

Developer target: 96.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 2023278 
(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))))