Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.4% → 96.6%
Time: 8.5s
Alternatives: 11
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 11 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.4% 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: 96.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 \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(b, z, t\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 INFINITY) t_1 (* 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 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = 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 <= Inf)
		tmp = t_1;
	else
		tmp = 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, Infinity], t$95$1, N[(a * N[(b * z + t), $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 \infty:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 97.6%

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

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

    1. Initial program 0.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. 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.f6478.6

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

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

    \[\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 \infty:\\ \;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + b \cdot \left(z \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(b, z, t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 73.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \mathsf{fma}\left(a, b, y\right)\\ \mathbf{if}\;z \leq -1.25 \cdot 10^{+173}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -550000000:\\ \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\ \mathbf{elif}\;z \leq 1.26 \cdot 10^{+50}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* z (fma a b y))))
   (if (<= z -1.25e+173)
     t_1
     (if (<= z -550000000.0)
       (fma z y x)
       (if (<= z 1.26e+50) (fma a t x) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = z * fma(a, b, y);
	double tmp;
	if (z <= -1.25e+173) {
		tmp = t_1;
	} else if (z <= -550000000.0) {
		tmp = fma(z, y, x);
	} else if (z <= 1.26e+50) {
		tmp = fma(a, t, x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(z * fma(a, b, y))
	tmp = 0.0
	if (z <= -1.25e+173)
		tmp = t_1;
	elseif (z <= -550000000.0)
		tmp = fma(z, y, x);
	elseif (z <= 1.26e+50)
		tmp = fma(a, t, 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]), $MachinePrecision]}, If[LessEqual[z, -1.25e+173], t$95$1, If[LessEqual[z, -550000000.0], N[(z * y + x), $MachinePrecision], If[LessEqual[z, 1.26e+50], N[(a * t + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq 1.26 \cdot 10^{+50}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.25000000000000009e173 or 1.26000000000000001e50 < z

    1. Initial program 81.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 inf

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

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

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

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

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

    if -1.25000000000000009e173 < z < -5.5e8

    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 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.f6481.2

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

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

    if -5.5e8 < z < 1.26000000000000001e50

    1. Initial program 98.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 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.f6480.7

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

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

Alternative 3: 63.9% accurate, 1.2× speedup?

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

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

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

\mathbf{elif}\;z \leq 1.2 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\

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


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

    1. Initial program 86.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 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-*.f6468.7

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

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

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

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

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

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

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

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

    if -4.6999999999999998e206 < z < -5.5e8 or 1.20000000000000009e38 < z

    1. Initial program 83.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 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.f6464.1

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

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

    if -5.5e8 < z < 1.20000000000000009e38

    1. Initial program 98.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 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.f6481.0

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

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

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

Alternative 4: 63.6% accurate, 1.2× speedup?

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

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

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

\mathbf{elif}\;z \leq 1.2 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\

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


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

    1. Initial program 86.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 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-*.f6468.7

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

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

    if -4.6999999999999998e206 < z < -5.5e8 or 1.20000000000000009e38 < z

    1. Initial program 83.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 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.f6464.1

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

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

    if -5.5e8 < z < 1.20000000000000009e38

    1. Initial program 98.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 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.f6481.0

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

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

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

Alternative 5: 86.6% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.45999999999999997e-43 or 0.0027000000000000001 < t

    1. Initial program 92.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 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)} \]

    if -1.45999999999999997e-43 < t < 0.0027000000000000001

    1. Initial program 92.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.f6493.6

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

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

Alternative 6: 82.2% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \mathsf{fma}\left(a, b, y\right)\\ \mathbf{if}\;z \leq -3.6 \cdot 10^{+198}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+134}:\\ \;\;\;\;\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 (* z (fma a b y))))
   (if (<= z -3.6e+198) t_1 (if (<= z 7e+134) (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 = z * fma(a, b, y);
	double tmp;
	if (z <= -3.6e+198) {
		tmp = t_1;
	} else if (z <= 7e+134) {
		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(z * fma(a, b, y))
	tmp = 0.0
	if (z <= -3.6e+198)
		tmp = t_1;
	elseif (z <= 7e+134)
		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]), $MachinePrecision]}, If[LessEqual[z, -3.6e+198], t$95$1, If[LessEqual[z, 7e+134], N[(a * t + N[(z * y + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 7 \cdot 10^{+134}:\\
\;\;\;\;\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 z < -3.6000000000000002e198 or 7.00000000000000006e134 < z

    1. Initial program 80.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 inf

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

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

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

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

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

    if -3.6000000000000002e198 < z < 7.00000000000000006e134

    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 b around 0

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

      \[\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 7: 72.8% 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.04 \cdot 10^{+105}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{+16}:\\ \;\;\;\;\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 -1.04e+105) t_1 (if (<= a 2.8e+16) (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.04e+105) {
		tmp = t_1;
	} else if (a <= 2.8e+16) {
		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 <= -1.04e+105)
		tmp = t_1;
	elseif (a <= 2.8e+16)
		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, -1.04e+105], t$95$1, If[LessEqual[a, 2.8e+16], 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 -1.04 \cdot 10^{+105}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 2.8 \cdot 10^{+16}:\\
\;\;\;\;\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 < -1.04e105 or 2.8e16 < a

    1. Initial program 84.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 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.f6479.9

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

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

    if -1.04e105 < a < 2.8e16

    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
    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.f6477.3

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

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

Alternative 8: 64.6% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -550000000:\\
\;\;\;\;\mathsf{fma}\left(z, y, x\right)\\

\mathbf{elif}\;z \leq 1.2 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.5e8 or 1.20000000000000009e38 < z

    1. Initial program 84.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.f6460.6

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

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

    if -5.5e8 < z < 1.20000000000000009e38

    1. Initial program 98.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 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.f6481.0

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

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

Alternative 9: 60.0% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;z \leq 1.36 \cdot 10^{+52}:\\
\;\;\;\;\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 < -7.4999999999999998e28 or 1.35999999999999994e52 < z

    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 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-*.f6450.4

        \[\leadsto \color{blue}{z \cdot y} \]
    5. Applied rewrites50.4%

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

    if -7.4999999999999998e28 < z < 1.35999999999999994e52

    1. Initial program 98.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 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.f6479.9

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

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

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

Alternative 10: 40.4% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.095:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;z \leq 1.2 \cdot 10^{+38}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.095000000000000001 or 1.20000000000000009e38 < z

    1. Initial program 84.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 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-*.f6448.5

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

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

    if -0.095000000000000001 < z < 1.20000000000000009e38

    1. Initial program 98.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-*.f6443.1

        \[\leadsto \color{blue}{a \cdot t} \]
    5. Applied rewrites43.1%

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

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

Alternative 11: 28.2% 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 92.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 t around inf

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

      \[\leadsto \color{blue}{a \cdot t} \]
  5. Applied rewrites30.3%

    \[\leadsto \color{blue}{a \cdot t} \]
  6. Final simplification30.3%

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

Developer Target 1: 97.1% 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 2024219 
(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)))