Statistics.Distribution.Beta:$centropy from math-functions-0.1.5.2

Percentage Accurate: 95.2% → 97.9%
Time: 13.6s
Alternatives: 16
Speedup: 0.5×

Specification

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

\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\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 16 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: 95.2% accurate, 1.0× speedup?

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

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

Alternative 1: 97.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\left(x + z \cdot \left(1 - y\right)\right) + a \cdot \left(1 - t\right)\right) + \left(\left(y + t\right) - 2\right) \cdot b \leq \infty:\\ \;\;\;\;x - \mathsf{fma}\left(y + -1, z, \left(t + -1\right) \cdot a - b \cdot \left(y + \left(t + -2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(b - a\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<=
      (+ (+ (+ x (* z (- 1.0 y))) (* a (- 1.0 t))) (* (- (+ y t) 2.0) b))
      INFINITY)
   (- x (fma (+ y -1.0) z (- (* (+ t -1.0) a) (* b (+ y (+ t -2.0))))))
   (* t (- b a))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((((x + (z * (1.0 - y))) + (a * (1.0 - t))) + (((y + t) - 2.0) * b)) <= ((double) INFINITY)) {
		tmp = x - fma((y + -1.0), z, (((t + -1.0) * a) - (b * (y + (t + -2.0)))));
	} else {
		tmp = t * (b - a);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(Float64(Float64(x + Float64(z * Float64(1.0 - y))) + Float64(a * Float64(1.0 - t))) + Float64(Float64(Float64(y + t) - 2.0) * b)) <= Inf)
		tmp = Float64(x - fma(Float64(y + -1.0), z, Float64(Float64(Float64(t + -1.0) * a) - Float64(b * Float64(y + Float64(t + -2.0))))));
	else
		tmp = Float64(t * Float64(b - a));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(x + N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], Infinity], N[(x - N[(N[(y + -1.0), $MachinePrecision] * z + N[(N[(N[(t + -1.0), $MachinePrecision] * a), $MachinePrecision] - N[(b * N[(y + N[(t + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\left(\left(x + z \cdot \left(1 - y\right)\right) + a \cdot \left(1 - t\right)\right) + \left(\left(y + t\right) - 2\right) \cdot b \leq \infty:\\
\;\;\;\;x - \mathsf{fma}\left(y + -1, z, \left(t + -1\right) \cdot a - b \cdot \left(y + \left(t + -2\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t \cdot \left(b - a\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < +inf.0

    1. Initial program 100.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right)} \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right) \cdot z}\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      3. lift--.f64N/A

        \[\leadsto \left(\color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      4. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right)} \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right) \cdot a}\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      6. lift-+.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\color{blue}{\left(y + t\right)} - 2\right) \cdot b \]
      7. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right)} \cdot b \]
      8. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
      9. associate-+l-N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right) - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
      10. lift--.f64N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right) \]
      11. associate--l-N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      12. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      13. lift-*.f64N/A

        \[\leadsto x - \left(\color{blue}{\left(y - 1\right) \cdot z} + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right) \]
      14. lower-fma.f64N/A

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(y - 1, z, \left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
    4. Applied egg-rr100.0%

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

    if +inf.0 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b))

    1. Initial program 0.0%

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

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

        \[\leadsto \color{blue}{t \cdot \left(b - a\right)} \]
      2. lower--.f6477.8

        \[\leadsto t \cdot \color{blue}{\left(b - a\right)} \]
    5. Simplified77.8%

      \[\leadsto \color{blue}{t \cdot \left(b - a\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(x + z \cdot \left(1 - y\right)\right) + a \cdot \left(1 - t\right)\right) + \left(\left(y + t\right) - 2\right) \cdot b \leq \infty:\\ \;\;\;\;x - \mathsf{fma}\left(y + -1, z, \left(t + -1\right) \cdot a - b \cdot \left(y + \left(t + -2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(b - a\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 49.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(y + -2\right)\\ t_2 := t \cdot \left(b - a\right)\\ \mathbf{if}\;t \leq -1.1 \cdot 10^{-11}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -2.9 \cdot 10^{-157}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1.52 \cdot 10^{-261}:\\ \;\;\;\;x + a\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{-183}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{+56}:\\ \;\;\;\;\mathsf{fma}\left(b, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (+ y -2.0))) (t_2 (* t (- b a))))
   (if (<= t -1.1e-11)
     t_2
     (if (<= t -2.9e-157)
       t_1
       (if (<= t -1.52e-261)
         (+ x a)
         (if (<= t 1.7e-183) t_1 (if (<= t 7.2e+56) (fma b y x) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (y + -2.0);
	double t_2 = t * (b - a);
	double tmp;
	if (t <= -1.1e-11) {
		tmp = t_2;
	} else if (t <= -2.9e-157) {
		tmp = t_1;
	} else if (t <= -1.52e-261) {
		tmp = x + a;
	} else if (t <= 1.7e-183) {
		tmp = t_1;
	} else if (t <= 7.2e+56) {
		tmp = fma(b, y, x);
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(b * Float64(y + -2.0))
	t_2 = Float64(t * Float64(b - a))
	tmp = 0.0
	if (t <= -1.1e-11)
		tmp = t_2;
	elseif (t <= -2.9e-157)
		tmp = t_1;
	elseif (t <= -1.52e-261)
		tmp = Float64(x + a);
	elseif (t <= 1.7e-183)
		tmp = t_1;
	elseif (t <= 7.2e+56)
		tmp = fma(b, y, x);
	else
		tmp = t_2;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(y + -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.1e-11], t$95$2, If[LessEqual[t, -2.9e-157], t$95$1, If[LessEqual[t, -1.52e-261], N[(x + a), $MachinePrecision], If[LessEqual[t, 1.7e-183], t$95$1, If[LessEqual[t, 7.2e+56], N[(b * y + x), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := b \cdot \left(y + -2\right)\\
t_2 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -1.1 \cdot 10^{-11}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq -2.9 \cdot 10^{-157}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -1.52 \cdot 10^{-261}:\\
\;\;\;\;x + a\\

\mathbf{elif}\;t \leq 1.7 \cdot 10^{-183}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 7.2 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(b, y, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.1000000000000001e-11 or 7.19999999999999996e56 < t

    1. Initial program 92.9%

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

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

        \[\leadsto \color{blue}{t \cdot \left(b - a\right)} \]
      2. lower--.f6472.8

        \[\leadsto t \cdot \color{blue}{\left(b - a\right)} \]
    5. Simplified72.8%

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

    if -1.1000000000000001e-11 < t < -2.89999999999999988e-157 or -1.5200000000000001e-261 < t < 1.70000000000000007e-183

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{b \cdot \left(\left(t + y\right) - 2\right)} \]
      2. +-commutativeN/A

        \[\leadsto b \cdot \left(\color{blue}{\left(y + t\right)} - 2\right) \]
      3. associate-+r-N/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
      4. lower-+.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
      5. sub-negN/A

        \[\leadsto b \cdot \left(y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      6. lower-+.f64N/A

        \[\leadsto b \cdot \left(y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      7. metadata-eval58.5

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

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

      \[\leadsto \color{blue}{b \cdot \left(y - 2\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{b \cdot \left(y - 2\right)} \]
      2. sub-negN/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(\mathsf{neg}\left(2\right)\right)\right)} \]
      3. lower-+.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(\mathsf{neg}\left(2\right)\right)\right)} \]
      4. metadata-eval58.5

        \[\leadsto b \cdot \left(y + \color{blue}{-2}\right) \]
    8. Simplified58.5%

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

    if -2.89999999999999988e-157 < t < -1.5200000000000001e-261

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{\left(b \cdot \left(\left(t + y\right) - 2\right) + x\right)} - a \cdot \left(t - 1\right) \]
      2. associate--l+N/A

        \[\leadsto \color{blue}{b \cdot \left(\left(t + y\right) - 2\right) + \left(x - a \cdot \left(t - 1\right)\right)} \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, \left(t + y\right) - 2, x - a \cdot \left(t - 1\right)\right)} \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\left(y + t\right)} - 2, x - a \cdot \left(t - 1\right)\right) \]
      5. associate-+r-N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
      6. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
      8. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + \color{blue}{-2}\right), x - a \cdot \left(t - 1\right)\right) \]
      10. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{x + \left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right)}\right) \]
      11. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right) + x}\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{a \cdot \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right)} + x\right) \]
      13. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + x\right) \]
      14. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\mathsf{fma}\left(a, -1 \cdot \left(t - 1\right), x\right)}\right) \]
      15. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\mathsf{neg}\left(\left(t - 1\right)\right)}, x\right)\right) \]
      16. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}\right), x\right)\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\left(t + \color{blue}{-1}\right)\right), x\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(-1 + t\right)}\right), x\right)\right) \]
      19. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(-1\right)\right) + \left(\mathsf{neg}\left(t\right)\right)}, x\right)\right) \]
      20. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1} + \left(\mathsf{neg}\left(t\right)\right), x\right)\right) \]
      21. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
      22. lower--.f6467.5

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
    5. Simplified67.5%

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

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

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

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

        \[\leadsto a \cdot \left(1 + \color{blue}{-1 \cdot t}\right) + x \]
      4. +-commutativeN/A

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

        \[\leadsto a \cdot \left(\color{blue}{\left(\mathsf{neg}\left(t\right)\right)} + 1\right) + x \]
      6. metadata-evalN/A

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

        \[\leadsto a \cdot \color{blue}{\left(\mathsf{neg}\left(\left(t + -1\right)\right)\right)} + x \]
      8. metadata-evalN/A

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

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

        \[\leadsto a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + x \]
      11. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(a, -1 \cdot \color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}, x\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a, -1 \cdot \left(t + \color{blue}{-1}\right), x\right) \]
      14. distribute-lft-inN/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{-1 \cdot t + -1 \cdot -1}, x\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a, -1 \cdot t + \color{blue}{1}, x\right) \]
      16. +-commutativeN/A

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

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

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right) \]
      19. lower--.f6448.2

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right) \]
    8. Simplified48.2%

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

      \[\leadsto \color{blue}{a + x} \]
    10. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{x + a} \]
      2. lower-+.f6448.2

        \[\leadsto \color{blue}{x + a} \]
    11. Simplified48.2%

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

    if 1.70000000000000007e-183 < t < 7.19999999999999996e56

    1. Initial program 100.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right)} \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right) \cdot z}\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      3. lift--.f64N/A

        \[\leadsto \left(\color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      4. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right)} \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right) \cdot a}\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      6. lift-+.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\color{blue}{\left(y + t\right)} - 2\right) \cdot b \]
      7. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right)} \cdot b \]
      8. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
      9. associate-+l-N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right) - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
      10. lift--.f64N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right) \]
      11. associate--l-N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      12. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      13. lift-*.f64N/A

        \[\leadsto x - \left(\color{blue}{\left(y - 1\right) \cdot z} + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right) \]
      14. lower-fma.f64N/A

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(y - 1, z, \left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
    4. Applied egg-rr100.0%

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

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

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

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

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

        \[\leadsto x - y \cdot \left(-1 \cdot b + \color{blue}{1 \cdot z}\right) \]
      5. metadata-evalN/A

        \[\leadsto x - y \cdot \left(-1 \cdot b + \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot z\right) \]
      6. cancel-sign-sub-invN/A

        \[\leadsto x - y \cdot \color{blue}{\left(-1 \cdot b - -1 \cdot z\right)} \]
      7. lower-*.f64N/A

        \[\leadsto x - \color{blue}{y \cdot \left(-1 \cdot b - -1 \cdot z\right)} \]
      8. cancel-sign-sub-invN/A

        \[\leadsto x - y \cdot \color{blue}{\left(-1 \cdot b + \left(\mathsf{neg}\left(-1\right)\right) \cdot z\right)} \]
      9. metadata-evalN/A

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

        \[\leadsto x - y \cdot \left(-1 \cdot b + \color{blue}{z}\right) \]
      11. +-commutativeN/A

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

        \[\leadsto x - y \cdot \left(z + \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      13. sub-negN/A

        \[\leadsto x - y \cdot \color{blue}{\left(z - b\right)} \]
      14. lower--.f6464.4

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

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

      \[\leadsto \color{blue}{x - -1 \cdot \left(b \cdot y\right)} \]
    9. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto x - \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \cdot y \]
      3. cancel-sign-subN/A

        \[\leadsto \color{blue}{x + b \cdot y} \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{b \cdot y + x} \]
      5. lower-fma.f6457.6

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, y, x\right)} \]
    10. Simplified57.6%

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

Alternative 3: 79.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.6 \cdot 10^{-11}:\\ \;\;\;\;b \cdot \left(y + \left(t + -2\right)\right)\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{-49}:\\ \;\;\;\;\mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right)\\ \mathbf{elif}\;b \leq 7.2 \cdot 10^{+141}:\\ \;\;\;\;x - \mathsf{fma}\left(y + -1, z, t \cdot \left(a - b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t + -2, b, y \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -1.6e-11)
   (* b (+ y (+ t -2.0)))
   (if (<= b 8.5e-49)
     (fma a (- 1.0 t) (fma z (- 1.0 y) x))
     (if (<= b 7.2e+141)
       (- x (fma (+ y -1.0) z (* t (- a b))))
       (fma (+ t -2.0) b (* y b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -1.6e-11) {
		tmp = b * (y + (t + -2.0));
	} else if (b <= 8.5e-49) {
		tmp = fma(a, (1.0 - t), fma(z, (1.0 - y), x));
	} else if (b <= 7.2e+141) {
		tmp = x - fma((y + -1.0), z, (t * (a - b)));
	} else {
		tmp = fma((t + -2.0), b, (y * b));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -1.6e-11)
		tmp = Float64(b * Float64(y + Float64(t + -2.0)));
	elseif (b <= 8.5e-49)
		tmp = fma(a, Float64(1.0 - t), fma(z, Float64(1.0 - y), x));
	elseif (b <= 7.2e+141)
		tmp = Float64(x - fma(Float64(y + -1.0), z, Float64(t * Float64(a - b))));
	else
		tmp = fma(Float64(t + -2.0), b, Float64(y * b));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.6e-11], N[(b * N[(y + N[(t + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.5e-49], N[(a * N[(1.0 - t), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.2e+141], N[(x - N[(N[(y + -1.0), $MachinePrecision] * z + N[(t * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t + -2.0), $MachinePrecision] * b + N[(y * b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.6 \cdot 10^{-11}:\\
\;\;\;\;b \cdot \left(y + \left(t + -2\right)\right)\\

\mathbf{elif}\;b \leq 8.5 \cdot 10^{-49}:\\
\;\;\;\;\mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right)\\

\mathbf{elif}\;b \leq 7.2 \cdot 10^{+141}:\\
\;\;\;\;x - \mathsf{fma}\left(y + -1, z, t \cdot \left(a - b\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t + -2, b, y \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -1.59999999999999997e-11

    1. Initial program 95.5%

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

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

        \[\leadsto \color{blue}{b \cdot \left(\left(t + y\right) - 2\right)} \]
      2. +-commutativeN/A

        \[\leadsto b \cdot \left(\color{blue}{\left(y + t\right)} - 2\right) \]
      3. associate-+r-N/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
      4. lower-+.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
      5. sub-negN/A

        \[\leadsto b \cdot \left(y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      6. lower-+.f64N/A

        \[\leadsto b \cdot \left(y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      7. metadata-eval79.0

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

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

    if -1.59999999999999997e-11 < b < 8.50000000000000069e-49

    1. Initial program 98.1%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right) + x\right)} - z \cdot \left(y - 1\right) \]
      4. associate-+r-N/A

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

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

        \[\leadsto a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + \left(x - z \cdot \left(y - 1\right)\right) \]
      7. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}\right), x - z \cdot \left(y - 1\right)\right) \]
      10. metadata-evalN/A

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

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

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(-1\right)\right) + \left(\mathsf{neg}\left(t\right)\right)}, x - z \cdot \left(y - 1\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{1} + \left(\mathsf{neg}\left(t\right)\right), x - z \cdot \left(y - 1\right)\right) \]
      14. sub-negN/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{1 - t}, x - z \cdot \left(y - 1\right)\right) \]
      15. lower--.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(a, 1 - t, \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - 1\right)\right)\right) + x}\right) \]
      18. distribute-rgt-neg-inN/A

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

        \[\leadsto \mathsf{fma}\left(a, 1 - t, z \cdot \color{blue}{\left(-1 \cdot \left(y - 1\right)\right)} + x\right) \]
      20. lower-fma.f64N/A

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

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

    if 8.50000000000000069e-49 < b < 7.2000000000000003e141

    1. Initial program 97.4%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right)} \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right) \cdot z}\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      3. lift--.f64N/A

        \[\leadsto \left(\color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      4. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right)} \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right) \cdot a}\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      6. lift-+.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\color{blue}{\left(y + t\right)} - 2\right) \cdot b \]
      7. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right)} \cdot b \]
      8. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
      9. associate-+l-N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right) - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
      10. lift--.f64N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right) \]
      11. associate--l-N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      12. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      13. lift-*.f64N/A

        \[\leadsto x - \left(\color{blue}{\left(y - 1\right) \cdot z} + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right) \]
      14. lower-fma.f64N/A

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

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

      \[\leadsto x - \mathsf{fma}\left(y + -1, z, \color{blue}{t \cdot \left(a - b\right)}\right) \]
    6. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x - \mathsf{fma}\left(y + -1, z, t \cdot \color{blue}{\left(a + \left(\mathsf{neg}\left(b\right)\right)\right)}\right) \]
      2. mul-1-negN/A

        \[\leadsto x - \mathsf{fma}\left(y + -1, z, t \cdot \left(a + \color{blue}{-1 \cdot b}\right)\right) \]
      3. lower-*.f64N/A

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

        \[\leadsto x - \mathsf{fma}\left(y + -1, z, t \cdot \left(a + \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right)\right) \]
      5. sub-negN/A

        \[\leadsto x - \mathsf{fma}\left(y + -1, z, t \cdot \color{blue}{\left(a - b\right)}\right) \]
      6. lower--.f6478.4

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

      \[\leadsto x - \mathsf{fma}\left(y + -1, z, \color{blue}{t \cdot \left(a - b\right)}\right) \]

    if 7.2000000000000003e141 < b

    1. Initial program 92.3%

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

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

        \[\leadsto \color{blue}{b \cdot \left(\left(t + y\right) - 2\right)} \]
      2. +-commutativeN/A

        \[\leadsto b \cdot \left(\color{blue}{\left(y + t\right)} - 2\right) \]
      3. associate-+r-N/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
      4. lower-+.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
      5. sub-negN/A

        \[\leadsto b \cdot \left(y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      6. lower-+.f64N/A

        \[\leadsto b \cdot \left(y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      7. metadata-eval87.5

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

      \[\leadsto \color{blue}{b \cdot \left(y + \left(t + -2\right)\right)} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto b \cdot \left(y + \color{blue}{\left(t + -2\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto b \cdot \color{blue}{\left(\left(t + -2\right) + y\right)} \]
      3. distribute-lft-inN/A

        \[\leadsto \color{blue}{b \cdot \left(t + -2\right) + b \cdot y} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(t + -2\right) \cdot b} + b \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(t + -2, b, b \cdot y\right)} \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(t + -2, b, \color{blue}{y \cdot b}\right) \]
      7. lower-*.f6487.5

        \[\leadsto \mathsf{fma}\left(t + -2, b, \color{blue}{y \cdot b}\right) \]
    7. Applied egg-rr87.5%

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

Alternative 4: 36.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(y + -2\right)\\ \mathbf{if}\;t \leq -3.5 \cdot 10^{+43}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;t \leq -2.9 \cdot 10^{-157}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1.52 \cdot 10^{-261}:\\ \;\;\;\;x + a\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{-183}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 7.8 \cdot 10^{+139}:\\ \;\;\;\;\mathsf{fma}\left(b, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;-t \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (+ y -2.0))))
   (if (<= t -3.5e+43)
     (* t b)
     (if (<= t -2.9e-157)
       t_1
       (if (<= t -1.52e-261)
         (+ x a)
         (if (<= t 1.7e-183)
           t_1
           (if (<= t 7.8e+139) (fma b y x) (- (* t a)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (y + -2.0);
	double tmp;
	if (t <= -3.5e+43) {
		tmp = t * b;
	} else if (t <= -2.9e-157) {
		tmp = t_1;
	} else if (t <= -1.52e-261) {
		tmp = x + a;
	} else if (t <= 1.7e-183) {
		tmp = t_1;
	} else if (t <= 7.8e+139) {
		tmp = fma(b, y, x);
	} else {
		tmp = -(t * a);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(b * Float64(y + -2.0))
	tmp = 0.0
	if (t <= -3.5e+43)
		tmp = Float64(t * b);
	elseif (t <= -2.9e-157)
		tmp = t_1;
	elseif (t <= -1.52e-261)
		tmp = Float64(x + a);
	elseif (t <= 1.7e-183)
		tmp = t_1;
	elseif (t <= 7.8e+139)
		tmp = fma(b, y, x);
	else
		tmp = Float64(-Float64(t * a));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(y + -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.5e+43], N[(t * b), $MachinePrecision], If[LessEqual[t, -2.9e-157], t$95$1, If[LessEqual[t, -1.52e-261], N[(x + a), $MachinePrecision], If[LessEqual[t, 1.7e-183], t$95$1, If[LessEqual[t, 7.8e+139], N[(b * y + x), $MachinePrecision], (-N[(t * a), $MachinePrecision])]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := b \cdot \left(y + -2\right)\\
\mathbf{if}\;t \leq -3.5 \cdot 10^{+43}:\\
\;\;\;\;t \cdot b\\

\mathbf{elif}\;t \leq -2.9 \cdot 10^{-157}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -1.52 \cdot 10^{-261}:\\
\;\;\;\;x + a\\

\mathbf{elif}\;t \leq 1.7 \cdot 10^{-183}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 7.8 \cdot 10^{+139}:\\
\;\;\;\;\mathsf{fma}\left(b, y, x\right)\\

\mathbf{else}:\\
\;\;\;\;-t \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -3.5000000000000001e43

    1. Initial program 95.2%

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

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

        \[\leadsto \color{blue}{t \cdot \left(b - a\right)} \]
      2. lower--.f6482.8

        \[\leadsto t \cdot \color{blue}{\left(b - a\right)} \]
    5. Simplified82.8%

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

      \[\leadsto \color{blue}{b \cdot t} \]
    7. Step-by-step derivation
      1. lower-*.f6451.3

        \[\leadsto \color{blue}{b \cdot t} \]
    8. Simplified51.3%

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

    if -3.5000000000000001e43 < t < -2.89999999999999988e-157 or -1.5200000000000001e-261 < t < 1.70000000000000007e-183

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{b \cdot \left(\left(t + y\right) - 2\right)} \]
      2. +-commutativeN/A

        \[\leadsto b \cdot \left(\color{blue}{\left(y + t\right)} - 2\right) \]
      3. associate-+r-N/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
      4. lower-+.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
      5. sub-negN/A

        \[\leadsto b \cdot \left(y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      6. lower-+.f64N/A

        \[\leadsto b \cdot \left(y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      7. metadata-eval54.0

        \[\leadsto b \cdot \left(y + \left(t + \color{blue}{-2}\right)\right) \]
    5. Simplified54.0%

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

      \[\leadsto \color{blue}{b \cdot \left(y - 2\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{b \cdot \left(y - 2\right)} \]
      2. sub-negN/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(\mathsf{neg}\left(2\right)\right)\right)} \]
      3. lower-+.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(\mathsf{neg}\left(2\right)\right)\right)} \]
      4. metadata-eval52.9

        \[\leadsto b \cdot \left(y + \color{blue}{-2}\right) \]
    8. Simplified52.9%

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

    if -2.89999999999999988e-157 < t < -1.5200000000000001e-261

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{\left(b \cdot \left(\left(t + y\right) - 2\right) + x\right)} - a \cdot \left(t - 1\right) \]
      2. associate--l+N/A

        \[\leadsto \color{blue}{b \cdot \left(\left(t + y\right) - 2\right) + \left(x - a \cdot \left(t - 1\right)\right)} \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, \left(t + y\right) - 2, x - a \cdot \left(t - 1\right)\right)} \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\left(y + t\right)} - 2, x - a \cdot \left(t - 1\right)\right) \]
      5. associate-+r-N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
      6. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
      8. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + \color{blue}{-2}\right), x - a \cdot \left(t - 1\right)\right) \]
      10. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{x + \left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right)}\right) \]
      11. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right) + x}\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{a \cdot \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right)} + x\right) \]
      13. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + x\right) \]
      14. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\mathsf{fma}\left(a, -1 \cdot \left(t - 1\right), x\right)}\right) \]
      15. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\mathsf{neg}\left(\left(t - 1\right)\right)}, x\right)\right) \]
      16. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}\right), x\right)\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\left(t + \color{blue}{-1}\right)\right), x\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(-1 + t\right)}\right), x\right)\right) \]
      19. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(-1\right)\right) + \left(\mathsf{neg}\left(t\right)\right)}, x\right)\right) \]
      20. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1} + \left(\mathsf{neg}\left(t\right)\right), x\right)\right) \]
      21. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
      22. lower--.f6467.5

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
    5. Simplified67.5%

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

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

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

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

        \[\leadsto a \cdot \left(1 + \color{blue}{-1 \cdot t}\right) + x \]
      4. +-commutativeN/A

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

        \[\leadsto a \cdot \left(\color{blue}{\left(\mathsf{neg}\left(t\right)\right)} + 1\right) + x \]
      6. metadata-evalN/A

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

        \[\leadsto a \cdot \color{blue}{\left(\mathsf{neg}\left(\left(t + -1\right)\right)\right)} + x \]
      8. metadata-evalN/A

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

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

        \[\leadsto a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + x \]
      11. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(a, -1 \cdot \color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}, x\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a, -1 \cdot \left(t + \color{blue}{-1}\right), x\right) \]
      14. distribute-lft-inN/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{-1 \cdot t + -1 \cdot -1}, x\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a, -1 \cdot t + \color{blue}{1}, x\right) \]
      16. +-commutativeN/A

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

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

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right) \]
      19. lower--.f6448.2

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right) \]
    8. Simplified48.2%

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

      \[\leadsto \color{blue}{a + x} \]
    10. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{x + a} \]
      2. lower-+.f6448.2

        \[\leadsto \color{blue}{x + a} \]
    11. Simplified48.2%

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

    if 1.70000000000000007e-183 < t < 7.80000000000000012e139

    1. Initial program 98.2%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right)} \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right) \cdot z}\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      3. lift--.f64N/A

        \[\leadsto \left(\color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      4. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right)} \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right) \cdot a}\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      6. lift-+.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\color{blue}{\left(y + t\right)} - 2\right) \cdot b \]
      7. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right)} \cdot b \]
      8. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
      9. associate-+l-N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right) - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
      10. lift--.f64N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right) \]
      11. associate--l-N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      12. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      13. lift-*.f64N/A

        \[\leadsto x - \left(\color{blue}{\left(y - 1\right) \cdot z} + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right) \]
      14. lower-fma.f64N/A

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

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

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

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

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

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

        \[\leadsto x - y \cdot \left(-1 \cdot b + \color{blue}{1 \cdot z}\right) \]
      5. metadata-evalN/A

        \[\leadsto x - y \cdot \left(-1 \cdot b + \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot z\right) \]
      6. cancel-sign-sub-invN/A

        \[\leadsto x - y \cdot \color{blue}{\left(-1 \cdot b - -1 \cdot z\right)} \]
      7. lower-*.f64N/A

        \[\leadsto x - \color{blue}{y \cdot \left(-1 \cdot b - -1 \cdot z\right)} \]
      8. cancel-sign-sub-invN/A

        \[\leadsto x - y \cdot \color{blue}{\left(-1 \cdot b + \left(\mathsf{neg}\left(-1\right)\right) \cdot z\right)} \]
      9. metadata-evalN/A

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

        \[\leadsto x - y \cdot \left(-1 \cdot b + \color{blue}{z}\right) \]
      11. +-commutativeN/A

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

        \[\leadsto x - y \cdot \left(z + \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      13. sub-negN/A

        \[\leadsto x - y \cdot \color{blue}{\left(z - b\right)} \]
      14. lower--.f6460.0

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

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

      \[\leadsto \color{blue}{x - -1 \cdot \left(b \cdot y\right)} \]
    9. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto x - \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \cdot y \]
      3. cancel-sign-subN/A

        \[\leadsto \color{blue}{x + b \cdot y} \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{b \cdot y + x} \]
      5. lower-fma.f6453.5

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, y, x\right)} \]
    10. Simplified53.5%

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

    if 7.80000000000000012e139 < t

    1. Initial program 87.8%

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

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

        \[\leadsto \color{blue}{t \cdot \left(b - a\right)} \]
      2. lower--.f6471.7

        \[\leadsto t \cdot \color{blue}{\left(b - a\right)} \]
    5. Simplified71.7%

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \]
      5. lower-neg.f6445.0

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

      \[\leadsto \color{blue}{t \cdot \left(-a\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification50.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.5 \cdot 10^{+43}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;t \leq -2.9 \cdot 10^{-157}:\\ \;\;\;\;b \cdot \left(y + -2\right)\\ \mathbf{elif}\;t \leq -1.52 \cdot 10^{-261}:\\ \;\;\;\;x + a\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{-183}:\\ \;\;\;\;b \cdot \left(y + -2\right)\\ \mathbf{elif}\;t \leq 7.8 \cdot 10^{+139}:\\ \;\;\;\;\mathsf{fma}\left(b, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;-t \cdot a\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 86.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.38 \cdot 10^{-11}:\\ \;\;\;\;\mathsf{fma}\left(y, b - z, \mathsf{fma}\left(b, t + -2, x + z\right)\right)\\ \mathbf{elif}\;b \leq 1.12 \cdot 10^{-38}:\\ \;\;\;\;\mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, 1 - t, x\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -1.38e-11)
   (fma y (- b z) (fma b (+ t -2.0) (+ x z)))
   (if (<= b 1.12e-38)
     (fma a (- 1.0 t) (fma z (- 1.0 y) x))
     (fma b (+ y (+ t -2.0)) (fma a (- 1.0 t) x)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -1.38e-11) {
		tmp = fma(y, (b - z), fma(b, (t + -2.0), (x + z)));
	} else if (b <= 1.12e-38) {
		tmp = fma(a, (1.0 - t), fma(z, (1.0 - y), x));
	} else {
		tmp = fma(b, (y + (t + -2.0)), fma(a, (1.0 - t), x));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -1.38e-11)
		tmp = fma(y, Float64(b - z), fma(b, Float64(t + -2.0), Float64(x + z)));
	elseif (b <= 1.12e-38)
		tmp = fma(a, Float64(1.0 - t), fma(z, Float64(1.0 - y), x));
	else
		tmp = fma(b, Float64(y + Float64(t + -2.0)), fma(a, Float64(1.0 - t), x));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.38e-11], N[(y * N[(b - z), $MachinePrecision] + N[(b * N[(t + -2.0), $MachinePrecision] + N[(x + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.12e-38], N[(a * N[(1.0 - t), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(b * N[(y + N[(t + -2.0), $MachinePrecision]), $MachinePrecision] + N[(a * N[(1.0 - t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.38 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(y, b - z, \mathsf{fma}\left(b, t + -2, x + z\right)\right)\\

\mathbf{elif}\;b \leq 1.12 \cdot 10^{-38}:\\
\;\;\;\;\mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, 1 - t, x\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.38e-11

    1. Initial program 95.5%

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

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

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

    if -1.38e-11 < b < 1.1200000000000001e-38

    1. Initial program 98.2%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right) + x\right)} - z \cdot \left(y - 1\right) \]
      4. associate-+r-N/A

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

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

        \[\leadsto a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + \left(x - z \cdot \left(y - 1\right)\right) \]
      7. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}\right), x - z \cdot \left(y - 1\right)\right) \]
      10. metadata-evalN/A

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

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

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(-1\right)\right) + \left(\mathsf{neg}\left(t\right)\right)}, x - z \cdot \left(y - 1\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{1} + \left(\mathsf{neg}\left(t\right)\right), x - z \cdot \left(y - 1\right)\right) \]
      14. sub-negN/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{1 - t}, x - z \cdot \left(y - 1\right)\right) \]
      15. lower--.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(a, 1 - t, \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - 1\right)\right)\right) + x}\right) \]
      18. distribute-rgt-neg-inN/A

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

        \[\leadsto \mathsf{fma}\left(a, 1 - t, z \cdot \color{blue}{\left(-1 \cdot \left(y - 1\right)\right)} + x\right) \]
      20. lower-fma.f64N/A

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

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

    if 1.1200000000000001e-38 < b

    1. Initial program 94.5%

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

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

        \[\leadsto \color{blue}{\left(b \cdot \left(\left(t + y\right) - 2\right) + x\right)} - a \cdot \left(t - 1\right) \]
      2. associate--l+N/A

        \[\leadsto \color{blue}{b \cdot \left(\left(t + y\right) - 2\right) + \left(x - a \cdot \left(t - 1\right)\right)} \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, \left(t + y\right) - 2, x - a \cdot \left(t - 1\right)\right)} \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\left(y + t\right)} - 2, x - a \cdot \left(t - 1\right)\right) \]
      5. associate-+r-N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
      6. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
      8. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + \color{blue}{-2}\right), x - a \cdot \left(t - 1\right)\right) \]
      10. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{x + \left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right)}\right) \]
      11. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right) + x}\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{a \cdot \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right)} + x\right) \]
      13. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + x\right) \]
      14. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\mathsf{fma}\left(a, -1 \cdot \left(t - 1\right), x\right)}\right) \]
      15. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\mathsf{neg}\left(\left(t - 1\right)\right)}, x\right)\right) \]
      16. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}\right), x\right)\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\left(t + \color{blue}{-1}\right)\right), x\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(-1 + t\right)}\right), x\right)\right) \]
      19. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(-1\right)\right) + \left(\mathsf{neg}\left(t\right)\right)}, x\right)\right) \]
      20. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1} + \left(\mathsf{neg}\left(t\right)\right), x\right)\right) \]
      21. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
      22. lower--.f6488.2

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
    5. Simplified88.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, 1 - t, x\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.38 \cdot 10^{-11}:\\ \;\;\;\;\mathsf{fma}\left(y, b - z, \mathsf{fma}\left(b, t + -2, x + z\right)\right)\\ \mathbf{elif}\;b \leq 1.12 \cdot 10^{-38}:\\ \;\;\;\;\mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, 1 - t, x\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 89.1% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \mathsf{fma}\left(y + -1, z, t \cdot \left(a - b\right)\right)\\ \mathbf{if}\;z \leq -9.2 \cdot 10^{+75}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{+80}:\\ \;\;\;\;\mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, 1 - t, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (- x (fma (+ y -1.0) z (* t (- a b))))))
   (if (<= z -9.2e+75)
     t_1
     (if (<= z 1.35e+80) (fma b (+ y (+ t -2.0)) (fma a (- 1.0 t) x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x - fma((y + -1.0), z, (t * (a - b)));
	double tmp;
	if (z <= -9.2e+75) {
		tmp = t_1;
	} else if (z <= 1.35e+80) {
		tmp = fma(b, (y + (t + -2.0)), fma(a, (1.0 - t), x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(x - fma(Float64(y + -1.0), z, Float64(t * Float64(a - b))))
	tmp = 0.0
	if (z <= -9.2e+75)
		tmp = t_1;
	elseif (z <= 1.35e+80)
		tmp = fma(b, Float64(y + Float64(t + -2.0)), fma(a, Float64(1.0 - t), x));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x - N[(N[(y + -1.0), $MachinePrecision] * z + N[(t * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.2e+75], t$95$1, If[LessEqual[z, 1.35e+80], N[(b * N[(y + N[(t + -2.0), $MachinePrecision]), $MachinePrecision] + N[(a * N[(1.0 - t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x - \mathsf{fma}\left(y + -1, z, t \cdot \left(a - b\right)\right)\\
\mathbf{if}\;z \leq -9.2 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.35 \cdot 10^{+80}:\\
\;\;\;\;\mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, 1 - t, x\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.1999999999999994e75 or 1.34999999999999991e80 < z

    1. Initial program 93.4%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right)} \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right) \cdot z}\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      3. lift--.f64N/A

        \[\leadsto \left(\color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      4. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right)} \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right) \cdot a}\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      6. lift-+.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\color{blue}{\left(y + t\right)} - 2\right) \cdot b \]
      7. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right)} \cdot b \]
      8. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
      9. associate-+l-N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right) - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
      10. lift--.f64N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right) \]
      11. associate--l-N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      12. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      13. lift-*.f64N/A

        \[\leadsto x - \left(\color{blue}{\left(y - 1\right) \cdot z} + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right) \]
      14. lower-fma.f64N/A

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(y - 1, z, \left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
    4. Applied egg-rr96.0%

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

      \[\leadsto x - \mathsf{fma}\left(y + -1, z, \color{blue}{t \cdot \left(a - b\right)}\right) \]
    6. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x - \mathsf{fma}\left(y + -1, z, t \cdot \color{blue}{\left(a + \left(\mathsf{neg}\left(b\right)\right)\right)}\right) \]
      2. mul-1-negN/A

        \[\leadsto x - \mathsf{fma}\left(y + -1, z, t \cdot \left(a + \color{blue}{-1 \cdot b}\right)\right) \]
      3. lower-*.f64N/A

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

        \[\leadsto x - \mathsf{fma}\left(y + -1, z, t \cdot \left(a + \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right)\right) \]
      5. sub-negN/A

        \[\leadsto x - \mathsf{fma}\left(y + -1, z, t \cdot \color{blue}{\left(a - b\right)}\right) \]
      6. lower--.f6490.0

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

      \[\leadsto x - \mathsf{fma}\left(y + -1, z, \color{blue}{t \cdot \left(a - b\right)}\right) \]

    if -9.1999999999999994e75 < z < 1.34999999999999991e80

    1. Initial program 97.7%

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

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

        \[\leadsto \color{blue}{\left(b \cdot \left(\left(t + y\right) - 2\right) + x\right)} - a \cdot \left(t - 1\right) \]
      2. associate--l+N/A

        \[\leadsto \color{blue}{b \cdot \left(\left(t + y\right) - 2\right) + \left(x - a \cdot \left(t - 1\right)\right)} \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, \left(t + y\right) - 2, x - a \cdot \left(t - 1\right)\right)} \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\left(y + t\right)} - 2, x - a \cdot \left(t - 1\right)\right) \]
      5. associate-+r-N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
      6. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
      8. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + \color{blue}{-2}\right), x - a \cdot \left(t - 1\right)\right) \]
      10. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{x + \left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right)}\right) \]
      11. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right) + x}\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{a \cdot \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right)} + x\right) \]
      13. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + x\right) \]
      14. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\mathsf{fma}\left(a, -1 \cdot \left(t - 1\right), x\right)}\right) \]
      15. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\mathsf{neg}\left(\left(t - 1\right)\right)}, x\right)\right) \]
      16. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}\right), x\right)\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\left(t + \color{blue}{-1}\right)\right), x\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(-1 + t\right)}\right), x\right)\right) \]
      19. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(-1\right)\right) + \left(\mathsf{neg}\left(t\right)\right)}, x\right)\right) \]
      20. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1} + \left(\mathsf{neg}\left(t\right)\right), x\right)\right) \]
      21. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
      22. lower--.f6490.9

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
    5. Simplified90.9%

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

Alternative 7: 79.3% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.6 \cdot 10^{-11}:\\ \;\;\;\;b \cdot \left(y + \left(t + -2\right)\right)\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{+138}:\\ \;\;\;\;\mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t + -2, b, y \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -1.6e-11)
   (* b (+ y (+ t -2.0)))
   (if (<= b 4.2e+138)
     (fma a (- 1.0 t) (fma z (- 1.0 y) x))
     (fma (+ t -2.0) b (* y b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -1.6e-11) {
		tmp = b * (y + (t + -2.0));
	} else if (b <= 4.2e+138) {
		tmp = fma(a, (1.0 - t), fma(z, (1.0 - y), x));
	} else {
		tmp = fma((t + -2.0), b, (y * b));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -1.6e-11)
		tmp = Float64(b * Float64(y + Float64(t + -2.0)));
	elseif (b <= 4.2e+138)
		tmp = fma(a, Float64(1.0 - t), fma(z, Float64(1.0 - y), x));
	else
		tmp = fma(Float64(t + -2.0), b, Float64(y * b));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.6e-11], N[(b * N[(y + N[(t + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.2e+138], N[(a * N[(1.0 - t), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(t + -2.0), $MachinePrecision] * b + N[(y * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.6 \cdot 10^{-11}:\\
\;\;\;\;b \cdot \left(y + \left(t + -2\right)\right)\\

\mathbf{elif}\;b \leq 4.2 \cdot 10^{+138}:\\
\;\;\;\;\mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t + -2, b, y \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.59999999999999997e-11

    1. Initial program 95.5%

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

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

        \[\leadsto \color{blue}{b \cdot \left(\left(t + y\right) - 2\right)} \]
      2. +-commutativeN/A

        \[\leadsto b \cdot \left(\color{blue}{\left(y + t\right)} - 2\right) \]
      3. associate-+r-N/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
      4. lower-+.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
      5. sub-negN/A

        \[\leadsto b \cdot \left(y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      6. lower-+.f64N/A

        \[\leadsto b \cdot \left(y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      7. metadata-eval79.0

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

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

    if -1.59999999999999997e-11 < b < 4.20000000000000014e138

    1. Initial program 97.9%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right) + x\right)} - z \cdot \left(y - 1\right) \]
      4. associate-+r-N/A

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

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

        \[\leadsto a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + \left(x - z \cdot \left(y - 1\right)\right) \]
      7. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}\right), x - z \cdot \left(y - 1\right)\right) \]
      10. metadata-evalN/A

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

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

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(-1\right)\right) + \left(\mathsf{neg}\left(t\right)\right)}, x - z \cdot \left(y - 1\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{1} + \left(\mathsf{neg}\left(t\right)\right), x - z \cdot \left(y - 1\right)\right) \]
      14. sub-negN/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{1 - t}, x - z \cdot \left(y - 1\right)\right) \]
      15. lower--.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(a, 1 - t, \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(y - 1\right)\right)\right) + x}\right) \]
      18. distribute-rgt-neg-inN/A

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

        \[\leadsto \mathsf{fma}\left(a, 1 - t, z \cdot \color{blue}{\left(-1 \cdot \left(y - 1\right)\right)} + x\right) \]
      20. lower-fma.f64N/A

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

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

    if 4.20000000000000014e138 < b

    1. Initial program 92.6%

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

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

        \[\leadsto \color{blue}{b \cdot \left(\left(t + y\right) - 2\right)} \]
      2. +-commutativeN/A

        \[\leadsto b \cdot \left(\color{blue}{\left(y + t\right)} - 2\right) \]
      3. associate-+r-N/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
      4. lower-+.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
      5. sub-negN/A

        \[\leadsto b \cdot \left(y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      6. lower-+.f64N/A

        \[\leadsto b \cdot \left(y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      7. metadata-eval85.8

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

      \[\leadsto \color{blue}{b \cdot \left(y + \left(t + -2\right)\right)} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto b \cdot \left(y + \color{blue}{\left(t + -2\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto b \cdot \color{blue}{\left(\left(t + -2\right) + y\right)} \]
      3. distribute-lft-inN/A

        \[\leadsto \color{blue}{b \cdot \left(t + -2\right) + b \cdot y} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(t + -2\right) \cdot b} + b \cdot y \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(t + -2, b, b \cdot y\right)} \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(t + -2, b, \color{blue}{y \cdot b}\right) \]
      7. lower-*.f6485.9

        \[\leadsto \mathsf{fma}\left(t + -2, b, \color{blue}{y \cdot b}\right) \]
    7. Applied egg-rr85.9%

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

Alternative 8: 31.9% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -7 \cdot 10^{+51}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;t \leq -6.8 \cdot 10^{-302}:\\ \;\;\;\;x + a\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{-86}:\\ \;\;\;\;y \cdot b\\ \mathbf{elif}\;t \leq 5 \cdot 10^{+141}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;t \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -7e+51)
   (* t b)
   (if (<= t -6.8e-302)
     (+ x a)
     (if (<= t 2.7e-86) (* y b) (if (<= t 5e+141) (+ x z) (* t b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -7e+51) {
		tmp = t * b;
	} else if (t <= -6.8e-302) {
		tmp = x + a;
	} else if (t <= 2.7e-86) {
		tmp = y * b;
	} else if (t <= 5e+141) {
		tmp = x + z;
	} else {
		tmp = t * b;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (t <= (-7d+51)) then
        tmp = t * b
    else if (t <= (-6.8d-302)) then
        tmp = x + a
    else if (t <= 2.7d-86) then
        tmp = y * b
    else if (t <= 5d+141) then
        tmp = x + z
    else
        tmp = t * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -7e+51) {
		tmp = t * b;
	} else if (t <= -6.8e-302) {
		tmp = x + a;
	} else if (t <= 2.7e-86) {
		tmp = y * b;
	} else if (t <= 5e+141) {
		tmp = x + z;
	} else {
		tmp = t * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if t <= -7e+51:
		tmp = t * b
	elif t <= -6.8e-302:
		tmp = x + a
	elif t <= 2.7e-86:
		tmp = y * b
	elif t <= 5e+141:
		tmp = x + z
	else:
		tmp = t * b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= -7e+51)
		tmp = Float64(t * b);
	elseif (t <= -6.8e-302)
		tmp = Float64(x + a);
	elseif (t <= 2.7e-86)
		tmp = Float64(y * b);
	elseif (t <= 5e+141)
		tmp = Float64(x + z);
	else
		tmp = Float64(t * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (t <= -7e+51)
		tmp = t * b;
	elseif (t <= -6.8e-302)
		tmp = x + a;
	elseif (t <= 2.7e-86)
		tmp = y * b;
	elseif (t <= 5e+141)
		tmp = x + z;
	else
		tmp = t * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -7e+51], N[(t * b), $MachinePrecision], If[LessEqual[t, -6.8e-302], N[(x + a), $MachinePrecision], If[LessEqual[t, 2.7e-86], N[(y * b), $MachinePrecision], If[LessEqual[t, 5e+141], N[(x + z), $MachinePrecision], N[(t * b), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+51}:\\
\;\;\;\;t \cdot b\\

\mathbf{elif}\;t \leq -6.8 \cdot 10^{-302}:\\
\;\;\;\;x + a\\

\mathbf{elif}\;t \leq 2.7 \cdot 10^{-86}:\\
\;\;\;\;y \cdot b\\

\mathbf{elif}\;t \leq 5 \cdot 10^{+141}:\\
\;\;\;\;x + z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -7e51 or 5.00000000000000025e141 < t

    1. Initial program 91.6%

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

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

        \[\leadsto \color{blue}{t \cdot \left(b - a\right)} \]
      2. lower--.f6480.6

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

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

      \[\leadsto \color{blue}{b \cdot t} \]
    7. Step-by-step derivation
      1. lower-*.f6446.8

        \[\leadsto \color{blue}{b \cdot t} \]
    8. Simplified46.8%

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

    if -7e51 < t < -6.8e-302

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{\left(b \cdot \left(\left(t + y\right) - 2\right) + x\right)} - a \cdot \left(t - 1\right) \]
      2. associate--l+N/A

        \[\leadsto \color{blue}{b \cdot \left(\left(t + y\right) - 2\right) + \left(x - a \cdot \left(t - 1\right)\right)} \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, \left(t + y\right) - 2, x - a \cdot \left(t - 1\right)\right)} \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\left(y + t\right)} - 2, x - a \cdot \left(t - 1\right)\right) \]
      5. associate-+r-N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
      6. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
      8. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + \color{blue}{-2}\right), x - a \cdot \left(t - 1\right)\right) \]
      10. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{x + \left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right)}\right) \]
      11. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right) + x}\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{a \cdot \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right)} + x\right) \]
      13. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + x\right) \]
      14. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\mathsf{fma}\left(a, -1 \cdot \left(t - 1\right), x\right)}\right) \]
      15. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\mathsf{neg}\left(\left(t - 1\right)\right)}, x\right)\right) \]
      16. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}\right), x\right)\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\left(t + \color{blue}{-1}\right)\right), x\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(-1 + t\right)}\right), x\right)\right) \]
      19. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(-1\right)\right) + \left(\mathsf{neg}\left(t\right)\right)}, x\right)\right) \]
      20. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1} + \left(\mathsf{neg}\left(t\right)\right), x\right)\right) \]
      21. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
      22. lower--.f6475.2

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
    5. Simplified75.2%

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

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

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

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

        \[\leadsto a \cdot \left(1 + \color{blue}{-1 \cdot t}\right) + x \]
      4. +-commutativeN/A

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

        \[\leadsto a \cdot \left(\color{blue}{\left(\mathsf{neg}\left(t\right)\right)} + 1\right) + x \]
      6. metadata-evalN/A

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

        \[\leadsto a \cdot \color{blue}{\left(\mathsf{neg}\left(\left(t + -1\right)\right)\right)} + x \]
      8. metadata-evalN/A

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

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

        \[\leadsto a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + x \]
      11. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(a, -1 \cdot \color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}, x\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a, -1 \cdot \left(t + \color{blue}{-1}\right), x\right) \]
      14. distribute-lft-inN/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{-1 \cdot t + -1 \cdot -1}, x\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a, -1 \cdot t + \color{blue}{1}, x\right) \]
      16. +-commutativeN/A

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

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

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right) \]
      19. lower--.f6438.1

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right) \]
    8. Simplified38.1%

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

      \[\leadsto \color{blue}{a + x} \]
    10. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{x + a} \]
      2. lower-+.f6434.2

        \[\leadsto \color{blue}{x + a} \]
    11. Simplified34.2%

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

    if -6.8e-302 < t < 2.69999999999999992e-86

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{b \cdot \left(\left(t + y\right) - 2\right)} \]
      2. +-commutativeN/A

        \[\leadsto b \cdot \left(\color{blue}{\left(y + t\right)} - 2\right) \]
      3. associate-+r-N/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
      4. lower-+.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
      5. sub-negN/A

        \[\leadsto b \cdot \left(y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      6. lower-+.f64N/A

        \[\leadsto b \cdot \left(y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      7. metadata-eval54.7

        \[\leadsto b \cdot \left(y + \left(t + \color{blue}{-2}\right)\right) \]
    5. Simplified54.7%

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

      \[\leadsto \color{blue}{b \cdot y} \]
    7. Step-by-step derivation
      1. lower-*.f6441.6

        \[\leadsto \color{blue}{b \cdot y} \]
    8. Simplified41.6%

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

    if 2.69999999999999992e-86 < t < 5.00000000000000025e141

    1. Initial program 97.5%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right)} \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right) \cdot z}\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      3. lift--.f64N/A

        \[\leadsto \left(\color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      4. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right)} \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right) \cdot a}\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      6. lift-+.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\color{blue}{\left(y + t\right)} - 2\right) \cdot b \]
      7. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right)} \cdot b \]
      8. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
      9. associate-+l-N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right) - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
      10. lift--.f64N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right) \]
      11. associate--l-N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      12. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      13. lift-*.f64N/A

        \[\leadsto x - \left(\color{blue}{\left(y - 1\right) \cdot z} + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right) \]
      14. lower-fma.f64N/A

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(y - 1, z, \left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
    4. Applied egg-rr97.5%

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

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

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

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

        \[\leadsto x - \mathsf{fma}\left(y + -1, z, b \cdot \color{blue}{\left(-1 \cdot y\right)}\right) \]
      4. lower-*.f64N/A

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

        \[\leadsto x - \mathsf{fma}\left(y + -1, z, b \cdot \color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right) \]
      6. lower-neg.f6469.3

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

      \[\leadsto x - \mathsf{fma}\left(y + -1, z, \color{blue}{b \cdot \left(-y\right)}\right) \]
    8. Taylor expanded in y around 0

      \[\leadsto \color{blue}{x - -1 \cdot z} \]
    9. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(-1\right)\right) \cdot z} \]
      2. metadata-evalN/A

        \[\leadsto x + \color{blue}{1} \cdot z \]
      3. *-lft-identityN/A

        \[\leadsto x + \color{blue}{z} \]
      4. lower-+.f6447.9

        \[\leadsto \color{blue}{x + z} \]
    10. Simplified47.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7 \cdot 10^{+51}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;t \leq -6.8 \cdot 10^{-302}:\\ \;\;\;\;x + a\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{-86}:\\ \;\;\;\;y \cdot b\\ \mathbf{elif}\;t \leq 5 \cdot 10^{+141}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;t \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 50.7% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -980000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.15 \cdot 10^{-85}:\\
\;\;\;\;y \cdot \left(b - z\right)\\

\mathbf{elif}\;t \leq 3 \cdot 10^{+56}:\\
\;\;\;\;x + z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -9.8e8 or 3.00000000000000006e56 < t

    1. Initial program 92.7%

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

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

        \[\leadsto \color{blue}{t \cdot \left(b - a\right)} \]
      2. lower--.f6474.4

        \[\leadsto t \cdot \color{blue}{\left(b - a\right)} \]
    5. Simplified74.4%

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

    if -9.8e8 < t < 1.15e-85

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{y \cdot \left(b - z\right)} \]
      2. lower--.f6447.6

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

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

    if 1.15e-85 < t < 3.00000000000000006e56

    1. Initial program 99.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right)} \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right) \cdot z}\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      3. lift--.f64N/A

        \[\leadsto \left(\color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      4. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right)} \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right) \cdot a}\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      6. lift-+.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\color{blue}{\left(y + t\right)} - 2\right) \cdot b \]
      7. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right)} \cdot b \]
      8. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
      9. associate-+l-N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right) - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
      10. lift--.f64N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right) \]
      11. associate--l-N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      12. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      13. lift-*.f64N/A

        \[\leadsto x - \left(\color{blue}{\left(y - 1\right) \cdot z} + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right) \]
      14. lower-fma.f64N/A

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(y - 1, z, \left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
    4. Applied egg-rr99.9%

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

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

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

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

        \[\leadsto x - \mathsf{fma}\left(y + -1, z, b \cdot \color{blue}{\left(-1 \cdot y\right)}\right) \]
      4. lower-*.f64N/A

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

        \[\leadsto x - \mathsf{fma}\left(y + -1, z, b \cdot \color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right) \]
      6. lower-neg.f6481.2

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

      \[\leadsto x - \mathsf{fma}\left(y + -1, z, \color{blue}{b \cdot \left(-y\right)}\right) \]
    8. Taylor expanded in y around 0

      \[\leadsto \color{blue}{x - -1 \cdot z} \]
    9. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(-1\right)\right) \cdot z} \]
      2. metadata-evalN/A

        \[\leadsto x + \color{blue}{1} \cdot z \]
      3. *-lft-identityN/A

        \[\leadsto x + \color{blue}{z} \]
      4. lower-+.f6462.6

        \[\leadsto \color{blue}{x + z} \]
    10. Simplified62.6%

      \[\leadsto \color{blue}{x + z} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 10: 66.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(b - a\right)\\ \mathbf{if}\;t \leq -1.05 \cdot 10^{+21}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{+56}:\\ \;\;\;\;a + \mathsf{fma}\left(b, y + -2, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* t (- b a))))
   (if (<= t -1.05e+21)
     t_1
     (if (<= t 7.2e+56) (+ a (fma b (+ y -2.0) x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = t * (b - a);
	double tmp;
	if (t <= -1.05e+21) {
		tmp = t_1;
	} else if (t <= 7.2e+56) {
		tmp = a + fma(b, (y + -2.0), x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(t * Float64(b - a))
	tmp = 0.0
	if (t <= -1.05e+21)
		tmp = t_1;
	elseif (t <= 7.2e+56)
		tmp = Float64(a + fma(b, Float64(y + -2.0), x));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.05e+21], t$95$1, If[LessEqual[t, 7.2e+56], N[(a + N[(b * N[(y + -2.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -1.05 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 7.2 \cdot 10^{+56}:\\
\;\;\;\;a + \mathsf{fma}\left(b, y + -2, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.05e21 or 7.19999999999999996e56 < t

    1. Initial program 92.7%

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

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

        \[\leadsto \color{blue}{t \cdot \left(b - a\right)} \]
      2. lower--.f6474.4

        \[\leadsto t \cdot \color{blue}{\left(b - a\right)} \]
    5. Simplified74.4%

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

    if -1.05e21 < t < 7.19999999999999996e56

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{\left(b \cdot \left(\left(t + y\right) - 2\right) + x\right)} - a \cdot \left(t - 1\right) \]
      2. associate--l+N/A

        \[\leadsto \color{blue}{b \cdot \left(\left(t + y\right) - 2\right) + \left(x - a \cdot \left(t - 1\right)\right)} \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, \left(t + y\right) - 2, x - a \cdot \left(t - 1\right)\right)} \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\left(y + t\right)} - 2, x - a \cdot \left(t - 1\right)\right) \]
      5. associate-+r-N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
      6. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
      8. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + \color{blue}{-2}\right), x - a \cdot \left(t - 1\right)\right) \]
      10. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{x + \left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right)}\right) \]
      11. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right) + x}\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{a \cdot \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right)} + x\right) \]
      13. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + x\right) \]
      14. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\mathsf{fma}\left(a, -1 \cdot \left(t - 1\right), x\right)}\right) \]
      15. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\mathsf{neg}\left(\left(t - 1\right)\right)}, x\right)\right) \]
      16. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}\right), x\right)\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\left(t + \color{blue}{-1}\right)\right), x\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(-1 + t\right)}\right), x\right)\right) \]
      19. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(-1\right)\right) + \left(\mathsf{neg}\left(t\right)\right)}, x\right)\right) \]
      20. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1} + \left(\mathsf{neg}\left(t\right)\right), x\right)\right) \]
      21. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
      22. lower--.f6474.6

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
    5. Simplified74.6%

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

      \[\leadsto \color{blue}{a + \left(x + b \cdot \left(y - 2\right)\right)} \]
    7. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \color{blue}{a + \left(x + b \cdot \left(y - 2\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto a + \color{blue}{\left(b \cdot \left(y - 2\right) + x\right)} \]
      3. lower-fma.f64N/A

        \[\leadsto a + \color{blue}{\mathsf{fma}\left(b, y - 2, x\right)} \]
      4. sub-negN/A

        \[\leadsto a + \mathsf{fma}\left(b, \color{blue}{y + \left(\mathsf{neg}\left(2\right)\right)}, x\right) \]
      5. lower-+.f64N/A

        \[\leadsto a + \mathsf{fma}\left(b, \color{blue}{y + \left(\mathsf{neg}\left(2\right)\right)}, x\right) \]
      6. metadata-eval72.9

        \[\leadsto a + \mathsf{fma}\left(b, y + \color{blue}{-2}, x\right) \]
    8. Simplified72.9%

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

Alternative 11: 34.8% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -7 \cdot 10^{+51}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;t \leq 2.25 \cdot 10^{-91}:\\ \;\;\;\;x + a\\ \mathbf{elif}\;t \leq 5 \cdot 10^{+141}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;t \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -7e+51)
   (* t b)
   (if (<= t 2.25e-91) (+ x a) (if (<= t 5e+141) (+ x z) (* t b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -7e+51) {
		tmp = t * b;
	} else if (t <= 2.25e-91) {
		tmp = x + a;
	} else if (t <= 5e+141) {
		tmp = x + z;
	} else {
		tmp = t * b;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (t <= (-7d+51)) then
        tmp = t * b
    else if (t <= 2.25d-91) then
        tmp = x + a
    else if (t <= 5d+141) then
        tmp = x + z
    else
        tmp = t * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -7e+51) {
		tmp = t * b;
	} else if (t <= 2.25e-91) {
		tmp = x + a;
	} else if (t <= 5e+141) {
		tmp = x + z;
	} else {
		tmp = t * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if t <= -7e+51:
		tmp = t * b
	elif t <= 2.25e-91:
		tmp = x + a
	elif t <= 5e+141:
		tmp = x + z
	else:
		tmp = t * b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= -7e+51)
		tmp = Float64(t * b);
	elseif (t <= 2.25e-91)
		tmp = Float64(x + a);
	elseif (t <= 5e+141)
		tmp = Float64(x + z);
	else
		tmp = Float64(t * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (t <= -7e+51)
		tmp = t * b;
	elseif (t <= 2.25e-91)
		tmp = x + a;
	elseif (t <= 5e+141)
		tmp = x + z;
	else
		tmp = t * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -7e+51], N[(t * b), $MachinePrecision], If[LessEqual[t, 2.25e-91], N[(x + a), $MachinePrecision], If[LessEqual[t, 5e+141], N[(x + z), $MachinePrecision], N[(t * b), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+51}:\\
\;\;\;\;t \cdot b\\

\mathbf{elif}\;t \leq 2.25 \cdot 10^{-91}:\\
\;\;\;\;x + a\\

\mathbf{elif}\;t \leq 5 \cdot 10^{+141}:\\
\;\;\;\;x + z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7e51 or 5.00000000000000025e141 < t

    1. Initial program 91.6%

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

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

        \[\leadsto \color{blue}{t \cdot \left(b - a\right)} \]
      2. lower--.f6480.6

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

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

      \[\leadsto \color{blue}{b \cdot t} \]
    7. Step-by-step derivation
      1. lower-*.f6446.8

        \[\leadsto \color{blue}{b \cdot t} \]
    8. Simplified46.8%

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

    if -7e51 < t < 2.24999999999999988e-91

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{\left(b \cdot \left(\left(t + y\right) - 2\right) + x\right)} - a \cdot \left(t - 1\right) \]
      2. associate--l+N/A

        \[\leadsto \color{blue}{b \cdot \left(\left(t + y\right) - 2\right) + \left(x - a \cdot \left(t - 1\right)\right)} \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, \left(t + y\right) - 2, x - a \cdot \left(t - 1\right)\right)} \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\left(y + t\right)} - 2, x - a \cdot \left(t - 1\right)\right) \]
      5. associate-+r-N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
      6. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
      8. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + \color{blue}{-2}\right), x - a \cdot \left(t - 1\right)\right) \]
      10. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{x + \left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right)}\right) \]
      11. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right) + x}\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{a \cdot \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right)} + x\right) \]
      13. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + x\right) \]
      14. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\mathsf{fma}\left(a, -1 \cdot \left(t - 1\right), x\right)}\right) \]
      15. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\mathsf{neg}\left(\left(t - 1\right)\right)}, x\right)\right) \]
      16. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}\right), x\right)\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\left(t + \color{blue}{-1}\right)\right), x\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(-1 + t\right)}\right), x\right)\right) \]
      19. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(-1\right)\right) + \left(\mathsf{neg}\left(t\right)\right)}, x\right)\right) \]
      20. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1} + \left(\mathsf{neg}\left(t\right)\right), x\right)\right) \]
      21. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
      22. lower--.f6475.4

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
    5. Simplified75.4%

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

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

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

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

        \[\leadsto a \cdot \left(1 + \color{blue}{-1 \cdot t}\right) + x \]
      4. +-commutativeN/A

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

        \[\leadsto a \cdot \left(\color{blue}{\left(\mathsf{neg}\left(t\right)\right)} + 1\right) + x \]
      6. metadata-evalN/A

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

        \[\leadsto a \cdot \color{blue}{\left(\mathsf{neg}\left(\left(t + -1\right)\right)\right)} + x \]
      8. metadata-evalN/A

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

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

        \[\leadsto a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + x \]
      11. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(a, -1 \cdot \color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}, x\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a, -1 \cdot \left(t + \color{blue}{-1}\right), x\right) \]
      14. distribute-lft-inN/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{-1 \cdot t + -1 \cdot -1}, x\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a, -1 \cdot t + \color{blue}{1}, x\right) \]
      16. +-commutativeN/A

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

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

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right) \]
      19. lower--.f6433.3

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right) \]
    8. Simplified33.3%

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

      \[\leadsto \color{blue}{a + x} \]
    10. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{x + a} \]
      2. lower-+.f6430.7

        \[\leadsto \color{blue}{x + a} \]
    11. Simplified30.7%

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

    if 2.24999999999999988e-91 < t < 5.00000000000000025e141

    1. Initial program 97.7%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right)} \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right) \cdot z}\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      3. lift--.f64N/A

        \[\leadsto \left(\color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      4. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right)} \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right) \cdot a}\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      6. lift-+.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\color{blue}{\left(y + t\right)} - 2\right) \cdot b \]
      7. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right)} \cdot b \]
      8. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
      9. associate-+l-N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right) - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
      10. lift--.f64N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right) \]
      11. associate--l-N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      12. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      13. lift-*.f64N/A

        \[\leadsto x - \left(\color{blue}{\left(y - 1\right) \cdot z} + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right) \]
      14. lower-fma.f64N/A

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(y - 1, z, \left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
    4. Applied egg-rr97.7%

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

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

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

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

        \[\leadsto x - \mathsf{fma}\left(y + -1, z, b \cdot \color{blue}{\left(-1 \cdot y\right)}\right) \]
      4. lower-*.f64N/A

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

        \[\leadsto x - \mathsf{fma}\left(y + -1, z, b \cdot \color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right) \]
      6. lower-neg.f6471.4

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

      \[\leadsto x - \mathsf{fma}\left(y + -1, z, \color{blue}{b \cdot \left(-y\right)}\right) \]
    8. Taylor expanded in y around 0

      \[\leadsto \color{blue}{x - -1 \cdot z} \]
    9. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(-1\right)\right) \cdot z} \]
      2. metadata-evalN/A

        \[\leadsto x + \color{blue}{1} \cdot z \]
      3. *-lft-identityN/A

        \[\leadsto x + \color{blue}{z} \]
      4. lower-+.f6446.9

        \[\leadsto \color{blue}{x + z} \]
    10. Simplified46.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7 \cdot 10^{+51}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;t \leq 2.25 \cdot 10^{-91}:\\ \;\;\;\;x + a\\ \mathbf{elif}\;t \leq 5 \cdot 10^{+141}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;t \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 60.7% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(y + \left(t + -2\right)\right)\\ \mathbf{if}\;b \leq -1.38 \cdot 10^{-11}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 700000000:\\ \;\;\;\;\mathsf{fma}\left(a, 1 - t, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (+ y (+ t -2.0)))))
   (if (<= b -1.38e-11) t_1 (if (<= b 700000000.0) (fma a (- 1.0 t) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (y + (t + -2.0));
	double tmp;
	if (b <= -1.38e-11) {
		tmp = t_1;
	} else if (b <= 700000000.0) {
		tmp = fma(a, (1.0 - t), x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(b * Float64(y + Float64(t + -2.0)))
	tmp = 0.0
	if (b <= -1.38e-11)
		tmp = t_1;
	elseif (b <= 700000000.0)
		tmp = fma(a, Float64(1.0 - t), x);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(y + N[(t + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.38e-11], t$95$1, If[LessEqual[b, 700000000.0], N[(a * N[(1.0 - t), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := b \cdot \left(y + \left(t + -2\right)\right)\\
\mathbf{if}\;b \leq -1.38 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 700000000:\\
\;\;\;\;\mathsf{fma}\left(a, 1 - t, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.38e-11 or 7e8 < b

    1. Initial program 94.6%

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

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

        \[\leadsto \color{blue}{b \cdot \left(\left(t + y\right) - 2\right)} \]
      2. +-commutativeN/A

        \[\leadsto b \cdot \left(\color{blue}{\left(y + t\right)} - 2\right) \]
      3. associate-+r-N/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
      4. lower-+.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
      5. sub-negN/A

        \[\leadsto b \cdot \left(y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      6. lower-+.f64N/A

        \[\leadsto b \cdot \left(y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}\right) \]
      7. metadata-eval76.8

        \[\leadsto b \cdot \left(y + \left(t + \color{blue}{-2}\right)\right) \]
    5. Simplified76.8%

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

    if -1.38e-11 < b < 7e8

    1. Initial program 98.3%

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

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

        \[\leadsto \color{blue}{\left(b \cdot \left(\left(t + y\right) - 2\right) + x\right)} - a \cdot \left(t - 1\right) \]
      2. associate--l+N/A

        \[\leadsto \color{blue}{b \cdot \left(\left(t + y\right) - 2\right) + \left(x - a \cdot \left(t - 1\right)\right)} \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, \left(t + y\right) - 2, x - a \cdot \left(t - 1\right)\right)} \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\left(y + t\right)} - 2, x - a \cdot \left(t - 1\right)\right) \]
      5. associate-+r-N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
      6. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
      8. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + \color{blue}{-2}\right), x - a \cdot \left(t - 1\right)\right) \]
      10. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{x + \left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right)}\right) \]
      11. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right) + x}\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{a \cdot \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right)} + x\right) \]
      13. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + x\right) \]
      14. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\mathsf{fma}\left(a, -1 \cdot \left(t - 1\right), x\right)}\right) \]
      15. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\mathsf{neg}\left(\left(t - 1\right)\right)}, x\right)\right) \]
      16. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}\right), x\right)\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\left(t + \color{blue}{-1}\right)\right), x\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(-1 + t\right)}\right), x\right)\right) \]
      19. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(-1\right)\right) + \left(\mathsf{neg}\left(t\right)\right)}, x\right)\right) \]
      20. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1} + \left(\mathsf{neg}\left(t\right)\right), x\right)\right) \]
      21. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
      22. lower--.f6469.4

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
    5. Simplified69.4%

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

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

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

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

        \[\leadsto a \cdot \left(1 + \color{blue}{-1 \cdot t}\right) + x \]
      4. +-commutativeN/A

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

        \[\leadsto a \cdot \left(\color{blue}{\left(\mathsf{neg}\left(t\right)\right)} + 1\right) + x \]
      6. metadata-evalN/A

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

        \[\leadsto a \cdot \color{blue}{\left(\mathsf{neg}\left(\left(t + -1\right)\right)\right)} + x \]
      8. metadata-evalN/A

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

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

        \[\leadsto a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + x \]
      11. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(a, -1 \cdot \color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}, x\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a, -1 \cdot \left(t + \color{blue}{-1}\right), x\right) \]
      14. distribute-lft-inN/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{-1 \cdot t + -1 \cdot -1}, x\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a, -1 \cdot t + \color{blue}{1}, x\right) \]
      16. +-commutativeN/A

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

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

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right) \]
      19. lower--.f6462.3

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right) \]
    8. Simplified62.3%

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

Alternative 13: 39.0% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -8.6 \cdot 10^{+78}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;t \leq 7.8 \cdot 10^{+139}:\\ \;\;\;\;\mathsf{fma}\left(b, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;-t \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -8.6e+78) (* t b) (if (<= t 7.8e+139) (fma b y x) (- (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -8.6e+78) {
		tmp = t * b;
	} else if (t <= 7.8e+139) {
		tmp = fma(b, y, x);
	} else {
		tmp = -(t * a);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= -8.6e+78)
		tmp = Float64(t * b);
	elseif (t <= 7.8e+139)
		tmp = fma(b, y, x);
	else
		tmp = Float64(-Float64(t * a));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -8.6e+78], N[(t * b), $MachinePrecision], If[LessEqual[t, 7.8e+139], N[(b * y + x), $MachinePrecision], (-N[(t * a), $MachinePrecision])]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.6 \cdot 10^{+78}:\\
\;\;\;\;t \cdot b\\

\mathbf{elif}\;t \leq 7.8 \cdot 10^{+139}:\\
\;\;\;\;\mathsf{fma}\left(b, y, x\right)\\

\mathbf{else}:\\
\;\;\;\;-t \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -8.59999999999999962e78

    1. Initial program 94.3%

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

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

        \[\leadsto \color{blue}{t \cdot \left(b - a\right)} \]
      2. lower--.f6489.2

        \[\leadsto t \cdot \color{blue}{\left(b - a\right)} \]
    5. Simplified89.2%

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

      \[\leadsto \color{blue}{b \cdot t} \]
    7. Step-by-step derivation
      1. lower-*.f6454.1

        \[\leadsto \color{blue}{b \cdot t} \]
    8. Simplified54.1%

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

    if -8.59999999999999962e78 < t < 7.80000000000000012e139

    1. Initial program 99.3%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right)} \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right) \cdot z}\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      3. lift--.f64N/A

        \[\leadsto \left(\color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      4. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right)} \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right) \cdot a}\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      6. lift-+.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\color{blue}{\left(y + t\right)} - 2\right) \cdot b \]
      7. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right)} \cdot b \]
      8. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
      9. associate-+l-N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right) - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
      10. lift--.f64N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right) \]
      11. associate--l-N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      12. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      13. lift-*.f64N/A

        \[\leadsto x - \left(\color{blue}{\left(y - 1\right) \cdot z} + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right) \]
      14. lower-fma.f64N/A

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(y - 1, z, \left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
    4. Applied egg-rr99.3%

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

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

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

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

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

        \[\leadsto x - y \cdot \left(-1 \cdot b + \color{blue}{1 \cdot z}\right) \]
      5. metadata-evalN/A

        \[\leadsto x - y \cdot \left(-1 \cdot b + \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot z\right) \]
      6. cancel-sign-sub-invN/A

        \[\leadsto x - y \cdot \color{blue}{\left(-1 \cdot b - -1 \cdot z\right)} \]
      7. lower-*.f64N/A

        \[\leadsto x - \color{blue}{y \cdot \left(-1 \cdot b - -1 \cdot z\right)} \]
      8. cancel-sign-sub-invN/A

        \[\leadsto x - y \cdot \color{blue}{\left(-1 \cdot b + \left(\mathsf{neg}\left(-1\right)\right) \cdot z\right)} \]
      9. metadata-evalN/A

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

        \[\leadsto x - y \cdot \left(-1 \cdot b + \color{blue}{z}\right) \]
      11. +-commutativeN/A

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

        \[\leadsto x - y \cdot \left(z + \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      13. sub-negN/A

        \[\leadsto x - y \cdot \color{blue}{\left(z - b\right)} \]
      14. lower--.f6457.3

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

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

      \[\leadsto \color{blue}{x - -1 \cdot \left(b \cdot y\right)} \]
    9. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto x - \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \cdot y \]
      3. cancel-sign-subN/A

        \[\leadsto \color{blue}{x + b \cdot y} \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{b \cdot y + x} \]
      5. lower-fma.f6442.5

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, y, x\right)} \]
    10. Simplified42.5%

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

    if 7.80000000000000012e139 < t

    1. Initial program 87.8%

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

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

        \[\leadsto \color{blue}{t \cdot \left(b - a\right)} \]
      2. lower--.f6471.7

        \[\leadsto t \cdot \color{blue}{\left(b - a\right)} \]
    5. Simplified71.7%

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \]
      5. lower-neg.f6445.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.6 \cdot 10^{+78}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;t \leq 7.8 \cdot 10^{+139}:\\ \;\;\;\;\mathsf{fma}\left(b, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;-t \cdot a\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 38.0% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -8.6 \cdot 10^{+78}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{+138}:\\ \;\;\;\;\mathsf{fma}\left(b, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -8.6e+78) (* t b) (if (<= t 4.1e+138) (fma b y x) (* t b))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -8.6e+78) {
		tmp = t * b;
	} else if (t <= 4.1e+138) {
		tmp = fma(b, y, x);
	} else {
		tmp = t * b;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= -8.6e+78)
		tmp = Float64(t * b);
	elseif (t <= 4.1e+138)
		tmp = fma(b, y, x);
	else
		tmp = Float64(t * b);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -8.6e+78], N[(t * b), $MachinePrecision], If[LessEqual[t, 4.1e+138], N[(b * y + x), $MachinePrecision], N[(t * b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.6 \cdot 10^{+78}:\\
\;\;\;\;t \cdot b\\

\mathbf{elif}\;t \leq 4.1 \cdot 10^{+138}:\\
\;\;\;\;\mathsf{fma}\left(b, y, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.59999999999999962e78 or 4.0999999999999998e138 < t

    1. Initial program 91.6%

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

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

        \[\leadsto \color{blue}{t \cdot \left(b - a\right)} \]
      2. lower--.f6481.1

        \[\leadsto t \cdot \color{blue}{\left(b - a\right)} \]
    5. Simplified81.1%

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

      \[\leadsto \color{blue}{b \cdot t} \]
    7. Step-by-step derivation
      1. lower-*.f6446.2

        \[\leadsto \color{blue}{b \cdot t} \]
    8. Simplified46.2%

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

    if -8.59999999999999962e78 < t < 4.0999999999999998e138

    1. Initial program 99.3%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right)} \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right) \cdot z}\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      3. lift--.f64N/A

        \[\leadsto \left(\color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      4. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right)} \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right) \cdot a}\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      6. lift-+.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\color{blue}{\left(y + t\right)} - 2\right) \cdot b \]
      7. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right)} \cdot b \]
      8. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
      9. associate-+l-N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right) - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
      10. lift--.f64N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right) \]
      11. associate--l-N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      12. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      13. lift-*.f64N/A

        \[\leadsto x - \left(\color{blue}{\left(y - 1\right) \cdot z} + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right) \]
      14. lower-fma.f64N/A

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(y - 1, z, \left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
    4. Applied egg-rr99.3%

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

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

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

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

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

        \[\leadsto x - y \cdot \left(-1 \cdot b + \color{blue}{1 \cdot z}\right) \]
      5. metadata-evalN/A

        \[\leadsto x - y \cdot \left(-1 \cdot b + \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot z\right) \]
      6. cancel-sign-sub-invN/A

        \[\leadsto x - y \cdot \color{blue}{\left(-1 \cdot b - -1 \cdot z\right)} \]
      7. lower-*.f64N/A

        \[\leadsto x - \color{blue}{y \cdot \left(-1 \cdot b - -1 \cdot z\right)} \]
      8. cancel-sign-sub-invN/A

        \[\leadsto x - y \cdot \color{blue}{\left(-1 \cdot b + \left(\mathsf{neg}\left(-1\right)\right) \cdot z\right)} \]
      9. metadata-evalN/A

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

        \[\leadsto x - y \cdot \left(-1 \cdot b + \color{blue}{z}\right) \]
      11. +-commutativeN/A

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

        \[\leadsto x - y \cdot \left(z + \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      13. sub-negN/A

        \[\leadsto x - y \cdot \color{blue}{\left(z - b\right)} \]
      14. lower--.f6457.6

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

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

      \[\leadsto \color{blue}{x - -1 \cdot \left(b \cdot y\right)} \]
    9. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto x - \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \cdot y \]
      3. cancel-sign-subN/A

        \[\leadsto \color{blue}{x + b \cdot y} \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{b \cdot y + x} \]
      5. lower-fma.f6442.7

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, y, x\right)} \]
    10. Simplified42.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.6 \cdot 10^{+78}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{+138}:\\ \;\;\;\;\mathsf{fma}\left(b, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 29.5% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -7 \cdot 10^{+122}:\\ \;\;\;\;x + a\\ \mathbf{elif}\;a \leq 1.4 \cdot 10^{-70}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;x + a\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -7e+122) (+ x a) (if (<= a 1.4e-70) (+ x z) (+ x a))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -7e+122) {
		tmp = x + a;
	} else if (a <= 1.4e-70) {
		tmp = x + z;
	} else {
		tmp = x + a;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (a <= (-7d+122)) then
        tmp = x + a
    else if (a <= 1.4d-70) then
        tmp = x + z
    else
        tmp = x + a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -7e+122) {
		tmp = x + a;
	} else if (a <= 1.4e-70) {
		tmp = x + z;
	} else {
		tmp = x + a;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -7e+122:
		tmp = x + a
	elif a <= 1.4e-70:
		tmp = x + z
	else:
		tmp = x + a
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -7e+122)
		tmp = Float64(x + a);
	elseif (a <= 1.4e-70)
		tmp = Float64(x + z);
	else
		tmp = Float64(x + a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= -7e+122)
		tmp = x + a;
	elseif (a <= 1.4e-70)
		tmp = x + z;
	else
		tmp = x + a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -7e+122], N[(x + a), $MachinePrecision], If[LessEqual[a, 1.4e-70], N[(x + z), $MachinePrecision], N[(x + a), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -7 \cdot 10^{+122}:\\
\;\;\;\;x + a\\

\mathbf{elif}\;a \leq 1.4 \cdot 10^{-70}:\\
\;\;\;\;x + z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.00000000000000028e122 or 1.4e-70 < a

    1. Initial program 93.7%

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

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

        \[\leadsto \color{blue}{\left(b \cdot \left(\left(t + y\right) - 2\right) + x\right)} - a \cdot \left(t - 1\right) \]
      2. associate--l+N/A

        \[\leadsto \color{blue}{b \cdot \left(\left(t + y\right) - 2\right) + \left(x - a \cdot \left(t - 1\right)\right)} \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, \left(t + y\right) - 2, x - a \cdot \left(t - 1\right)\right)} \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\left(y + t\right)} - 2, x - a \cdot \left(t - 1\right)\right) \]
      5. associate-+r-N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
      6. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
      8. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + \color{blue}{-2}\right), x - a \cdot \left(t - 1\right)\right) \]
      10. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{x + \left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right)}\right) \]
      11. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right) + x}\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{a \cdot \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right)} + x\right) \]
      13. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + x\right) \]
      14. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\mathsf{fma}\left(a, -1 \cdot \left(t - 1\right), x\right)}\right) \]
      15. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\mathsf{neg}\left(\left(t - 1\right)\right)}, x\right)\right) \]
      16. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}\right), x\right)\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\left(t + \color{blue}{-1}\right)\right), x\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(-1 + t\right)}\right), x\right)\right) \]
      19. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(-1\right)\right) + \left(\mathsf{neg}\left(t\right)\right)}, x\right)\right) \]
      20. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1} + \left(\mathsf{neg}\left(t\right)\right), x\right)\right) \]
      21. sub-negN/A

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
      22. lower--.f6485.3

        \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
    5. Simplified85.3%

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

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

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

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

        \[\leadsto a \cdot \left(1 + \color{blue}{-1 \cdot t}\right) + x \]
      4. +-commutativeN/A

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

        \[\leadsto a \cdot \left(\color{blue}{\left(\mathsf{neg}\left(t\right)\right)} + 1\right) + x \]
      6. metadata-evalN/A

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

        \[\leadsto a \cdot \color{blue}{\left(\mathsf{neg}\left(\left(t + -1\right)\right)\right)} + x \]
      8. metadata-evalN/A

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

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

        \[\leadsto a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + x \]
      11. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(a, -1 \cdot \color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}, x\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a, -1 \cdot \left(t + \color{blue}{-1}\right), x\right) \]
      14. distribute-lft-inN/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{-1 \cdot t + -1 \cdot -1}, x\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a, -1 \cdot t + \color{blue}{1}, x\right) \]
      16. +-commutativeN/A

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

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

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right) \]
      19. lower--.f6458.4

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right) \]
    8. Simplified58.4%

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

      \[\leadsto \color{blue}{a + x} \]
    10. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{x + a} \]
      2. lower-+.f6421.6

        \[\leadsto \color{blue}{x + a} \]
    11. Simplified21.6%

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

    if -7.00000000000000028e122 < a < 1.4e-70

    1. Initial program 98.6%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right)} \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(x - \color{blue}{\left(y - 1\right) \cdot z}\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      3. lift--.f64N/A

        \[\leadsto \left(\color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      4. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right)} \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \color{blue}{\left(t - 1\right) \cdot a}\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      6. lift-+.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\color{blue}{\left(y + t\right)} - 2\right) \cdot b \]
      7. lift--.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right)} \cdot b \]
      8. lift-*.f64N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b} \]
      9. associate-+l-N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right) - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
      10. lift--.f64N/A

        \[\leadsto \color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right) \]
      11. associate--l-N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      12. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\left(y - 1\right) \cdot z + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)} \]
      13. lift-*.f64N/A

        \[\leadsto x - \left(\color{blue}{\left(y - 1\right) \cdot z} + \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right) \]
      14. lower-fma.f64N/A

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(y - 1, z, \left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)} \]
    4. Applied egg-rr99.3%

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

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

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

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

        \[\leadsto x - \mathsf{fma}\left(y + -1, z, b \cdot \color{blue}{\left(-1 \cdot y\right)}\right) \]
      4. lower-*.f64N/A

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

        \[\leadsto x - \mathsf{fma}\left(y + -1, z, b \cdot \color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right) \]
      6. lower-neg.f6465.1

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

      \[\leadsto x - \mathsf{fma}\left(y + -1, z, \color{blue}{b \cdot \left(-y\right)}\right) \]
    8. Taylor expanded in y around 0

      \[\leadsto \color{blue}{x - -1 \cdot z} \]
    9. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{x + \left(\mathsf{neg}\left(-1\right)\right) \cdot z} \]
      2. metadata-evalN/A

        \[\leadsto x + \color{blue}{1} \cdot z \]
      3. *-lft-identityN/A

        \[\leadsto x + \color{blue}{z} \]
      4. lower-+.f6434.5

        \[\leadsto \color{blue}{x + z} \]
    10. Simplified34.5%

      \[\leadsto \color{blue}{x + z} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 16: 24.3% accurate, 9.3× speedup?

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

\\
x + a
\end{array}
Derivation
  1. Initial program 96.4%

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

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

      \[\leadsto \color{blue}{\left(b \cdot \left(\left(t + y\right) - 2\right) + x\right)} - a \cdot \left(t - 1\right) \]
    2. associate--l+N/A

      \[\leadsto \color{blue}{b \cdot \left(\left(t + y\right) - 2\right) + \left(x - a \cdot \left(t - 1\right)\right)} \]
    3. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, \left(t + y\right) - 2, x - a \cdot \left(t - 1\right)\right)} \]
    4. +-commutativeN/A

      \[\leadsto \mathsf{fma}\left(b, \color{blue}{\left(y + t\right)} - 2, x - a \cdot \left(t - 1\right)\right) \]
    5. associate-+r-N/A

      \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
    6. lower-+.f64N/A

      \[\leadsto \mathsf{fma}\left(b, \color{blue}{y + \left(t - 2\right)}, x - a \cdot \left(t - 1\right)\right) \]
    7. sub-negN/A

      \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
    8. lower-+.f64N/A

      \[\leadsto \mathsf{fma}\left(b, y + \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right)\right)}, x - a \cdot \left(t - 1\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(b, y + \left(t + \color{blue}{-2}\right), x - a \cdot \left(t - 1\right)\right) \]
    10. sub-negN/A

      \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{x + \left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right)}\right) \]
    11. +-commutativeN/A

      \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\left(\mathsf{neg}\left(a \cdot \left(t - 1\right)\right)\right) + x}\right) \]
    12. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{a \cdot \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right)} + x\right) \]
    13. mul-1-negN/A

      \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + x\right) \]
    14. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \color{blue}{\mathsf{fma}\left(a, -1 \cdot \left(t - 1\right), x\right)}\right) \]
    15. mul-1-negN/A

      \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\mathsf{neg}\left(\left(t - 1\right)\right)}, x\right)\right) \]
    16. sub-negN/A

      \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}\right), x\right)\right) \]
    17. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\left(t + \color{blue}{-1}\right)\right), x\right)\right) \]
    18. +-commutativeN/A

      \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \mathsf{neg}\left(\color{blue}{\left(-1 + t\right)}\right), x\right)\right) \]
    19. distribute-neg-inN/A

      \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(-1\right)\right) + \left(\mathsf{neg}\left(t\right)\right)}, x\right)\right) \]
    20. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1} + \left(\mathsf{neg}\left(t\right)\right), x\right)\right) \]
    21. sub-negN/A

      \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
    22. lower--.f6478.8

      \[\leadsto \mathsf{fma}\left(b, y + \left(t + -2\right), \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right)\right) \]
  5. Simplified78.8%

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

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

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

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

      \[\leadsto a \cdot \left(1 + \color{blue}{-1 \cdot t}\right) + x \]
    4. +-commutativeN/A

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

      \[\leadsto a \cdot \left(\color{blue}{\left(\mathsf{neg}\left(t\right)\right)} + 1\right) + x \]
    6. metadata-evalN/A

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

      \[\leadsto a \cdot \color{blue}{\left(\mathsf{neg}\left(\left(t + -1\right)\right)\right)} + x \]
    8. metadata-evalN/A

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

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

      \[\leadsto a \cdot \color{blue}{\left(-1 \cdot \left(t - 1\right)\right)} + x \]
    11. lower-fma.f64N/A

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

      \[\leadsto \mathsf{fma}\left(a, -1 \cdot \color{blue}{\left(t + \left(\mathsf{neg}\left(1\right)\right)\right)}, x\right) \]
    13. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(a, -1 \cdot \left(t + \color{blue}{-1}\right), x\right) \]
    14. distribute-lft-inN/A

      \[\leadsto \mathsf{fma}\left(a, \color{blue}{-1 \cdot t + -1 \cdot -1}, x\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(a, -1 \cdot t + \color{blue}{1}, x\right) \]
    16. +-commutativeN/A

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

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

      \[\leadsto \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right) \]
    19. lower--.f6441.8

      \[\leadsto \mathsf{fma}\left(a, \color{blue}{1 - t}, x\right) \]
  8. Simplified41.8%

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

    \[\leadsto \color{blue}{a + x} \]
  10. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \color{blue}{x + a} \]
    2. lower-+.f6422.3

      \[\leadsto \color{blue}{x + a} \]
  11. Simplified22.3%

    \[\leadsto \color{blue}{x + a} \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2024207 
(FPCore (x y z t a b)
  :name "Statistics.Distribution.Beta:$centropy from math-functions-0.1.5.2"
  :precision binary64
  (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))