Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.4% → 96.6%
Time: 11.1s
Alternatives: 11
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 11 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.4% 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: 96.6% 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 99.9%

      \[\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*15.8%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified15.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 inf 84.2%

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

    \[\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 2: 95.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.5 \cdot 10^{+49} \lor \neg \left(a \leq 1.25 \cdot 10^{+93}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.5000000000000001e49 or 1.25e93 < a

    1. Initial program 84.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. associate-+l+84.0%

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

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

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

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

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

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

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

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

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

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

      \[\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 94.4%

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

    if -1.5000000000000001e49 < a < 1.25e93

    1. Initial program 98.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. *-commutative98.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*98.6%

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

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

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

Alternative 3: 58.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;z \leq -4 \cdot 10^{+238}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{+192}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq -4.9 \cdot 10^{-37}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+79}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+151} \lor \neg \left(z \leq 6.8 \cdot 10^{+224}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* z b))))
   (if (<= z -4e+238)
     t_1
     (if (<= z -6.8e+192)
       (* y z)
       (if (<= z -4.9e-37)
         t_1
         (if (<= z 2e+79)
           (+ x (* t a))
           (if (or (<= z 2e+151) (not (<= z 6.8e+224))) t_1 (* y z))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (z <= -4e+238) {
		tmp = t_1;
	} else if (z <= -6.8e+192) {
		tmp = y * z;
	} else if (z <= -4.9e-37) {
		tmp = t_1;
	} else if (z <= 2e+79) {
		tmp = x + (t * a);
	} else if ((z <= 2e+151) || !(z <= 6.8e+224)) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = a * (z * b)
    if (z <= (-4d+238)) then
        tmp = t_1
    else if (z <= (-6.8d+192)) then
        tmp = y * z
    else if (z <= (-4.9d-37)) then
        tmp = t_1
    else if (z <= 2d+79) then
        tmp = x + (t * a)
    else if ((z <= 2d+151) .or. (.not. (z <= 6.8d+224))) then
        tmp = t_1
    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 t_1 = a * (z * b);
	double tmp;
	if (z <= -4e+238) {
		tmp = t_1;
	} else if (z <= -6.8e+192) {
		tmp = y * z;
	} else if (z <= -4.9e-37) {
		tmp = t_1;
	} else if (z <= 2e+79) {
		tmp = x + (t * a);
	} else if ((z <= 2e+151) || !(z <= 6.8e+224)) {
		tmp = t_1;
	} else {
		tmp = y * z;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (z * b)
	tmp = 0
	if z <= -4e+238:
		tmp = t_1
	elif z <= -6.8e+192:
		tmp = y * z
	elif z <= -4.9e-37:
		tmp = t_1
	elif z <= 2e+79:
		tmp = x + (t * a)
	elif (z <= 2e+151) or not (z <= 6.8e+224):
		tmp = t_1
	else:
		tmp = y * z
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (z <= -4e+238)
		tmp = t_1;
	elseif (z <= -6.8e+192)
		tmp = Float64(y * z);
	elseif (z <= -4.9e-37)
		tmp = t_1;
	elseif (z <= 2e+79)
		tmp = Float64(x + Float64(t * a));
	elseif ((z <= 2e+151) || !(z <= 6.8e+224))
		tmp = t_1;
	else
		tmp = Float64(y * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (z * b);
	tmp = 0.0;
	if (z <= -4e+238)
		tmp = t_1;
	elseif (z <= -6.8e+192)
		tmp = y * z;
	elseif (z <= -4.9e-37)
		tmp = t_1;
	elseif (z <= 2e+79)
		tmp = x + (t * a);
	elseif ((z <= 2e+151) || ~((z <= 6.8e+224)))
		tmp = t_1;
	else
		tmp = y * z;
	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[z, -4e+238], t$95$1, If[LessEqual[z, -6.8e+192], N[(y * z), $MachinePrecision], If[LessEqual[z, -4.9e-37], t$95$1, If[LessEqual[z, 2e+79], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 2e+151], N[Not[LessEqual[z, 6.8e+224]], $MachinePrecision]], t$95$1, N[(y * z), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -6.8 \cdot 10^{+192}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;z \leq -4.9 \cdot 10^{-37}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 2 \cdot 10^{+79}:\\
\;\;\;\;x + t \cdot a\\

\mathbf{elif}\;z \leq 2 \cdot 10^{+151} \lor \neg \left(z \leq 6.8 \cdot 10^{+224}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.0000000000000002e238 or -6.79999999999999992e192 < z < -4.90000000000000018e-37 or 1.99999999999999993e79 < z < 2.00000000000000003e151 or 6.8000000000000004e224 < z

    1. Initial program 85.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. *-commutative85.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.0%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified87.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 a around inf 65.3%

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

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

    if -4.0000000000000002e238 < z < -6.79999999999999992e192 or 2.00000000000000003e151 < z < 6.8000000000000004e224

    1. Initial program 85.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. *-commutative85.2%

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

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified92.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 y around inf 67.8%

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

        \[\leadsto \color{blue}{z \cdot y} \]
    6. Simplified67.8%

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

    if -4.90000000000000018e-37 < z < 1.99999999999999993e79

    1. Initial program 98.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. *-commutative98.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*91.4%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified91.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 0 77.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+238}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{+192}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq -4.9 \cdot 10^{-37}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+79}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+151} \lor \neg \left(z \leq 6.8 \cdot 10^{+224}\right):\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]

Alternative 4: 38.5% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.85 \cdot 10^{-11}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;a \leq -4 \cdot 10^{-177}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq -8 \cdot 10^{-211}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 2.7 \cdot 10^{-301}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 3.5 \cdot 10^{-94}:\\
\;\;\;\;y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.8500000000000001e-11 or 3.49999999999999998e-94 < a

    1. Initial program 88.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. *-commutative88.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*83.9%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified83.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 44.7%

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

    if -1.8500000000000001e-11 < a < -3.99999999999999981e-177 or -8.00000000000000069e-211 < a < 2.7e-301

    1. Initial program 99.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. *-commutative99.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*99.9%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified99.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 x around inf 53.9%

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

    if -3.99999999999999981e-177 < a < -8.00000000000000069e-211 or 2.7e-301 < a < 3.49999999999999998e-94

    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 56.9%

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

        \[\leadsto \color{blue}{z \cdot y} \]
    6. Simplified56.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.85 \cdot 10^{-11}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq -4 \cdot 10^{-177}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -8 \cdot 10^{-211}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 2.7 \cdot 10^{-301}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 3.5 \cdot 10^{-94}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \]

Alternative 5: 36.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;b \leq -3.5 \cdot 10^{+105}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -9.5 \cdot 10^{+31}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq -2.3 \cdot 10^{-30} \lor \neg \left(b \leq 1.55 \cdot 10^{+52}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* z b))))
   (if (<= b -3.5e+105)
     t_1
     (if (<= b -9.5e+31)
       (* y z)
       (if (or (<= b -2.3e-30) (not (<= b 1.55e+52))) t_1 (* t a))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (b <= -3.5e+105) {
		tmp = t_1;
	} else if (b <= -9.5e+31) {
		tmp = y * z;
	} else if ((b <= -2.3e-30) || !(b <= 1.55e+52)) {
		tmp = t_1;
	} else {
		tmp = 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) :: t_1
    real(8) :: tmp
    t_1 = a * (z * b)
    if (b <= (-3.5d+105)) then
        tmp = t_1
    else if (b <= (-9.5d+31)) then
        tmp = y * z
    else if ((b <= (-2.3d-30)) .or. (.not. (b <= 1.55d+52))) then
        tmp = t_1
    else
        tmp = 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 t_1 = a * (z * b);
	double tmp;
	if (b <= -3.5e+105) {
		tmp = t_1;
	} else if (b <= -9.5e+31) {
		tmp = y * z;
	} else if ((b <= -2.3e-30) || !(b <= 1.55e+52)) {
		tmp = t_1;
	} else {
		tmp = t * a;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (z * b)
	tmp = 0
	if b <= -3.5e+105:
		tmp = t_1
	elif b <= -9.5e+31:
		tmp = y * z
	elif (b <= -2.3e-30) or not (b <= 1.55e+52):
		tmp = t_1
	else:
		tmp = t * a
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (b <= -3.5e+105)
		tmp = t_1;
	elseif (b <= -9.5e+31)
		tmp = Float64(y * z);
	elseif ((b <= -2.3e-30) || !(b <= 1.55e+52))
		tmp = t_1;
	else
		tmp = Float64(t * a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (z * b);
	tmp = 0.0;
	if (b <= -3.5e+105)
		tmp = t_1;
	elseif (b <= -9.5e+31)
		tmp = y * z;
	elseif ((b <= -2.3e-30) || ~((b <= 1.55e+52)))
		tmp = t_1;
	else
		tmp = t * a;
	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, -3.5e+105], t$95$1, If[LessEqual[b, -9.5e+31], N[(y * z), $MachinePrecision], If[Or[LessEqual[b, -2.3e-30], N[Not[LessEqual[b, 1.55e+52]], $MachinePrecision]], t$95$1, N[(t * a), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq -9.5 \cdot 10^{+31}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;b \leq -2.3 \cdot 10^{-30} \lor \neg \left(b \leq 1.55 \cdot 10^{+52}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -3.49999999999999991e105 or -9.5000000000000008e31 < b < -2.29999999999999984e-30 or 1.55e52 < b

    1. Initial program 91.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. *-commutative91.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*84.3%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified84.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 a around inf 65.6%

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

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

    if -3.49999999999999991e105 < b < -9.5000000000000008e31

    1. Initial program 94.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. *-commutative94.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*88.2%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified88.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 48.4%

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

        \[\leadsto \color{blue}{z \cdot y} \]
    6. Simplified48.4%

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

    if -2.29999999999999984e-30 < b < 1.55e52

    1. Initial program 93.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. *-commutative93.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*95.8%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified95.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 45.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.5 \cdot 10^{+105}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;b \leq -9.5 \cdot 10^{+31}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq -2.3 \cdot 10^{-30} \lor \neg \left(b \leq 1.55 \cdot 10^{+52}\right):\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \]

Alternative 6: 83.0% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.38 \cdot 10^{-145} \lor \neg \left(a \leq 4.6 \cdot 10^{-95}\right):\\ \;\;\;\;x + 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.38e-145) (not (<= a 4.6e-95)))
   (+ x (* 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.38e-145) || !(a <= 4.6e-95)) {
		tmp = x + (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.38d-145)) .or. (.not. (a <= 4.6d-95))) then
        tmp = x + (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.38e-145) || !(a <= 4.6e-95)) {
		tmp = x + (a * (t + (z * b)));
	} else {
		tmp = x + (y * z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (a <= -1.38e-145) or not (a <= 4.6e-95):
		tmp = x + (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.38e-145) || !(a <= 4.6e-95))
		tmp = Float64(x + 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.38e-145) || ~((a <= 4.6e-95)))
		tmp = x + (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.38e-145], N[Not[LessEqual[a, 4.6e-95]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.38 \cdot 10^{-145} \lor \neg \left(a \leq 4.6 \cdot 10^{-95}\right):\\
\;\;\;\;x + 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.38e-145 or 4.59999999999999998e-95 < a

    1. Initial program 89.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. associate-+l+89.4%

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

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

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

        \[\leadsto \left(t \cdot a + b \cdot \color{blue}{\left(z \cdot a\right)}\right) + \left(x + y \cdot z\right) \]
      5. associate-*l*90.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-out93.4%

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

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

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

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

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

      \[\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 89.2%

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

    if -1.38e-145 < a < 4.59999999999999998e-95

    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 a around 0 83.5%

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

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

Alternative 7: 87.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.28 \cdot 10^{-45} \lor \neg \left(a \leq 3.8 \cdot 10^{-72}\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 (<= a -1.28e-45) (not (<= a 3.8e-72)))
   (+ 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 ((a <= -1.28e-45) || !(a <= 3.8e-72)) {
		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 ((a <= (-1.28d-45)) .or. (.not. (a <= 3.8d-72))) 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 ((a <= -1.28e-45) || !(a <= 3.8e-72)) {
		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 (a <= -1.28e-45) or not (a <= 3.8e-72):
		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 ((a <= -1.28e-45) || !(a <= 3.8e-72))
		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 ((a <= -1.28e-45) || ~((a <= 3.8e-72)))
		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[a, -1.28e-45], N[Not[LessEqual[a, 3.8e-72]], $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}\;a \leq -1.28 \cdot 10^{-45} \lor \neg \left(a \leq 3.8 \cdot 10^{-72}\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 a < -1.28e-45 or 3.80000000000000002e-72 < a

    1. Initial program 87.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. associate-+l+87.8%

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

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

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

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

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

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

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

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

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

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

      \[\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 91.3%

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

    if -1.28e-45 < a < 3.80000000000000002e-72

    1. Initial program 99.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. *-commutative99.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*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 b around 0 89.6%

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

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

Alternative 8: 62.0% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_1 := x + t \cdot a\\
\mathbf{if}\;a \leq -1.15 \cdot 10^{+188}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq -62000000000000:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\

\mathbf{elif}\;a \leq 5 \cdot 10^{-72}:\\
\;\;\;\;x + y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.15000000000000006e188 or 4.9999999999999996e-72 < a

    1. Initial program 86.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. *-commutative86.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*82.1%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified82.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 0 62.9%

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

    if -1.15000000000000006e188 < a < -6.2e13

    1. Initial program 90.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. *-commutative90.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*84.7%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified84.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 93.4%

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

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

    if -6.2e13 < a < 4.9999999999999996e-72

    1. Initial program 99.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. *-commutative99.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*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 a around 0 77.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.15 \cdot 10^{+188}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;a \leq -62000000000000:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-72}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot a\\ \end{array} \]

Alternative 9: 73.9% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.7 \cdot 10^{+18} \lor \neg \left(a \leq 5 \cdot 10^{-72}\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.7e+18) (not (<= a 5e-72)))
   (* 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.7e+18) || !(a <= 5e-72)) {
		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.7d+18)) .or. (.not. (a <= 5d-72))) 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.7e+18) || !(a <= 5e-72)) {
		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.7e+18) or not (a <= 5e-72):
		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.7e+18) || !(a <= 5e-72))
		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.7e+18) || ~((a <= 5e-72)))
		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.7e+18], N[Not[LessEqual[a, 5e-72]], $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.7 \cdot 10^{+18} \lor \neg \left(a \leq 5 \cdot 10^{-72}\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.7e18 or 4.9999999999999996e-72 < a

    1. Initial program 87.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. *-commutative87.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*82.7%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified82.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 79.4%

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

    if -1.7e18 < a < 4.9999999999999996e-72

    1. Initial program 99.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. *-commutative99.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*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 a around 0 77.1%

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

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

Alternative 10: 39.6% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{-10}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;a \leq 1.95 \cdot 10^{-17}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.8999999999999999e-10 or 1.94999999999999995e-17 < a

    1. Initial program 86.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. *-commutative86.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*81.7%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified81.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 t around inf 46.9%

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

    if -1.8999999999999999e-10 < a < 1.94999999999999995e-17

    1. Initial program 99.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. *-commutative99.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*99.9%

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
    3. Simplified99.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 x around inf 39.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.9 \cdot 10^{-10}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq 1.95 \cdot 10^{-17}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \]

Alternative 11: 27.4% 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 92.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. *-commutative92.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.0%

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{z \cdot \left(a \cdot b\right)} \]
  3. Simplified90.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 x around inf 24.1%

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

    \[\leadsto x \]

Developer target: 97.4% 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 2023280 
(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)))