Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.1% → 99.0%
Time: 12.3s
Alternatives: 14
Speedup: 0.8×

Specification

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

\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 14 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.1% 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: 99.0% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+153} \lor \neg \left(z \leq 2 \cdot 10^{+51}\right):\\ \;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -4.5e+153) (not (<= z 2e+51)))
   (* z (+ y (+ (/ x z) (* a (+ b (/ t z))))))
   (+ (fma y z x) (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -4.5e+153) || !(z <= 2e+51)) {
		tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
	} else {
		tmp = fma(y, z, x) + (a * (t + (z * b)));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -4.5e+153) || !(z <= 2e+51))
		tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z))))));
	else
		tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.5e+153], N[Not[LessEqual[z, 2e+51]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+153} \lor \neg \left(z \leq 2 \cdot 10^{+51}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.5000000000000001e153 or 2e51 < z

    1. Initial program 79.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+79.3%

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

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

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

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

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

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

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

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

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

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

    if -4.5000000000000001e153 < z < 2e51

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+153} \lor \neg \left(z \leq 2 \cdot 10^{+51}\right):\\ \;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 39.7% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \leq 3.6 \cdot 10^{-260}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;a \leq 11200000:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -5.4e-40 or 1.15000000000000001e163 < a

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

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

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

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

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Taylor expanded in x around 0 45.0%

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

    if -5.4e-40 < a < 3.6000000000000001e-260

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.6000000000000001e-260 < a < 1.12e7

    1. Initial program 97.9%

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

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

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

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

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Taylor expanded in x around inf 56.7%

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

    if 1.12e7 < a < 1.15000000000000001e163

    1. Initial program 86.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+86.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(z \cdot b\right)} \]
    10. Simplified45.1%

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

Alternative 3: 99.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+53} \lor \neg \left(z \leq 1.75 \cdot 10^{+59}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.2000000000000004e53 or 1.75e59 < z

    1. Initial program 78.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+78.3%

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

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

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

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

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

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

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

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

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

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

    if -4.2000000000000004e53 < z < 1.75e59

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+53} \lor \neg \left(z \leq 1.75 \cdot 10^{+59}\right):\\ \;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot \left(z \cdot b\right) + a \cdot t\right) + \left(x + z \cdot y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 62.2% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -6.8 \cdot 10^{+80} \lor \neg \left(z \leq 7.6 \cdot 10^{-114}\right):\\
\;\;\;\;x + z \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.95000000000000003e257

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.95000000000000003e257 < z < -6.79999999999999984e80 or 7.5999999999999997e-114 < z

    1. Initial program 84.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+84.9%

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

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

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

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

      \[\leadsto \color{blue}{x + y \cdot z} \]
    7. Step-by-step derivation
      1. *-commutative62.3%

        \[\leadsto x + \color{blue}{z \cdot y} \]
    8. Simplified62.3%

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

    if -6.79999999999999984e80 < z < 7.5999999999999997e-114

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.95 \cdot 10^{+257}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{+80} \lor \neg \left(z \leq 7.6 \cdot 10^{-114}\right):\\ \;\;\;\;x + z \cdot y\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 85.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+81} \lor \neg \left(z \leq 1.16 \cdot 10^{-108}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.99999999999999997e81 or 1.16e-108 < z

    1. Initial program 84.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+84.7%

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

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

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

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

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

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

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

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

    if -2.99999999999999997e81 < z < 1.16e-108

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

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

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

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

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

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

        \[\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-out100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{+81} \lor \neg \left(z \leq 1.16 \cdot 10^{-108}\right):\\ \;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 82.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{-35} \lor \neg \left(a \leq 1.16 \cdot 10^{-95}\right):\\
\;\;\;\;x + 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 < -2.99999999999999989e-35 or 1.15999999999999997e-95 < a

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

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

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

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

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

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

        \[\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-out96.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.99999999999999989e-35 < a < 1.15999999999999997e-95

    1. Initial program 97.1%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{z \cdot y} \]
    8. Simplified83.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3 \cdot 10^{-35} \lor \neg \left(a \leq 1.16 \cdot 10^{-95}\right):\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 84.2% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 91.2%

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

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

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

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

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

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

        \[\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-out78.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{t \cdot \left(a + \frac{a \cdot \left(b \cdot z\right)}{t}\right)} \]
    7. Step-by-step derivation
      1. associate-/l*74.7%

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

        \[\leadsto x + t \cdot \left(a + a \cdot \color{blue}{\left(b \cdot \frac{z}{t}\right)}\right) \]
    8. Simplified81.1%

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

    if -6.39999999999999986e39 < b < 3.19999999999999983e50

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

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

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

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

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

    if 3.19999999999999983e50 < b

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -6.4 \cdot 10^{+39}:\\ \;\;\;\;x + t \cdot \left(a + a \cdot \left(b \cdot \frac{z}{t}\right)\right)\\ \mathbf{elif}\;b \leq 3.2 \cdot 10^{+50}:\\ \;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 85.8% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

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

    if -7.00000000000000047e42 < b < 3.3e50

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

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

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

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

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

    if 3.3e50 < b

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7 \cdot 10^{+42}:\\ \;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;b \leq 3.3 \cdot 10^{+50}:\\ \;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 39.7% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;a \leq 4.2 \cdot 10^{-260}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;a \leq 5 \cdot 10^{+28}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -7.99999999999999943e-39 or 4.99999999999999957e28 < a

    1. Initial program 85.5%

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

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

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

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

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Taylor expanded in x around 0 43.0%

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

    if -7.99999999999999943e-39 < a < 4.20000000000000009e-260

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.20000000000000009e-260 < a < 4.99999999999999957e28

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

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

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

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Taylor expanded in x around inf 52.6%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 10: 95.1% accurate, 0.8× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000013e193 < a

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

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

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

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

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

Alternative 11: 74.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -4.4 \cdot 10^{-37} \lor \neg \left(a \leq 14000\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 -4.4e-37) (not (<= a 14000.0)))
   (* 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 <= -4.4e-37) || !(a <= 14000.0)) {
		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 <= (-4.4d-37)) .or. (.not. (a <= 14000.0d0))) 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 <= -4.4e-37) || !(a <= 14000.0)) {
		tmp = a * (t + (z * b));
	} else {
		tmp = x + (z * y);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (a <= -4.4e-37) or not (a <= 14000.0):
		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 <= -4.4e-37) || !(a <= 14000.0))
		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 <= -4.4e-37) || ~((a <= 14000.0)))
		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, -4.4e-37], N[Not[LessEqual[a, 14000.0]], $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 -4.4 \cdot 10^{-37} \lor \neg \left(a \leq 14000\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 < -4.40000000000000004e-37 or 14000 < a

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

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

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

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

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

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

        \[\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-out95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.40000000000000004e-37 < a < 14000

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

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

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

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

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

      \[\leadsto \color{blue}{x + y \cdot z} \]
    7. Step-by-step derivation
      1. *-commutative80.6%

        \[\leadsto x + \color{blue}{z \cdot y} \]
    8. Simplified80.6%

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

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

Alternative 12: 55.2% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.6000000000000003e153

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.6000000000000003e153 < z < 6.10000000000000007e-108

    1. Initial program 96.5%

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

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

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

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

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

    if 6.10000000000000007e-108 < z

    1. Initial program 84.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+84.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot y} \]
    10. Simplified48.7%

      \[\leadsto \color{blue}{z \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 13: 39.3% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x \leq 2.3 \cdot 10^{+49}:\\
\;\;\;\;a \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.2999999999999998e49 or 2.30000000000000002e49 < x

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

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

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

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

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Taylor expanded in x around inf 49.0%

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

    if -3.2999999999999998e49 < x < 2.30000000000000002e49

    1. Initial program 90.5%

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

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

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

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

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Taylor expanded in x around 0 38.1%

      \[\leadsto \color{blue}{a \cdot t} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 14: 26.1% 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 91.2%

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

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

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

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

    \[\leadsto \color{blue}{x + a \cdot t} \]
  6. Taylor expanded in x around inf 24.5%

    \[\leadsto \color{blue}{x} \]
  7. Add Preprocessing

Developer Target 1: 97.1% accurate, 0.7× 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 2024163 
(FPCore (x y z t a b)
  :name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< z -11820553527347888000) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 47589743188364287/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a))))))

  (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))