Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.3% → 97.7%
Time: 8.7s
Alternatives: 16
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 16 alternatives:

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

Initial Program: 92.3% 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: 97.7% accurate, 0.0× 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 5 \cdot 10^{+300}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, z, \mathsf{fma}\left(a, \mathsf{fma}\left(z, b, t\right), x\right)\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 5e+300) t_1 (fma y z (fma a (fma z b t) x)))))
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 <= 5e+300) {
		tmp = t_1;
	} else {
		tmp = fma(y, z, fma(a, fma(z, b, t), x));
	}
	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 <= 5e+300)
		tmp = t_1;
	else
		tmp = fma(y, z, fma(a, fma(z, b, t), x));
	end
	return 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, 5e+300], t$95$1, N[(y * z + N[(a * N[(z * b + t), $MachinePrecision] + x), $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 5 \cdot 10^{+300}:\\
\;\;\;\;t_1\\

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

    1. Initial program 99.5%

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

    if 5.00000000000000026e300 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 96.7% 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.2%

      \[\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. associate-+l+0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 37.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;b \leq -6.8 \cdot 10^{-21}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -9.8 \cdot 10^{-107}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq -6.5 \cdot 10^{-235}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;b \leq -1.12 \cdot 10^{-291}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq -7.2 \cdot 10^{-308}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;b \leq 2.25 \cdot 10^{-244}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 6.8 \cdot 10^{-145}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;b \leq 7.6 \cdot 10^{+96}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* z b))))
   (if (<= b -6.8e-21)
     t_1
     (if (<= b -9.8e-107)
       (* y z)
       (if (<= b -6.5e-235)
         (* t a)
         (if (<= b -1.12e-291)
           x
           (if (<= b -7.2e-308)
             (* t a)
             (if (<= b 2.25e-244)
               (* y z)
               (if (<= b 6.8e-145) (* t a) (if (<= b 7.6e+96) x t_1))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (b <= -6.8e-21) {
		tmp = t_1;
	} else if (b <= -9.8e-107) {
		tmp = y * z;
	} else if (b <= -6.5e-235) {
		tmp = t * a;
	} else if (b <= -1.12e-291) {
		tmp = x;
	} else if (b <= -7.2e-308) {
		tmp = t * a;
	} else if (b <= 2.25e-244) {
		tmp = y * z;
	} else if (b <= 6.8e-145) {
		tmp = t * a;
	} else if (b <= 7.6e+96) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = a * (z * b)
    if (b <= (-6.8d-21)) then
        tmp = t_1
    else if (b <= (-9.8d-107)) then
        tmp = y * z
    else if (b <= (-6.5d-235)) then
        tmp = t * a
    else if (b <= (-1.12d-291)) then
        tmp = x
    else if (b <= (-7.2d-308)) then
        tmp = t * a
    else if (b <= 2.25d-244) then
        tmp = y * z
    else if (b <= 6.8d-145) then
        tmp = t * a
    else if (b <= 7.6d+96) then
        tmp = x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (b <= -6.8e-21) {
		tmp = t_1;
	} else if (b <= -9.8e-107) {
		tmp = y * z;
	} else if (b <= -6.5e-235) {
		tmp = t * a;
	} else if (b <= -1.12e-291) {
		tmp = x;
	} else if (b <= -7.2e-308) {
		tmp = t * a;
	} else if (b <= 2.25e-244) {
		tmp = y * z;
	} else if (b <= 6.8e-145) {
		tmp = t * a;
	} else if (b <= 7.6e+96) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (z * b)
	tmp = 0
	if b <= -6.8e-21:
		tmp = t_1
	elif b <= -9.8e-107:
		tmp = y * z
	elif b <= -6.5e-235:
		tmp = t * a
	elif b <= -1.12e-291:
		tmp = x
	elif b <= -7.2e-308:
		tmp = t * a
	elif b <= 2.25e-244:
		tmp = y * z
	elif b <= 6.8e-145:
		tmp = t * a
	elif b <= 7.6e+96:
		tmp = x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (b <= -6.8e-21)
		tmp = t_1;
	elseif (b <= -9.8e-107)
		tmp = Float64(y * z);
	elseif (b <= -6.5e-235)
		tmp = Float64(t * a);
	elseif (b <= -1.12e-291)
		tmp = x;
	elseif (b <= -7.2e-308)
		tmp = Float64(t * a);
	elseif (b <= 2.25e-244)
		tmp = Float64(y * z);
	elseif (b <= 6.8e-145)
		tmp = Float64(t * a);
	elseif (b <= 7.6e+96)
		tmp = x;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (z * b);
	tmp = 0.0;
	if (b <= -6.8e-21)
		tmp = t_1;
	elseif (b <= -9.8e-107)
		tmp = y * z;
	elseif (b <= -6.5e-235)
		tmp = t * a;
	elseif (b <= -1.12e-291)
		tmp = x;
	elseif (b <= -7.2e-308)
		tmp = t * a;
	elseif (b <= 2.25e-244)
		tmp = y * z;
	elseif (b <= 6.8e-145)
		tmp = t * a;
	elseif (b <= 7.6e+96)
		tmp = x;
	else
		tmp = t_1;
	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, -6.8e-21], t$95$1, If[LessEqual[b, -9.8e-107], N[(y * z), $MachinePrecision], If[LessEqual[b, -6.5e-235], N[(t * a), $MachinePrecision], If[LessEqual[b, -1.12e-291], x, If[LessEqual[b, -7.2e-308], N[(t * a), $MachinePrecision], If[LessEqual[b, 2.25e-244], N[(y * z), $MachinePrecision], If[LessEqual[b, 6.8e-145], N[(t * a), $MachinePrecision], If[LessEqual[b, 7.6e+96], x, t$95$1]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq -9.8 \cdot 10^{-107}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;b \leq -6.5 \cdot 10^{-235}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;b \leq -1.12 \cdot 10^{-291}:\\
\;\;\;\;x\\

\mathbf{elif}\;b \leq -7.2 \cdot 10^{-308}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;b \leq 2.25 \cdot 10^{-244}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;b \leq 6.8 \cdot 10^{-145}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;b \leq 7.6 \cdot 10^{+96}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -6.8e-21 or 7.6000000000000003e96 < b

    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. associate-+l+90.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.8e-21 < b < -9.79999999999999959e-107 or -7.1999999999999997e-308 < b < 2.2500000000000001e-244

    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. associate-+l+96.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot y} \]
    6. Simplified55.2%

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

    if -9.79999999999999959e-107 < b < -6.49999999999999973e-235 or -1.1200000000000001e-291 < b < -7.1999999999999997e-308 or 2.2500000000000001e-244 < b < 6.7999999999999998e-145

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot t} \]
    6. Step-by-step derivation
      1. *-commutative53.4%

        \[\leadsto \color{blue}{t \cdot a} \]
    7. Simplified53.4%

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

    if -6.49999999999999973e-235 < b < -1.1200000000000001e-291 or 6.7999999999999998e-145 < b < 7.6000000000000003e96

    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. associate-+l+98.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -6.8 \cdot 10^{-21}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;b \leq -9.8 \cdot 10^{-107}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq -6.5 \cdot 10^{-235}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;b \leq -1.12 \cdot 10^{-291}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq -7.2 \cdot 10^{-308}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;b \leq 2.25 \cdot 10^{-244}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 6.8 \cdot 10^{-145}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;b \leq 7.6 \cdot 10^{+96}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \end{array} \]

Alternative 4: 93.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+195} \lor \neg \left(z \leq 1.04 \cdot 10^{+163}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.4000000000000001e195 or 1.04e163 < z

    1. Initial program 81.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+81.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.4000000000000001e195 < z < 1.04e163

    1. Initial program 97.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+97.0%

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

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

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

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

Alternative 5: 87.6% accurate, 0.9× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.44999999999999989e37 or 0.00309999999999999989 < 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(y \cdot z + x\right)} + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right) \]
      3. associate-+l+87.8%

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

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

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

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

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

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

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

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

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

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

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

    if -1.44999999999999989e37 < a < -1.45e-79

    1. Initial program 99.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Taylor expanded in x around 0 93.9%

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

    if -1.45e-79 < a < 0.00309999999999999989

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 59.5% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + t \cdot a\\ \mathbf{if}\;a \leq -5.5 \cdot 10^{+78}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -4.9 \cdot 10^{+14}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 0.096:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 8.2 \cdot 10^{+102}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* t a))))
   (if (<= a -5.5e+78)
     (* a (* z b))
     (if (<= a -4.9e+14)
       t_1
       (if (<= a 0.096)
         (+ x (* y z))
         (if (<= a 8.2e+102) (* z (* a b)) 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 <= -5.5e+78) {
		tmp = a * (z * b);
	} else if (a <= -4.9e+14) {
		tmp = t_1;
	} else if (a <= 0.096) {
		tmp = x + (y * z);
	} else if (a <= 8.2e+102) {
		tmp = z * (a * b);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + (t * a)
    if (a <= (-5.5d+78)) then
        tmp = a * (z * b)
    else if (a <= (-4.9d+14)) then
        tmp = t_1
    else if (a <= 0.096d0) then
        tmp = x + (y * z)
    else if (a <= 8.2d+102) then
        tmp = z * (a * b)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (t * a);
	double tmp;
	if (a <= -5.5e+78) {
		tmp = a * (z * b);
	} else if (a <= -4.9e+14) {
		tmp = t_1;
	} else if (a <= 0.096) {
		tmp = x + (y * z);
	} else if (a <= 8.2e+102) {
		tmp = z * (a * b);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (t * a)
	tmp = 0
	if a <= -5.5e+78:
		tmp = a * (z * b)
	elif a <= -4.9e+14:
		tmp = t_1
	elif a <= 0.096:
		tmp = x + (y * z)
	elif a <= 8.2e+102:
		tmp = z * (a * b)
	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 <= -5.5e+78)
		tmp = Float64(a * Float64(z * b));
	elseif (a <= -4.9e+14)
		tmp = t_1;
	elseif (a <= 0.096)
		tmp = Float64(x + Float64(y * z));
	elseif (a <= 8.2e+102)
		tmp = Float64(z * Float64(a * b));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (t * a);
	tmp = 0.0;
	if (a <= -5.5e+78)
		tmp = a * (z * b);
	elseif (a <= -4.9e+14)
		tmp = t_1;
	elseif (a <= 0.096)
		tmp = x + (y * z);
	elseif (a <= 8.2e+102)
		tmp = z * (a * b);
	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, -5.5e+78], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -4.9e+14], t$95$1, If[LessEqual[a, 0.096], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.2e+102], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -4.9 \cdot 10^{+14}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 0.096:\\
\;\;\;\;x + y \cdot z\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -5.4999999999999997e78

    1. Initial program 81.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+81.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.4999999999999997e78 < a < -4.9e14 or 8.1999999999999999e102 < 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. associate-+l+91.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9e14 < a < 0.096000000000000002

    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. associate-+l+98.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.096000000000000002 < a < 8.1999999999999999e102

    1. Initial program 99.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+99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.5 \cdot 10^{+78}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -4.9 \cdot 10^{+14}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;a \leq 0.096:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 8.2 \cdot 10^{+102}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot a\\ \end{array} \]

Alternative 7: 72.7% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;z \leq -6 \cdot 10^{+15}:\\
\;\;\;\;x + \left(z \cdot a\right) \cdot b\\

\mathbf{elif}\;z \leq 1.46 \cdot 10^{-12}:\\
\;\;\;\;x + t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.2000000000000001e162 or 1.46000000000000004e-12 < z

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.2000000000000001e162 < z < -6e15

    1. Initial program 91.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+91.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6e15 < z < 1.46000000000000004e-12

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 81.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+163} \lor \neg \left(z \leq 1.95 \cdot 10^{+33}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.10000000000000029e163 or 1.9500000000000001e33 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.10000000000000029e163 < z < 1.9500000000000001e33

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 87.9% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.6 \cdot 10^{+43} \lor \neg \left(a \leq 0.0165\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.6000000000000005e43 or 0.016500000000000001 < a

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.6000000000000005e43 < a < 0.016500000000000001

    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. associate-+l+98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 39.1% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;z \leq 3 \cdot 10^{-201}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.32 \cdot 10^{-34}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.45e-31 or 1.32e-34 < z

    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. associate-+l+91.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.45e-31 < z < 3.00000000000000002e-201

    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. associate-+l+98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.00000000000000002e-201 < z < 1.32e-34

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot t} \]
    6. Step-by-step derivation
      1. *-commutative46.5%

        \[\leadsto \color{blue}{t \cdot a} \]
    7. Simplified46.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{-31}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-201}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{-34}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \end{array} \]

Alternative 11: 74.7% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.25 \cdot 10^{-20} \lor \neg \left(a \leq 0.023\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.25e-20) (not (<= a 0.023)))
   (* 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.25e-20) || !(a <= 0.023)) {
		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.25d-20)) .or. (.not. (a <= 0.023d0))) 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.25e-20) || !(a <= 0.023)) {
		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.25e-20) or not (a <= 0.023):
		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.25e-20) || !(a <= 0.023))
		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.25e-20) || ~((a <= 0.023)))
		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.25e-20], N[Not[LessEqual[a, 0.023]], $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.25 \cdot 10^{-20} \lor \neg \left(a \leq 0.023\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.25e-20 or 0.023 < a

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.25e-20 < a < 0.023

    1. Initial program 98.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+98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 39.2% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;z \leq 10^{-204}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 12000:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.12e78 or 12000 < z

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.12e78 < z < 1e-204

    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. associate-+l+97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e-204 < z < 12000

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot t} \]
    6. Step-by-step derivation
      1. *-commutative41.0%

        \[\leadsto \color{blue}{t \cdot a} \]
    7. Simplified41.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.12 \cdot 10^{+78}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq 10^{-204}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 12000:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]

Alternative 13: 39.8% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;z \leq 4.5 \cdot 10^{-203}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 7100:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.39999999999999978e-32

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.39999999999999978e-32 < z < 4.5000000000000002e-203

    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. associate-+l+98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.5000000000000002e-203 < z < 7100

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot t} \]
    6. Step-by-step derivation
      1. *-commutative41.0%

        \[\leadsto \color{blue}{t \cdot a} \]
    7. Simplified41.0%

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

    if 7100 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{-32}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-203}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7100:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]

Alternative 14: 57.3% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{+102} \lor \neg \left(b \leq 1.45 \cdot 10^{+95}\right):\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3.79999999999999979e102 or 1.45000000000000007e95 < b

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.79999999999999979e102 < b < 1.45000000000000007e95

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 38.4% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.7 \cdot 10^{-122}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.7 \cdot 10^{+114}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.6999999999999999e-122 or 1.7e114 < x

    1. Initial program 94.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+94.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.6999999999999999e-122 < x < 1.7e114

    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. associate-+l+93.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot t} \]
    6. Step-by-step derivation
      1. *-commutative36.4%

        \[\leadsto \color{blue}{t \cdot a} \]
    7. Simplified36.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.7 \cdot 10^{-122}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{+114}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 16: 27.2% 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 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification26.8%

    \[\leadsto x \]

Developer target: 97.0% 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 2023258 
(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)))