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

Percentage Accurate: 95.3% → 98.6%
Time: 38.2s
Alternatives: 13
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 13 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 95.3% 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: 98.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := \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\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, 1 - y, t \cdot \left(b - a\right)\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

    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 x around 0

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

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

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

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

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

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

    \[\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:\\ \;\;\;\;\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\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, 1 - y, t \cdot \left(b - a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 68.1% accurate, 1.0× speedup?

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

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

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

\mathbf{elif}\;t \leq 4.8 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{x}{z}, z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.6000000000000001e-14 or 4.8e20 < t

    1. Initial program 91.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 x around 0

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

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

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

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

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

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

    if -1.6000000000000001e-14 < t < 7.80000000000000049e-7

    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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(b - z\right)} + a \]
      4. lower--.f6452.2

        \[\leadsto y \cdot \color{blue}{\left(b - z\right)} + a \]
    12. Applied rewrites52.2%

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

    if 7.80000000000000049e-7 < t < 4.8e20

    1. Initial program 90.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 z around inf

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{x}{z}}, z\right) \]
    8. Applied rewrites62.3%

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{x}{z}}, z\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification66.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.6 \cdot 10^{-14}:\\ \;\;\;\;\mathsf{fma}\left(z, 1 - y, t \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;t \leq 7.8 \cdot 10^{-7}:\\ \;\;\;\;a + y \cdot \left(b - z\right)\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{+20}:\\ \;\;\;\;\mathsf{fma}\left(z, \frac{x}{z}, z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, 1 - y, t \cdot \left(b - a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 85.9% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(t, b - a, a + \mathsf{fma}\left(b, y + -2, x\right)\right)\\ \mathbf{if}\;b \leq -2.3 \cdot 10^{+127}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 9.2 \cdot 10^{-63}:\\ \;\;\;\;\mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (fma t (- b a) (+ a (fma b (+ y -2.0) x)))))
   (if (<= b -2.3e+127)
     t_1
     (if (<= b 9.2e-63) (fma a (- 1.0 t) (fma z (- 1.0 y) x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = fma(t, (b - a), (a + fma(b, (y + -2.0), x)));
	double tmp;
	if (b <= -2.3e+127) {
		tmp = t_1;
	} else if (b <= 9.2e-63) {
		tmp = fma(a, (1.0 - t), fma(z, (1.0 - y), x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = fma(t, Float64(b - a), Float64(a + fma(b, Float64(y + -2.0), x)))
	tmp = 0.0
	if (b <= -2.3e+127)
		tmp = t_1;
	elseif (b <= 9.2e-63)
		tmp = fma(a, Float64(1.0 - t), fma(z, Float64(1.0 - y), 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] + N[(a + N[(b * N[(y + -2.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.3e+127], t$95$1, If[LessEqual[b, 9.2e-63], N[(a * N[(1.0 - t), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.3000000000000002e127 or 9.2e-63 < b

    1. Initial program 90.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 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. Applied rewrites90.5%

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

    if -2.3000000000000002e127 < b < 9.2e-63

    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. sub-negN/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, 1 + \color{blue}{\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. Applied rewrites92.1%

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

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

Alternative 4: 86.9% accurate, 1.1× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.9e143 or 4.2000000000000003e29 < y

    1. Initial program 90.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(z, 1 - y, a + \left(x + \color{blue}{b \cdot y}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f6485.3

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

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

    if -1.9e143 < y < 4.2000000000000003e29

    1. Initial program 96.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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 82.9% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3.00000000000000002e146 or 1.39999999999999999e117 < b

    1. Initial program 88.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto b \cdot \left(t + \color{blue}{\left(y + -2\right)}\right) + a \]
    12. Applied rewrites79.7%

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

    if -3.00000000000000002e146 < b < 1.39999999999999999e117

    1. Initial program 97.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. sub-negN/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, 1 + \color{blue}{\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. Applied rewrites87.1%

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

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

Alternative 6: 68.5% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;t \leq 5400000:\\
\;\;\;\;a + y \cdot \left(b - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.6000000000000001e-14 or 5.4e6 < 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 x around 0

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

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

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

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

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

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

    if -1.6000000000000001e-14 < t < 5.4e6

    1. Initial program 97.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(b - z\right)} + a \]
      4. lower--.f6451.2

        \[\leadsto y \cdot \color{blue}{\left(b - z\right)} + a \]
    12. Applied rewrites51.2%

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

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

Alternative 7: 59.8% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, t \cdot b\right)\\

\mathbf{elif}\;t \leq 1800000000000:\\
\;\;\;\;a + y \cdot \left(b - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.00000000000000018e25

    1. Initial program 90.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--.f6464.7

        \[\leadsto t \cdot \color{blue}{\left(b - a\right)} \]
    5. Applied rewrites64.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) + b \cdot t} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(a\right)}, t, b \cdot t\right) \]
      4. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(a\right)}, t, b \cdot t\right) \]
      5. lower-*.f6464.7

        \[\leadsto \mathsf{fma}\left(-a, t, \color{blue}{b \cdot t}\right) \]
    8. Applied rewrites64.7%

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

    if -2.00000000000000018e25 < t < 1.8e12

    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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(b - z\right)} + a \]
      4. lower--.f6450.3

        \[\leadsto y \cdot \color{blue}{\left(b - z\right)} + a \]
    12. Applied rewrites50.3%

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

    if 1.8e12 < t

    1. Initial program 91.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--.f6463.5

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

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

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

Alternative 8: 60.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(b - a\right)\\ \mathbf{if}\;t \leq -2 \cdot 10^{+25}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1800000000000:\\ \;\;\;\;a + y \cdot \left(b - z\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 -2e+25) t_1 (if (<= t 1800000000000.0) (+ a (* y (- b 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 <= -2e+25) {
		tmp = t_1;
	} else if (t <= 1800000000000.0) {
		tmp = a + (y * (b - 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 <= (-2d+25)) then
        tmp = t_1
    else if (t <= 1800000000000.0d0) then
        tmp = a + (y * (b - 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 <= -2e+25) {
		tmp = t_1;
	} else if (t <= 1800000000000.0) {
		tmp = a + (y * (b - z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = t * (b - a)
	tmp = 0
	if t <= -2e+25:
		tmp = t_1
	elif t <= 1800000000000.0:
		tmp = a + (y * (b - 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 <= -2e+25)
		tmp = t_1;
	elseif (t <= 1800000000000.0)
		tmp = Float64(a + Float64(y * Float64(b - 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 <= -2e+25)
		tmp = t_1;
	elseif (t <= 1800000000000.0)
		tmp = a + (y * (b - 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, -2e+25], t$95$1, If[LessEqual[t, 1800000000000.0], N[(a + N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 1800000000000:\\
\;\;\;\;a + y \cdot \left(b - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.00000000000000018e25 or 1.8e12 < t

    1. Initial program 91.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--.f6464.1

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

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

    if -2.00000000000000018e25 < t < 1.8e12

    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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(b - z\right)} + a \]
      4. lower--.f6450.3

        \[\leadsto y \cdot \color{blue}{\left(b - z\right)} + a \]
    12. Applied rewrites50.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2 \cdot 10^{+25}:\\ \;\;\;\;t \cdot \left(b - a\right)\\ \mathbf{elif}\;t \leq 1800000000000:\\ \;\;\;\;a + y \cdot \left(b - z\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(b - a\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 49.6% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(b - z\right)\\ \mathbf{if}\;y \leq -1.8 \cdot 10^{+143}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+18}:\\ \;\;\;\;t \cdot \left(b - a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* y (- b z))))
   (if (<= y -1.8e+143) t_1 (if (<= y 4e+18) (* t (- b a)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y * (b - z);
	double tmp;
	if (y <= -1.8e+143) {
		tmp = t_1;
	} else if (y <= 4e+18) {
		tmp = t * (b - a);
	} 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 = y * (b - z)
    if (y <= (-1.8d+143)) then
        tmp = t_1
    else if (y <= 4d+18) then
        tmp = t * (b - a)
    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 = y * (b - z);
	double tmp;
	if (y <= -1.8e+143) {
		tmp = t_1;
	} else if (y <= 4e+18) {
		tmp = t * (b - a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = y * (b - z)
	tmp = 0
	if y <= -1.8e+143:
		tmp = t_1
	elif y <= 4e+18:
		tmp = t * (b - a)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(y * Float64(b - z))
	tmp = 0.0
	if (y <= -1.8e+143)
		tmp = t_1;
	elseif (y <= 4e+18)
		tmp = Float64(t * Float64(b - a));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = y * (b - z);
	tmp = 0.0;
	if (y <= -1.8e+143)
		tmp = t_1;
	elseif (y <= 4e+18)
		tmp = t * (b - a);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.8e+143], t$95$1, If[LessEqual[y, 4e+18], N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \left(b - z\right)\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+143}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 4 \cdot 10^{+18}:\\
\;\;\;\;t \cdot \left(b - a\right)\\

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


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

    1. Initial program 91.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--.f6473.6

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

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

    if -1.8e143 < y < 4e18

    1. Initial program 96.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--.f6439.1

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

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

Alternative 10: 41.8% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(b - a\right)\\ \mathbf{if}\;t \leq -3.9 \cdot 10^{+21}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 30:\\ \;\;\;\;a \cdot \left(1 - t\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 -3.9e+21) t_1 (if (<= t 30.0) (* a (- 1.0 t)) 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 <= -3.9e+21) {
		tmp = t_1;
	} else if (t <= 30.0) {
		tmp = a * (1.0 - t);
	} 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 <= (-3.9d+21)) then
        tmp = t_1
    else if (t <= 30.0d0) then
        tmp = a * (1.0d0 - t)
    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 <= -3.9e+21) {
		tmp = t_1;
	} else if (t <= 30.0) {
		tmp = a * (1.0 - t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = t * (b - a)
	tmp = 0
	if t <= -3.9e+21:
		tmp = t_1
	elif t <= 30.0:
		tmp = a * (1.0 - t)
	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 <= -3.9e+21)
		tmp = t_1;
	elseif (t <= 30.0)
		tmp = Float64(a * Float64(1.0 - t));
	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 <= -3.9e+21)
		tmp = t_1;
	elseif (t <= 30.0)
		tmp = a * (1.0 - t);
	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, -3.9e+21], t$95$1, If[LessEqual[t, 30.0], N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 30:\\
\;\;\;\;a \cdot \left(1 - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.9e21 or 30 < t

    1. Initial program 90.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 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--.f6462.7

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

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

    if -3.9e21 < t < 30

    1. Initial program 98.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 x around 0

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

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \left(1 - t\right)} \]
      4. lower--.f6416.0

        \[\leadsto a \cdot \color{blue}{\left(1 - t\right)} \]
    7. Applied rewrites16.0%

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

Alternative 11: 34.7% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.6 \cdot 10^{+146}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;b \leq 1.7 \cdot 10^{+117}:\\ \;\;\;\;a \cdot \left(1 - t\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -2.6e+146) (* t b) (if (<= b 1.7e+117) (* a (- 1.0 t)) (* t b))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -2.6e+146) {
		tmp = t * b;
	} else if (b <= 1.7e+117) {
		tmp = a * (1.0 - t);
	} 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 (b <= (-2.6d+146)) then
        tmp = t * b
    else if (b <= 1.7d+117) then
        tmp = a * (1.0d0 - t)
    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 (b <= -2.6e+146) {
		tmp = t * b;
	} else if (b <= 1.7e+117) {
		tmp = a * (1.0 - t);
	} else {
		tmp = t * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if b <= -2.6e+146:
		tmp = t * b
	elif b <= 1.7e+117:
		tmp = a * (1.0 - t)
	else:
		tmp = t * b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -2.6e+146)
		tmp = Float64(t * b);
	elseif (b <= 1.7e+117)
		tmp = Float64(a * Float64(1.0 - t));
	else
		tmp = Float64(t * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (b <= -2.6e+146)
		tmp = t * b;
	elseif (b <= 1.7e+117)
		tmp = a * (1.0 - t);
	else
		tmp = t * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.6e+146], N[(t * b), $MachinePrecision], If[LessEqual[b, 1.7e+117], N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision], N[(t * b), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq 1.7 \cdot 10^{+117}:\\
\;\;\;\;a \cdot \left(1 - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.60000000000000014e146 or 1.7e117 < b

    1. Initial program 88.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--.f6437.5

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

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

        \[\leadsto \color{blue}{b \cdot t} \]
    8. Applied rewrites34.2%

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

    if -2.60000000000000014e146 < b < 1.7e117

    1. Initial program 97.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 x around 0

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

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \left(1 - t\right)} \]
      4. lower--.f6435.7

        \[\leadsto a \cdot \color{blue}{\left(1 - t\right)} \]
    7. Applied rewrites35.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.6 \cdot 10^{+146}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;b \leq 1.7 \cdot 10^{+117}:\\ \;\;\;\;a \cdot \left(1 - t\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 26.5% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;b \leq 1.24 \cdot 10^{+117}:\\
\;\;\;\;t \cdot \left(-a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.4000000000000002e146 or 1.23999999999999998e117 < b

    1. Initial program 88.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--.f6437.5

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

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

        \[\leadsto \color{blue}{b \cdot t} \]
    8. Applied rewrites34.2%

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

    if -2.4000000000000002e146 < b < 1.23999999999999998e117

    1. Initial program 97.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--.f6429.9

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \]
      2. lower-neg.f6426.9

        \[\leadsto t \cdot \color{blue}{\left(-a\right)} \]
    8. Applied rewrites26.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.4 \cdot 10^{+146}:\\ \;\;\;\;t \cdot b\\ \mathbf{elif}\;b \leq 1.24 \cdot 10^{+117}:\\ \;\;\;\;t \cdot \left(-a\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 17.5% accurate, 6.2× speedup?

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

\\
t \cdot b
\end{array}
Derivation
  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 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--.f6432.1

      \[\leadsto t \cdot \color{blue}{\left(b - a\right)} \]
  5. Applied rewrites32.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-*.f6414.9

      \[\leadsto \color{blue}{b \cdot t} \]
  8. Applied rewrites14.9%

    \[\leadsto \color{blue}{b \cdot t} \]
  9. Final simplification14.9%

    \[\leadsto t \cdot b \]
  10. Add Preprocessing

Reproduce

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