Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 8.4s
Alternatives: 12
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 12 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: 70.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -2.3 \cdot 10^{+17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -8 \cdot 10^{-88}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-247}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 0.00034:\\ \;\;\;\;\mathsf{fma}\left(z, -t, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (- t x))))
   (if (<= y -2.3e+17)
     t_1
     (if (<= y -8e-88)
       (* (- y z) t)
       (if (<= y 2.6e-247)
         (* z (- x t))
         (if (<= y 0.00034) (fma z (- t) x) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double tmp;
	if (y <= -2.3e+17) {
		tmp = t_1;
	} else if (y <= -8e-88) {
		tmp = (y - z) * t;
	} else if (y <= 2.6e-247) {
		tmp = z * (x - t);
	} else if (y <= 0.00034) {
		tmp = fma(z, -t, x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(y * Float64(t - x))
	tmp = 0.0
	if (y <= -2.3e+17)
		tmp = t_1;
	elseif (y <= -8e-88)
		tmp = Float64(Float64(y - z) * t);
	elseif (y <= 2.6e-247)
		tmp = Float64(z * Float64(x - t));
	elseif (y <= 0.00034)
		tmp = fma(z, Float64(-t), x);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.3e+17], t$95$1, If[LessEqual[y, -8e-88], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 2.6e-247], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.00034], N[(z * (-t) + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;y \leq 0.00034:\\
\;\;\;\;\mathsf{fma}\left(z, -t, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.3e17 or 3.4e-4 < 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--.f6482.9

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

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

    if -2.3e17 < y < -7.99999999999999947e-88

    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--.f6469.6

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

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

    if -7.99999999999999947e-88 < y < 2.6e-247

    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.2

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

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

    if 2.6e-247 < y < 3.4e-4

    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--.f6494.6

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

      \[\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.f6475.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.3 \cdot 10^{+17}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -8 \cdot 10^{-88}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-247}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 0.00034:\\ \;\;\;\;\mathsf{fma}\left(z, -t, x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 68.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -4.4 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -9.2 \cdot 10^{-88}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{-176}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 0.00085:\\ \;\;\;\;\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 (- t x))))
   (if (<= y -4.4e+14)
     t_1
     (if (<= y -9.2e-88)
       (* (- y z) t)
       (if (<= y 5.4e-176)
         (* z (- x t))
         (if (<= y 0.00085) (fma z x x) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double tmp;
	if (y <= -4.4e+14) {
		tmp = t_1;
	} else if (y <= -9.2e-88) {
		tmp = (y - z) * t;
	} else if (y <= 5.4e-176) {
		tmp = z * (x - t);
	} else if (y <= 0.00085) {
		tmp = fma(z, x, x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(y * Float64(t - x))
	tmp = 0.0
	if (y <= -4.4e+14)
		tmp = t_1;
	elseif (y <= -9.2e-88)
		tmp = Float64(Float64(y - z) * t);
	elseif (y <= 5.4e-176)
		tmp = Float64(z * Float64(x - t));
	elseif (y <= 0.00085)
		tmp = fma(z, x, x);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.4e+14], t$95$1, If[LessEqual[y, -9.2e-88], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 5.4e-176], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.00085], N[(z * x + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;y \leq 0.00085:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -4.4e14 or 8.49999999999999953e-4 < 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--.f6482.9

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

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

    if -4.4e14 < y < -9.19999999999999945e-88

    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--.f6469.6

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

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

    if -9.19999999999999945e-88 < y < 5.3999999999999997e-176

    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--.f6477.0

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

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

    if 5.3999999999999997e-176 < y < 8.49999999999999953e-4

    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--.f6492.8

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{x - t}, x\right) \]
    5. Simplified92.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. Simplified67.4%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.4 \cdot 10^{+14}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -9.2 \cdot 10^{-88}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{-176}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 0.00085:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
    10. Add Preprocessing

    Alternative 4: 48.9% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.1 \cdot 10^{+191}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -1.3 \cdot 10^{+18}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{-62}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+61}:\\ \;\;\;\;\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 -4.1e+191)
       (* y t)
       (if (<= y -1.3e+18)
         (* y (- x))
         (if (<= y -1.8e-62) (* y t) (if (<= y 1.3e+61) (fma z x x) (* y t))))))
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if (y <= -4.1e+191) {
    		tmp = y * t;
    	} else if (y <= -1.3e+18) {
    		tmp = y * -x;
    	} else if (y <= -1.8e-62) {
    		tmp = y * t;
    	} else if (y <= 1.3e+61) {
    		tmp = fma(z, x, x);
    	} else {
    		tmp = y * t;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	tmp = 0.0
    	if (y <= -4.1e+191)
    		tmp = Float64(y * t);
    	elseif (y <= -1.3e+18)
    		tmp = Float64(y * Float64(-x));
    	elseif (y <= -1.8e-62)
    		tmp = Float64(y * t);
    	elseif (y <= 1.3e+61)
    		tmp = fma(z, x, x);
    	else
    		tmp = Float64(y * t);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := If[LessEqual[y, -4.1e+191], N[(y * t), $MachinePrecision], If[LessEqual[y, -1.3e+18], N[(y * (-x)), $MachinePrecision], If[LessEqual[y, -1.8e-62], N[(y * t), $MachinePrecision], If[LessEqual[y, 1.3e+61], N[(z * x + x), $MachinePrecision], N[(y * t), $MachinePrecision]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq -4.1 \cdot 10^{+191}:\\
    \;\;\;\;y \cdot t\\
    
    \mathbf{elif}\;y \leq -1.3 \cdot 10^{+18}:\\
    \;\;\;\;y \cdot \left(-x\right)\\
    
    \mathbf{elif}\;y \leq -1.8 \cdot 10^{-62}:\\
    \;\;\;\;y \cdot t\\
    
    \mathbf{elif}\;y \leq 1.3 \cdot 10^{+61}:\\
    \;\;\;\;\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 < -4.0999999999999999e191 or -1.3e18 < y < -1.8e-62 or 1.29999999999999986e61 < 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--.f6480.6

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

        \[\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. Simplified53.4%

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

        if -4.0999999999999999e191 < y < -1.3e18

        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.5

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

          \[\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.f6459.2

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

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

        if -1.8e-62 < y < 1.29999999999999986e61

        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--.f6488.8

            \[\leadsto \mathsf{fma}\left(z, \color{blue}{x - t}, x\right) \]
        5. Simplified88.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. Simplified56.7%

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

        Alternative 5: 67.9% accurate, 0.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -20000000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-96}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-6}:\\ \;\;\;\;\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 (- t x))))
           (if (<= y -20000000000000.0)
             t_1
             (if (<= y -4e-96) (* (- y z) t) (if (<= y 1.5e-6) (fma z x x) t_1)))))
        double code(double x, double y, double z, double t) {
        	double t_1 = y * (t - x);
        	double tmp;
        	if (y <= -20000000000000.0) {
        		tmp = t_1;
        	} else if (y <= -4e-96) {
        		tmp = (y - z) * t;
        	} else if (y <= 1.5e-6) {
        		tmp = fma(z, x, x);
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	t_1 = Float64(y * Float64(t - x))
        	tmp = 0.0
        	if (y <= -20000000000000.0)
        		tmp = t_1;
        	elseif (y <= -4e-96)
        		tmp = Float64(Float64(y - z) * t);
        	elseif (y <= 1.5e-6)
        		tmp = fma(z, x, x);
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -20000000000000.0], t$95$1, If[LessEqual[y, -4e-96], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 1.5e-6], N[(z * x + x), $MachinePrecision], t$95$1]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := y \cdot \left(t - x\right)\\
        \mathbf{if}\;y \leq -20000000000000:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;y \leq -4 \cdot 10^{-96}:\\
        \;\;\;\;\left(y - z\right) \cdot t\\
        
        \mathbf{elif}\;y \leq 1.5 \cdot 10^{-6}:\\
        \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if y < -2e13 or 1.5e-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--.f6482.9

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

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

          if -2e13 < y < -3.9999999999999996e-96

          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--.f6470.7

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

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

          if -3.9999999999999996e-96 < y < 1.5e-6

          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--.f6494.6

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

            \[\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. Simplified60.9%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -20000000000000:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-96}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-6}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
          10. Add Preprocessing

          Alternative 6: 84.5% accurate, 0.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -500000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 0.00105:\\ \;\;\;\;\mathsf{fma}\left(z, x - t, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (let* ((t_1 (* y (- t x))))
             (if (<= y -500000.0) t_1 (if (<= y 0.00105) (fma z (- x t) x) t_1))))
          double code(double x, double y, double z, double t) {
          	double t_1 = y * (t - x);
          	double tmp;
          	if (y <= -500000.0) {
          		tmp = t_1;
          	} else if (y <= 0.00105) {
          		tmp = fma(z, (x - t), x);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t)
          	t_1 = Float64(y * Float64(t - x))
          	tmp = 0.0
          	if (y <= -500000.0)
          		tmp = t_1;
          	elseif (y <= 0.00105)
          		tmp = fma(z, Float64(x - t), x);
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -500000.0], t$95$1, If[LessEqual[y, 0.00105], N[(z * N[(x - t), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := y \cdot \left(t - x\right)\\
          \mathbf{if}\;y \leq -500000:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;y \leq 0.00105:\\
          \;\;\;\;\mathsf{fma}\left(z, x - t, x\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -5e5 or 0.00104999999999999994 < 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--.f6483.2

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

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

            if -5e5 < y < 0.00104999999999999994

            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--.f6489.7

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

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

          Alternative 7: 76.5% accurate, 0.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot t\\ \mathbf{if}\;t \leq -3.8 \cdot 10^{-14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 250000000:\\ \;\;\;\;\mathsf{fma}\left(x, z - y, 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 -3.8e-14) t_1 (if (<= t 250000000.0) (fma x (- z y) x) t_1))))
          double code(double x, double y, double z, double t) {
          	double t_1 = (y - z) * t;
          	double tmp;
          	if (t <= -3.8e-14) {
          		tmp = t_1;
          	} else if (t <= 250000000.0) {
          		tmp = fma(x, (z - y), 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 <= -3.8e-14)
          		tmp = t_1;
          	elseif (t <= 250000000.0)
          		tmp = fma(x, Float64(z - y), 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, -3.8e-14], t$95$1, If[LessEqual[t, 250000000.0], N[(x * N[(z - y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := \left(y - z\right) \cdot t\\
          \mathbf{if}\;t \leq -3.8 \cdot 10^{-14}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;t \leq 250000000:\\
          \;\;\;\;\mathsf{fma}\left(x, z - y, x\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if t < -3.8000000000000002e-14 or 2.5e8 < 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.0

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

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

            if -3.8000000000000002e-14 < t < 2.5e8

            1. Initial program 100.0%

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

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

                \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \left(y - z\right) + 1\right)} \]
              2. distribute-lft-inN/A

                \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \left(y - z\right)\right) + x \cdot 1} \]
              3. *-rgt-identityN/A

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(x, \color{blue}{z} - y, x\right) \]
              11. --lowering--.f6479.5

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(x, z - y, x\right)} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification78.8%

            \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.8 \cdot 10^{-14}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;t \leq 250000000:\\ \;\;\;\;\mathsf{fma}\left(x, z - y, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \]
          5. Add Preprocessing

          Alternative 8: 62.8% accurate, 0.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot t\\ \mathbf{if}\;t \leq -2.45 \cdot 10^{-92}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 55:\\ \;\;\;\;\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 -2.45e-92) t_1 (if (<= t 55.0) (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 <= -2.45e-92) {
          		tmp = t_1;
          	} else if (t <= 55.0) {
          		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 <= -2.45e-92)
          		tmp = t_1;
          	elseif (t <= 55.0)
          		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, -2.45e-92], t$95$1, If[LessEqual[t, 55.0], 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 -2.45 \cdot 10^{-92}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;t \leq 55:\\
          \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if t < -2.45e-92 or 55 < 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--.f6472.4

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

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

            if -2.45e-92 < t < 55

            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--.f6459.9

                \[\leadsto \mathsf{fma}\left(z, \color{blue}{x - t}, x\right) \]
            5. Simplified59.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. Simplified52.3%

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

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

            Alternative 9: 48.9% accurate, 0.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{-62}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{+61}:\\ \;\;\;\;\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 -1.8e-62) (* y t) (if (<= y 1.2e+61) (fma z x x) (* y t))))
            double code(double x, double y, double z, double t) {
            	double tmp;
            	if (y <= -1.8e-62) {
            		tmp = y * t;
            	} else if (y <= 1.2e+61) {
            		tmp = fma(z, x, x);
            	} else {
            		tmp = y * t;
            	}
            	return tmp;
            }
            
            function code(x, y, z, t)
            	tmp = 0.0
            	if (y <= -1.8e-62)
            		tmp = Float64(y * t);
            	elseif (y <= 1.2e+61)
            		tmp = fma(z, x, x);
            	else
            		tmp = Float64(y * t);
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_] := If[LessEqual[y, -1.8e-62], N[(y * t), $MachinePrecision], If[LessEqual[y, 1.2e+61], N[(z * x + x), $MachinePrecision], N[(y * t), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \leq -1.8 \cdot 10^{-62}:\\
            \;\;\;\;y \cdot t\\
            
            \mathbf{elif}\;y \leq 1.2 \cdot 10^{+61}:\\
            \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;y \cdot t\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -1.8e-62 or 1.1999999999999999e61 < 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--.f6480.3

                  \[\leadsto y \cdot \color{blue}{\left(t - x\right)} \]
              5. Simplified80.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. Simplified44.5%

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

                if -1.8e-62 < y < 1.1999999999999999e61

                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--.f6488.8

                    \[\leadsto \mathsf{fma}\left(z, \color{blue}{x - t}, x\right) \]
                5. Simplified88.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. Simplified56.7%

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

                Alternative 10: 37.9% accurate, 0.8× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+73}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq 3.85 \cdot 10^{+118}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \end{array} \]
                (FPCore (x y z t)
                 :precision binary64
                 (if (<= z -1.4e+73) (* x z) (if (<= z 3.85e+118) (* y t) (* x z))))
                double code(double x, double y, double z, double t) {
                	double tmp;
                	if (z <= -1.4e+73) {
                		tmp = x * z;
                	} else if (z <= 3.85e+118) {
                		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.4d+73)) then
                        tmp = x * z
                    else if (z <= 3.85d+118) 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.4e+73) {
                		tmp = x * z;
                	} else if (z <= 3.85e+118) {
                		tmp = y * t;
                	} else {
                		tmp = x * z;
                	}
                	return tmp;
                }
                
                def code(x, y, z, t):
                	tmp = 0
                	if z <= -1.4e+73:
                		tmp = x * z
                	elif z <= 3.85e+118:
                		tmp = y * t
                	else:
                		tmp = x * z
                	return tmp
                
                function code(x, y, z, t)
                	tmp = 0.0
                	if (z <= -1.4e+73)
                		tmp = Float64(x * z);
                	elseif (z <= 3.85e+118)
                		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.4e+73)
                		tmp = x * z;
                	elseif (z <= 3.85e+118)
                		tmp = y * t;
                	else
                		tmp = x * z;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_, t_] := If[LessEqual[z, -1.4e+73], N[(x * z), $MachinePrecision], If[LessEqual[z, 3.85e+118], N[(y * t), $MachinePrecision], N[(x * z), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;z \leq -1.4 \cdot 10^{+73}:\\
                \;\;\;\;x \cdot z\\
                
                \mathbf{elif}\;z \leq 3.85 \cdot 10^{+118}:\\
                \;\;\;\;y \cdot t\\
                
                \mathbf{else}:\\
                \;\;\;\;x \cdot z\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if z < -1.40000000000000004e73 or 3.8499999999999999e118 < 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--.f6487.5

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

                    \[\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. Simplified53.6%

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

                    if -1.40000000000000004e73 < z < 3.8499999999999999e118

                    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.8

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

                      \[\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. Simplified36.2%

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+73}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq 3.85 \cdot 10^{+118}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
                    10. Add Preprocessing

                    Alternative 11: 37.9% accurate, 0.8× speedup?

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

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

                        \[\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. Simplified42.4%

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

                        if -1.95000000000000011e-63 < y < 2.44999999999999997e-14

                        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--.f6494.1

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

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

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

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

                        Alternative 12: 18.3% 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 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--.f6456.8

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

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

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

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

                          Developer Target 1: 96.6% accurate, 0.6× speedup?

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

                          Reproduce

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