Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.0% → 95.0%
Time: 9.3s
Alternatives: 14
Speedup: 0.8×

Specification

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

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

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

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

Alternative 1: 95.0% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 96.3%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+96.3%

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

        \[\leadsto \color{blue}{\left(t \cdot a + \left(a \cdot z\right) \cdot b\right) + \left(x + y \cdot z\right)} \]
      3. *-commutative96.3%

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

        \[\leadsto \left(t \cdot a + b \cdot \color{blue}{\left(z \cdot a\right)}\right) + \left(x + y \cdot z\right) \]
      5. associate-*l*97.1%

        \[\leadsto \left(t \cdot a + \color{blue}{\left(b \cdot z\right) \cdot a}\right) + \left(x + y \cdot z\right) \]
      6. distribute-rgt-out97.1%

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

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

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

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

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

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

    if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b))

    1. Initial program 0.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*11.1%

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

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in a around inf 94.4%

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

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

Alternative 2: 96.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\ \mathbf{if}\;t_1 \leq \infty:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b))))
   (if (<= t_1 INFINITY) t_1 (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = a * (t + (z * b));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = a * (t + (z * b));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b)
	tmp = 0
	if t_1 <= math.inf:
		tmp = t_1
	else:
		tmp = a * (t + (z * b))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(a * Float64(t + Float64(z * b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = a * (t + (z * b));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 96.3%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]

    if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b))

    1. Initial program 0.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*11.1%

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

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in a around inf 94.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b \leq \infty:\\ \;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 3: 36.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;b \leq -2.2 \cdot 10^{+165}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -1.05 \cdot 10^{+55}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;b \leq -3.1 \cdot 10^{-111}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq -8.5 \cdot 10^{-238}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 4.5 \cdot 10^{-194}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 2.8 \cdot 10^{-82}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;b \leq 950:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 2 \cdot 10^{+25}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 3 \cdot 10^{+36} \lor \neg \left(b \leq 2.25 \cdot 10^{+99}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* z b))))
   (if (<= b -2.2e+165)
     t_1
     (if (<= b -1.05e+55)
       (* t a)
       (if (<= b -3.1e-111)
         (* y z)
         (if (<= b -8.5e-238)
           x
           (if (<= b 4.5e-194)
             (* y z)
             (if (<= b 2.8e-82)
               (* t a)
               (if (<= b 950.0)
                 (* y z)
                 (if (<= b 2e+25)
                   x
                   (if (or (<= b 3e+36) (not (<= b 2.25e+99))) t_1 x)))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (b <= -2.2e+165) {
		tmp = t_1;
	} else if (b <= -1.05e+55) {
		tmp = t * a;
	} else if (b <= -3.1e-111) {
		tmp = y * z;
	} else if (b <= -8.5e-238) {
		tmp = x;
	} else if (b <= 4.5e-194) {
		tmp = y * z;
	} else if (b <= 2.8e-82) {
		tmp = t * a;
	} else if (b <= 950.0) {
		tmp = y * z;
	} else if (b <= 2e+25) {
		tmp = x;
	} else if ((b <= 3e+36) || !(b <= 2.25e+99)) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	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 = a * (z * b)
    if (b <= (-2.2d+165)) then
        tmp = t_1
    else if (b <= (-1.05d+55)) then
        tmp = t * a
    else if (b <= (-3.1d-111)) then
        tmp = y * z
    else if (b <= (-8.5d-238)) then
        tmp = x
    else if (b <= 4.5d-194) then
        tmp = y * z
    else if (b <= 2.8d-82) then
        tmp = t * a
    else if (b <= 950.0d0) then
        tmp = y * z
    else if (b <= 2d+25) then
        tmp = x
    else if ((b <= 3d+36) .or. (.not. (b <= 2.25d+99))) then
        tmp = t_1
    else
        tmp = x
    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 = a * (z * b);
	double tmp;
	if (b <= -2.2e+165) {
		tmp = t_1;
	} else if (b <= -1.05e+55) {
		tmp = t * a;
	} else if (b <= -3.1e-111) {
		tmp = y * z;
	} else if (b <= -8.5e-238) {
		tmp = x;
	} else if (b <= 4.5e-194) {
		tmp = y * z;
	} else if (b <= 2.8e-82) {
		tmp = t * a;
	} else if (b <= 950.0) {
		tmp = y * z;
	} else if (b <= 2e+25) {
		tmp = x;
	} else if ((b <= 3e+36) || !(b <= 2.25e+99)) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (z * b)
	tmp = 0
	if b <= -2.2e+165:
		tmp = t_1
	elif b <= -1.05e+55:
		tmp = t * a
	elif b <= -3.1e-111:
		tmp = y * z
	elif b <= -8.5e-238:
		tmp = x
	elif b <= 4.5e-194:
		tmp = y * z
	elif b <= 2.8e-82:
		tmp = t * a
	elif b <= 950.0:
		tmp = y * z
	elif b <= 2e+25:
		tmp = x
	elif (b <= 3e+36) or not (b <= 2.25e+99):
		tmp = t_1
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (b <= -2.2e+165)
		tmp = t_1;
	elseif (b <= -1.05e+55)
		tmp = Float64(t * a);
	elseif (b <= -3.1e-111)
		tmp = Float64(y * z);
	elseif (b <= -8.5e-238)
		tmp = x;
	elseif (b <= 4.5e-194)
		tmp = Float64(y * z);
	elseif (b <= 2.8e-82)
		tmp = Float64(t * a);
	elseif (b <= 950.0)
		tmp = Float64(y * z);
	elseif (b <= 2e+25)
		tmp = x;
	elseif ((b <= 3e+36) || !(b <= 2.25e+99))
		tmp = t_1;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (z * b);
	tmp = 0.0;
	if (b <= -2.2e+165)
		tmp = t_1;
	elseif (b <= -1.05e+55)
		tmp = t * a;
	elseif (b <= -3.1e-111)
		tmp = y * z;
	elseif (b <= -8.5e-238)
		tmp = x;
	elseif (b <= 4.5e-194)
		tmp = y * z;
	elseif (b <= 2.8e-82)
		tmp = t * a;
	elseif (b <= 950.0)
		tmp = y * z;
	elseif (b <= 2e+25)
		tmp = x;
	elseif ((b <= 3e+36) || ~((b <= 2.25e+99)))
		tmp = t_1;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.2e+165], t$95$1, If[LessEqual[b, -1.05e+55], N[(t * a), $MachinePrecision], If[LessEqual[b, -3.1e-111], N[(y * z), $MachinePrecision], If[LessEqual[b, -8.5e-238], x, If[LessEqual[b, 4.5e-194], N[(y * z), $MachinePrecision], If[LessEqual[b, 2.8e-82], N[(t * a), $MachinePrecision], If[LessEqual[b, 950.0], N[(y * z), $MachinePrecision], If[LessEqual[b, 2e+25], x, If[Or[LessEqual[b, 3e+36], N[Not[LessEqual[b, 2.25e+99]], $MachinePrecision]], t$95$1, x]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;b \leq -2.2 \cdot 10^{+165}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq -1.05 \cdot 10^{+55}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;b \leq -3.1 \cdot 10^{-111}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;b \leq -8.5 \cdot 10^{-238}:\\
\;\;\;\;x\\

\mathbf{elif}\;b \leq 4.5 \cdot 10^{-194}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;b \leq 2.8 \cdot 10^{-82}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;b \leq 950:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;b \leq 2 \cdot 10^{+25}:\\
\;\;\;\;x\\

\mathbf{elif}\;b \leq 3 \cdot 10^{+36} \lor \neg \left(b \leq 2.25 \cdot 10^{+99}\right):\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -2.1999999999999999e165 or 2.00000000000000018e25 < b < 3e36 or 2.25e99 < b

    1. Initial program 83.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative83.0%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*75.7%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified75.7%

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in a around inf 76.1%

      \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
    5. Taylor expanded in t around 0 72.3%

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

    if -2.1999999999999999e165 < b < -1.05e55 or 4.4999999999999999e-194 < b < 2.80000000000000024e-82

    1. Initial program 87.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative87.7%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*87.8%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified87.8%

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in t around inf 53.4%

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

    if -1.05e55 < b < -3.10000000000000014e-111 or -8.5000000000000006e-238 < b < 4.4999999999999999e-194 or 2.80000000000000024e-82 < b < 950

    1. Initial program 94.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative94.9%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*97.4%

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

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in y around inf 50.3%

      \[\leadsto \color{blue}{y \cdot z} \]
    5. Step-by-step derivation
      1. *-commutative50.3%

        \[\leadsto \color{blue}{z \cdot y} \]
    6. Simplified50.3%

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

    if -3.10000000000000014e-111 < b < -8.5000000000000006e-238 or 950 < b < 2.00000000000000018e25 or 3e36 < b < 2.25e99

    1. Initial program 93.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative93.6%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*97.8%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified97.8%

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in x around inf 51.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.2 \cdot 10^{+165}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;b \leq -1.05 \cdot 10^{+55}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;b \leq -3.1 \cdot 10^{-111}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq -8.5 \cdot 10^{-238}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 4.5 \cdot 10^{-194}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 2.8 \cdot 10^{-82}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;b \leq 950:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 2 \cdot 10^{+25}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 3 \cdot 10^{+36} \lor \neg \left(b \leq 2.25 \cdot 10^{+99}\right):\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 4: 37.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z \cdot a\right) \cdot b\\ \mathbf{if}\;b \leq -2 \cdot 10^{+165}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -1.22 \cdot 10^{+55}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;b \leq -4 \cdot 10^{-111}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq -1.1 \cdot 10^{-243}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 8.7 \cdot 10^{-193}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 1.7 \cdot 10^{-82}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;b \leq 1.8:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 2.5 \cdot 10^{+25}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 6.6 \cdot 10^{+36}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;b \leq 1.4 \cdot 10^{+98}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* (* z a) b)))
   (if (<= b -2e+165)
     t_1
     (if (<= b -1.22e+55)
       (* t a)
       (if (<= b -4e-111)
         (* y z)
         (if (<= b -1.1e-243)
           x
           (if (<= b 8.7e-193)
             (* y z)
             (if (<= b 1.7e-82)
               (* t a)
               (if (<= b 1.8)
                 (* y z)
                 (if (<= b 2.5e+25)
                   x
                   (if (<= b 6.6e+36)
                     (* a (* z b))
                     (if (<= b 1.4e+98) x t_1))))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z * a) * b;
	double tmp;
	if (b <= -2e+165) {
		tmp = t_1;
	} else if (b <= -1.22e+55) {
		tmp = t * a;
	} else if (b <= -4e-111) {
		tmp = y * z;
	} else if (b <= -1.1e-243) {
		tmp = x;
	} else if (b <= 8.7e-193) {
		tmp = y * z;
	} else if (b <= 1.7e-82) {
		tmp = t * a;
	} else if (b <= 1.8) {
		tmp = y * z;
	} else if (b <= 2.5e+25) {
		tmp = x;
	} else if (b <= 6.6e+36) {
		tmp = a * (z * b);
	} else if (b <= 1.4e+98) {
		tmp = x;
	} 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 = (z * a) * b
    if (b <= (-2d+165)) then
        tmp = t_1
    else if (b <= (-1.22d+55)) then
        tmp = t * a
    else if (b <= (-4d-111)) then
        tmp = y * z
    else if (b <= (-1.1d-243)) then
        tmp = x
    else if (b <= 8.7d-193) then
        tmp = y * z
    else if (b <= 1.7d-82) then
        tmp = t * a
    else if (b <= 1.8d0) then
        tmp = y * z
    else if (b <= 2.5d+25) then
        tmp = x
    else if (b <= 6.6d+36) then
        tmp = a * (z * b)
    else if (b <= 1.4d+98) then
        tmp = x
    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 = (z * a) * b;
	double tmp;
	if (b <= -2e+165) {
		tmp = t_1;
	} else if (b <= -1.22e+55) {
		tmp = t * a;
	} else if (b <= -4e-111) {
		tmp = y * z;
	} else if (b <= -1.1e-243) {
		tmp = x;
	} else if (b <= 8.7e-193) {
		tmp = y * z;
	} else if (b <= 1.7e-82) {
		tmp = t * a;
	} else if (b <= 1.8) {
		tmp = y * z;
	} else if (b <= 2.5e+25) {
		tmp = x;
	} else if (b <= 6.6e+36) {
		tmp = a * (z * b);
	} else if (b <= 1.4e+98) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (z * a) * b
	tmp = 0
	if b <= -2e+165:
		tmp = t_1
	elif b <= -1.22e+55:
		tmp = t * a
	elif b <= -4e-111:
		tmp = y * z
	elif b <= -1.1e-243:
		tmp = x
	elif b <= 8.7e-193:
		tmp = y * z
	elif b <= 1.7e-82:
		tmp = t * a
	elif b <= 1.8:
		tmp = y * z
	elif b <= 2.5e+25:
		tmp = x
	elif b <= 6.6e+36:
		tmp = a * (z * b)
	elif b <= 1.4e+98:
		tmp = x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(z * a) * b)
	tmp = 0.0
	if (b <= -2e+165)
		tmp = t_1;
	elseif (b <= -1.22e+55)
		tmp = Float64(t * a);
	elseif (b <= -4e-111)
		tmp = Float64(y * z);
	elseif (b <= -1.1e-243)
		tmp = x;
	elseif (b <= 8.7e-193)
		tmp = Float64(y * z);
	elseif (b <= 1.7e-82)
		tmp = Float64(t * a);
	elseif (b <= 1.8)
		tmp = Float64(y * z);
	elseif (b <= 2.5e+25)
		tmp = x;
	elseif (b <= 6.6e+36)
		tmp = Float64(a * Float64(z * b));
	elseif (b <= 1.4e+98)
		tmp = x;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (z * a) * b;
	tmp = 0.0;
	if (b <= -2e+165)
		tmp = t_1;
	elseif (b <= -1.22e+55)
		tmp = t * a;
	elseif (b <= -4e-111)
		tmp = y * z;
	elseif (b <= -1.1e-243)
		tmp = x;
	elseif (b <= 8.7e-193)
		tmp = y * z;
	elseif (b <= 1.7e-82)
		tmp = t * a;
	elseif (b <= 1.8)
		tmp = y * z;
	elseif (b <= 2.5e+25)
		tmp = x;
	elseif (b <= 6.6e+36)
		tmp = a * (z * b);
	elseif (b <= 1.4e+98)
		tmp = x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -2e+165], t$95$1, If[LessEqual[b, -1.22e+55], N[(t * a), $MachinePrecision], If[LessEqual[b, -4e-111], N[(y * z), $MachinePrecision], If[LessEqual[b, -1.1e-243], x, If[LessEqual[b, 8.7e-193], N[(y * z), $MachinePrecision], If[LessEqual[b, 1.7e-82], N[(t * a), $MachinePrecision], If[LessEqual[b, 1.8], N[(y * z), $MachinePrecision], If[LessEqual[b, 2.5e+25], x, If[LessEqual[b, 6.6e+36], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.4e+98], x, t$95$1]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq -1.22 \cdot 10^{+55}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;b \leq -4 \cdot 10^{-111}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;b \leq -1.1 \cdot 10^{-243}:\\
\;\;\;\;x\\

\mathbf{elif}\;b \leq 8.7 \cdot 10^{-193}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;b \leq 1.7 \cdot 10^{-82}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;b \leq 1.8:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;b \leq 2.5 \cdot 10^{+25}:\\
\;\;\;\;x\\

\mathbf{elif}\;b \leq 6.6 \cdot 10^{+36}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\

\mathbf{elif}\;b \leq 1.4 \cdot 10^{+98}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -1.9999999999999998e165 or 1.4e98 < b

    1. Initial program 82.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative82.1%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*74.4%

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

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in z around inf 79.9%

      \[\leadsto \color{blue}{z \cdot \left(y + a \cdot b\right)} \]
    5. Taylor expanded in y around 0 72.0%

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

      \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]
    7. Step-by-step derivation
      1. associate-*r*72.0%

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot z} \]
      2. *-commutative72.0%

        \[\leadsto \color{blue}{\left(b \cdot a\right)} \cdot z \]
      3. associate-*r*75.3%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot z\right)} \]
    8. Simplified75.3%

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

    if -1.9999999999999998e165 < b < -1.22e55 or 8.6999999999999997e-193 < b < 1.69999999999999988e-82

    1. Initial program 87.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative87.7%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*87.8%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified87.8%

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in t around inf 53.4%

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

    if -1.22e55 < b < -4.00000000000000035e-111 or -1.1e-243 < b < 8.6999999999999997e-193 or 1.69999999999999988e-82 < b < 1.80000000000000004

    1. Initial program 94.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative94.9%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*97.4%

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

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in y around inf 50.3%

      \[\leadsto \color{blue}{y \cdot z} \]
    5. Step-by-step derivation
      1. *-commutative50.3%

        \[\leadsto \color{blue}{z \cdot y} \]
    6. Simplified50.3%

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

    if -4.00000000000000035e-111 < b < -1.1e-243 or 1.80000000000000004 < b < 2.50000000000000012e25 or 6.5999999999999997e36 < b < 1.4e98

    1. Initial program 93.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative93.6%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*97.8%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified97.8%

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in x around inf 51.5%

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

    if 2.50000000000000012e25 < b < 6.5999999999999997e36

    1. Initial program 99.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative99.6%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*99.6%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in a around inf 75.2%

      \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
    5. Taylor expanded in t around 0 75.3%

      \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification58.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2 \cdot 10^{+165}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;b \leq -1.22 \cdot 10^{+55}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;b \leq -4 \cdot 10^{-111}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq -1.1 \cdot 10^{-243}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 8.7 \cdot 10^{-193}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 1.7 \cdot 10^{-82}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;b \leq 1.8:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 2.5 \cdot 10^{+25}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 6.6 \cdot 10^{+36}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;b \leq 1.4 \cdot 10^{+98}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \end{array} \]

Alternative 5: 56.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + t \cdot a\\ t_2 := x + y \cdot z\\ t_3 := \left(z \cdot a\right) \cdot b\\ \mathbf{if}\;b \leq -3.4 \cdot 10^{+165}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq -3.25 \cdot 10^{+56}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -2.8 \cdot 10^{-46}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -7.5 \cdot 10^{-227}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 4.75 \cdot 10^{-194}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 2.2 \cdot 10^{-82}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 1.5 \cdot 10^{+105}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* t a))) (t_2 (+ x (* y z))) (t_3 (* (* z a) b)))
   (if (<= b -3.4e+165)
     t_3
     (if (<= b -3.25e+56)
       t_1
       (if (<= b -2.8e-46)
         t_2
         (if (<= b -7.5e-227)
           t_1
           (if (<= b 4.75e-194)
             t_2
             (if (<= b 2.2e-82) t_1 (if (<= b 1.5e+105) t_2 t_3)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (t * a);
	double t_2 = x + (y * z);
	double t_3 = (z * a) * b;
	double tmp;
	if (b <= -3.4e+165) {
		tmp = t_3;
	} else if (b <= -3.25e+56) {
		tmp = t_1;
	} else if (b <= -2.8e-46) {
		tmp = t_2;
	} else if (b <= -7.5e-227) {
		tmp = t_1;
	} else if (b <= 4.75e-194) {
		tmp = t_2;
	} else if (b <= 2.2e-82) {
		tmp = t_1;
	} else if (b <= 1.5e+105) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x + (t * a)
    t_2 = x + (y * z)
    t_3 = (z * a) * b
    if (b <= (-3.4d+165)) then
        tmp = t_3
    else if (b <= (-3.25d+56)) then
        tmp = t_1
    else if (b <= (-2.8d-46)) then
        tmp = t_2
    else if (b <= (-7.5d-227)) then
        tmp = t_1
    else if (b <= 4.75d-194) then
        tmp = t_2
    else if (b <= 2.2d-82) then
        tmp = t_1
    else if (b <= 1.5d+105) then
        tmp = t_2
    else
        tmp = t_3
    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 = x + (t * a);
	double t_2 = x + (y * z);
	double t_3 = (z * a) * b;
	double tmp;
	if (b <= -3.4e+165) {
		tmp = t_3;
	} else if (b <= -3.25e+56) {
		tmp = t_1;
	} else if (b <= -2.8e-46) {
		tmp = t_2;
	} else if (b <= -7.5e-227) {
		tmp = t_1;
	} else if (b <= 4.75e-194) {
		tmp = t_2;
	} else if (b <= 2.2e-82) {
		tmp = t_1;
	} else if (b <= 1.5e+105) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (t * a)
	t_2 = x + (y * z)
	t_3 = (z * a) * b
	tmp = 0
	if b <= -3.4e+165:
		tmp = t_3
	elif b <= -3.25e+56:
		tmp = t_1
	elif b <= -2.8e-46:
		tmp = t_2
	elif b <= -7.5e-227:
		tmp = t_1
	elif b <= 4.75e-194:
		tmp = t_2
	elif b <= 2.2e-82:
		tmp = t_1
	elif b <= 1.5e+105:
		tmp = t_2
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(t * a))
	t_2 = Float64(x + Float64(y * z))
	t_3 = Float64(Float64(z * a) * b)
	tmp = 0.0
	if (b <= -3.4e+165)
		tmp = t_3;
	elseif (b <= -3.25e+56)
		tmp = t_1;
	elseif (b <= -2.8e-46)
		tmp = t_2;
	elseif (b <= -7.5e-227)
		tmp = t_1;
	elseif (b <= 4.75e-194)
		tmp = t_2;
	elseif (b <= 2.2e-82)
		tmp = t_1;
	elseif (b <= 1.5e+105)
		tmp = t_2;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (t * a);
	t_2 = x + (y * z);
	t_3 = (z * a) * b;
	tmp = 0.0;
	if (b <= -3.4e+165)
		tmp = t_3;
	elseif (b <= -3.25e+56)
		tmp = t_1;
	elseif (b <= -2.8e-46)
		tmp = t_2;
	elseif (b <= -7.5e-227)
		tmp = t_1;
	elseif (b <= 4.75e-194)
		tmp = t_2;
	elseif (b <= 2.2e-82)
		tmp = t_1;
	elseif (b <= 1.5e+105)
		tmp = t_2;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -3.4e+165], t$95$3, If[LessEqual[b, -3.25e+56], t$95$1, If[LessEqual[b, -2.8e-46], t$95$2, If[LessEqual[b, -7.5e-227], t$95$1, If[LessEqual[b, 4.75e-194], t$95$2, If[LessEqual[b, 2.2e-82], t$95$1, If[LessEqual[b, 1.5e+105], t$95$2, t$95$3]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + t \cdot a\\
t_2 := x + y \cdot z\\
t_3 := \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;b \leq -3.4 \cdot 10^{+165}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;b \leq -3.25 \cdot 10^{+56}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq -2.8 \cdot 10^{-46}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \leq -7.5 \cdot 10^{-227}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 4.75 \cdot 10^{-194}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \leq 2.2 \cdot 10^{-82}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 1.5 \cdot 10^{+105}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -3.40000000000000011e165 or 1.5e105 < b

    1. Initial program 81.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative81.9%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*74.0%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified74.0%

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in z around inf 79.7%

      \[\leadsto \color{blue}{z \cdot \left(y + a \cdot b\right)} \]
    5. Taylor expanded in y around 0 72.9%

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

      \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]
    7. Step-by-step derivation
      1. associate-*r*72.9%

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot z} \]
      2. *-commutative72.9%

        \[\leadsto \color{blue}{\left(b \cdot a\right)} \cdot z \]
      3. associate-*r*76.2%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot z\right)} \]
    8. Simplified76.2%

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

    if -3.40000000000000011e165 < b < -3.25e56 or -2.7999999999999998e-46 < b < -7.49999999999999988e-227 or 4.75000000000000005e-194 < b < 2.19999999999999986e-82

    1. Initial program 89.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative89.1%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*91.3%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified91.3%

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in z around 0 74.4%

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

    if -3.25e56 < b < -2.7999999999999998e-46 or -7.49999999999999988e-227 < b < 4.75000000000000005e-194 or 2.19999999999999986e-82 < b < 1.5e105

    1. Initial program 95.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative95.8%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*97.8%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified97.8%

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in a around 0 71.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.4 \cdot 10^{+165}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;b \leq -3.25 \cdot 10^{+56}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;b \leq -2.8 \cdot 10^{-46}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;b \leq -7.5 \cdot 10^{-227}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;b \leq 4.75 \cdot 10^{-194}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;b \leq 2.2 \cdot 10^{-82}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;b \leq 1.5 \cdot 10^{+105}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \end{array} \]

Alternative 6: 94.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -3.2 \cdot 10^{+103}:\\
\;\;\;\;x + t_1\\

\mathbf{elif}\;a \leq 1.7 \cdot 10^{+182}:\\
\;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.19999999999999993e103

    1. Initial program 77.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+77.5%

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

        \[\leadsto \color{blue}{\left(t \cdot a + \left(a \cdot z\right) \cdot b\right) + \left(x + y \cdot z\right)} \]
      3. *-commutative77.5%

        \[\leadsto \left(t \cdot a + \color{blue}{b \cdot \left(a \cdot z\right)}\right) + \left(x + y \cdot z\right) \]
      4. *-commutative77.5%

        \[\leadsto \left(t \cdot a + b \cdot \color{blue}{\left(z \cdot a\right)}\right) + \left(x + y \cdot z\right) \]
      5. associate-*l*85.6%

        \[\leadsto \left(t \cdot a + \color{blue}{\left(b \cdot z\right) \cdot a}\right) + \left(x + y \cdot z\right) \]
      6. distribute-rgt-out97.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)} \]
    4. Taylor expanded in y around 0 92.0%

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

    if -3.19999999999999993e103 < a < 1.69999999999999993e182

    1. Initial program 95.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative95.7%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*96.8%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified96.8%

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

    if 1.69999999999999993e182 < a

    1. Initial program 68.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative68.5%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*66.2%

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

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in a around inf 97.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.2 \cdot 10^{+103}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{+182}:\\ \;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 7: 81.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{+43} \lor \neg \left(z \leq 5.6 \cdot 10^{-11}\right) \land \left(z \leq 2.6 \cdot 10^{+37} \lor \neg \left(z \leq 4 \cdot 10^{+88}\right)\right):\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -9e+43)
         (and (not (<= z 5.6e-11)) (or (<= z 2.6e+37) (not (<= z 4e+88)))))
   (* z (+ y (* a b)))
   (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -9e+43) || (!(z <= 5.6e-11) && ((z <= 2.6e+37) || !(z <= 4e+88)))) {
		tmp = z * (y + (a * b));
	} else {
		tmp = x + (a * (t + (z * 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 ((z <= (-9d+43)) .or. (.not. (z <= 5.6d-11)) .and. (z <= 2.6d+37) .or. (.not. (z <= 4d+88))) then
        tmp = z * (y + (a * b))
    else
        tmp = x + (a * (t + (z * 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 ((z <= -9e+43) || (!(z <= 5.6e-11) && ((z <= 2.6e+37) || !(z <= 4e+88)))) {
		tmp = z * (y + (a * b));
	} else {
		tmp = x + (a * (t + (z * b)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (z <= -9e+43) or (not (z <= 5.6e-11) and ((z <= 2.6e+37) or not (z <= 4e+88))):
		tmp = z * (y + (a * b))
	else:
		tmp = x + (a * (t + (z * b)))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -9e+43) || (!(z <= 5.6e-11) && ((z <= 2.6e+37) || !(z <= 4e+88))))
		tmp = Float64(z * Float64(y + Float64(a * b)));
	else
		tmp = Float64(x + Float64(a * Float64(t + Float64(z * b))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((z <= -9e+43) || (~((z <= 5.6e-11)) && ((z <= 2.6e+37) || ~((z <= 4e+88)))))
		tmp = z * (y + (a * b));
	else
		tmp = x + (a * (t + (z * b)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -9e+43], And[N[Not[LessEqual[z, 5.6e-11]], $MachinePrecision], Or[LessEqual[z, 2.6e+37], N[Not[LessEqual[z, 4e+88]], $MachinePrecision]]]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+43} \lor \neg \left(z \leq 5.6 \cdot 10^{-11}\right) \land \left(z \leq 2.6 \cdot 10^{+37} \lor \neg \left(z \leq 4 \cdot 10^{+88}\right)\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9e43 or 5.6e-11 < z < 2.5999999999999999e37 or 3.99999999999999984e88 < z

    1. Initial program 78.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative78.8%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*87.7%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified87.7%

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in z around inf 86.9%

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

    if -9e43 < z < 5.6e-11 or 2.5999999999999999e37 < z < 3.99999999999999984e88

    1. Initial program 96.2%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+96.2%

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

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

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

        \[\leadsto \left(t \cdot a + b \cdot \color{blue}{\left(z \cdot a\right)}\right) + \left(x + y \cdot z\right) \]
      5. associate-*l*97.4%

        \[\leadsto \left(t \cdot a + \color{blue}{\left(b \cdot z\right) \cdot a}\right) + \left(x + y \cdot z\right) \]
      6. distribute-rgt-out99.3%

        \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} + \left(x + y \cdot z\right) \]
      7. fma-def99.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, t + b \cdot z, x + y \cdot z\right)} \]
      8. *-commutative99.3%

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

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

        \[\leadsto \mathsf{fma}\left(a, t + z \cdot b, \color{blue}{\mathsf{fma}\left(y, z, x\right)}\right) \]
    3. Simplified99.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)} \]
    4. Taylor expanded in y around 0 90.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{+43} \lor \neg \left(z \leq 5.6 \cdot 10^{-11}\right) \land \left(z \leq 2.6 \cdot 10^{+37} \lor \neg \left(z \leq 4 \cdot 10^{+88}\right)\right):\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 8: 72.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.9 \cdot 10^{-59} \lor \neg \left(a \leq 1.9 \cdot 10^{-71}\right) \land \left(a \leq 4.6 \cdot 10^{+16} \lor \neg \left(a \leq 1.4 \cdot 10^{+86}\right)\right):\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= a -1.9e-59)
         (and (not (<= a 1.9e-71)) (or (<= a 4.6e+16) (not (<= a 1.4e+86)))))
   (* a (+ t (* z b)))
   (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -1.9e-59) || (!(a <= 1.9e-71) && ((a <= 4.6e+16) || !(a <= 1.4e+86)))) {
		tmp = a * (t + (z * b));
	} else {
		tmp = x + (y * z);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((a <= (-1.9d-59)) .or. (.not. (a <= 1.9d-71)) .and. (a <= 4.6d+16) .or. (.not. (a <= 1.4d+86))) then
        tmp = a * (t + (z * b))
    else
        tmp = x + (y * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -1.9e-59) || (!(a <= 1.9e-71) && ((a <= 4.6e+16) || !(a <= 1.4e+86)))) {
		tmp = a * (t + (z * b));
	} else {
		tmp = x + (y * z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (a <= -1.9e-59) or (not (a <= 1.9e-71) and ((a <= 4.6e+16) or not (a <= 1.4e+86))):
		tmp = a * (t + (z * b))
	else:
		tmp = x + (y * z)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((a <= -1.9e-59) || (!(a <= 1.9e-71) && ((a <= 4.6e+16) || !(a <= 1.4e+86))))
		tmp = Float64(a * Float64(t + Float64(z * b)));
	else
		tmp = Float64(x + Float64(y * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((a <= -1.9e-59) || (~((a <= 1.9e-71)) && ((a <= 4.6e+16) || ~((a <= 1.4e+86)))))
		tmp = a * (t + (z * b));
	else
		tmp = x + (y * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.9e-59], And[N[Not[LessEqual[a, 1.9e-71]], $MachinePrecision], Or[LessEqual[a, 4.6e+16], N[Not[LessEqual[a, 1.4e+86]], $MachinePrecision]]]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{-59} \lor \neg \left(a \leq 1.9 \cdot 10^{-71}\right) \land \left(a \leq 4.6 \cdot 10^{+16} \lor \neg \left(a \leq 1.4 \cdot 10^{+86}\right)\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.89999999999999992e-59 or 1.89999999999999996e-71 < a < 4.6e16 or 1.40000000000000002e86 < a

    1. Initial program 85.4%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative85.4%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*82.9%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified82.9%

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in a around inf 75.6%

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

    if -1.89999999999999992e-59 < a < 1.89999999999999996e-71 or 4.6e16 < a < 1.40000000000000002e86

    1. Initial program 95.3%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative95.3%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*97.2%

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

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in a around 0 79.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.9 \cdot 10^{-59} \lor \neg \left(a \leq 1.9 \cdot 10^{-71}\right) \land \left(a \leq 4.6 \cdot 10^{+16} \lor \neg \left(a \leq 1.4 \cdot 10^{+86}\right)\right):\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array} \]

Alternative 9: 73.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.32 \cdot 10^{-92} \lor \neg \left(z \leq 1.75 \cdot 10^{-12} \lor \neg \left(z \leq 8.5 \cdot 10^{+49}\right) \land z \leq 1.12 \cdot 10^{+69}\right):\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -1.32e-92)
         (not (or (<= z 1.75e-12) (and (not (<= z 8.5e+49)) (<= z 1.12e+69)))))
   (* z (+ y (* a b)))
   (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -1.32e-92) || !((z <= 1.75e-12) || (!(z <= 8.5e+49) && (z <= 1.12e+69)))) {
		tmp = z * (y + (a * b));
	} else {
		tmp = x + (t * a);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((z <= (-1.32d-92)) .or. (.not. (z <= 1.75d-12) .or. (.not. (z <= 8.5d+49)) .and. (z <= 1.12d+69))) then
        tmp = z * (y + (a * b))
    else
        tmp = x + (t * a)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -1.32e-92) || !((z <= 1.75e-12) || (!(z <= 8.5e+49) && (z <= 1.12e+69)))) {
		tmp = z * (y + (a * b));
	} else {
		tmp = x + (t * a);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (z <= -1.32e-92) or not ((z <= 1.75e-12) or (not (z <= 8.5e+49) and (z <= 1.12e+69))):
		tmp = z * (y + (a * b))
	else:
		tmp = x + (t * a)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -1.32e-92) || !((z <= 1.75e-12) || (!(z <= 8.5e+49) && (z <= 1.12e+69))))
		tmp = Float64(z * Float64(y + Float64(a * b)));
	else
		tmp = Float64(x + Float64(t * a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((z <= -1.32e-92) || ~(((z <= 1.75e-12) || (~((z <= 8.5e+49)) && (z <= 1.12e+69)))))
		tmp = z * (y + (a * b));
	else
		tmp = x + (t * a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.32e-92], N[Not[Or[LessEqual[z, 1.75e-12], And[N[Not[LessEqual[z, 8.5e+49]], $MachinePrecision], LessEqual[z, 1.12e+69]]]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.32 \cdot 10^{-92} \lor \neg \left(z \leq 1.75 \cdot 10^{-12} \lor \neg \left(z \leq 8.5 \cdot 10^{+49}\right) \land z \leq 1.12 \cdot 10^{+69}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.3200000000000001e-92 or 1.75e-12 < z < 8.4999999999999996e49 or 1.12e69 < z

    1. Initial program 83.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative83.5%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*90.1%

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

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in z around inf 82.2%

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

    if -1.3200000000000001e-92 < z < 1.75e-12 or 8.4999999999999996e49 < z < 1.12e69

    1. Initial program 95.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative95.9%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*87.5%

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

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in z around 0 76.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.32 \cdot 10^{-92} \lor \neg \left(z \leq 1.75 \cdot 10^{-12} \lor \neg \left(z \leq 8.5 \cdot 10^{+49}\right) \land z \leq 1.12 \cdot 10^{+69}\right):\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot a\\ \end{array} \]

Alternative 10: 56.0% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_1 := x + t \cdot a\\
t_2 := \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;b \leq -1.5 \cdot 10^{+166}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \leq -55000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq -5 \cdot 10^{-45}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;b \leq 1.75 \cdot 10^{+118}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.49999999999999999e166 or 1.75000000000000008e118 < b

    1. Initial program 81.4%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative81.4%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*73.3%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified73.3%

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in z around inf 80.8%

      \[\leadsto \color{blue}{z \cdot \left(y + a \cdot b\right)} \]
    5. Taylor expanded in y around 0 73.7%

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

      \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]
    7. Step-by-step derivation
      1. associate-*r*73.7%

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot z} \]
      2. *-commutative73.7%

        \[\leadsto \color{blue}{\left(b \cdot a\right)} \cdot z \]
      3. associate-*r*77.1%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot z\right)} \]
    8. Simplified77.1%

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

    if -1.49999999999999999e166 < b < -55000 or -4.99999999999999976e-45 < b < 1.75000000000000008e118

    1. Initial program 92.3%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative92.3%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*94.5%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified94.5%

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in z around 0 63.4%

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

    if -55000 < b < -4.99999999999999976e-45

    1. Initial program 100.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*100.0%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in y around inf 86.1%

      \[\leadsto \color{blue}{y \cdot z} \]
    5. Step-by-step derivation
      1. *-commutative86.1%

        \[\leadsto \color{blue}{z \cdot y} \]
    6. Simplified86.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.5 \cdot 10^{+166}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;b \leq -55000:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;b \leq -5 \cdot 10^{-45}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 1.75 \cdot 10^{+118}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \end{array} \]

Alternative 11: 86.1% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.5 \cdot 10^{+83} \lor \neg \left(b \leq 2.1 \cdot 10^{+65}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3.49999999999999977e83 or 2.09999999999999991e65 < b

    1. Initial program 85.3%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+85.3%

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

        \[\leadsto \color{blue}{\left(t \cdot a + \left(a \cdot z\right) \cdot b\right) + \left(x + y \cdot z\right)} \]
      3. *-commutative85.3%

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

        \[\leadsto \left(t \cdot a + b \cdot \color{blue}{\left(z \cdot a\right)}\right) + \left(x + y \cdot z\right) \]
      5. associate-*l*80.4%

        \[\leadsto \left(t \cdot a + \color{blue}{\left(b \cdot z\right) \cdot a}\right) + \left(x + y \cdot z\right) \]
      6. distribute-rgt-out87.8%

        \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} + \left(x + y \cdot z\right) \]
      7. fma-def87.8%

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

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

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

        \[\leadsto \mathsf{fma}\left(a, t + z \cdot b, \color{blue}{\mathsf{fma}\left(y, z, x\right)}\right) \]
    3. Simplified87.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)} \]
    4. Taylor expanded in y around 0 88.8%

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

    if -3.49999999999999977e83 < b < 2.09999999999999991e65

    1. Initial program 92.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative92.0%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*96.2%

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

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in b around 0 93.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.5 \cdot 10^{+83} \lor \neg \left(b \leq 2.1 \cdot 10^{+65}\right):\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\ \end{array} \]

Alternative 12: 40.1% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{-64}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;z \leq -2.2 \cdot 10^{-216}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 5 \cdot 10^{-258}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;z \leq 3.4 \cdot 10^{-11}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.4500000000000001e-64 or 3.3999999999999999e-11 < z

    1. Initial program 82.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative82.6%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*89.2%

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

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

      \[\leadsto \color{blue}{y \cdot z} \]
    5. Step-by-step derivation
      1. *-commutative44.7%

        \[\leadsto \color{blue}{z \cdot y} \]
    6. Simplified44.7%

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

    if -2.4500000000000001e-64 < z < -2.1999999999999999e-216 or 4.9999999999999999e-258 < z < 3.3999999999999999e-11

    1. Initial program 95.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative95.7%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*87.6%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified87.6%

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in x around inf 40.2%

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

    if -2.1999999999999999e-216 < z < 4.9999999999999999e-258

    1. Initial program 100.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*90.9%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified90.9%

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in t around inf 60.7%

      \[\leadsto \color{blue}{a \cdot t} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification45.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.45 \cdot 10^{-64}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-216}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-258}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-11}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]

Alternative 13: 39.5% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{+67}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.76 \cdot 10^{+81}:\\
\;\;\;\;t \cdot a\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.5000000000000005e67 or 1.76000000000000002e81 < x

    1. Initial program 91.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative91.6%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*89.6%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified89.6%

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in x around inf 53.4%

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

    if -7.5000000000000005e67 < x < 1.76000000000000002e81

    1. Initial program 88.3%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. *-commutative88.3%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
      2. associate-*l*88.4%

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

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in t around inf 34.3%

      \[\leadsto \color{blue}{a \cdot t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification41.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.5 \cdot 10^{+67}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.76 \cdot 10^{+81}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 14: 25.6% accurate, 15.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 89.5%

    \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
  2. Step-by-step derivation
    1. *-commutative89.5%

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(z \cdot a\right)} \cdot b \]
    2. associate-*l*88.8%

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
  3. Simplified88.8%

    \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + z \cdot \left(a \cdot b\right)} \]
  4. Taylor expanded in x around inf 24.4%

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

    \[\leadsto x \]

Developer target: 97.3% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
\mathbf{if}\;z < -11820553527347888000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023271 
(FPCore (x y z t a b)
  :name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
  :precision binary64

  :herbie-target
  (if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))

  (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))