Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 91.9% → 94.9%
Time: 13.0s
Alternatives: 13
Speedup: 1.0×

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 13 alternatives:

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

Initial Program: 91.9% 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: 94.9% accurate, 0.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.61999999999999997e65

    1. Initial program 90.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+90.2%

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

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

        \[\leadsto \left(t \cdot a + \color{blue}{b \cdot \left(a \cdot z\right)}\right) + \left(x + y \cdot z\right) \]
      4. *-commutative90.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*94.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-out100.0%

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

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

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

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

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

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

    if -1.61999999999999997e65 < a

    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. +-commutative96.2%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, a \cdot b, \mathsf{fma}\left(t, a, \mathsf{fma}\left(y, z, x\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef97.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 96.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(x + z \cdot y\right) + a \cdot t\right) + b \cdot \left(a \cdot z\right)\\ \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 (* z y)) (* a t)) (* b (* a z)))))
   (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 + (z * y)) + (a * t)) + (b * (a * z));
	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 + (z * y)) + (a * t)) + (b * (a * z));
	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 + (z * y)) + (a * t)) + (b * (a * z))
	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(z * y)) + Float64(a * t)) + Float64(b * Float64(a * z)))
	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 + (z * y)) + (a * t)) + (b * (a * z));
	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[(z * y), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * z), $MachinePrecision]), $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 + z \cdot y\right) + a \cdot t\right) + b \cdot \left(a \cdot z\right)\\
\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 97.7%

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

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

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

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

Alternative 3: 40.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;t \leq -5.2 \cdot 10^{+90}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;t \leq -2.5 \cdot 10^{-74}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;t \leq -1 \cdot 10^{-228}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{-86}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{+44}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+75}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* z b))))
   (if (<= t -5.2e+90)
     (* a t)
     (if (<= t -2.5e-74)
       (* z y)
       (if (<= t -1e-228)
         t_1
         (if (<= t 2.3e-86)
           x
           (if (<= t 5.5e+44) t_1 (if (<= t 1.05e+75) x (* a t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (t <= -5.2e+90) {
		tmp = a * t;
	} else if (t <= -2.5e-74) {
		tmp = z * y;
	} else if (t <= -1e-228) {
		tmp = t_1;
	} else if (t <= 2.3e-86) {
		tmp = x;
	} else if (t <= 5.5e+44) {
		tmp = t_1;
	} else if (t <= 1.05e+75) {
		tmp = x;
	} else {
		tmp = a * t;
	}
	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 (t <= (-5.2d+90)) then
        tmp = a * t
    else if (t <= (-2.5d-74)) then
        tmp = z * y
    else if (t <= (-1d-228)) then
        tmp = t_1
    else if (t <= 2.3d-86) then
        tmp = x
    else if (t <= 5.5d+44) then
        tmp = t_1
    else if (t <= 1.05d+75) then
        tmp = x
    else
        tmp = a * t
    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 (t <= -5.2e+90) {
		tmp = a * t;
	} else if (t <= -2.5e-74) {
		tmp = z * y;
	} else if (t <= -1e-228) {
		tmp = t_1;
	} else if (t <= 2.3e-86) {
		tmp = x;
	} else if (t <= 5.5e+44) {
		tmp = t_1;
	} else if (t <= 1.05e+75) {
		tmp = x;
	} else {
		tmp = a * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (z * b)
	tmp = 0
	if t <= -5.2e+90:
		tmp = a * t
	elif t <= -2.5e-74:
		tmp = z * y
	elif t <= -1e-228:
		tmp = t_1
	elif t <= 2.3e-86:
		tmp = x
	elif t <= 5.5e+44:
		tmp = t_1
	elif t <= 1.05e+75:
		tmp = x
	else:
		tmp = a * t
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (t <= -5.2e+90)
		tmp = Float64(a * t);
	elseif (t <= -2.5e-74)
		tmp = Float64(z * y);
	elseif (t <= -1e-228)
		tmp = t_1;
	elseif (t <= 2.3e-86)
		tmp = x;
	elseif (t <= 5.5e+44)
		tmp = t_1;
	elseif (t <= 1.05e+75)
		tmp = x;
	else
		tmp = Float64(a * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (z * b);
	tmp = 0.0;
	if (t <= -5.2e+90)
		tmp = a * t;
	elseif (t <= -2.5e-74)
		tmp = z * y;
	elseif (t <= -1e-228)
		tmp = t_1;
	elseif (t <= 2.3e-86)
		tmp = x;
	elseif (t <= 5.5e+44)
		tmp = t_1;
	elseif (t <= 1.05e+75)
		tmp = x;
	else
		tmp = a * t;
	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[t, -5.2e+90], N[(a * t), $MachinePrecision], If[LessEqual[t, -2.5e-74], N[(z * y), $MachinePrecision], If[LessEqual[t, -1e-228], t$95$1, If[LessEqual[t, 2.3e-86], x, If[LessEqual[t, 5.5e+44], t$95$1, If[LessEqual[t, 1.05e+75], x, N[(a * t), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -2.5 \cdot 10^{-74}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;t \leq -1 \cdot 10^{-228}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 2.3 \cdot 10^{-86}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 5.5 \cdot 10^{+44}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 1.05 \cdot 10^{+75}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -5.1999999999999997e90 or 1.04999999999999999e75 < t

    1. Initial program 92.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. *-commutative92.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*92.4%

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

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

    if -5.1999999999999997e90 < t < -2.49999999999999999e-74

    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. *-commutative96.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*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 y around inf 47.0%

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

        \[\leadsto \color{blue}{z \cdot y} \]
    6. Simplified47.0%

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

    if -2.49999999999999999e-74 < t < -1.00000000000000003e-228 or 2.29999999999999996e-86 < t < 5.5000000000000001e44

    1. Initial program 96.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. +-commutative96.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, a \cdot b, \mathsf{fma}\left(t, a, \mathsf{fma}\left(y, z, x\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef94.6%

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000003e-228 < t < 2.29999999999999996e-86 or 5.5000000000000001e44 < t < 1.04999999999999999e75

    1. Initial program 97.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. *-commutative97.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*97.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.2 \cdot 10^{+90}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;t \leq -2.5 \cdot 10^{-74}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;t \leq -1 \cdot 10^{-228}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{-86}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{+44}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+75}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]

Alternative 4: 73.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.78 \cdot 10^{+65} \lor \neg \left(a \leq 3.2 \cdot 10^{-68}\right) \land \left(a \leq 4.4 \cdot 10^{-48} \lor \neg \left(a \leq 1.32 \cdot 10^{-23}\right)\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.77999999999999995e65 or 3.1999999999999999e-68 < a < 4.40000000000000025e-48 or 1.31999999999999994e-23 < a

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

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

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

    if -1.77999999999999995e65 < a < 3.1999999999999999e-68 or 4.40000000000000025e-48 < a < 1.31999999999999994e-23

    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*99.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.78 \cdot 10^{+65} \lor \neg \left(a \leq 3.2 \cdot 10^{-68}\right) \land \left(a \leq 4.4 \cdot 10^{-48} \lor \neg \left(a \leq 1.32 \cdot 10^{-23}\right)\right):\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot y\\ \end{array} \]

Alternative 5: 92.0% accurate, 1.0× speedup?

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

\\
z \cdot \left(a \cdot b\right) + \left(\left(x + z \cdot y\right) + a \cdot t\right)
\end{array}
Derivation
  1. Initial program 95.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. *-commutative95.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*95.0%

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

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

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

Alternative 6: 83.6% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+126} \lor \neg \left(z \leq 4.1 \cdot 10^{+131}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.49999999999999951e126 or 4.10000000000000007e131 < z

    1. Initial program 86.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. *-commutative86.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*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 z around inf 84.0%

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

    if -9.49999999999999951e126 < z < 4.10000000000000007e131

    1. Initial program 97.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. *-commutative97.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*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 b around 0 84.7%

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

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

Alternative 7: 83.7% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.5 \cdot 10^{+137}:\\
\;\;\;\;x + a \cdot \left(z \cdot b\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -6.5000000000000002e137

    1. Initial program 97.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. *-commutative97.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*86.7%

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

      \[\leadsto \color{blue}{x + \left(a \cdot \left(b \cdot z\right) + y \cdot z\right)} \]
    5. Step-by-step derivation
      1. +-commutative81.1%

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

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

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

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

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

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

    if -6.5000000000000002e137 < b < 1.4999999999999999e50

    1. Initial program 94.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. *-commutative94.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*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 b around 0 91.8%

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

    if 1.4999999999999999e50 < b

    1. Initial program 95.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. *-commutative95.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*93.4%

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

      \[\leadsto \color{blue}{x + \left(a \cdot \left(b \cdot z\right) + y \cdot z\right)} \]
    5. Step-by-step derivation
      1. +-commutative76.4%

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

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

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

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

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

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

Alternative 8: 62.9% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.86 \cdot 10^{+230}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;a \leq -6 \cdot 10^{+44} \lor \neg \left(a \leq 4200000000000\right):\\
\;\;\;\;x + a \cdot t\\

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


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

    1. Initial program 88.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. +-commutative88.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, a \cdot b, \mathsf{fma}\left(t, a, \mathsf{fma}\left(y, z, x\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef94.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.86e230 < a < -5.99999999999999974e44 or 4.2e12 < a

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

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

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

    if -5.99999999999999974e44 < a < 4.2e12

    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*99.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.86 \cdot 10^{+230}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq -6 \cdot 10^{+44} \lor \neg \left(a \leq 4200000000000\right):\\ \;\;\;\;x + a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot y\\ \end{array} \]

Alternative 9: 59.5% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+131}:\\
\;\;\;\;z \cdot y\\

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

\mathbf{elif}\;z \leq 2.15 \cdot 10^{+118}:\\
\;\;\;\;z \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.6e131 or 2.7999999999999999e42 < z < 2.1500000000000002e118

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

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

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

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

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

    if -2.6e131 < z < 2.7999999999999999e42

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

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

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

    if 2.1500000000000002e118 < z

    1. Initial program 89.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. +-commutative89.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, a \cdot b, \mathsf{fma}\left(t, a, \mathsf{fma}\left(y, z, x\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef91.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+131}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+42}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{+118}:\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \end{array} \]

Alternative 10: 74.8% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+54} \lor \neg \left(z \leq 10^{-37}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.30000000000000003e54 or 1.00000000000000007e-37 < z

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

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

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

    if -1.30000000000000003e54 < z < 1.00000000000000007e-37

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

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

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

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

Alternative 11: 40.1% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;t \leq -3.65 \cdot 10^{-101}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;t \leq 9 \cdot 10^{+74}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.0999999999999996e93 or 8.9999999999999999e74 < t

    1. Initial program 92.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. *-commutative92.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*92.4%

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

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

    if -5.0999999999999996e93 < t < -3.65e-101

    1. Initial program 96.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. *-commutative96.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*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 y around inf 42.9%

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

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

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

    if -3.65e-101 < t < 8.9999999999999999e74

    1. Initial program 96.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. *-commutative96.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*95.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.1 \cdot 10^{+93}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;t \leq -3.65 \cdot 10^{-101}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;t \leq 9 \cdot 10^{+74}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]

Alternative 12: 39.9% accurate, 2.1× speedup?

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

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

\mathbf{elif}\;t \leq 10^{+75}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.4e90 or 9.99999999999999927e74 < t

    1. Initial program 92.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. *-commutative92.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*92.4%

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

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

    if -1.4e90 < t < 9.99999999999999927e74

    1. Initial program 96.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. *-commutative96.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*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)} \]
    4. Taylor expanded in x around inf 39.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.4 \cdot 10^{+90}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;t \leq 10^{+75}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]

Alternative 13: 26.9% 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 95.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. *-commutative95.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*95.0%

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification27.9%

    \[\leadsto x \]

Developer target: 97.2% 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 2023285 
(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)))