Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 9.4s
Alternatives: 14
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 0.1× speedup?

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

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

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

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

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

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

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

Alternative 2: 38.2% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -2.2 \cdot 10^{-59}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -5.4 \cdot 10^{-104}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 5.2 \cdot 10^{-253}:\\
\;\;\;\;y \cdot t\\

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

\mathbf{elif}\;z \leq 3.25 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.5e14

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

    if -1.5e14 < z < -2.1999999999999999e-59 or 4.0000000000000001e-127 < z < 3.2500000000000001e114

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1999999999999999e-59 < z < -5.3999999999999997e-104 or 5.2e-253 < z < 4.0000000000000001e-127

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

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

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

    if -5.3999999999999997e-104 < z < 5.2e-253

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y + x} \]
    7. Taylor expanded in t around inf 47.7%

      \[\leadsto \color{blue}{t \cdot y} \]
    8. Step-by-step derivation
      1. *-commutative47.7%

        \[\leadsto \color{blue}{y \cdot t} \]
    9. Simplified47.7%

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

    if 3.2500000000000001e114 < 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 64.3%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+14}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-59}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq -5.4 \cdot 10^{-104}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{-253}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-127}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.25 \cdot 10^{+114}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 53.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - z \cdot t\\ \mathbf{if}\;z \leq -2.5 \cdot 10^{+142}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{+80}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.22 \cdot 10^{+23}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-159}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+114}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- x (* z t))))
   (if (<= z -2.5e+142)
     (* z x)
     (if (<= z -1.7e+80)
       t_1
       (if (<= z -1.22e+23)
         (* z x)
         (if (<= z 2.8e-159)
           (+ x (* y t))
           (if (<= z 3.6e+114) (* x (- 1.0 y)) t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x - (z * t);
	double tmp;
	if (z <= -2.5e+142) {
		tmp = z * x;
	} else if (z <= -1.7e+80) {
		tmp = t_1;
	} else if (z <= -1.22e+23) {
		tmp = z * x;
	} else if (z <= 2.8e-159) {
		tmp = x + (y * t);
	} else if (z <= 3.6e+114) {
		tmp = x * (1.0 - y);
	} 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 = x - (z * t)
    if (z <= (-2.5d+142)) then
        tmp = z * x
    else if (z <= (-1.7d+80)) then
        tmp = t_1
    else if (z <= (-1.22d+23)) then
        tmp = z * x
    else if (z <= 2.8d-159) then
        tmp = x + (y * t)
    else if (z <= 3.6d+114) then
        tmp = x * (1.0d0 - y)
    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 = x - (z * t);
	double tmp;
	if (z <= -2.5e+142) {
		tmp = z * x;
	} else if (z <= -1.7e+80) {
		tmp = t_1;
	} else if (z <= -1.22e+23) {
		tmp = z * x;
	} else if (z <= 2.8e-159) {
		tmp = x + (y * t);
	} else if (z <= 3.6e+114) {
		tmp = x * (1.0 - y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x - (z * t)
	tmp = 0
	if z <= -2.5e+142:
		tmp = z * x
	elif z <= -1.7e+80:
		tmp = t_1
	elif z <= -1.22e+23:
		tmp = z * x
	elif z <= 2.8e-159:
		tmp = x + (y * t)
	elif z <= 3.6e+114:
		tmp = x * (1.0 - y)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x - Float64(z * t))
	tmp = 0.0
	if (z <= -2.5e+142)
		tmp = Float64(z * x);
	elseif (z <= -1.7e+80)
		tmp = t_1;
	elseif (z <= -1.22e+23)
		tmp = Float64(z * x);
	elseif (z <= 2.8e-159)
		tmp = Float64(x + Float64(y * t));
	elseif (z <= 3.6e+114)
		tmp = Float64(x * Float64(1.0 - y));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x - (z * t);
	tmp = 0.0;
	if (z <= -2.5e+142)
		tmp = z * x;
	elseif (z <= -1.7e+80)
		tmp = t_1;
	elseif (z <= -1.22e+23)
		tmp = z * x;
	elseif (z <= 2.8e-159)
		tmp = x + (y * t);
	elseif (z <= 3.6e+114)
		tmp = x * (1.0 - y);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.5e+142], N[(z * x), $MachinePrecision], If[LessEqual[z, -1.7e+80], t$95$1, If[LessEqual[z, -1.22e+23], N[(z * x), $MachinePrecision], If[LessEqual[z, 2.8e-159], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+114], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x - z \cdot t\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{+142}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -1.7 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.22 \cdot 10^{+23}:\\
\;\;\;\;z \cdot x\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.5000000000000001e142 or -1.69999999999999996e80 < z < -1.22e23

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

    if -2.5000000000000001e142 < z < -1.69999999999999996e80 or 3.6000000000000001e114 < 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 64.0%

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

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

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

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

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

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

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

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

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

    if -1.22e23 < z < 2.8000000000000002e-159

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

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

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

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

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

    if 2.8000000000000002e-159 < z < 3.6000000000000001e114

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{+142}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{+80}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;z \leq -1.22 \cdot 10^{+23}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-159}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+114}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 53.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - z \cdot t\\ \mathbf{if}\;z \leq -2.6 \cdot 10^{+140}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -5.4 \cdot 10^{+76}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{+20}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-160}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{+116}:\\ \;\;\;\;x - y \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- x (* z t))))
   (if (<= z -2.6e+140)
     (* z x)
     (if (<= z -5.4e+76)
       t_1
       (if (<= z -9.2e+20)
         (* z x)
         (if (<= z 8e-160)
           (+ x (* y t))
           (if (<= z 2.35e+116) (- x (* y x)) t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x - (z * t);
	double tmp;
	if (z <= -2.6e+140) {
		tmp = z * x;
	} else if (z <= -5.4e+76) {
		tmp = t_1;
	} else if (z <= -9.2e+20) {
		tmp = z * x;
	} else if (z <= 8e-160) {
		tmp = x + (y * t);
	} else if (z <= 2.35e+116) {
		tmp = x - (y * 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 = x - (z * t)
    if (z <= (-2.6d+140)) then
        tmp = z * x
    else if (z <= (-5.4d+76)) then
        tmp = t_1
    else if (z <= (-9.2d+20)) then
        tmp = z * x
    else if (z <= 8d-160) then
        tmp = x + (y * t)
    else if (z <= 2.35d+116) then
        tmp = x - (y * 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 = x - (z * t);
	double tmp;
	if (z <= -2.6e+140) {
		tmp = z * x;
	} else if (z <= -5.4e+76) {
		tmp = t_1;
	} else if (z <= -9.2e+20) {
		tmp = z * x;
	} else if (z <= 8e-160) {
		tmp = x + (y * t);
	} else if (z <= 2.35e+116) {
		tmp = x - (y * x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x - (z * t)
	tmp = 0
	if z <= -2.6e+140:
		tmp = z * x
	elif z <= -5.4e+76:
		tmp = t_1
	elif z <= -9.2e+20:
		tmp = z * x
	elif z <= 8e-160:
		tmp = x + (y * t)
	elif z <= 2.35e+116:
		tmp = x - (y * x)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x - Float64(z * t))
	tmp = 0.0
	if (z <= -2.6e+140)
		tmp = Float64(z * x);
	elseif (z <= -5.4e+76)
		tmp = t_1;
	elseif (z <= -9.2e+20)
		tmp = Float64(z * x);
	elseif (z <= 8e-160)
		tmp = Float64(x + Float64(y * t));
	elseif (z <= 2.35e+116)
		tmp = Float64(x - Float64(y * x));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x - (z * t);
	tmp = 0.0;
	if (z <= -2.6e+140)
		tmp = z * x;
	elseif (z <= -5.4e+76)
		tmp = t_1;
	elseif (z <= -9.2e+20)
		tmp = z * x;
	elseif (z <= 8e-160)
		tmp = x + (y * t);
	elseif (z <= 2.35e+116)
		tmp = x - (y * x);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e+140], N[(z * x), $MachinePrecision], If[LessEqual[z, -5.4e+76], t$95$1, If[LessEqual[z, -9.2e+20], N[(z * x), $MachinePrecision], If[LessEqual[z, 8e-160], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.35e+116], N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x - z \cdot t\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{+140}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -5.4 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -9.2 \cdot 10^{+20}:\\
\;\;\;\;z \cdot x\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.6000000000000001e140 or -5.3999999999999998e76 < z < -9.2e20

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

    if -2.6000000000000001e140 < z < -5.3999999999999998e76 or 2.3500000000000002e116 < 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 64.0%

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

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

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

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

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

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

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

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

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

    if -9.2e20 < z < 7.9999999999999999e-160

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

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

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

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

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

    if 7.9999999999999999e-160 < z < 2.3500000000000002e116

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 \cdot x + \left(-y\right) \cdot x} \]
      3. *-un-lft-identity55.4%

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

      \[\leadsto \color{blue}{x + \left(-y\right) \cdot x} \]
    11. Step-by-step derivation
      1. distribute-lft-neg-out55.4%

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

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

        \[\leadsto x - \color{blue}{x \cdot y} \]
    12. Applied egg-rr55.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+140}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -5.4 \cdot 10^{+76}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{+20}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-160}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{+116}:\\ \;\;\;\;x - y \cdot x\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 49.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - y\right)\\ \mathbf{if}\;z \leq -76000000:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{-112}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -7.4 \cdot 10^{-157}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+114}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 y))))
   (if (<= z -76000000.0)
     (* z x)
     (if (<= z -1.55e-112)
       t_1
       (if (<= z -7.4e-157) (* y t) (if (<= z 2.9e+114) t_1 (* z (- t))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - y);
	double tmp;
	if (z <= -76000000.0) {
		tmp = z * x;
	} else if (z <= -1.55e-112) {
		tmp = t_1;
	} else if (z <= -7.4e-157) {
		tmp = y * t;
	} else if (z <= 2.9e+114) {
		tmp = t_1;
	} else {
		tmp = 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) :: t_1
    real(8) :: tmp
    t_1 = x * (1.0d0 - y)
    if (z <= (-76000000.0d0)) then
        tmp = z * x
    else if (z <= (-1.55d-112)) then
        tmp = t_1
    else if (z <= (-7.4d-157)) then
        tmp = y * t
    else if (z <= 2.9d+114) then
        tmp = t_1
    else
        tmp = z * -t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - y);
	double tmp;
	if (z <= -76000000.0) {
		tmp = z * x;
	} else if (z <= -1.55e-112) {
		tmp = t_1;
	} else if (z <= -7.4e-157) {
		tmp = y * t;
	} else if (z <= 2.9e+114) {
		tmp = t_1;
	} else {
		tmp = z * -t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - y)
	tmp = 0
	if z <= -76000000.0:
		tmp = z * x
	elif z <= -1.55e-112:
		tmp = t_1
	elif z <= -7.4e-157:
		tmp = y * t
	elif z <= 2.9e+114:
		tmp = t_1
	else:
		tmp = z * -t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - y))
	tmp = 0.0
	if (z <= -76000000.0)
		tmp = Float64(z * x);
	elseif (z <= -1.55e-112)
		tmp = t_1;
	elseif (z <= -7.4e-157)
		tmp = Float64(y * t);
	elseif (z <= 2.9e+114)
		tmp = t_1;
	else
		tmp = Float64(z * Float64(-t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 - y);
	tmp = 0.0;
	if (z <= -76000000.0)
		tmp = z * x;
	elseif (z <= -1.55e-112)
		tmp = t_1;
	elseif (z <= -7.4e-157)
		tmp = y * t;
	elseif (z <= 2.9e+114)
		tmp = t_1;
	else
		tmp = z * -t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -76000000.0], N[(z * x), $MachinePrecision], If[LessEqual[z, -1.55e-112], t$95$1, If[LessEqual[z, -7.4e-157], N[(y * t), $MachinePrecision], If[LessEqual[z, 2.9e+114], t$95$1, N[(z * (-t)), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.55 \cdot 10^{-112}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -7.4 \cdot 10^{-157}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 2.9 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7.6e7

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

    if -7.6e7 < z < -1.5499999999999999e-112 or -7.3999999999999995e-157 < z < 2.9e114

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

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

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

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

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

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

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

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

    if -1.5499999999999999e-112 < z < -7.3999999999999995e-157

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y + x} \]
    7. Taylor expanded in t around inf 68.8%

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

        \[\leadsto \color{blue}{y \cdot t} \]
    9. Simplified68.8%

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

    if 2.9e114 < 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 64.3%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -76000000:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{-112}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq -7.4 \cdot 10^{-157}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+114}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 37.1% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq 140000000:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 2.2 \cdot 10^{+150} \lor \neg \left(y \leq 3.8 \cdot 10^{+209}\right):\\
\;\;\;\;y \cdot \left(-x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.54999999999999998e-33 or 2.19999999999999999e150 < y < 3.79999999999999984e209

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y + x} \]
    7. Taylor expanded in t around inf 43.3%

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

        \[\leadsto \color{blue}{y \cdot t} \]
    9. Simplified43.3%

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

    if -1.54999999999999998e-33 < y < 1.4e8

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

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

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

    if 1.4e8 < y < 2.19999999999999999e150 or 3.79999999999999984e209 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.55 \cdot 10^{-33}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 140000000:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+150} \lor \neg \left(y \leq 3.8 \cdot 10^{+209}\right):\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 53.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+22}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-154}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 7.3 \cdot 10^{+115}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -1.6e+22)
   (* z x)
   (if (<= z 2.8e-154)
     (+ x (* y t))
     (if (<= z 7.3e+115) (* x (- 1.0 y)) (* z (- t))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1.6e+22) {
		tmp = z * x;
	} else if (z <= 2.8e-154) {
		tmp = x + (y * t);
	} else if (z <= 7.3e+115) {
		tmp = x * (1.0 - y);
	} else {
		tmp = 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 (z <= (-1.6d+22)) then
        tmp = z * x
    else if (z <= 2.8d-154) then
        tmp = x + (y * t)
    else if (z <= 7.3d+115) then
        tmp = x * (1.0d0 - y)
    else
        tmp = z * -t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1.6e+22) {
		tmp = z * x;
	} else if (z <= 2.8e-154) {
		tmp = x + (y * t);
	} else if (z <= 7.3e+115) {
		tmp = x * (1.0 - y);
	} else {
		tmp = z * -t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -1.6e+22:
		tmp = z * x
	elif z <= 2.8e-154:
		tmp = x + (y * t)
	elif z <= 7.3e+115:
		tmp = x * (1.0 - y)
	else:
		tmp = z * -t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -1.6e+22)
		tmp = Float64(z * x);
	elseif (z <= 2.8e-154)
		tmp = Float64(x + Float64(y * t));
	elseif (z <= 7.3e+115)
		tmp = Float64(x * Float64(1.0 - y));
	else
		tmp = Float64(z * Float64(-t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -1.6e+22)
		tmp = z * x;
	elseif (z <= 2.8e-154)
		tmp = x + (y * t);
	elseif (z <= 7.3e+115)
		tmp = x * (1.0 - y);
	else
		tmp = z * -t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.6e+22], N[(z * x), $MachinePrecision], If[LessEqual[z, 2.8e-154], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.3e+115], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], N[(z * (-t)), $MachinePrecision]]]]
\begin{array}{l}

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.6e22

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

    if -1.6e22 < z < 2.80000000000000012e-154

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

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

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

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

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

    if 2.80000000000000012e-154 < z < 7.29999999999999968e115

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

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

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

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

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

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

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

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

    if 7.29999999999999968e115 < 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 64.3%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+22}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-154}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 7.3 \cdot 10^{+115}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 65.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{-69} \lor \neg \left(x \leq 1.35 \cdot 10^{-137}\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.3499999999999999e-69 or 1.34999999999999996e-137 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if -1.3499999999999999e-69 < x < 1.34999999999999996e-137

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 80.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-69} \lor \neg \left(x \leq 9.5 \cdot 10^{-16}\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.05e-69 or 9.5000000000000005e-16 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if -1.05e-69 < x < 9.5000000000000005e-16

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

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

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

Alternative 10: 84.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+23} \lor \neg \left(z \leq 4.2 \cdot 10^{+41}\right):\\
\;\;\;\;x + z \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.9999999999999992e22 or 4.1999999999999999e41 < z

    1. Initial program 100.0%

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

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

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

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

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

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

    if -9.9999999999999992e22 < z < 4.1999999999999999e41

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

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

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

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

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

Alternative 11: 36.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.28 \lor \neg \left(z \leq 2.8 \cdot 10^{-28}\right):\\
\;\;\;\;z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.28000000000000003 or 2.7999999999999998e-28 < 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 0 54.0%

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

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

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

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

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

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

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

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

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

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

    if -0.28000000000000003 < z < 2.7999999999999998e-28

    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.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.28 \lor \neg \left(z \leq 2.8 \cdot 10^{-28}\right):\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 37.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.7 \cdot 10^{-31} \lor \neg \left(y \leq 6 \cdot 10^{-99}\right):\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.6999999999999998e-31 or 6.00000000000000012e-99 < y

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y + x} \]
    7. Taylor expanded in t around inf 36.5%

      \[\leadsto \color{blue}{t \cdot y} \]
    8. Step-by-step derivation
      1. *-commutative36.5%

        \[\leadsto \color{blue}{y \cdot t} \]
    9. Simplified36.5%

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

    if -3.6999999999999998e-31 < y < 6.00000000000000012e-99

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

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

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

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

Alternative 13: 100.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 14: 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. Add Preprocessing
  3. Taylor expanded in t around inf 62.3%

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification18.0%

    \[\leadsto x \]
  6. Add Preprocessing

Developer target: 96.4% accurate, 0.6× speedup?

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

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

Reproduce

?
herbie shell --seed 2024029 
(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))))