Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.7% → 97.6%
Time: 8.9s
Alternatives: 10
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 92.7% accurate, 1.0× speedup?

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

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

Alternative 1: 97.6% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 98.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing

    if 1.99999999999999997e307 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b))

    1. Initial program 62.8%

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

      \[\leadsto \color{blue}{a \cdot t + \left(a \cdot \left(b \cdot z\right) + y \cdot z\right)} \]
    4. Step-by-step derivation
      1. associate-+r+N/A

        \[\leadsto \color{blue}{\left(a \cdot t + a \cdot \left(b \cdot z\right)\right) + y \cdot z} \]
      2. distribute-lft-inN/A

        \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} + y \cdot z \]
      3. +-commutativeN/A

        \[\leadsto \color{blue}{y \cdot z + a \cdot \left(t + b \cdot z\right)} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{z \cdot y} + a \cdot \left(t + b \cdot z\right) \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, a \cdot \left(t + b \cdot z\right)\right)} \]
      6. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z, y, \color{blue}{a \cdot \left(t + b \cdot z\right)}\right) \]
      7. +-commutativeN/A

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

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

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

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

Alternative 2: 84.7% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.25000000000000007e36

    1. Initial program 90.9%

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

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

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

    if -4.25000000000000007e36 < x < 2.39999999999999993e96

    1. Initial program 88.8%

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

      \[\leadsto \color{blue}{a \cdot t + \left(a \cdot \left(b \cdot z\right) + y \cdot z\right)} \]
    4. Step-by-step derivation
      1. associate-+r+N/A

        \[\leadsto \color{blue}{\left(a \cdot t + a \cdot \left(b \cdot z\right)\right) + y \cdot z} \]
      2. distribute-lft-inN/A

        \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} + y \cdot z \]
      3. +-commutativeN/A

        \[\leadsto \color{blue}{y \cdot z + a \cdot \left(t + b \cdot z\right)} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{z \cdot y} + a \cdot \left(t + b \cdot z\right) \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, a \cdot \left(t + b \cdot z\right)\right)} \]
      6. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z, y, \color{blue}{a \cdot \left(t + b \cdot z\right)}\right) \]
      7. +-commutativeN/A

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

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

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

    if 2.39999999999999993e96 < x

    1. Initial program 92.4%

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

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

        \[\leadsto \color{blue}{\left(a \cdot \left(b \cdot z\right) + y \cdot z\right) + x} \]
      2. +-commutativeN/A

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

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

        \[\leadsto \color{blue}{z \cdot \left(y + a \cdot b\right)} + x \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, y + a \cdot b, x\right)} \]
      6. +-commutativeN/A

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(a, b, y\right)}, x\right) \]
    5. Applied rewrites86.7%

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

Alternative 3: 86.4% accurate, 1.2× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.1e38 or 3.3999999999999998e103 < b

    1. Initial program 94.6%

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

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

        \[\leadsto \color{blue}{\left(a \cdot \left(b \cdot z\right) + y \cdot z\right) + x} \]
      2. +-commutativeN/A

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

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

        \[\leadsto \color{blue}{z \cdot \left(y + a \cdot b\right)} + x \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, y + a \cdot b, x\right)} \]
      6. +-commutativeN/A

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(a, b, y\right)}, x\right) \]
    5. Applied rewrites79.6%

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

    if -2.1e38 < b < 3.3999999999999998e103

    1. Initial program 87.3%

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

      \[\leadsto \color{blue}{x + \left(a \cdot t + y \cdot z\right)} \]
    4. Applied rewrites92.7%

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

Alternative 4: 81.5% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_1 := a \cdot \mathsf{fma}\left(b, z, t\right)\\
\mathbf{if}\;a \leq -1.52 \cdot 10^{+187}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 6.5 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, x\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.5199999999999999e187 or 6.5000000000000001e-19 < a

    1. Initial program 83.3%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
      2. +-commutativeN/A

        \[\leadsto a \cdot \color{blue}{\left(b \cdot z + t\right)} \]
      3. lower-fma.f6486.8

        \[\leadsto a \cdot \color{blue}{\mathsf{fma}\left(b, z, t\right)} \]
    5. Applied rewrites86.8%

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

    if -1.5199999999999999e187 < a < 6.5000000000000001e-19

    1. Initial program 93.5%

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

      \[\leadsto \color{blue}{x + \left(a \cdot t + y \cdot z\right)} \]
    4. Applied rewrites86.6%

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

Alternative 5: 72.1% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_1 := a \cdot \mathsf{fma}\left(b, z, t\right)\\
\mathbf{if}\;a \leq -2.8 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.8 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(z, y, x\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.8000000000000001e125 or 1.8000000000000001e-19 < a

    1. Initial program 82.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
      2. +-commutativeN/A

        \[\leadsto a \cdot \color{blue}{\left(b \cdot z + t\right)} \]
      3. lower-fma.f6481.3

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

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

    if -2.8000000000000001e125 < a < 1.8000000000000001e-19

    1. Initial program 95.2%

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

      \[\leadsto \color{blue}{x + y \cdot z} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{y \cdot z + x} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{z \cdot y} + x \]
      3. lower-fma.f6476.9

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]
    5. Applied rewrites76.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 60.8% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;a \leq 13.5:\\
\;\;\;\;\mathsf{fma}\left(z, y, x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\


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

    1. Initial program 80.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto a \cdot \color{blue}{\left(b \cdot z\right)} \]
    5. Applied rewrites50.0%

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

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

      if -8.99999999999999959e160 < a < 13.5

      1. Initial program 93.3%

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

        \[\leadsto \color{blue}{x + y \cdot z} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{y \cdot z + x} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{z \cdot y} + x \]
        3. lower-fma.f6473.8

          \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]
      5. Applied rewrites73.8%

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

      if 13.5 < a

      1. Initial program 85.7%

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

        \[\leadsto \color{blue}{x + a \cdot t} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{a \cdot t + x} \]
        2. lower-fma.f6462.8

          \[\leadsto \color{blue}{\mathsf{fma}\left(a, t, x\right)} \]
      5. Applied rewrites62.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, t, x\right)} \]
    7. Recombined 3 regimes into one program.
    8. Final simplification69.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9 \cdot 10^{+160}:\\ \;\;\;\;b \cdot \left(z \cdot a\right)\\ \mathbf{elif}\;a \leq 13.5:\\ \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \end{array} \]
    9. Add Preprocessing

    Alternative 7: 62.8% accurate, 1.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -5.6 \cdot 10^{+125}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \mathbf{elif}\;a \leq 13.5:\\ \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (if (<= a -5.6e+125) (fma a t x) (if (<= a 13.5) (fma z y x) (fma a t x))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double tmp;
    	if (a <= -5.6e+125) {
    		tmp = fma(a, t, x);
    	} else if (a <= 13.5) {
    		tmp = fma(z, y, x);
    	} else {
    		tmp = fma(a, t, x);
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b)
    	tmp = 0.0
    	if (a <= -5.6e+125)
    		tmp = fma(a, t, x);
    	elseif (a <= 13.5)
    		tmp = fma(z, y, x);
    	else
    		tmp = fma(a, t, x);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5.6e+125], N[(a * t + x), $MachinePrecision], If[LessEqual[a, 13.5], N[(z * y + x), $MachinePrecision], N[(a * t + x), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;a \leq -5.6 \cdot 10^{+125}:\\
    \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
    
    \mathbf{elif}\;a \leq 13.5:\\
    \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if a < -5.6000000000000002e125 or 13.5 < a

      1. Initial program 82.2%

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

        \[\leadsto \color{blue}{x + a \cdot t} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{a \cdot t + x} \]
        2. lower-fma.f6457.9

          \[\leadsto \color{blue}{\mathsf{fma}\left(a, t, x\right)} \]
      5. Applied rewrites57.9%

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

      if -5.6000000000000002e125 < a < 13.5

      1. Initial program 95.4%

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

        \[\leadsto \color{blue}{x + y \cdot z} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{y \cdot z + x} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{z \cdot y} + x \]
        3. lower-fma.f6476.2

          \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]
      5. Applied rewrites76.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 8: 59.4% accurate, 1.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+92}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+183}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (if (<= z -5e+92) (* y z) (if (<= z 5e+183) (fma a t x) (* y z))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double tmp;
    	if (z <= -5e+92) {
    		tmp = y * z;
    	} else if (z <= 5e+183) {
    		tmp = fma(a, t, x);
    	} else {
    		tmp = y * z;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b)
    	tmp = 0.0
    	if (z <= -5e+92)
    		tmp = Float64(y * z);
    	elseif (z <= 5e+183)
    		tmp = fma(a, t, x);
    	else
    		tmp = Float64(y * z);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5e+92], N[(y * z), $MachinePrecision], If[LessEqual[z, 5e+183], N[(a * t + x), $MachinePrecision], N[(y * z), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -5 \cdot 10^{+92}:\\
    \;\;\;\;y \cdot z\\
    
    \mathbf{elif}\;z \leq 5 \cdot 10^{+183}:\\
    \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;y \cdot z\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -5.00000000000000022e92 or 5.00000000000000009e183 < z

      1. Initial program 72.7%

        \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
      2. Add Preprocessing
      3. Taylor expanded in y around inf

        \[\leadsto \color{blue}{y \cdot z} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{z \cdot y} \]
        2. lower-*.f6457.7

          \[\leadsto \color{blue}{z \cdot y} \]
      5. Applied rewrites57.7%

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

      if -5.00000000000000022e92 < z < 5.00000000000000009e183

      1. Initial program 96.3%

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

        \[\leadsto \color{blue}{x + a \cdot t} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{a \cdot t + x} \]
        2. lower-fma.f6466.0

          \[\leadsto \color{blue}{\mathsf{fma}\left(a, t, x\right)} \]
      5. Applied rewrites66.0%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+92}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+183}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]
    5. Add Preprocessing

    Alternative 9: 38.3% accurate, 1.7× speedup?

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

      1. Initial program 81.6%

        \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
      2. Add Preprocessing
      3. Taylor expanded in t around inf

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

          \[\leadsto \color{blue}{a \cdot t} \]
      5. Applied rewrites47.4%

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

      if -9.49999999999999974e118 < a < 13.5

      1. Initial program 96.0%

        \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
      2. Add Preprocessing
      3. Taylor expanded in y around inf

        \[\leadsto \color{blue}{y \cdot z} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{z \cdot y} \]
        2. lower-*.f6441.3

          \[\leadsto \color{blue}{z \cdot y} \]
      5. Applied rewrites41.3%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9.5 \cdot 10^{+118}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq 13.5:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \]
    5. Add Preprocessing

    Alternative 10: 28.5% accurate, 5.0× speedup?

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

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf

      \[\leadsto \color{blue}{a \cdot t} \]
    4. Step-by-step derivation
      1. lower-*.f6428.0

        \[\leadsto \color{blue}{a \cdot t} \]
    5. Applied rewrites28.0%

      \[\leadsto \color{blue}{a \cdot t} \]
    6. Final simplification28.0%

      \[\leadsto t \cdot a \]
    7. Add Preprocessing

    Developer Target 1: 97.4% accurate, 0.8× 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 2024220 
    (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)))