Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 7.8s
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: 56.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ t_2 := z \cdot \left(-t\right)\\ \mathbf{if}\;y \leq -0.00032:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-169}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{-283}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-169}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 7.7 \cdot 10^{-128}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-6}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (- t x))) (t_2 (* z (- t))))
   (if (<= y -0.00032)
     t_1
     (if (<= y -3.8e-169)
       t_2
       (if (<= y -7.5e-283)
         x
         (if (<= y 4e-169)
           t_2
           (if (<= y 7.7e-128) x (if (<= y 1.65e-6) (* z x) t_1))))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double t_2 = z * -t;
	double tmp;
	if (y <= -0.00032) {
		tmp = t_1;
	} else if (y <= -3.8e-169) {
		tmp = t_2;
	} else if (y <= -7.5e-283) {
		tmp = x;
	} else if (y <= 4e-169) {
		tmp = t_2;
	} else if (y <= 7.7e-128) {
		tmp = x;
	} else if (y <= 1.65e-6) {
		tmp = z * x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = y * (t - x)
    t_2 = z * -t
    if (y <= (-0.00032d0)) then
        tmp = t_1
    else if (y <= (-3.8d-169)) then
        tmp = t_2
    else if (y <= (-7.5d-283)) then
        tmp = x
    else if (y <= 4d-169) then
        tmp = t_2
    else if (y <= 7.7d-128) then
        tmp = x
    else if (y <= 1.65d-6) then
        tmp = z * x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double t_2 = z * -t;
	double tmp;
	if (y <= -0.00032) {
		tmp = t_1;
	} else if (y <= -3.8e-169) {
		tmp = t_2;
	} else if (y <= -7.5e-283) {
		tmp = x;
	} else if (y <= 4e-169) {
		tmp = t_2;
	} else if (y <= 7.7e-128) {
		tmp = x;
	} else if (y <= 1.65e-6) {
		tmp = z * x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (t - x)
	t_2 = z * -t
	tmp = 0
	if y <= -0.00032:
		tmp = t_1
	elif y <= -3.8e-169:
		tmp = t_2
	elif y <= -7.5e-283:
		tmp = x
	elif y <= 4e-169:
		tmp = t_2
	elif y <= 7.7e-128:
		tmp = x
	elif y <= 1.65e-6:
		tmp = z * x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(t - x))
	t_2 = Float64(z * Float64(-t))
	tmp = 0.0
	if (y <= -0.00032)
		tmp = t_1;
	elseif (y <= -3.8e-169)
		tmp = t_2;
	elseif (y <= -7.5e-283)
		tmp = x;
	elseif (y <= 4e-169)
		tmp = t_2;
	elseif (y <= 7.7e-128)
		tmp = x;
	elseif (y <= 1.65e-6)
		tmp = Float64(z * x);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (t - x);
	t_2 = z * -t;
	tmp = 0.0;
	if (y <= -0.00032)
		tmp = t_1;
	elseif (y <= -3.8e-169)
		tmp = t_2;
	elseif (y <= -7.5e-283)
		tmp = x;
	elseif (y <= 4e-169)
		tmp = t_2;
	elseif (y <= 7.7e-128)
		tmp = x;
	elseif (y <= 1.65e-6)
		tmp = z * x;
	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 * (-t)), $MachinePrecision]}, If[LessEqual[y, -0.00032], t$95$1, If[LessEqual[y, -3.8e-169], t$95$2, If[LessEqual[y, -7.5e-283], x, If[LessEqual[y, 4e-169], t$95$2, If[LessEqual[y, 7.7e-128], x, If[LessEqual[y, 1.65e-6], N[(z * x), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -3.8 \cdot 10^{-169}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -7.5 \cdot 10^{-283}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 4 \cdot 10^{-169}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 7.7 \cdot 10^{-128}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.20000000000000026e-4 or 1.65000000000000008e-6 < y

    1. Initial program 100.0%

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

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

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

    if -3.20000000000000026e-4 < y < -3.8e-169 or -7.5000000000000001e-283 < y < 4.00000000000000008e-169

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

    if -3.8e-169 < y < -7.5000000000000001e-283 or 4.00000000000000008e-169 < y < 7.7e-128

    1. Initial program 99.9%

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

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

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

    if 7.7e-128 < y < 1.65000000000000008e-6

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.00032:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-169}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{-283}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-169}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 7.7 \cdot 10^{-128}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-6}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 3: 67.9% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;y \leq -4.8 \cdot 10^{-105}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;y \leq -6.5 \cdot 10^{-285}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.12 \cdot 10^{-229}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;y \leq 1.14 \cdot 10^{-128}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.22 \cdot 10^{+76}:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -11.5 or 1.22000000000000002e76 < y

    1. Initial program 100.0%

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

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

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

    if -11.5 < y < -4.8000000000000003e-105 or -6.5e-285 < y < 1.12e-229 or 1.14e-128 < y < 1.22000000000000002e76

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -4.8000000000000003e-105 < y < -6.5e-285 or 1.12e-229 < y < 1.14e-128

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(1 + \left(-\color{blue}{\left(-z\right)}\right)\right) \]
      4. remove-double-neg71.5%

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

        \[\leadsto \color{blue}{1 \cdot x + z \cdot x} \]
      6. *-lft-identity71.5%

        \[\leadsto \color{blue}{x} + z \cdot x \]
    7. Simplified71.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -11.5:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{-105}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-285}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;y \leq 1.12 \cdot 10^{-229}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 1.14 \cdot 10^{-128}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;y \leq 1.22 \cdot 10^{+76}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 4: 37.3% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq -3.6 \cdot 10^{-169}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -2.6 \cdot 10^{-285}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.45 \cdot 10^{-168}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.6 \cdot 10^{-127}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 8.5 \cdot 10^{+88}:\\
\;\;\;\;z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -0.0025999999999999999 or 8.5000000000000005e88 < y

    1. Initial program 100.0%

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

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

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

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

    if -0.0025999999999999999 < y < -3.60000000000000001e-169 or -2.6000000000000002e-285 < y < 1.4499999999999999e-168

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

    if -3.60000000000000001e-169 < y < -2.6000000000000002e-285 or 1.4499999999999999e-168 < y < 2.59999999999999991e-127

    1. Initial program 99.9%

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

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

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

    if 2.59999999999999991e-127 < y < 8.5000000000000005e88

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.0026:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -3.6 \cdot 10^{-169}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq -2.6 \cdot 10^{-285}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{-168}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-127}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+88}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]

Alternative 5: 35.1% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;y \leq -5 \cdot 10^{-284}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;y \leq 1.2 \cdot 10^{-128}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.8 \cdot 10^{+92}:\\
\;\;\;\;z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.05e18 or 1.8e92 < y

    1. Initial program 100.0%

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

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

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

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

    if -1.05e18 < y < -4.99999999999999973e-284 or 1.7000000000000001e-187 < y < 1.1999999999999999e-128

    1. Initial program 99.9%

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

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

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

    if -4.99999999999999973e-284 < y < 1.7000000000000001e-187 or 1.1999999999999999e-128 < y < 1.8e92

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.05 \cdot 10^{+18}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -5 \cdot 10^{-284}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-187}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{-128}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{+92}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]

Alternative 6: 65.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 -12:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{-170}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.95 \cdot 10^{-283}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{+77}:\\ \;\;\;\;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 -12.0)
     t_1
     (if (<= y -9.5e-170)
       t_2
       (if (<= y -1.95e-283) x (if (<= y 2.05e+77) 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 <= -12.0) {
		tmp = t_1;
	} else if (y <= -9.5e-170) {
		tmp = t_2;
	} else if (y <= -1.95e-283) {
		tmp = x;
	} else if (y <= 2.05e+77) {
		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 <= (-12.0d0)) then
        tmp = t_1
    else if (y <= (-9.5d-170)) then
        tmp = t_2
    else if (y <= (-1.95d-283)) then
        tmp = x
    else if (y <= 2.05d+77) 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 <= -12.0) {
		tmp = t_1;
	} else if (y <= -9.5e-170) {
		tmp = t_2;
	} else if (y <= -1.95e-283) {
		tmp = x;
	} else if (y <= 2.05e+77) {
		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 <= -12.0:
		tmp = t_1
	elif y <= -9.5e-170:
		tmp = t_2
	elif y <= -1.95e-283:
		tmp = x
	elif y <= 2.05e+77:
		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 <= -12.0)
		tmp = t_1;
	elseif (y <= -9.5e-170)
		tmp = t_2;
	elseif (y <= -1.95e-283)
		tmp = x;
	elseif (y <= 2.05e+77)
		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 <= -12.0)
		tmp = t_1;
	elseif (y <= -9.5e-170)
		tmp = t_2;
	elseif (y <= -1.95e-283)
		tmp = x;
	elseif (y <= 2.05e+77)
		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, -12.0], t$95$1, If[LessEqual[y, -9.5e-170], t$95$2, If[LessEqual[y, -1.95e-283], x, If[LessEqual[y, 2.05e+77], 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 -12:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -9.5 \cdot 10^{-170}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -1.95 \cdot 10^{-283}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 2.05 \cdot 10^{+77}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -12 or 2.05e77 < y

    1. Initial program 100.0%

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

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

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

    if -12 < y < -9.5000000000000001e-170 or -1.9500000000000001e-283 < y < 2.05e77

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -9.5000000000000001e-170 < y < -1.9500000000000001e-283

    1. Initial program 99.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -12:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{-170}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq -1.95 \cdot 10^{-283}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{+77}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 7: 83.9% accurate, 0.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -10.5 or 3.79999999999999997e80 < y

    1. Initial program 100.0%

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

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

    if -10.5 < y < 6.99999999999999961e-10

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if 6.99999999999999961e-10 < y < 3.79999999999999997e80

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -10.5:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-10}:\\ \;\;\;\;x - z \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{+80}:\\ \;\;\;\;x + x \cdot \left(z - y\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 8: 77.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -75000000000000 \lor \neg \left(z \leq 5.6 \cdot 10^{+42}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.5e13 or 5.5999999999999999e42 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -7.5e13 < z < 5.5999999999999999e42

    1. Initial program 100.0%

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

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

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

Alternative 9: 83.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00029 \lor \neg \left(z \leq 9.8 \cdot 10^{+95}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.9e-4 or 9.7999999999999998e95 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -2.9e-4 < z < 9.7999999999999998e95

    1. Initial program 100.0%

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

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

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

Alternative 10: 72.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-5} \lor \neg \left(z \leq 0.0136\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.8e-5 or 0.0135999999999999992 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -5.8e-5 < z < 0.0135999999999999992

    1. Initial program 99.9%

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

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

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

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

Alternative 11: 100.0% accurate, 1.0× speedup?

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

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

Alternative 12: 36.0% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;y \leq 2.35 \cdot 10^{-91}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.05e18 or 2.35000000000000003e-91 < y

    1. Initial program 100.0%

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

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

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

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

    if -1.05e18 < y < 2.35000000000000003e-91

    1. Initial program 99.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.05 \cdot 10^{+18}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 2.35 \cdot 10^{-91}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \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 64.7%

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

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

    \[\leadsto x \]

Developer target: 96.1% 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 2023207 
(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))))