Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 10.7s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 0.1× speedup?

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

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

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

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

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

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

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

Alternative 2: 39.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ \mathbf{if}\;z \leq -4.8 \cdot 10^{+268}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.38 \cdot 10^{+131}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-26}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-39}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-42}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{-115}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{-43}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.36 \cdot 10^{+247}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))))
   (if (<= z -4.8e+268)
     t_1
     (if (<= z -1.38e+131)
       (* z x)
       (if (<= z -1.1e-26)
         t_1
         (if (<= z -3.8e-39)
           (* y (- x))
           (if (<= z -8e-42)
             t_1
             (if (<= z 3.9e-115)
               (* y t)
               (if (<= z 5.2e-43) x (if (<= z 1.36e+247) t_1 (* z x)))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (z <= -4.8e+268) {
		tmp = t_1;
	} else if (z <= -1.38e+131) {
		tmp = z * x;
	} else if (z <= -1.1e-26) {
		tmp = t_1;
	} else if (z <= -3.8e-39) {
		tmp = y * -x;
	} else if (z <= -8e-42) {
		tmp = t_1;
	} else if (z <= 3.9e-115) {
		tmp = y * t;
	} else if (z <= 5.2e-43) {
		tmp = x;
	} else if (z <= 1.36e+247) {
		tmp = t_1;
	} else {
		tmp = z * x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * -t
    if (z <= (-4.8d+268)) then
        tmp = t_1
    else if (z <= (-1.38d+131)) then
        tmp = z * x
    else if (z <= (-1.1d-26)) then
        tmp = t_1
    else if (z <= (-3.8d-39)) then
        tmp = y * -x
    else if (z <= (-8d-42)) then
        tmp = t_1
    else if (z <= 3.9d-115) then
        tmp = y * t
    else if (z <= 5.2d-43) then
        tmp = x
    else if (z <= 1.36d+247) then
        tmp = t_1
    else
        tmp = z * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (z <= -4.8e+268) {
		tmp = t_1;
	} else if (z <= -1.38e+131) {
		tmp = z * x;
	} else if (z <= -1.1e-26) {
		tmp = t_1;
	} else if (z <= -3.8e-39) {
		tmp = y * -x;
	} else if (z <= -8e-42) {
		tmp = t_1;
	} else if (z <= 3.9e-115) {
		tmp = y * t;
	} else if (z <= 5.2e-43) {
		tmp = x;
	} else if (z <= 1.36e+247) {
		tmp = t_1;
	} else {
		tmp = z * x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	tmp = 0
	if z <= -4.8e+268:
		tmp = t_1
	elif z <= -1.38e+131:
		tmp = z * x
	elif z <= -1.1e-26:
		tmp = t_1
	elif z <= -3.8e-39:
		tmp = y * -x
	elif z <= -8e-42:
		tmp = t_1
	elif z <= 3.9e-115:
		tmp = y * t
	elif z <= 5.2e-43:
		tmp = x
	elif z <= 1.36e+247:
		tmp = t_1
	else:
		tmp = z * x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	tmp = 0.0
	if (z <= -4.8e+268)
		tmp = t_1;
	elseif (z <= -1.38e+131)
		tmp = Float64(z * x);
	elseif (z <= -1.1e-26)
		tmp = t_1;
	elseif (z <= -3.8e-39)
		tmp = Float64(y * Float64(-x));
	elseif (z <= -8e-42)
		tmp = t_1;
	elseif (z <= 3.9e-115)
		tmp = Float64(y * t);
	elseif (z <= 5.2e-43)
		tmp = x;
	elseif (z <= 1.36e+247)
		tmp = t_1;
	else
		tmp = Float64(z * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	tmp = 0.0;
	if (z <= -4.8e+268)
		tmp = t_1;
	elseif (z <= -1.38e+131)
		tmp = z * x;
	elseif (z <= -1.1e-26)
		tmp = t_1;
	elseif (z <= -3.8e-39)
		tmp = y * -x;
	elseif (z <= -8e-42)
		tmp = t_1;
	elseif (z <= 3.9e-115)
		tmp = y * t;
	elseif (z <= 5.2e-43)
		tmp = x;
	elseif (z <= 1.36e+247)
		tmp = t_1;
	else
		tmp = z * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -4.8e+268], t$95$1, If[LessEqual[z, -1.38e+131], N[(z * x), $MachinePrecision], If[LessEqual[z, -1.1e-26], t$95$1, If[LessEqual[z, -3.8e-39], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -8e-42], t$95$1, If[LessEqual[z, 3.9e-115], N[(y * t), $MachinePrecision], If[LessEqual[z, 5.2e-43], x, If[LessEqual[z, 1.36e+247], t$95$1, N[(z * x), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.38 \cdot 10^{+131}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -1.1 \cdot 10^{-26}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq -8 \cdot 10^{-42}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 3.9 \cdot 10^{-115}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 5.2 \cdot 10^{-43}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.36 \cdot 10^{+247}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -4.7999999999999999e268 or -1.38e131 < z < -1.1e-26 or -3.8000000000000002e-39 < z < -8.0000000000000003e-42 or 5.2e-43 < z < 1.35999999999999995e247

    1. Initial program 99.9%

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

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

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

        \[\leadsto \color{blue}{-t \cdot z} \]
      2. distribute-rgt-neg-out45.8%

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

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

    if -4.7999999999999999e268 < z < -1.38e131 or 1.35999999999999995e247 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if -1.1e-26 < z < -3.8000000000000002e-39

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.0000000000000003e-42 < z < 3.8999999999999998e-115

    1. Initial program 100.0%

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

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

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

    if 3.8999999999999998e-115 < z < 5.2e-43

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+268}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -1.38 \cdot 10^{+131}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-26}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-39}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-42}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{-115}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{-43}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.36 \cdot 10^{+247}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]

Alternative 3: 53.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - y \cdot x\\ t_2 := z \cdot \left(-t\right)\\ \mathbf{if}\;z \leq -3 \cdot 10^{+267}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.04 \cdot 10^{+130}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-23}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-36}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-198}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+56}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+243}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- x (* y x))) (t_2 (* z (- t))))
   (if (<= z -3e+267)
     t_2
     (if (<= z -1.04e+130)
       (* z x)
       (if (<= z -5.2e-23)
         t_2
         (if (<= z -1.02e-36)
           t_1
           (if (<= z 2.15e-198)
             (+ x (* y t))
             (if (<= z 3.1e+56) t_1 (if (<= z 6.2e+243) t_2 (* z x))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x - (y * x);
	double t_2 = z * -t;
	double tmp;
	if (z <= -3e+267) {
		tmp = t_2;
	} else if (z <= -1.04e+130) {
		tmp = z * x;
	} else if (z <= -5.2e-23) {
		tmp = t_2;
	} else if (z <= -1.02e-36) {
		tmp = t_1;
	} else if (z <= 2.15e-198) {
		tmp = x + (y * t);
	} else if (z <= 3.1e+56) {
		tmp = t_1;
	} else if (z <= 6.2e+243) {
		tmp = t_2;
	} else {
		tmp = z * x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x - (y * x)
    t_2 = z * -t
    if (z <= (-3d+267)) then
        tmp = t_2
    else if (z <= (-1.04d+130)) then
        tmp = z * x
    else if (z <= (-5.2d-23)) then
        tmp = t_2
    else if (z <= (-1.02d-36)) then
        tmp = t_1
    else if (z <= 2.15d-198) then
        tmp = x + (y * t)
    else if (z <= 3.1d+56) then
        tmp = t_1
    else if (z <= 6.2d+243) then
        tmp = t_2
    else
        tmp = z * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x - (y * x);
	double t_2 = z * -t;
	double tmp;
	if (z <= -3e+267) {
		tmp = t_2;
	} else if (z <= -1.04e+130) {
		tmp = z * x;
	} else if (z <= -5.2e-23) {
		tmp = t_2;
	} else if (z <= -1.02e-36) {
		tmp = t_1;
	} else if (z <= 2.15e-198) {
		tmp = x + (y * t);
	} else if (z <= 3.1e+56) {
		tmp = t_1;
	} else if (z <= 6.2e+243) {
		tmp = t_2;
	} else {
		tmp = z * x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x - (y * x)
	t_2 = z * -t
	tmp = 0
	if z <= -3e+267:
		tmp = t_2
	elif z <= -1.04e+130:
		tmp = z * x
	elif z <= -5.2e-23:
		tmp = t_2
	elif z <= -1.02e-36:
		tmp = t_1
	elif z <= 2.15e-198:
		tmp = x + (y * t)
	elif z <= 3.1e+56:
		tmp = t_1
	elif z <= 6.2e+243:
		tmp = t_2
	else:
		tmp = z * x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x - Float64(y * x))
	t_2 = Float64(z * Float64(-t))
	tmp = 0.0
	if (z <= -3e+267)
		tmp = t_2;
	elseif (z <= -1.04e+130)
		tmp = Float64(z * x);
	elseif (z <= -5.2e-23)
		tmp = t_2;
	elseif (z <= -1.02e-36)
		tmp = t_1;
	elseif (z <= 2.15e-198)
		tmp = Float64(x + Float64(y * t));
	elseif (z <= 3.1e+56)
		tmp = t_1;
	elseif (z <= 6.2e+243)
		tmp = t_2;
	else
		tmp = Float64(z * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x - (y * x);
	t_2 = z * -t;
	tmp = 0.0;
	if (z <= -3e+267)
		tmp = t_2;
	elseif (z <= -1.04e+130)
		tmp = z * x;
	elseif (z <= -5.2e-23)
		tmp = t_2;
	elseif (z <= -1.02e-36)
		tmp = t_1;
	elseif (z <= 2.15e-198)
		tmp = x + (y * t);
	elseif (z <= 3.1e+56)
		tmp = t_1;
	elseif (z <= 6.2e+243)
		tmp = t_2;
	else
		tmp = z * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -3e+267], t$95$2, If[LessEqual[z, -1.04e+130], N[(z * x), $MachinePrecision], If[LessEqual[z, -5.2e-23], t$95$2, If[LessEqual[z, -1.02e-36], t$95$1, If[LessEqual[z, 2.15e-198], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e+56], t$95$1, If[LessEqual[z, 6.2e+243], t$95$2, N[(z * x), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.04 \cdot 10^{+130}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -5.2 \cdot 10^{-23}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -1.02 \cdot 10^{-36}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 3.1 \cdot 10^{+56}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 6.2 \cdot 10^{+243}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.9999999999999999e267 or -1.04000000000000005e130 < z < -5.2e-23 or 3.10000000000000005e56 < z < 6.2e243

    1. Initial program 99.9%

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

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

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

        \[\leadsto \color{blue}{-t \cdot z} \]
      2. distribute-rgt-neg-out50.7%

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

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

    if -2.9999999999999999e267 < z < -1.04000000000000005e130 or 6.2e243 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if -5.2e-23 < z < -1.02e-36 or 2.1500000000000002e-198 < z < 3.10000000000000005e56

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto \color{blue}{x - y \cdot x} \]
    5. Simplified66.1%

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

    if -1.02e-36 < z < 2.1500000000000002e-198

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{+267}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -1.04 \cdot 10^{+130}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-23}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-36}:\\ \;\;\;\;x - y \cdot x\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-198}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+56}:\\ \;\;\;\;x - y \cdot x\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+243}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]

Alternative 4: 43.2% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;x \leq -3.3 \cdot 10^{-205}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;x \leq -1.95 \cdot 10^{-285}:\\
\;\;\;\;z \cdot \left(-t\right)\\

\mathbf{elif}\;x \leq 1.05 \cdot 10^{-131}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;x \leq 2 \cdot 10^{+112} \lor \neg \left(x \leq 8 \cdot 10^{+238}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -3.29999999999999984e-24 or 1.04999999999999999e-131 < x < 1.9999999999999999e112 or 8.0000000000000004e238 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -3.29999999999999984e-24 < x < -3.2999999999999999e-205 or -1.94999999999999993e-285 < x < 1.04999999999999999e-131

    1. Initial program 100.0%

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

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

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

    if -3.2999999999999999e-205 < x < -1.94999999999999993e-285

    1. Initial program 100.0%

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

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

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

        \[\leadsto \color{blue}{-t \cdot z} \]
      2. distribute-rgt-neg-out63.2%

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

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

    if 1.9999999999999999e112 < x < 8.0000000000000004e238

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.3 \cdot 10^{-24}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;x \leq -3.3 \cdot 10^{-205}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;x \leq -1.95 \cdot 10^{-285}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-131}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;x \leq 2 \cdot 10^{+112} \lor \neg \left(x \leq 8 \cdot 10^{+238}\right):\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \end{array} \]

Alternative 5: 39.6% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;z \leq -5.8 \cdot 10^{-41}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 2.2 \cdot 10^{-113}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 9 \cdot 10^{-43}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 4 \cdot 10^{+247}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7.99999999999999962e271 or -1.2200000000000001e129 < z < -5.79999999999999955e-41 or 9.0000000000000005e-43 < z < 3.99999999999999981e247

    1. Initial program 99.9%

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

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

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

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

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

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

    if -7.99999999999999962e271 < z < -1.2200000000000001e129 or 3.99999999999999981e247 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if -5.79999999999999955e-41 < z < 2.20000000000000004e-113

    1. Initial program 100.0%

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

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

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

    if 2.20000000000000004e-113 < z < 9.0000000000000005e-43

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+271}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -1.22 \cdot 10^{+129}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{-41}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-113}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-43}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4 \cdot 10^{+247}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]

Alternative 6: 53.3% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -3.5 \cdot 10^{+131}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -7.2 \cdot 10^{-24}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.49999999999999955e266 or -3.4999999999999999e131 < z < -7.2000000000000002e-24

    1. Initial program 99.9%

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

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

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

        \[\leadsto \color{blue}{-t \cdot z} \]
      2. distribute-rgt-neg-out50.1%

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

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

    if -8.49999999999999955e266 < z < -3.4999999999999999e131

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if -7.2000000000000002e-24 < z < 145000

    1. Initial program 100.0%

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

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

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

    if 145000 < z

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+266}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{+131}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{-24}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq 145000:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \end{array} \]

Alternative 7: 70.1% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;t \leq 3.3 \cdot 10^{-149}:\\
\;\;\;\;x - y \cdot x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.49999999999999985e-107 or 1.15999999999999992e-64 < t

    1. Initial program 100.0%

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

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

    if -3.49999999999999985e-107 < t < 3.30000000000000017e-149

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \color{blue}{x - y \cdot x} \]
    5. Simplified59.5%

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

    if 3.30000000000000017e-149 < t < 1.15999999999999992e-64

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.5 \cdot 10^{-107}:\\ \;\;\;\;x - t \cdot \left(z - y\right)\\ \mathbf{elif}\;t \leq 3.3 \cdot 10^{-149}:\\ \;\;\;\;x - y \cdot x\\ \mathbf{elif}\;t \leq 1.16 \cdot 10^{-64}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;x - t \cdot \left(z - y\right)\\ \end{array} \]

Alternative 8: 53.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := x + y \cdot t\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{+48}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 2.9 \cdot 10^{+36}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.35000000000000002e48 or 3.1999999999999997e-70 < y < 2.9e36

    1. Initial program 100.0%

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

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

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

    if -1.35000000000000002e48 < y < 3.1999999999999997e-70

    1. Initial program 100.0%

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

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

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

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

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

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

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

      \[\leadsto x - \color{blue}{t \cdot z} \]
    6. Step-by-step derivation
      1. *-commutative66.2%

        \[\leadsto x - \color{blue}{z \cdot t} \]
    7. Simplified66.2%

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

    if 2.9e36 < y < 3.59999999999999981e121

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.59999999999999981e121 < y

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{+48}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-70}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{+36}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{+121}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]

Alternative 9: 77.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+23} \lor \neg \left(y \leq 0.002\right):\\
\;\;\;\;x - y \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.69999999999999996e23 or 2e-3 < y

    1. Initial program 100.0%

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

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

    if -1.69999999999999996e23 < y < 2e-3

    1. Initial program 100.0%

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

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

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

Alternative 10: 81.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{-35} \lor \neg \left(t \leq 2.15 \cdot 10^{-13}\right):\\
\;\;\;\;x - t \cdot \left(z - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.49999999999999996e-35 or 2.1499999999999999e-13 < t

    1. Initial program 100.0%

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

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

    if -3.49999999999999996e-35 < t < 2.1499999999999999e-13

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.5 \cdot 10^{-35} \lor \neg \left(t \leq 2.15 \cdot 10^{-13}\right):\\ \;\;\;\;x - t \cdot \left(z - y\right)\\ \mathbf{else}:\\ \;\;\;\;x + x \cdot \left(z - y\right)\\ \end{array} \]

Alternative 11: 83.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+19} \lor \neg \left(y \leq 4.4 \cdot 10^{-26}\right):\\
\;\;\;\;x - y \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.9e19 or 4.4000000000000002e-26 < y

    1. Initial program 100.0%

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

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

    if -1.9e19 < y < 4.4000000000000002e-26

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

Alternative 12: 38.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;z \leq 2.85 \cdot 10^{-114}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 24:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.50000000000000035e61 or 24 < z

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

    if -8.50000000000000035e61 < z < 2.8499999999999999e-114

    1. Initial program 100.0%

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

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

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

    if 2.8499999999999999e-114 < z < 24

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+61}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 2.85 \cdot 10^{-114}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 24:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]

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. Final simplification100.0%

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

Alternative 14: 36.4% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;y \leq 1.85 \cdot 10^{-38}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.5e-109 or 1.85e-38 < y

    1. Initial program 100.0%

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

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

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

    if -3.5e-109 < y < 1.85e-38

    1. Initial program 99.9%

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

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

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

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

Alternative 15: 17.6% 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 65.3%

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification14.2%

    \[\leadsto x \]

Developer target: 96.6% 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 2023274 
(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))))