Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 9.2s
Alternatives: 13
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 13 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: 68.8% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;y \leq -2.5 \cdot 10^{-83}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;y \leq 1.08 \cdot 10^{+40}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.4e6 or 1.08000000000000001e40 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

    if -1.4e6 < y < -2.5e-83 or -1.0499999999999999e-301 < y < 1.08000000000000001e40

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if -2.5e-83 < y < -1.0499999999999999e-301

    1. Initial program 99.9%

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{x \cdot z} \]
    6. Step-by-step derivation
      1. *-commutative81.9%

        \[\leadsto x + \color{blue}{z \cdot x} \]
    7. Simplified81.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1400000:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{-83}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq -1.05 \cdot 10^{-301}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;y \leq 1.08 \cdot 10^{+40}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 3: 74.8% accurate, 0.7× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.89999999999999979e24 or 2.15e30 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if -2.89999999999999979e24 < z < -1.02000000000000003e-8

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if -1.02000000000000003e-8 < z < 3.00000000000000011e-45

    1. Initial program 100.0%

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

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

    if 3.00000000000000011e-45 < z < 2.15e30

    1. Initial program 100.0%

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

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

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

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

      \[\leadsto x + \color{blue}{\left(\left(t - x\right) \cdot y + \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Step-by-step derivation
      1. distribute-rgt-neg-out100.0%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+24}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-8}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-45}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{+30}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]

Alternative 4: 38.2% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;y \leq -2.65 \cdot 10^{-99}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -1.04 \cdot 10^{-302}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 3.9 \cdot 10^{+74}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.17999999999999997e-32 or 3.90000000000000008e74 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.17999999999999997e-32 < y < -2.6500000000000002e-99 or -1.04000000000000002e-302 < y < 3.90000000000000008e74

    1. Initial program 100.0%

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

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

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

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

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

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

    if -2.6500000000000002e-99 < y < -1.04000000000000002e-302

    1. Initial program 99.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.18 \cdot 10^{-32}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq -2.65 \cdot 10^{-99}:\\ \;\;\;\;-z \cdot t\\ \mathbf{elif}\;y \leq -1.04 \cdot 10^{-302}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{+74}:\\ \;\;\;\;-z \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \end{array} \]

Alternative 5: 68.1% accurate, 0.8× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.59999999999999983e24 or 2.05000000000000003e30 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if -3.59999999999999983e24 < z < -5.6000000000000001e-110

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if -5.6000000000000001e-110 < z < 2.05000000000000003e30

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{+24}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -5.6 \cdot 10^{-110}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+30}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]

Alternative 6: 82.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{-54} \lor \neg \left(t \leq 46\right):\\
\;\;\;\;x + t \cdot \left(y - z\right)\\

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


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

    1. Initial program 100.0%

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

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

    if -6.79999999999999975e-54 < t < 46

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto x + x \cdot \left(0 - \color{blue}{\left(\left(-z\right) + y\right)}\right) \]
      6. associate--r+83.9%

        \[\leadsto x + x \cdot \color{blue}{\left(\left(0 - \left(-z\right)\right) - y\right)} \]
      7. neg-sub083.9%

        \[\leadsto x + x \cdot \left(\color{blue}{\left(-\left(-z\right)\right)} - y\right) \]
      8. remove-double-neg83.9%

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

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

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

Alternative 7: 84.3% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.30000000000000023e-17 or 2.29999999999999994e40 < y

    1. Initial program 99.9%

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

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

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

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

    if -4.30000000000000023e-17 < y < 2.29999999999999994e40

    1. Initial program 100.0%

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

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

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

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

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

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

Alternative 8: 54.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{-91} \lor \neg \left(t \leq 4.3 \cdot 10^{-74}\right):\\
\;\;\;\;t \cdot \left(y - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.20000000000000028e-91 or 4.29999999999999972e-74 < t

    1. Initial program 100.0%

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

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

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

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

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

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

    if -5.20000000000000028e-91 < t < 4.29999999999999972e-74

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 62.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-55} \lor \neg \left(t \leq 3 \cdot 10^{+26}\right):\\
\;\;\;\;t \cdot \left(y - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.4999999999999999e-55 or 2.99999999999999997e26 < t

    1. Initial program 100.0%

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

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

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

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

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

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

    if -5.4999999999999999e-55 < t < 2.99999999999999997e26

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 100.0% accurate, 1.0× speedup?

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

\\
x + \left(t - x\right) \cdot \left(y - z\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(t - x\right) \cdot \left(y - z\right) \]

Alternative 11: 37.1% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.19999999999999967e-6 or 3.29999999999999988e34 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.19999999999999967e-6 < y < 3.29999999999999988e34

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{-6} \lor \neg \left(y \leq 3.3 \cdot 10^{+34}\right):\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 12: 37.3% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.74999999999999997e-53 or 1.61999999999999995e-6 < y

    1. Initial program 100.0%

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

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

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

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

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

    if -1.74999999999999997e-53 < y < 1.61999999999999995e-6

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{-53} \lor \neg \left(y \leq 1.62 \cdot 10^{-6}\right):\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 13: 17.9% accurate, 9.0× speedup?

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

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

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

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

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

    \[\leadsto x \]

Developer target: 96.3% accurate, 0.6× speedup?

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

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

Reproduce

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