Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.7% → 95.4%
Time: 10.4s
Alternatives: 15
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 15 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: 95.4% accurate, 0.0× speedup?

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

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

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


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

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999984e81 < z

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

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

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

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

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

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

Alternative 2: 95.4% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.6999999999999999e82 < z

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

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

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

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

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

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

Alternative 3: 95.1% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

    if 2e80 < z

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

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

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

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

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

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

Alternative 4: 95.2% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 98.2%

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 38.6% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;x \leq -6 \cdot 10^{-180}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;x \leq -1.65 \cdot 10^{-298}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;x \leq 6.2 \cdot 10^{-267}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;x \leq 1.08 \cdot 10^{-159}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq 2.6 \cdot 10^{+113}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -4.8e33 or 2.5999999999999999e113 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.8e33 < x < -6.0000000000000001e-180 or -1.6500000000000001e-298 < x < 6.2000000000000002e-267 or 1.08000000000000004e-159 < x < 1.22e-17

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.0000000000000001e-180 < x < -1.6500000000000001e-298

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.2000000000000002e-267 < x < 1.08000000000000004e-159 or 1.22e-17 < x < 2.5999999999999999e113

    1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{+33}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -6 \cdot 10^{-180}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;x \leq -1.65 \cdot 10^{-298}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-267}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;x \leq 1.08 \cdot 10^{-159}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \leq 1.22 \cdot 10^{-17}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{+113}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 6: 82.9% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.4000000000000002e33 or 1.45e13 < x

    1. Initial program 97.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.4000000000000002e33 < x < 1.45e13

    1. Initial program 93.5%

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

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

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

Alternative 7: 63.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + a \cdot t\\ t_2 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;a \leq -1.04 \cdot 10^{+251}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -1.75 \cdot 10^{+153}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -2.3 \cdot 10^{+82}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -0.00019 \lor \neg \left(a \leq 4.4 \cdot 10^{-23}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* a t))) (t_2 (* a (* z b))))
   (if (<= a -1.04e+251)
     t_2
     (if (<= a -1.75e+153)
       t_1
       (if (<= a -2.3e+82)
         t_2
         (if (or (<= a -0.00019) (not (<= a 4.4e-23))) t_1 (+ x (* z y))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (a * t);
	double t_2 = a * (z * b);
	double tmp;
	if (a <= -1.04e+251) {
		tmp = t_2;
	} else if (a <= -1.75e+153) {
		tmp = t_1;
	} else if (a <= -2.3e+82) {
		tmp = t_2;
	} else if ((a <= -0.00019) || !(a <= 4.4e-23)) {
		tmp = t_1;
	} else {
		tmp = x + (z * y);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x + (a * t)
    t_2 = a * (z * b)
    if (a <= (-1.04d+251)) then
        tmp = t_2
    else if (a <= (-1.75d+153)) then
        tmp = t_1
    else if (a <= (-2.3d+82)) then
        tmp = t_2
    else if ((a <= (-0.00019d0)) .or. (.not. (a <= 4.4d-23))) then
        tmp = t_1
    else
        tmp = x + (z * y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (a * t);
	double t_2 = a * (z * b);
	double tmp;
	if (a <= -1.04e+251) {
		tmp = t_2;
	} else if (a <= -1.75e+153) {
		tmp = t_1;
	} else if (a <= -2.3e+82) {
		tmp = t_2;
	} else if ((a <= -0.00019) || !(a <= 4.4e-23)) {
		tmp = t_1;
	} else {
		tmp = x + (z * y);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (a * t)
	t_2 = a * (z * b)
	tmp = 0
	if a <= -1.04e+251:
		tmp = t_2
	elif a <= -1.75e+153:
		tmp = t_1
	elif a <= -2.3e+82:
		tmp = t_2
	elif (a <= -0.00019) or not (a <= 4.4e-23):
		tmp = t_1
	else:
		tmp = x + (z * y)
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(a * t))
	t_2 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (a <= -1.04e+251)
		tmp = t_2;
	elseif (a <= -1.75e+153)
		tmp = t_1;
	elseif (a <= -2.3e+82)
		tmp = t_2;
	elseif ((a <= -0.00019) || !(a <= 4.4e-23))
		tmp = t_1;
	else
		tmp = Float64(x + Float64(z * y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (a * t);
	t_2 = a * (z * b);
	tmp = 0.0;
	if (a <= -1.04e+251)
		tmp = t_2;
	elseif (a <= -1.75e+153)
		tmp = t_1;
	elseif (a <= -2.3e+82)
		tmp = t_2;
	elseif ((a <= -0.00019) || ~((a <= 4.4e-23)))
		tmp = t_1;
	else
		tmp = x + (z * y);
	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[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.04e+251], t$95$2, If[LessEqual[a, -1.75e+153], t$95$1, If[LessEqual[a, -2.3e+82], t$95$2, If[Or[LessEqual[a, -0.00019], N[Not[LessEqual[a, 4.4e-23]], $MachinePrecision]], t$95$1, N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.75 \cdot 10^{+153}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq -2.3 \cdot 10^{+82}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq -0.00019 \lor \neg \left(a \leq 4.4 \cdot 10^{-23}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.04000000000000005e251 or -1.75e153 < a < -2.29999999999999988e82

    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(t \cdot a + \left(a \cdot z\right) \cdot b\right) + \left(x + y \cdot z\right)} \]
      3. *-commutative88.1%

        \[\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. *-commutative90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.04000000000000005e251 < a < -1.75e153 or -2.29999999999999988e82 < a < -1.9000000000000001e-4 or 4.3999999999999999e-23 < a

    1. Initial program 93.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+93.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9000000000000001e-4 < a < 4.3999999999999999e-23

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.04 \cdot 10^{+251}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -1.75 \cdot 10^{+153}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;a \leq -2.3 \cdot 10^{+82}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -0.00019 \lor \neg \left(a \leq 4.4 \cdot 10^{-23}\right):\\ \;\;\;\;x + a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot y\\ \end{array} \]

Alternative 8: 84.9% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.11999999999999998e-4 or 2.55000000000000002e-89 < a

    1. Initial program 93.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+93.0%

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

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

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

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

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

    if -1.11999999999999998e-4 < a < 2.55000000000000002e-89

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 39.8% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;a \leq -5.3 \cdot 10^{+156}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;a \leq -1.26 \cdot 10^{-6}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq -4.4 \cdot 10^{-52}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;a \leq 1.8 \cdot 10^{-32}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -5.5000000000000004e239 or -5.2999999999999998e156 < a < -1.26000000000000001e-6

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.5000000000000004e239 < a < -5.2999999999999998e156 or 1.79999999999999996e-32 < a

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.26000000000000001e-6 < a < -4.40000000000000018e-52

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.40000000000000018e-52 < a < 1.79999999999999996e-32

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.5 \cdot 10^{+239}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -5.3 \cdot 10^{+156}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -1.26 \cdot 10^{-6}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -4.4 \cdot 10^{-52}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq 1.8 \cdot 10^{-32}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]

Alternative 10: 81.2% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.29999999999999998e-161 or 2.6499999999999999e-11 < z

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.29999999999999998e-161 < z < 2.6499999999999999e-11

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 39.0% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x \leq -1.18 \cdot 10^{-179}:\\
\;\;\;\;a \cdot t\\

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

\mathbf{elif}\;x \leq 5.2 \cdot 10^{+104}:\\
\;\;\;\;a \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -9.9999999999999995e32 or 5.20000000000000001e104 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999995e32 < x < -1.1800000000000001e-179 or 1.5e-158 < x < 5.20000000000000001e104

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1800000000000001e-179 < x < 1.5e-158

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{+33}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -1.18 \cdot 10^{-179}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-158}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{+104}:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 12: 75.3% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.55 \cdot 10^{-5} \lor \neg \left(a \leq 7.4 \cdot 10^{-47}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.55000000000000007e-5 or 7.4000000000000001e-47 < a

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.55000000000000007e-5 < a < 7.4000000000000001e-47

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 57.3% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+187} \lor \neg \left(y \leq 2.6 \cdot 10^{+240}\right):\\
\;\;\;\;z \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.39999999999999985e187 or 2.6e240 < y

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.39999999999999985e187 < y < 2.6e240

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 38.7% accurate, 2.1× speedup?

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

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

\mathbf{elif}\;x \leq 5.8 \cdot 10^{+107}:\\
\;\;\;\;a \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.4999999999999999e32 or 5.79999999999999975e107 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.4999999999999999e32 < x < 5.79999999999999975e107

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{+32}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{+107}:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 15: 25.8% accurate, 15.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
def code(x, y, z, t, a, b):
	return x
function code(x, y, z, t, a, b)
	return x
end
function tmp = code(x, y, z, t, a, b)
	tmp = x;
end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 95.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+95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification31.0%

    \[\leadsto x \]

Developer target: 97.3% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023320 
(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)))