Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 8.9s
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, 1.0× speedup?

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

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

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

Alternative 2: 71.9% accurate, 0.5× 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 -260000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-146}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{-153}:\\ \;\;\;\;\mathsf{fma}\left(z, -t, x\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+19}:\\ \;\;\;\;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 -260000000.0)
     t_1
     (if (<= y -1.9e-146)
       t_2
       (if (<= y 2.4e-153) (fma z (- t) x) (if (<= y 1.4e+19) 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 <= -260000000.0) {
		tmp = t_1;
	} else if (y <= -1.9e-146) {
		tmp = t_2;
	} else if (y <= 2.4e-153) {
		tmp = fma(z, -t, x);
	} else if (y <= 1.4e+19) {
		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 <= -260000000.0)
		tmp = t_1;
	elseif (y <= -1.9e-146)
		tmp = t_2;
	elseif (y <= 2.4e-153)
		tmp = fma(z, Float64(-t), x);
	elseif (y <= 1.4e+19)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return 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, -260000000.0], t$95$1, If[LessEqual[y, -1.9e-146], t$95$2, If[LessEqual[y, 2.4e-153], N[(z * (-t) + x), $MachinePrecision], If[LessEqual[y, 1.4e+19], 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 -260000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -1.9 \cdot 10^{-146}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 2.4 \cdot 10^{-153}:\\
\;\;\;\;\mathsf{fma}\left(z, -t, x\right)\\

\mathbf{elif}\;y \leq 1.4 \cdot 10^{+19}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.6e8 or 1.4e19 < y

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
      2. --lowering--.f6485.8

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

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

    if -2.6e8 < y < -1.89999999999999997e-146 or 2.4000000000000002e-153 < y < 1.4e19

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{\mathsf{neg}\left(z \cdot \left(t - x\right)\right)} \]
      2. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{z \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)} \]
      3. mul-1-negN/A

        \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \left(t - x\right)\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \left(t - x\right)\right)} \]
      5. mul-1-negN/A

        \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(\left(t - x\right)\right)\right)} \]
      6. sub-negN/A

        \[\leadsto z \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(x\right)\right)\right)}\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto z \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)}\right)\right) \]
      8. distribute-neg-inN/A

        \[\leadsto z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) + \left(\mathsf{neg}\left(t\right)\right)\right)} \]
      9. unsub-negN/A

        \[\leadsto z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) - t\right)} \]
      10. remove-double-negN/A

        \[\leadsto z \cdot \left(\color{blue}{x} - t\right) \]
      11. --lowering--.f6471.5

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

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

    if -1.89999999999999997e-146 < y < 2.4000000000000002e-153

    1. Initial program 100.0%

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

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

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

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(t - x\right)\right)\right)} + x \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{z \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)} + x \]
      4. mul-1-negN/A

        \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \left(t - x\right)\right)} + x \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, -1 \cdot \left(t - x\right), x\right)} \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{neg}\left(\left(t - x\right)\right)}, x\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(x\right)\right)\right)}\right), x\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, \mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)}\right), x\right) \]
      9. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) + \left(\mathsf{neg}\left(t\right)\right)}, x\right) \]
      10. unsub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) - t}, x\right) \]
      11. remove-double-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{x} - t, x\right) \]
      12. --lowering--.f6497.1

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

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

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{-1 \cdot t}, x\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{neg}\left(t\right)}, x\right) \]
      2. neg-lowering-neg.f6479.7

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{-t}, x\right) \]
    8. Simplified79.7%

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{-t}, x\right) \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 65.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ t_2 := \left(y - z\right) \cdot t\\ \mathbf{if}\;y \leq -7.2 \cdot 10^{+47}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -4.6 \cdot 10^{-258}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{-28}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+19}:\\ \;\;\;\;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 (* (- y z) t)))
   (if (<= y -7.2e+47)
     t_1
     (if (<= y -4.6e-258)
       t_2
       (if (<= y 1.95e-28) (fma z x x) (if (<= y 1.6e+19) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double t_2 = (y - z) * t;
	double tmp;
	if (y <= -7.2e+47) {
		tmp = t_1;
	} else if (y <= -4.6e-258) {
		tmp = t_2;
	} else if (y <= 1.95e-28) {
		tmp = fma(z, x, x);
	} else if (y <= 1.6e+19) {
		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(Float64(y - z) * t)
	tmp = 0.0
	if (y <= -7.2e+47)
		tmp = t_1;
	elseif (y <= -4.6e-258)
		tmp = t_2;
	elseif (y <= 1.95e-28)
		tmp = fma(z, x, x);
	elseif (y <= 1.6e+19)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[y, -7.2e+47], t$95$1, If[LessEqual[y, -4.6e-258], t$95$2, If[LessEqual[y, 1.95e-28], N[(z * x + x), $MachinePrecision], If[LessEqual[y, 1.6e+19], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -4.6 \cdot 10^{-258}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 1.95 \cdot 10^{-28}:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\

\mathbf{elif}\;y \leq 1.6 \cdot 10^{+19}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.20000000000000015e47 or 1.6e19 < y

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
      2. --lowering--.f6487.3

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

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

    if -7.20000000000000015e47 < y < -4.59999999999999986e-258 or 1.94999999999999999e-28 < y < 1.6e19

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

    if -4.59999999999999986e-258 < y < 1.94999999999999999e-28

    1. Initial program 99.9%

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

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

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

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(t - x\right)\right)\right)} + x \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{z \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)} + x \]
      4. mul-1-negN/A

        \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \left(t - x\right)\right)} + x \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, -1 \cdot \left(t - x\right), x\right)} \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{neg}\left(\left(t - x\right)\right)}, x\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(x\right)\right)\right)}\right), x\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, \mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)}\right), x\right) \]
      9. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) + \left(\mathsf{neg}\left(t\right)\right)}, x\right) \]
      10. unsub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) - t}, x\right) \]
      11. remove-double-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{x} - t, x\right) \]
      12. --lowering--.f6493.7

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

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

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{x}, x\right) \]
    7. Step-by-step derivation
      1. Simplified64.4%

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{x}, x\right) \]
    8. Recombined 3 regimes into one program.
    9. Final simplification75.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+47}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -4.6 \cdot 10^{-258}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{-28}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+19}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
    10. Add Preprocessing

    Alternative 4: 59.6% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot t\\ \mathbf{if}\;t \leq -6.5 \cdot 10^{-21}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -2.5 \cdot 10^{-267}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-62}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* (- y z) t)))
       (if (<= t -6.5e-21)
         t_1
         (if (<= t -2.5e-267) (* x (- y)) (if (<= t 5.5e-62) (fma z x x) t_1)))))
    double code(double x, double y, double z, double t) {
    	double t_1 = (y - z) * t;
    	double tmp;
    	if (t <= -6.5e-21) {
    		tmp = t_1;
    	} else if (t <= -2.5e-267) {
    		tmp = x * -y;
    	} else if (t <= 5.5e-62) {
    		tmp = fma(z, x, x);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = Float64(Float64(y - z) * t)
    	tmp = 0.0
    	if (t <= -6.5e-21)
    		tmp = t_1;
    	elseif (t <= -2.5e-267)
    		tmp = Float64(x * Float64(-y));
    	elseif (t <= 5.5e-62)
    		tmp = fma(z, x, x);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -6.5e-21], t$95$1, If[LessEqual[t, -2.5e-267], N[(x * (-y)), $MachinePrecision], If[LessEqual[t, 5.5e-62], N[(z * x + x), $MachinePrecision], t$95$1]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(y - z\right) \cdot t\\
    \mathbf{if}\;t \leq -6.5 \cdot 10^{-21}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t \leq -2.5 \cdot 10^{-267}:\\
    \;\;\;\;x \cdot \left(-y\right)\\
    
    \mathbf{elif}\;t \leq 5.5 \cdot 10^{-62}:\\
    \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if t < -6.49999999999999987e-21 or 5.50000000000000022e-62 < t

      1. Initial program 100.0%

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

        \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
      4. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
        2. --lowering--.f6478.1

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

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

      if -6.49999999999999987e-21 < t < -2.5e-267

      1. Initial program 100.0%

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

        \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
      4. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
        2. --lowering--.f6459.6

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

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

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

          \[\leadsto y \cdot \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
        2. neg-lowering-neg.f6448.7

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

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

      if -2.5e-267 < t < 5.50000000000000022e-62

      1. Initial program 99.9%

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

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

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

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(t - x\right)\right)\right)} + x \]
        3. distribute-rgt-neg-inN/A

          \[\leadsto \color{blue}{z \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)} + x \]
        4. mul-1-negN/A

          \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \left(t - x\right)\right)} + x \]
        5. accelerator-lowering-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(z, -1 \cdot \left(t - x\right), x\right)} \]
        6. mul-1-negN/A

          \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{neg}\left(\left(t - x\right)\right)}, x\right) \]
        7. sub-negN/A

          \[\leadsto \mathsf{fma}\left(z, \mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(x\right)\right)\right)}\right), x\right) \]
        8. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(z, \mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)}\right), x\right) \]
        9. distribute-neg-inN/A

          \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) + \left(\mathsf{neg}\left(t\right)\right)}, x\right) \]
        10. unsub-negN/A

          \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) - t}, x\right) \]
        11. remove-double-negN/A

          \[\leadsto \mathsf{fma}\left(z, \color{blue}{x} - t, x\right) \]
        12. --lowering--.f6461.8

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{x}, x\right) \]
      7. Step-by-step derivation
        1. Simplified55.9%

          \[\leadsto \mathsf{fma}\left(z, \color{blue}{x}, x\right) \]
      8. Recombined 3 regimes into one program.
      9. Final simplification67.9%

        \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.5 \cdot 10^{-21}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;t \leq -2.5 \cdot 10^{-267}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-62}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \]
      10. Add Preprocessing

      Alternative 5: 85.1% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -7.4 \cdot 10^{-12}:\\ \;\;\;\;\mathsf{fma}\left(y, t - x, x\right)\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+19}:\\ \;\;\;\;\mathsf{fma}\left(z, x - t, x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (<= y -7.4e-12)
         (fma y (- t x) x)
         (if (<= y 2.2e+19) (fma z (- x t) x) (* y (- t x)))))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (y <= -7.4e-12) {
      		tmp = fma(y, (t - x), x);
      	} else if (y <= 2.2e+19) {
      		tmp = fma(z, (x - t), x);
      	} else {
      		tmp = y * (t - x);
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if (y <= -7.4e-12)
      		tmp = fma(y, Float64(t - x), x);
      	elseif (y <= 2.2e+19)
      		tmp = fma(z, Float64(x - t), x);
      	else
      		tmp = Float64(y * Float64(t - x));
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := If[LessEqual[y, -7.4e-12], N[(y * N[(t - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 2.2e+19], N[(z * N[(x - t), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -7.4 \cdot 10^{-12}:\\
      \;\;\;\;\mathsf{fma}\left(y, t - x, x\right)\\
      
      \mathbf{elif}\;y \leq 2.2 \cdot 10^{+19}:\\
      \;\;\;\;\mathsf{fma}\left(z, x - t, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;y \cdot \left(t - x\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if y < -7.39999999999999997e-12

        1. Initial program 100.0%

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

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

            \[\leadsto \color{blue}{y \cdot \left(t - x\right) + x} \]
          2. accelerator-lowering-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(y, t - x, x\right)} \]
          3. --lowering--.f6484.1

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

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

        if -7.39999999999999997e-12 < y < 2.2e19

        1. Initial program 100.0%

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

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

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

            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(t - x\right)\right)\right)} + x \]
          3. distribute-rgt-neg-inN/A

            \[\leadsto \color{blue}{z \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)} + x \]
          4. mul-1-negN/A

            \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \left(t - x\right)\right)} + x \]
          5. accelerator-lowering-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(z, -1 \cdot \left(t - x\right), x\right)} \]
          6. mul-1-negN/A

            \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{neg}\left(\left(t - x\right)\right)}, x\right) \]
          7. sub-negN/A

            \[\leadsto \mathsf{fma}\left(z, \mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(x\right)\right)\right)}\right), x\right) \]
          8. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(z, \mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)}\right), x\right) \]
          9. distribute-neg-inN/A

            \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) + \left(\mathsf{neg}\left(t\right)\right)}, x\right) \]
          10. unsub-negN/A

            \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) - t}, x\right) \]
          11. remove-double-negN/A

            \[\leadsto \mathsf{fma}\left(z, \color{blue}{x} - t, x\right) \]
          12. --lowering--.f6490.6

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

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

        if 2.2e19 < y

        1. Initial program 100.0%

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

          \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
          2. --lowering--.f6486.7

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

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

      Alternative 6: 85.2% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(x - t\right)\\ \mathbf{if}\;z \leq -7800000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+29}:\\ \;\;\;\;\mathsf{fma}\left(y, t - x, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* z (- x t))))
         (if (<= z -7800000000000.0) t_1 (if (<= z 9.5e+29) (fma y (- t x) x) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = z * (x - t);
      	double tmp;
      	if (z <= -7800000000000.0) {
      		tmp = t_1;
      	} else if (z <= 9.5e+29) {
      		tmp = fma(y, (t - x), x);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	t_1 = Float64(z * Float64(x - t))
      	tmp = 0.0
      	if (z <= -7800000000000.0)
      		tmp = t_1;
      	elseif (z <= 9.5e+29)
      		tmp = fma(y, Float64(t - x), x);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7800000000000.0], t$95$1, If[LessEqual[z, 9.5e+29], N[(y * N[(t - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := z \cdot \left(x - t\right)\\
      \mathbf{if}\;z \leq -7800000000000:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 9.5 \cdot 10^{+29}:\\
      \;\;\;\;\mathsf{fma}\left(y, t - x, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -7.8e12 or 9.5000000000000003e29 < z

        1. Initial program 100.0%

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

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

            \[\leadsto \color{blue}{\mathsf{neg}\left(z \cdot \left(t - x\right)\right)} \]
          2. distribute-rgt-neg-inN/A

            \[\leadsto \color{blue}{z \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)} \]
          3. mul-1-negN/A

            \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \left(t - x\right)\right)} \]
          4. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \left(t - x\right)\right)} \]
          5. mul-1-negN/A

            \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(\left(t - x\right)\right)\right)} \]
          6. sub-negN/A

            \[\leadsto z \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(x\right)\right)\right)}\right)\right) \]
          7. +-commutativeN/A

            \[\leadsto z \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)}\right)\right) \]
          8. distribute-neg-inN/A

            \[\leadsto z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) + \left(\mathsf{neg}\left(t\right)\right)\right)} \]
          9. unsub-negN/A

            \[\leadsto z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) - t\right)} \]
          10. remove-double-negN/A

            \[\leadsto z \cdot \left(\color{blue}{x} - t\right) \]
          11. --lowering--.f6479.6

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

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

        if -7.8e12 < z < 9.5000000000000003e29

        1. Initial program 100.0%

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

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

            \[\leadsto \color{blue}{y \cdot \left(t - x\right) + x} \]
          2. accelerator-lowering-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(y, t - x, x\right)} \]
          3. --lowering--.f6489.3

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(y, t - x, x\right)} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 7: 69.6% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -5200000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 8.8 \cdot 10^{+19}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* y (- t x))))
         (if (<= y -5200000000.0) t_1 (if (<= y 8.8e+19) (* z (- x t)) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = y * (t - x);
      	double tmp;
      	if (y <= -5200000000.0) {
      		tmp = t_1;
      	} else if (y <= 8.8e+19) {
      		tmp = z * (x - t);
      	} 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 = y * (t - x)
          if (y <= (-5200000000.0d0)) then
              tmp = t_1
          else if (y <= 8.8d+19) then
              tmp = z * (x - t)
          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 tmp;
      	if (y <= -5200000000.0) {
      		tmp = t_1;
      	} else if (y <= 8.8e+19) {
      		tmp = z * (x - t);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	t_1 = y * (t - x)
      	tmp = 0
      	if y <= -5200000000.0:
      		tmp = t_1
      	elif y <= 8.8e+19:
      		tmp = z * (x - t)
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t)
      	t_1 = Float64(y * Float64(t - x))
      	tmp = 0.0
      	if (y <= -5200000000.0)
      		tmp = t_1;
      	elseif (y <= 8.8e+19)
      		tmp = Float64(z * Float64(x - t));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	t_1 = y * (t - x);
      	tmp = 0.0;
      	if (y <= -5200000000.0)
      		tmp = t_1;
      	elseif (y <= 8.8e+19)
      		tmp = z * (x - t);
      	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]}, If[LessEqual[y, -5200000000.0], t$95$1, If[LessEqual[y, 8.8e+19], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := y \cdot \left(t - x\right)\\
      \mathbf{if}\;y \leq -5200000000:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;y \leq 8.8 \cdot 10^{+19}:\\
      \;\;\;\;z \cdot \left(x - t\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -5.2e9 or 8.8e19 < y

        1. Initial program 100.0%

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

          \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
          2. --lowering--.f6485.8

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

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

        if -5.2e9 < y < 8.8e19

        1. Initial program 100.0%

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

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

            \[\leadsto \color{blue}{\mathsf{neg}\left(z \cdot \left(t - x\right)\right)} \]
          2. distribute-rgt-neg-inN/A

            \[\leadsto \color{blue}{z \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)} \]
          3. mul-1-negN/A

            \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \left(t - x\right)\right)} \]
          4. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \left(t - x\right)\right)} \]
          5. mul-1-negN/A

            \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(\left(t - x\right)\right)\right)} \]
          6. sub-negN/A

            \[\leadsto z \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(x\right)\right)\right)}\right)\right) \]
          7. +-commutativeN/A

            \[\leadsto z \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)}\right)\right) \]
          8. distribute-neg-inN/A

            \[\leadsto z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) + \left(\mathsf{neg}\left(t\right)\right)\right)} \]
          9. unsub-negN/A

            \[\leadsto z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) - t\right)} \]
          10. remove-double-negN/A

            \[\leadsto z \cdot \left(\color{blue}{x} - t\right) \]
          11. --lowering--.f6467.0

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

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

      Alternative 8: 54.8% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ \mathbf{if}\;z \leq -165000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 10^{+30}:\\ \;\;\;\;\mathsf{fma}\left(y, t, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* z (- t))))
         (if (<= z -165000000000.0) t_1 (if (<= z 1e+30) (fma y t x) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = z * -t;
      	double tmp;
      	if (z <= -165000000000.0) {
      		tmp = t_1;
      	} else if (z <= 1e+30) {
      		tmp = fma(y, t, x);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	t_1 = Float64(z * Float64(-t))
      	tmp = 0.0
      	if (z <= -165000000000.0)
      		tmp = t_1;
      	elseif (z <= 1e+30)
      		tmp = fma(y, t, x);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -165000000000.0], t$95$1, If[LessEqual[z, 1e+30], N[(y * t + x), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := z \cdot \left(-t\right)\\
      \mathbf{if}\;z \leq -165000000000:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 10^{+30}:\\
      \;\;\;\;\mathsf{fma}\left(y, t, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -1.65e11 or 1e30 < z

        1. Initial program 100.0%

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

          \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

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

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

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

          \[\leadsto \color{blue}{-1 \cdot \left(t \cdot z\right)} \]
        7. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \color{blue}{\left(-1 \cdot t\right) \cdot z} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{z \cdot \left(-1 \cdot t\right)} \]
          3. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{z \cdot \left(-1 \cdot t\right)} \]
          4. mul-1-negN/A

            \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(t\right)\right)} \]
          5. neg-lowering-neg.f6447.0

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

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

        if -1.65e11 < z < 1e30

        1. Initial program 100.0%

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

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

            \[\leadsto \color{blue}{y \cdot \left(t - x\right) + x} \]
          2. accelerator-lowering-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(y, t - x, x\right)} \]
          3. --lowering--.f6489.3

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

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

          \[\leadsto \mathsf{fma}\left(y, \color{blue}{t}, x\right) \]
        7. Step-by-step derivation
          1. Simplified60.2%

            \[\leadsto \mathsf{fma}\left(y, \color{blue}{t}, x\right) \]
        8. Recombined 2 regimes into one program.
        9. Add Preprocessing

        Alternative 9: 50.1% accurate, 0.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.85 \cdot 10^{+45}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+47}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (if (<= y -2.85e+45) (* x (- y)) (if (<= y 1.6e+47) (fma z x x) (* y t))))
        double code(double x, double y, double z, double t) {
        	double tmp;
        	if (y <= -2.85e+45) {
        		tmp = x * -y;
        	} else if (y <= 1.6e+47) {
        		tmp = fma(z, x, x);
        	} else {
        		tmp = y * t;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	tmp = 0.0
        	if (y <= -2.85e+45)
        		tmp = Float64(x * Float64(-y));
        	elseif (y <= 1.6e+47)
        		tmp = fma(z, x, x);
        	else
        		tmp = Float64(y * t);
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := If[LessEqual[y, -2.85e+45], N[(x * (-y)), $MachinePrecision], If[LessEqual[y, 1.6e+47], N[(z * x + x), $MachinePrecision], N[(y * t), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \leq -2.85 \cdot 10^{+45}:\\
        \;\;\;\;x \cdot \left(-y\right)\\
        
        \mathbf{elif}\;y \leq 1.6 \cdot 10^{+47}:\\
        \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;y \cdot t\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if y < -2.85000000000000013e45

          1. Initial program 100.0%

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

            \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
          4. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
            2. --lowering--.f6488.3

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

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

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

              \[\leadsto y \cdot \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
            2. neg-lowering-neg.f6454.8

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

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

          if -2.85000000000000013e45 < y < 1.6e47

          1. Initial program 100.0%

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

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

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

              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(t - x\right)\right)\right)} + x \]
            3. distribute-rgt-neg-inN/A

              \[\leadsto \color{blue}{z \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)} + x \]
            4. mul-1-negN/A

              \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \left(t - x\right)\right)} + x \]
            5. accelerator-lowering-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(z, -1 \cdot \left(t - x\right), x\right)} \]
            6. mul-1-negN/A

              \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{neg}\left(\left(t - x\right)\right)}, x\right) \]
            7. sub-negN/A

              \[\leadsto \mathsf{fma}\left(z, \mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(x\right)\right)\right)}\right), x\right) \]
            8. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(z, \mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)}\right), x\right) \]
            9. distribute-neg-inN/A

              \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) + \left(\mathsf{neg}\left(t\right)\right)}, x\right) \]
            10. unsub-negN/A

              \[\leadsto \mathsf{fma}\left(z, \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) - t}, x\right) \]
            11. remove-double-negN/A

              \[\leadsto \mathsf{fma}\left(z, \color{blue}{x} - t, x\right) \]
            12. --lowering--.f6485.9

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

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

            \[\leadsto \mathsf{fma}\left(z, \color{blue}{x}, x\right) \]
          7. Step-by-step derivation
            1. Simplified48.3%

              \[\leadsto \mathsf{fma}\left(z, \color{blue}{x}, x\right) \]

            if 1.6e47 < y

            1. Initial program 99.9%

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

              \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
            4. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
              2. --lowering--.f6488.5

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

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

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.85 \cdot 10^{+45}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+47}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]
            10. Add Preprocessing

            Alternative 10: 53.4% accurate, 0.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+57}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+135}:\\ \;\;\;\;\mathsf{fma}\left(y, t, x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \end{array} \]
            (FPCore (x y z t)
             :precision binary64
             (if (<= z -1.9e+57) (* x z) (if (<= z 1.1e+135) (fma y t x) (* x z))))
            double code(double x, double y, double z, double t) {
            	double tmp;
            	if (z <= -1.9e+57) {
            		tmp = x * z;
            	} else if (z <= 1.1e+135) {
            		tmp = fma(y, t, x);
            	} else {
            		tmp = x * z;
            	}
            	return tmp;
            }
            
            function code(x, y, z, t)
            	tmp = 0.0
            	if (z <= -1.9e+57)
            		tmp = Float64(x * z);
            	elseif (z <= 1.1e+135)
            		tmp = fma(y, t, x);
            	else
            		tmp = Float64(x * z);
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_] := If[LessEqual[z, -1.9e+57], N[(x * z), $MachinePrecision], If[LessEqual[z, 1.1e+135], N[(y * t + x), $MachinePrecision], N[(x * z), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;z \leq -1.9 \cdot 10^{+57}:\\
            \;\;\;\;x \cdot z\\
            
            \mathbf{elif}\;z \leq 1.1 \cdot 10^{+135}:\\
            \;\;\;\;\mathsf{fma}\left(y, t, x\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;x \cdot z\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if z < -1.8999999999999999e57 or 1.1e135 < z

              1. Initial program 100.0%

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

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

                  \[\leadsto \color{blue}{\mathsf{neg}\left(z \cdot \left(t - x\right)\right)} \]
                2. distribute-rgt-neg-inN/A

                  \[\leadsto \color{blue}{z \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)} \]
                3. mul-1-negN/A

                  \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \left(t - x\right)\right)} \]
                4. *-lowering-*.f64N/A

                  \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \left(t - x\right)\right)} \]
                5. mul-1-negN/A

                  \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(\left(t - x\right)\right)\right)} \]
                6. sub-negN/A

                  \[\leadsto z \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(x\right)\right)\right)}\right)\right) \]
                7. +-commutativeN/A

                  \[\leadsto z \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)}\right)\right) \]
                8. distribute-neg-inN/A

                  \[\leadsto z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) + \left(\mathsf{neg}\left(t\right)\right)\right)} \]
                9. unsub-negN/A

                  \[\leadsto z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) - t\right)} \]
                10. remove-double-negN/A

                  \[\leadsto z \cdot \left(\color{blue}{x} - t\right) \]
                11. --lowering--.f6485.3

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

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

                \[\leadsto z \cdot \color{blue}{x} \]
              7. Step-by-step derivation
                1. Simplified46.7%

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

                if -1.8999999999999999e57 < z < 1.1e135

                1. Initial program 100.0%

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

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

                    \[\leadsto \color{blue}{y \cdot \left(t - x\right) + x} \]
                  2. accelerator-lowering-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(y, t - x, x\right)} \]
                  3. --lowering--.f6479.4

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

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

                  \[\leadsto \mathsf{fma}\left(y, \color{blue}{t}, x\right) \]
                7. Step-by-step derivation
                  1. Simplified53.1%

                    \[\leadsto \mathsf{fma}\left(y, \color{blue}{t}, x\right) \]
                8. Recombined 2 regimes into one program.
                9. Final simplification50.9%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+57}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+135}:\\ \;\;\;\;\mathsf{fma}\left(y, t, x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
                10. Add Preprocessing

                Alternative 11: 38.2% accurate, 0.8× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.95 \cdot 10^{+59}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+134}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \end{array} \]
                (FPCore (x y z t)
                 :precision binary64
                 (if (<= z -1.95e+59) (* x z) (if (<= z 8.5e+134) (* y t) (* x z))))
                double code(double x, double y, double z, double t) {
                	double tmp;
                	if (z <= -1.95e+59) {
                		tmp = x * z;
                	} else if (z <= 8.5e+134) {
                		tmp = y * t;
                	} else {
                		tmp = x * 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 (z <= (-1.95d+59)) then
                        tmp = x * z
                    else if (z <= 8.5d+134) then
                        tmp = y * t
                    else
                        tmp = x * z
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z, double t) {
                	double tmp;
                	if (z <= -1.95e+59) {
                		tmp = x * z;
                	} else if (z <= 8.5e+134) {
                		tmp = y * t;
                	} else {
                		tmp = x * z;
                	}
                	return tmp;
                }
                
                def code(x, y, z, t):
                	tmp = 0
                	if z <= -1.95e+59:
                		tmp = x * z
                	elif z <= 8.5e+134:
                		tmp = y * t
                	else:
                		tmp = x * z
                	return tmp
                
                function code(x, y, z, t)
                	tmp = 0.0
                	if (z <= -1.95e+59)
                		tmp = Float64(x * z);
                	elseif (z <= 8.5e+134)
                		tmp = Float64(y * t);
                	else
                		tmp = Float64(x * z);
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z, t)
                	tmp = 0.0;
                	if (z <= -1.95e+59)
                		tmp = x * z;
                	elseif (z <= 8.5e+134)
                		tmp = y * t;
                	else
                		tmp = x * z;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_, t_] := If[LessEqual[z, -1.95e+59], N[(x * z), $MachinePrecision], If[LessEqual[z, 8.5e+134], N[(y * t), $MachinePrecision], N[(x * z), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;z \leq -1.95 \cdot 10^{+59}:\\
                \;\;\;\;x \cdot z\\
                
                \mathbf{elif}\;z \leq 8.5 \cdot 10^{+134}:\\
                \;\;\;\;y \cdot t\\
                
                \mathbf{else}:\\
                \;\;\;\;x \cdot z\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if z < -1.95000000000000011e59 or 8.50000000000000024e134 < z

                  1. Initial program 100.0%

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

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

                      \[\leadsto \color{blue}{\mathsf{neg}\left(z \cdot \left(t - x\right)\right)} \]
                    2. distribute-rgt-neg-inN/A

                      \[\leadsto \color{blue}{z \cdot \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)} \]
                    3. mul-1-negN/A

                      \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \left(t - x\right)\right)} \]
                    4. *-lowering-*.f64N/A

                      \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \left(t - x\right)\right)} \]
                    5. mul-1-negN/A

                      \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(\left(t - x\right)\right)\right)} \]
                    6. sub-negN/A

                      \[\leadsto z \cdot \left(\mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(x\right)\right)\right)}\right)\right) \]
                    7. +-commutativeN/A

                      \[\leadsto z \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)}\right)\right) \]
                    8. distribute-neg-inN/A

                      \[\leadsto z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) + \left(\mathsf{neg}\left(t\right)\right)\right)} \]
                    9. unsub-negN/A

                      \[\leadsto z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) - t\right)} \]
                    10. remove-double-negN/A

                      \[\leadsto z \cdot \left(\color{blue}{x} - t\right) \]
                    11. --lowering--.f6485.3

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

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

                    \[\leadsto z \cdot \color{blue}{x} \]
                  7. Step-by-step derivation
                    1. Simplified46.7%

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

                    if -1.95000000000000011e59 < z < 8.50000000000000024e134

                    1. Initial program 100.0%

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

                      \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
                    4. Step-by-step derivation
                      1. *-lowering-*.f64N/A

                        \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
                      2. --lowering--.f6461.3

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

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

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

                        \[\leadsto y \cdot \color{blue}{t} \]
                    8. Recombined 2 regimes into one program.
                    9. Final simplification39.2%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.95 \cdot 10^{+59}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+134}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
                    10. Add Preprocessing

                    Alternative 12: 37.9% accurate, 0.8× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{-42}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 2.45 \cdot 10^{-6}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \end{array} \]
                    (FPCore (x y z t)
                     :precision binary64
                     (if (<= y -5.8e-42) (* y t) (if (<= y 2.45e-6) x (* y t))))
                    double code(double x, double y, double z, double t) {
                    	double tmp;
                    	if (y <= -5.8e-42) {
                    		tmp = y * t;
                    	} else if (y <= 2.45e-6) {
                    		tmp = x;
                    	} else {
                    		tmp = y * t;
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(x, y, z, t)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        real(8), intent (in) :: t
                        real(8) :: tmp
                        if (y <= (-5.8d-42)) then
                            tmp = y * t
                        else if (y <= 2.45d-6) then
                            tmp = x
                        else
                            tmp = y * t
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y, double z, double t) {
                    	double tmp;
                    	if (y <= -5.8e-42) {
                    		tmp = y * t;
                    	} else if (y <= 2.45e-6) {
                    		tmp = x;
                    	} else {
                    		tmp = y * t;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z, t):
                    	tmp = 0
                    	if y <= -5.8e-42:
                    		tmp = y * t
                    	elif y <= 2.45e-6:
                    		tmp = x
                    	else:
                    		tmp = y * t
                    	return tmp
                    
                    function code(x, y, z, t)
                    	tmp = 0.0
                    	if (y <= -5.8e-42)
                    		tmp = Float64(y * t);
                    	elseif (y <= 2.45e-6)
                    		tmp = x;
                    	else
                    		tmp = Float64(y * t);
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z, t)
                    	tmp = 0.0;
                    	if (y <= -5.8e-42)
                    		tmp = y * t;
                    	elseif (y <= 2.45e-6)
                    		tmp = x;
                    	else
                    		tmp = y * t;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_, t_] := If[LessEqual[y, -5.8e-42], N[(y * t), $MachinePrecision], If[LessEqual[y, 2.45e-6], x, N[(y * t), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;y \leq -5.8 \cdot 10^{-42}:\\
                    \;\;\;\;y \cdot t\\
                    
                    \mathbf{elif}\;y \leq 2.45 \cdot 10^{-6}:\\
                    \;\;\;\;x\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;y \cdot t\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if y < -5.8000000000000006e-42 or 2.44999999999999984e-6 < y

                      1. Initial program 100.0%

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

                        \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
                      4. Step-by-step derivation
                        1. *-lowering-*.f64N/A

                          \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
                        2. --lowering--.f6479.7

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

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

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

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

                        if -5.8000000000000006e-42 < y < 2.44999999999999984e-6

                        1. Initial program 100.0%

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

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

                            \[\leadsto \color{blue}{y \cdot \left(t - x\right) + x} \]
                          2. accelerator-lowering-fma.f64N/A

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

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

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

                          \[\leadsto \color{blue}{x} \]
                        7. Step-by-step derivation
                          1. Simplified27.1%

                            \[\leadsto \color{blue}{x} \]
                        8. Recombined 2 regimes into one program.
                        9. Add Preprocessing

                        Alternative 13: 17.8% accurate, 15.0× speedup?

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

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

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

                            \[\leadsto \color{blue}{y \cdot \left(t - x\right) + x} \]
                          2. accelerator-lowering-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(y, t - x, x\right)} \]
                          3. --lowering--.f6460.1

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

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

                          \[\leadsto \color{blue}{x} \]
                        7. Step-by-step derivation
                          1. Simplified13.8%

                            \[\leadsto \color{blue}{x} \]
                          2. Add Preprocessing

                          Developer Target 1: 96.0% 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 2024198 
                          (FPCore (x y z t)
                            :name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
                            :precision binary64
                          
                            :alt
                            (! :herbie-platform default (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
                          
                            (+ x (* (- y z) (- t x))))