Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 8.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. Final simplification100.0%

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

Alternative 2: 52.3% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;y - z \leq -5 \cdot 10^{+152}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y - z \leq -0.05:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y - z \leq 4 \cdot 10^{+98} \lor \neg \left(y - z \leq 10^{+158}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 y z) < -9.9999999999999997e223 or -5e152 < (-.f64 y z) < -0.050000000000000003 or 2.0000000000000001e-13 < (-.f64 y z) < 3.99999999999999999e98 or 9.99999999999999953e157 < (-.f64 y z)

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -9.9999999999999997e223 < (-.f64 y z) < -5e152 or 3.99999999999999999e98 < (-.f64 y z) < 9.99999999999999953e157

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.050000000000000003 < (-.f64 y z) < 2.0000000000000001e-13

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y - z \leq -1 \cdot 10^{+224}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y - z \leq -5 \cdot 10^{+152}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y - z \leq -0.05:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y - z \leq 2 \cdot 10^{-13}:\\ \;\;\;\;x\\ \mathbf{elif}\;y - z \leq 4 \cdot 10^{+98} \lor \neg \left(y - z \leq 10^{+158}\right):\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \end{array} \]

Alternative 3: 74.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot t\\ t_2 := x \cdot \left(\left(z + 1\right) - y\right)\\ \mathbf{if}\;x \leq -4.9 \cdot 10^{-18}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{-92}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-149}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 7.6 \cdot 10^{-39}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{-5} \lor \neg \left(x \leq 1.85 \cdot 10^{+32}\right):\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- y z) t)) (t_2 (* x (- (+ z 1.0) y))))
   (if (<= x -4.9e-18)
     t_2
     (if (<= x -1.9e-92)
       t_1
       (if (<= x -4.8e-149)
         t_2
         (if (<= x 7.6e-39)
           t_1
           (if (or (<= x 6.5e-5) (not (<= x 1.85e+32)))
             t_2
             (- x (* z t)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * t;
	double t_2 = x * ((z + 1.0) - y);
	double tmp;
	if (x <= -4.9e-18) {
		tmp = t_2;
	} else if (x <= -1.9e-92) {
		tmp = t_1;
	} else if (x <= -4.8e-149) {
		tmp = t_2;
	} else if (x <= 7.6e-39) {
		tmp = t_1;
	} else if ((x <= 6.5e-5) || !(x <= 1.85e+32)) {
		tmp = t_2;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (y - z) * t
    t_2 = x * ((z + 1.0d0) - y)
    if (x <= (-4.9d-18)) then
        tmp = t_2
    else if (x <= (-1.9d-92)) then
        tmp = t_1
    else if (x <= (-4.8d-149)) then
        tmp = t_2
    else if (x <= 7.6d-39) then
        tmp = t_1
    else if ((x <= 6.5d-5) .or. (.not. (x <= 1.85d+32))) then
        tmp = t_2
    else
        tmp = x - (z * t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * t;
	double t_2 = x * ((z + 1.0) - y);
	double tmp;
	if (x <= -4.9e-18) {
		tmp = t_2;
	} else if (x <= -1.9e-92) {
		tmp = t_1;
	} else if (x <= -4.8e-149) {
		tmp = t_2;
	} else if (x <= 7.6e-39) {
		tmp = t_1;
	} else if ((x <= 6.5e-5) || !(x <= 1.85e+32)) {
		tmp = t_2;
	} else {
		tmp = x - (z * t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y - z) * t
	t_2 = x * ((z + 1.0) - y)
	tmp = 0
	if x <= -4.9e-18:
		tmp = t_2
	elif x <= -1.9e-92:
		tmp = t_1
	elif x <= -4.8e-149:
		tmp = t_2
	elif x <= 7.6e-39:
		tmp = t_1
	elif (x <= 6.5e-5) or not (x <= 1.85e+32):
		tmp = t_2
	else:
		tmp = x - (z * t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y - z) * t)
	t_2 = Float64(x * Float64(Float64(z + 1.0) - y))
	tmp = 0.0
	if (x <= -4.9e-18)
		tmp = t_2;
	elseif (x <= -1.9e-92)
		tmp = t_1;
	elseif (x <= -4.8e-149)
		tmp = t_2;
	elseif (x <= 7.6e-39)
		tmp = t_1;
	elseif ((x <= 6.5e-5) || !(x <= 1.85e+32))
		tmp = t_2;
	else
		tmp = Float64(x - Float64(z * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y - z) * t;
	t_2 = x * ((z + 1.0) - y);
	tmp = 0.0;
	if (x <= -4.9e-18)
		tmp = t_2;
	elseif (x <= -1.9e-92)
		tmp = t_1;
	elseif (x <= -4.8e-149)
		tmp = t_2;
	elseif (x <= 7.6e-39)
		tmp = t_1;
	elseif ((x <= 6.5e-5) || ~((x <= 1.85e+32)))
		tmp = t_2;
	else
		tmp = x - (z * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(z + 1.0), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.9e-18], t$95$2, If[LessEqual[x, -1.9e-92], t$95$1, If[LessEqual[x, -4.8e-149], t$95$2, If[LessEqual[x, 7.6e-39], t$95$1, If[Or[LessEqual[x, 6.5e-5], N[Not[LessEqual[x, 1.85e+32]], $MachinePrecision]], t$95$2, N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -1.9 \cdot 10^{-92}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -4.8 \cdot 10^{-149}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 7.6 \cdot 10^{-39}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 6.5 \cdot 10^{-5} \lor \neg \left(x \leq 1.85 \cdot 10^{+32}\right):\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.9000000000000001e-18 or -1.9e-92 < x < -4.8000000000000002e-149 or 7.6000000000000004e-39 < x < 6.49999999999999943e-5 or 1.85e32 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if -4.9000000000000001e-18 < x < -1.9e-92 or -4.8000000000000002e-149 < x < 7.6000000000000004e-39

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if 6.49999999999999943e-5 < x < 1.85e32

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \color{blue}{x - t \cdot z} \]
      4. *-commutative76.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.9 \cdot 10^{-18}:\\ \;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{-92}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-149}:\\ \;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\ \mathbf{elif}\;x \leq 7.6 \cdot 10^{-39}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{-5} \lor \neg \left(x \leq 1.85 \cdot 10^{+32}\right):\\ \;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot t\\ \end{array} \]

Alternative 4: 60.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(z + 1\right)\\ t_2 := \left(y - z\right) \cdot t\\ \mathbf{if}\;x \leq -1.6 \cdot 10^{+21}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4.5 \cdot 10^{-103}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-149}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{+36}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{+148} \lor \neg \left(x \leq 5.1 \cdot 10^{+156}\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))) (t_2 (* (- y z) t)))
   (if (<= x -1.6e+21)
     t_1
     (if (<= x -4.5e-103)
       t_2
       (if (<= x -4.8e-149)
         t_1
         (if (<= x 3.8e+36)
           t_2
           (if (or (<= x 4.1e+148) (not (<= x 5.1e+156)))
             t_1
             (* y (- x)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (z + 1.0);
	double t_2 = (y - z) * t;
	double tmp;
	if (x <= -1.6e+21) {
		tmp = t_1;
	} else if (x <= -4.5e-103) {
		tmp = t_2;
	} else if (x <= -4.8e-149) {
		tmp = t_1;
	} else if (x <= 3.8e+36) {
		tmp = t_2;
	} else if ((x <= 4.1e+148) || !(x <= 5.1e+156)) {
		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) :: t_2
    real(8) :: tmp
    t_1 = x * (z + 1.0d0)
    t_2 = (y - z) * t
    if (x <= (-1.6d+21)) then
        tmp = t_1
    else if (x <= (-4.5d-103)) then
        tmp = t_2
    else if (x <= (-4.8d-149)) then
        tmp = t_1
    else if (x <= 3.8d+36) then
        tmp = t_2
    else if ((x <= 4.1d+148) .or. (.not. (x <= 5.1d+156))) 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 t_2 = (y - z) * t;
	double tmp;
	if (x <= -1.6e+21) {
		tmp = t_1;
	} else if (x <= -4.5e-103) {
		tmp = t_2;
	} else if (x <= -4.8e-149) {
		tmp = t_1;
	} else if (x <= 3.8e+36) {
		tmp = t_2;
	} else if ((x <= 4.1e+148) || !(x <= 5.1e+156)) {
		tmp = t_1;
	} else {
		tmp = y * -x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (z + 1.0)
	t_2 = (y - z) * t
	tmp = 0
	if x <= -1.6e+21:
		tmp = t_1
	elif x <= -4.5e-103:
		tmp = t_2
	elif x <= -4.8e-149:
		tmp = t_1
	elif x <= 3.8e+36:
		tmp = t_2
	elif (x <= 4.1e+148) or not (x <= 5.1e+156):
		tmp = t_1
	else:
		tmp = y * -x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(z + 1.0))
	t_2 = Float64(Float64(y - z) * t)
	tmp = 0.0
	if (x <= -1.6e+21)
		tmp = t_1;
	elseif (x <= -4.5e-103)
		tmp = t_2;
	elseif (x <= -4.8e-149)
		tmp = t_1;
	elseif (x <= 3.8e+36)
		tmp = t_2;
	elseif ((x <= 4.1e+148) || !(x <= 5.1e+156))
		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);
	t_2 = (y - z) * t;
	tmp = 0.0;
	if (x <= -1.6e+21)
		tmp = t_1;
	elseif (x <= -4.5e-103)
		tmp = t_2;
	elseif (x <= -4.8e-149)
		tmp = t_1;
	elseif (x <= 3.8e+36)
		tmp = t_2;
	elseif ((x <= 4.1e+148) || ~((x <= 5.1e+156)))
		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]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[x, -1.6e+21], t$95$1, If[LessEqual[x, -4.5e-103], t$95$2, If[LessEqual[x, -4.8e-149], t$95$1, If[LessEqual[x, 3.8e+36], t$95$2, If[Or[LessEqual[x, 4.1e+148], N[Not[LessEqual[x, 5.1e+156]], $MachinePrecision]], t$95$1, N[(y * (-x)), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -4.5 \cdot 10^{-103}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq -4.8 \cdot 10^{-149}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 3.8 \cdot 10^{+36}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 4.1 \cdot 10^{+148} \lor \neg \left(x \leq 5.1 \cdot 10^{+156}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.6e21 or -4.5e-103 < x < -4.8000000000000002e-149 or 3.80000000000000025e36 < x < 4.0999999999999998e148 or 5.10000000000000014e156 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -1.6e21 < x < -4.5e-103 or -4.8000000000000002e-149 < x < 3.80000000000000025e36

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if 4.0999999999999998e148 < x < 5.10000000000000014e156

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.6 \cdot 10^{+21}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;x \leq -4.5 \cdot 10^{-103}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-149}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{+36}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{+148} \lor \neg \left(x \leq 5.1 \cdot 10^{+156}\right):\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \end{array} \]

Alternative 5: 37.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ \mathbf{if}\;z \leq -6.6 \cdot 10^{+284}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.08 \cdot 10^{+98}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{-34}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{+54}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))))
   (if (<= z -6.6e+284)
     t_1
     (if (<= z -1.08e+98)
       (* z x)
       (if (<= z -5.8e-34)
         t_1
         (if (<= z 8.5e-27) x (if (<= z 1.65e+54) (* y t) (* z x))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (z <= -6.6e+284) {
		tmp = t_1;
	} else if (z <= -1.08e+98) {
		tmp = z * x;
	} else if (z <= -5.8e-34) {
		tmp = t_1;
	} else if (z <= 8.5e-27) {
		tmp = x;
	} else if (z <= 1.65e+54) {
		tmp = y * t;
	} else {
		tmp = z * x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * -t
    if (z <= (-6.6d+284)) then
        tmp = t_1
    else if (z <= (-1.08d+98)) then
        tmp = z * x
    else if (z <= (-5.8d-34)) then
        tmp = t_1
    else if (z <= 8.5d-27) then
        tmp = x
    else if (z <= 1.65d+54) then
        tmp = y * t
    else
        tmp = z * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (z <= -6.6e+284) {
		tmp = t_1;
	} else if (z <= -1.08e+98) {
		tmp = z * x;
	} else if (z <= -5.8e-34) {
		tmp = t_1;
	} else if (z <= 8.5e-27) {
		tmp = x;
	} else if (z <= 1.65e+54) {
		tmp = y * t;
	} else {
		tmp = z * x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	tmp = 0
	if z <= -6.6e+284:
		tmp = t_1
	elif z <= -1.08e+98:
		tmp = z * x
	elif z <= -5.8e-34:
		tmp = t_1
	elif z <= 8.5e-27:
		tmp = x
	elif z <= 1.65e+54:
		tmp = y * t
	else:
		tmp = z * x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	tmp = 0.0
	if (z <= -6.6e+284)
		tmp = t_1;
	elseif (z <= -1.08e+98)
		tmp = Float64(z * x);
	elseif (z <= -5.8e-34)
		tmp = t_1;
	elseif (z <= 8.5e-27)
		tmp = x;
	elseif (z <= 1.65e+54)
		tmp = Float64(y * t);
	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 <= -6.6e+284)
		tmp = t_1;
	elseif (z <= -1.08e+98)
		tmp = z * x;
	elseif (z <= -5.8e-34)
		tmp = t_1;
	elseif (z <= 8.5e-27)
		tmp = x;
	elseif (z <= 1.65e+54)
		tmp = y * t;
	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, -6.6e+284], t$95$1, If[LessEqual[z, -1.08e+98], N[(z * x), $MachinePrecision], If[LessEqual[z, -5.8e-34], t$95$1, If[LessEqual[z, 8.5e-27], x, If[LessEqual[z, 1.65e+54], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.08 \cdot 10^{+98}:\\
\;\;\;\;z \cdot x\\

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

\mathbf{elif}\;z \leq 8.5 \cdot 10^{-27}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.65 \cdot 10^{+54}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -6.5999999999999995e284 or -1.07999999999999997e98 < z < -5.8000000000000004e-34

    1. Initial program 99.9%

      \[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 z around inf 64.0%

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

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

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

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

    if -6.5999999999999995e284 < z < -1.07999999999999997e98 or 1.65e54 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if -5.8000000000000004e-34 < z < 8.50000000000000033e-27

    1. Initial program 100.0%

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

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

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

    if 8.50000000000000033e-27 < z < 1.65e54

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{+284}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -1.08 \cdot 10^{+98}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{-34}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{+54}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]

Alternative 6: 55.6% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -4.5 \cdot 10^{-34}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 2.6 \cdot 10^{-27}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 3.8 \cdot 10^{+64}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.4999999999999993e97 or 3.8000000000000001e64 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -8.4999999999999993e97 < z < -4.50000000000000042e-34 or 2.60000000000000017e-27 < z < 3.8000000000000001e64

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if -4.50000000000000042e-34 < z < 2.60000000000000017e-27

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+97}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-34}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+64}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]

Alternative 7: 67.5% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -1 \cdot 10^{-33}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq 8.2 \cdot 10^{+69}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.4999999999999993e97 or 8.1999999999999998e69 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -8.4999999999999993e97 < z < -1.0000000000000001e-33 or 1.99999999999999992e-23 < z < 8.1999999999999998e69

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if -1.0000000000000001e-33 < z < 1.99999999999999992e-23

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+97}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-33}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-23}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{+69}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]

Alternative 8: 67.5% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -3 \cdot 10^{-34}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 6 \cdot 10^{-25}:\\
\;\;\;\;x - y \cdot x\\

\mathbf{elif}\;z \leq 4.8 \cdot 10^{+69}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.4999999999999993e97 or 4.8000000000000003e69 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -8.4999999999999993e97 < z < -3e-34 or 5.9999999999999995e-25 < z < 4.8000000000000003e69

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if -3e-34 < z < 5.9999999999999995e-25

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+97}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-34}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-25}:\\ \;\;\;\;x - y \cdot x\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{+69}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]

Alternative 9: 36.5% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq -57000000000:\\
\;\;\;\;y \cdot t\\

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

\mathbf{elif}\;z \leq 4 \cdot 10^{+55}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.30000000000000008e103 or 4.00000000000000004e55 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if -2.30000000000000008e103 < z < -5.7e10 or 5.20000000000000034e-27 < z < 4.00000000000000004e55

    1. Initial program 99.9%

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

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

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

    if -5.7e10 < z < 5.20000000000000034e-27

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{+103}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -57000000000:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4 \cdot 10^{+55}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]

Alternative 10: 81.3% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.7e12 or 2.35e55 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if -6.7e12 < x < 2.35e55

    1. Initial program 100.0%

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

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

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

Alternative 11: 81.2% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.85e11

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if -1.85e11 < x < 1.45e60

    1. Initial program 100.0%

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

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

    if 1.45e60 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -185000000000:\\ \;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{+60}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + x \cdot \left(z - y\right)\\ \end{array} \]

Alternative 12: 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 13: 37.9% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{+23}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq 9 \cdot 10^{-6}:\\
\;\;\;\;x\\

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


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

    1. Initial program 100.0%

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

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

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

    if -4.49999999999999979e23 < y < 9.00000000000000023e-6

    1. Initial program 99.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{+23}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 9 \cdot 10^{-6}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]

Alternative 14: 18.5% 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 64.4%

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification22.3%

    \[\leadsto x \]

Developer target: 96.5% accurate, 0.6× speedup?

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

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

Reproduce

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