Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.7% → 98.9%
Time: 8.9s
Alternatives: 17
Speedup: 0.5×

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 17 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.7% 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: 98.9% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{-104}:\\ \;\;\;\;\mathsf{fma}\left(y, z, a \cdot \left(t + z \cdot b\right) + x\right)\\ \mathbf{elif}\;a \leq 4 \cdot 10^{+96}:\\ \;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\ \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
 (if (<= a -2e-104)
   (fma y z (+ (* a (+ t (* z b))) x))
   (if (<= a 4e+96)
     (fma z (fma a b y) (fma t a x))
     (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 tmp;
	if (a <= -2e-104) {
		tmp = fma(y, z, ((a * (t + (z * b))) + x));
	} else if (a <= 4e+96) {
		tmp = fma(z, fma(a, b, y), fma(t, a, x));
	} else {
		tmp = fma(y, z, fma(a, fma(z, b, t), x));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -2e-104)
		tmp = fma(y, z, Float64(Float64(a * Float64(t + Float64(z * b))) + x));
	elseif (a <= 4e+96)
		tmp = fma(z, fma(a, b, y), fma(t, a, x));
	else
		tmp = fma(y, z, fma(a, fma(z, b, t), x));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2e-104], N[(y * z + N[(N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4e+96], N[(z * N[(a * b + y), $MachinePrecision] + N[(t * a + x), $MachinePrecision]), $MachinePrecision], N[(y * z + N[(a * N[(z * b + t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

\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 3 regimes
  2. if a < -1.99999999999999985e-104

    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-def89.4%

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

        \[\leadsto \mathsf{fma}\left(y, z, \color{blue}{\left(t \cdot a + \left(a \cdot z\right) \cdot b\right) + x}\right) \]
      6. *-commutative89.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*95.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 a around 0 99.9%

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

    if -1.99999999999999985e-104 < a < 4.0000000000000002e96

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.0000000000000002e96 < a

    1. Initial program 85.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+85.0%

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, \color{blue}{\left(t \cdot a + \left(a \cdot z\right) \cdot b\right) + x}\right) \]
      6. *-commutative85.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.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-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-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)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification100.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{-104}:\\ \;\;\;\;\mathsf{fma}\left(y, z, a \cdot \left(t + z \cdot b\right) + x\right)\\ \mathbf{elif}\;a \leq 4 \cdot 10^{+96}:\\ \;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\ \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: 97.5% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot t + \left(x + y \cdot z\right)\right) + b \cdot \left(a \cdot z\right)\\ \mathbf{if}\;t_1 \leq 2 \cdot 10^{+275}:\\ \;\;\;\;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 (+ (+ (* a t) (+ x (* y z))) (* b (* a z)))))
   (if (<= t_1 2e+275) 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 = ((a * t) + (x + (y * z))) + (b * (a * z));
	double tmp;
	if (t_1 <= 2e+275) {
		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(a * t) + Float64(x + Float64(y * z))) + Float64(b * Float64(a * z)))
	tmp = 0.0
	if (t_1 <= 2e+275)
		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[(a * t), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+275], 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(a \cdot t + \left(x + y \cdot z\right)\right) + b \cdot \left(a \cdot z\right)\\
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+275}:\\
\;\;\;\;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)) < 1.99999999999999992e275

    1. Initial program 98.9%

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

    if 1.99999999999999992e275 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b))

    1. Initial program 69.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+69.3%

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, \color{blue}{\left(t \cdot a + \left(a \cdot z\right) \cdot b\right) + x}\right) \]
      6. *-commutative73.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*85.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-out96.3%

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

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

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

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

      \[\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 simplification98.4%

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

Alternative 3: 97.6% accurate, 0.1× speedup?

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

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

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

    1. Initial program 98.9%

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

    if 1.00000000000000003e286 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b))

    1. Initial program 68.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+68.8%

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, \color{blue}{\left(t \cdot a + \left(a \cdot z\right) \cdot b\right) + x}\right) \]
      6. *-commutative72.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*85.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-out96.3%

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(z, b, t\right)}, x\right)\right) \]
    3. Simplified96.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 a around 0 96.3%

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

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

Alternative 4: 96.8% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \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 98.3%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 38.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;x \leq -5200000000:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq -7.5 \cdot 10^{-180}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;x \leq -2.6 \cdot 10^{-223}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;x \leq 1.4 \cdot 10^{-207}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 6 \cdot 10^{-158}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;x \leq 1.05 \cdot 10^{-120}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 1.15 \cdot 10^{+45}:\\
\;\;\;\;y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -5.2e9 or 1.15000000000000006e45 < x

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.2e9 < x < -7.50000000000000015e-180 or 1.39999999999999996e-207 < x < 6e-158 or 1.05e-120 < x < 1.15000000000000006e45

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.50000000000000015e-180 < x < -2.6e-223

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.6e-223 < x < 1.39999999999999996e-207 or 6e-158 < x < 1.05e-120

    1. Initial program 87.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. +-commutative87.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5200000000:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -7.5 \cdot 10^{-180}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq -2.6 \cdot 10^{-223}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-207}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;x \leq 6 \cdot 10^{-158}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-120}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{+45}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 6: 38.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -130000:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq -2.85 \cdot 10^{-179}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;x \leq -2.15 \cdot 10^{-223}:\\
\;\;\;\;a \cdot t\\

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

\mathbf{elif}\;x \leq 2.6 \cdot 10^{-158}:\\
\;\;\;\;y \cdot z\\

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

\mathbf{elif}\;x \leq 4.7 \cdot 10^{+48}:\\
\;\;\;\;y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -1.3e5 or 4.70000000000000012e48 < x

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3e5 < x < -2.85e-179 or 5.4999999999999999e-204 < x < 2.6e-158 or 3.8000000000000001e-118 < x < 4.70000000000000012e48

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.85e-179 < x < -2.15e-223

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.15e-223 < x < 5.4999999999999999e-204

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.6e-158 < x < 3.8000000000000001e-118

    1. Initial program 83.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. +-commutative83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -130000:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -2.85 \cdot 10^{-179}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq -2.15 \cdot 10^{-223}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-204}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{-158}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{-118}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \leq 4.7 \cdot 10^{+48}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 7: 84.7% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;a \leq 3.4 \cdot 10^{-151}:\\
\;\;\;\;\left(x + a \cdot t\right) + y \cdot z\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.12e-10 or 1.7e-33 < a

    1. Initial program 85.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+85.5%

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

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

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

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

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

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

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

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

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

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

    if -1.12e-10 < a < 3.4000000000000003e-151

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.4000000000000003e-151 < a < 9.0000000000000006e-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. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.0000000000000006e-79 < a < 1.7e-33

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.12 \cdot 10^{-10}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right) + x\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{-151}:\\ \;\;\;\;\left(x + a \cdot t\right) + y \cdot z\\ \mathbf{elif}\;a \leq 9 \cdot 10^{-79}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-33}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right) + x\\ \end{array} \]

Alternative 8: 83.3% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3600 \lor \neg \left(x \leq 55000\right):\\
\;\;\;\;\left(x + a \cdot t\right) + y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3600 or 55000 < x

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3600 < x < 55000

    1. Initial program 88.9%

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

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

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

Alternative 9: 91.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.4 \cdot 10^{+54}:\\
\;\;\;\;\left(a \cdot \left(z \cdot b\right) + a \cdot t\right) + \left(x + y \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.40000000000000008e54

    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. associate-*l*95.5%

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

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

    if 1.40000000000000008e54 < z

    1. Initial program 77.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 39.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -240000:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -7.2 \cdot 10^{-180}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq -5.9 \cdot 10^{-210}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;x \leq 9.2 \cdot 10^{-251}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{-199}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;x \leq 2 \cdot 10^{+42}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -240000.0)
   x
   (if (<= x -7.2e-180)
     (* y z)
     (if (<= x -5.9e-210)
       (* a t)
       (if (<= x 9.2e-251)
         (* y z)
         (if (<= x 2.7e-199) (* a t) (if (<= x 2e+42) (* y z) x)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -240000.0) {
		tmp = x;
	} else if (x <= -7.2e-180) {
		tmp = y * z;
	} else if (x <= -5.9e-210) {
		tmp = a * t;
	} else if (x <= 9.2e-251) {
		tmp = y * z;
	} else if (x <= 2.7e-199) {
		tmp = a * t;
	} else if (x <= 2e+42) {
		tmp = y * z;
	} 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 <= (-240000.0d0)) then
        tmp = x
    else if (x <= (-7.2d-180)) then
        tmp = y * z
    else if (x <= (-5.9d-210)) then
        tmp = a * t
    else if (x <= 9.2d-251) then
        tmp = y * z
    else if (x <= 2.7d-199) then
        tmp = a * t
    else if (x <= 2d+42) then
        tmp = y * z
    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 <= -240000.0) {
		tmp = x;
	} else if (x <= -7.2e-180) {
		tmp = y * z;
	} else if (x <= -5.9e-210) {
		tmp = a * t;
	} else if (x <= 9.2e-251) {
		tmp = y * z;
	} else if (x <= 2.7e-199) {
		tmp = a * t;
	} else if (x <= 2e+42) {
		tmp = y * z;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -240000.0:
		tmp = x
	elif x <= -7.2e-180:
		tmp = y * z
	elif x <= -5.9e-210:
		tmp = a * t
	elif x <= 9.2e-251:
		tmp = y * z
	elif x <= 2.7e-199:
		tmp = a * t
	elif x <= 2e+42:
		tmp = y * z
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -240000.0)
		tmp = x;
	elseif (x <= -7.2e-180)
		tmp = Float64(y * z);
	elseif (x <= -5.9e-210)
		tmp = Float64(a * t);
	elseif (x <= 9.2e-251)
		tmp = Float64(y * z);
	elseif (x <= 2.7e-199)
		tmp = Float64(a * t);
	elseif (x <= 2e+42)
		tmp = Float64(y * z);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (x <= -240000.0)
		tmp = x;
	elseif (x <= -7.2e-180)
		tmp = y * z;
	elseif (x <= -5.9e-210)
		tmp = a * t;
	elseif (x <= 9.2e-251)
		tmp = y * z;
	elseif (x <= 2.7e-199)
		tmp = a * t;
	elseif (x <= 2e+42)
		tmp = y * z;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -240000.0], x, If[LessEqual[x, -7.2e-180], N[(y * z), $MachinePrecision], If[LessEqual[x, -5.9e-210], N[(a * t), $MachinePrecision], If[LessEqual[x, 9.2e-251], N[(y * z), $MachinePrecision], If[LessEqual[x, 2.7e-199], N[(a * t), $MachinePrecision], If[LessEqual[x, 2e+42], N[(y * z), $MachinePrecision], x]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -240000:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq -7.2 \cdot 10^{-180}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;x \leq -5.9 \cdot 10^{-210}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;x \leq 9.2 \cdot 10^{-251}:\\
\;\;\;\;y \cdot z\\

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

\mathbf{elif}\;x \leq 2 \cdot 10^{+42}:\\
\;\;\;\;y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.4e5 or 2.00000000000000009e42 < x

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.4e5 < x < -7.1999999999999998e-180 or -5.8999999999999999e-210 < x < 9.20000000000000068e-251 or 2.69999999999999989e-199 < x < 2.00000000000000009e42

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.1999999999999998e-180 < x < -5.8999999999999999e-210 or 9.20000000000000068e-251 < x < 2.69999999999999989e-199

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -240000:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -7.2 \cdot 10^{-180}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq -5.9 \cdot 10^{-210}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;x \leq 9.2 \cdot 10^{-251}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{-199}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;x \leq 2 \cdot 10^{+42}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 11: 62.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := x + a \cdot t\\
t_2 := x + y \cdot z\\
\mathbf{if}\;y \leq -7 \cdot 10^{+103}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -2.9 \cdot 10^{-6}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -1.52 \cdot 10^{-28}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;y \leq 2.9 \cdot 10^{+19}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7e103 or -2.9000000000000002e-6 < y < -1.5199999999999999e-28 or 2.9e19 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7e103 < y < -2.9000000000000002e-6 or -5.9999999999999998e-48 < y < 2.9e19

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5199999999999999e-28 < y < -5.9999999999999998e-48

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7 \cdot 10^{+103}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;y \leq -2.9 \cdot 10^{-6}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;y \leq -1.52 \cdot 10^{-28}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;y \leq -6 \cdot 10^{-48}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{+19}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array} \]

Alternative 12: 72.3% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;a \leq 3.4 \cdot 10^{-151}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \leq 8.5 \cdot 10^{+66}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.5e-11 or 8.5000000000000004e66 < a

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5e-11 < a < 3.4000000000000003e-151 or 2.20000000000000002e-72 < a < 8.5000000000000004e66

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.4000000000000003e-151 < a < 2.20000000000000002e-72

    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. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.5 \cdot 10^{-11}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{-151}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 2.2 \cdot 10^{-72}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{+66}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 13: 57.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_1 := x + a \cdot t\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{+109}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;y \leq -7.2 \cdot 10^{-16}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -4.2 \cdot 10^{-48}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;y \leq 1.25 \cdot 10^{+126}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.1999999999999997e109 or 1.24999999999999994e126 < y

    1. Initial program 92.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. +-commutative92.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.1999999999999997e109 < y < -7.19999999999999965e-16 or -4.19999999999999977e-48 < y < 1.24999999999999994e126

    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. +-commutative92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.19999999999999965e-16 < y < -4.19999999999999977e-48

    1. Initial program 87.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. +-commutative87.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.2 \cdot 10^{+109}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{-16}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-48}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+126}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]

Alternative 14: 79.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+100} \lor \neg \left(y \leq 1.2 \cdot 10^{+71}\right):\\
\;\;\;\;x + y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.1999999999999997e100 or 1.1999999999999999e71 < y

    1. Initial program 92.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. +-commutative92.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.1999999999999997e100 < y < 1.1999999999999999e71

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 73.8% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-48} \lor \neg \left(z \leq 6.6 \cdot 10^{-86}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.9999999999999999e-48 or 6.59999999999999974e-86 < z

    1. Initial program 87.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. +-commutative87.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.9999999999999999e-48 < z < 6.59999999999999974e-86

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 38.5% accurate, 2.1× speedup?

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

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

\mathbf{elif}\;x \leq 2 \cdot 10^{-58}:\\
\;\;\;\;a \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.0500000000000001e26 or 2.0000000000000001e-58 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.0500000000000001e26 < x < 2.0000000000000001e-58

    1. Initial program 89.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.05 \cdot 10^{+26}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-58}:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 17: 26.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 92.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. +-commutative92.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x \]

Developer target: 97.6% 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 2023214 
(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)))