Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.5% → 97.6%
Time: 11.2s
Alternatives: 14
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 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.5% 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} \mathbf{if}\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + b \cdot \left(z \cdot a\right) \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(z \cdot a, b, \mathsf{fma}\left(y, z, \mathsf{fma}\left(t, a, x\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \mathsf{fma}\left(\frac{a}{y}, \mathsf{fma}\left(b, z, t\right), z\right), x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= (+ (+ (+ x (* y z)) (* t a)) (* b (* z a))) INFINITY)
   (fma (* z a) b (fma y z (fma t a x)))
   (fma y (fma (/ a y) (fma b z t) z) x)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((((x + (y * z)) + (t * a)) + (b * (z * a))) <= ((double) INFINITY)) {
		tmp = fma((z * a), b, fma(y, z, fma(t, a, x)));
	} else {
		tmp = fma(y, fma((a / y), fma(b, z, t), z), x);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(b * Float64(z * a))) <= Inf)
		tmp = fma(Float64(z * a), b, fma(y, z, fma(t, a, x)));
	else
		tmp = fma(y, fma(Float64(a / y), fma(b, z, t), z), x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(z * a), $MachinePrecision] * b + N[(y * z + N[(t * a + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(a / y), $MachinePrecision] * N[(b * z + t), $MachinePrecision] + z), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 99.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot a}, b, \left(x + y \cdot z\right) + t \cdot a\right) \]
      5. associate-+l+N/A

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

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

        \[\leadsto \mathsf{fma}\left(z \cdot a, b, \color{blue}{y \cdot z + \left(t \cdot a + x\right)}\right) \]
      8. accelerator-lowering-fma.f64N/A

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \left(\left(\frac{a \cdot t}{y} + \frac{a \cdot \left(b \cdot z\right)}{y}\right) + z\right) + x \cdot \color{blue}{1} \]
      9. *-rgt-identityN/A

        \[\leadsto y \cdot \left(\left(\frac{a \cdot t}{y} + \frac{a \cdot \left(b \cdot z\right)}{y}\right) + z\right) + \color{blue}{x} \]
      10. accelerator-lowering-fma.f64N/A

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

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

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

Alternative 2: 96.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \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:\\ \;\;\;\;\mathsf{fma}\left(z \cdot a, b, \mathsf{fma}\left(y, z, \mathsf{fma}\left(t, a, x\right)\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 (* y z)) (* t a)) (* b (* z a))) INFINITY)
   (fma (* z a) b (fma y z (fma t a x)))
   (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 + (y * z)) + (t * a)) + (b * (z * a))) <= ((double) INFINITY)) {
		tmp = fma((z * a), b, fma(y, z, fma(t, a, x)));
	} else {
		tmp = fma(z, fma(a, b, y), x);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(b * Float64(z * a))) <= Inf)
		tmp = fma(Float64(z * a), b, fma(y, z, fma(t, a, x)));
	else
		tmp = fma(z, fma(a, b, y), x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(z * a), $MachinePrecision] * b + N[(y * z + N[(t * a + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(a * b + y), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}

\\
\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:\\
\;\;\;\;\mathsf{fma}\left(z \cdot a, b, \mathsf{fma}\left(y, z, \mathsf{fma}\left(t, a, x\right)\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 2 regimes
  2. if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0

    1. Initial program 99.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot a}, b, \left(x + y \cdot z\right) + t \cdot a\right) \]
      5. associate-+l+N/A

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

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

        \[\leadsto \mathsf{fma}\left(z \cdot a, b, \color{blue}{y \cdot z + \left(t \cdot a + x\right)}\right) \]
      8. accelerator-lowering-fma.f64N/A

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

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

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

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

    1. Initial program 0.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. 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. accelerator-lowering-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. accelerator-lowering-fma.f6483.5

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

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

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

Alternative 3: 61.2% accurate, 1.0× speedup?

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

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

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

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

\mathbf{elif}\;y \leq 4.8 \cdot 10^{+32}:\\
\;\;\;\;\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 y < -1.8e8 or 4.79999999999999983e32 < y

    1. Initial program 91.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 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. accelerator-lowering-fma.f6472.2

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

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

    if -1.8e8 < y < -4.9999999999999999e-148 or -1.28000000000000007e-247 < y < 4.79999999999999983e32

    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 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. accelerator-lowering-fma.f6465.8

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

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

    if -4.9999999999999999e-148 < y < -1.28000000000000007e-247

    1. Initial program 99.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 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. accelerator-lowering-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. accelerator-lowering-fma.f6478.0

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), x\right)} \]
    6. Step-by-step derivation
      1. flip-+N/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{\left(a \cdot b\right) \cdot \left(a \cdot b\right) - y \cdot y}{a \cdot b - y}}, x\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{\frac{a \cdot b - y}{\left(a \cdot b\right) \cdot \left(a \cdot b\right) - y \cdot y}}}, x\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{\frac{a \cdot b - y}{\left(a \cdot b\right) \cdot \left(a \cdot b\right) - y \cdot y}}}, x\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{fma}\left(z, \frac{1}{\color{blue}{\frac{1}{\frac{\left(a \cdot b\right) \cdot \left(a \cdot b\right) - y \cdot y}{a \cdot b - y}}}}, x\right) \]
      5. flip-+N/A

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

        \[\leadsto \mathsf{fma}\left(z, \frac{1}{\color{blue}{\frac{1}{a \cdot b + y}}}, x\right) \]
      7. accelerator-lowering-fma.f6478.0

        \[\leadsto \mathsf{fma}\left(z, \frac{1}{\frac{1}{\color{blue}{\mathsf{fma}\left(a, b, y\right)}}}, x\right) \]
    7. Applied egg-rr78.0%

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{\frac{1}{\mathsf{fma}\left(a, b, y\right)}}}, x\right) \]
    8. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]
    9. 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}{\left(b \cdot a\right)} \cdot z \]
      3. associate-*r*N/A

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

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

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

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

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

Alternative 4: 60.9% accurate, 1.0× speedup?

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

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

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

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

\mathbf{elif}\;y \leq 6 \cdot 10^{+32}:\\
\;\;\;\;\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 y < -3.1e6 or 6e32 < y

    1. Initial program 91.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 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. accelerator-lowering-fma.f6472.2

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

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

    if -3.1e6 < y < -8.5999999999999998e-146 or -5.0000000000000001e-248 < y < 6e32

    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 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. accelerator-lowering-fma.f6465.8

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

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

    if -8.5999999999999998e-146 < y < -5.0000000000000001e-248

    1. Initial program 99.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 b around inf

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

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

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

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

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

Alternative 5: 86.8% 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 -2400000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 7.8 \cdot 10^{+50}:\\ \;\;\;\;\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 -2400000000.0)
     t_1
     (if (<= b 7.8e+50) (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 <= -2400000000.0) {
		tmp = t_1;
	} else if (b <= 7.8e+50) {
		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 <= -2400000000.0)
		tmp = t_1;
	elseif (b <= 7.8e+50)
		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, -2400000000.0], t$95$1, If[LessEqual[b, 7.8e+50], 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 -2400000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 7.8 \cdot 10^{+50}:\\
\;\;\;\;\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.4e9 or 7.79999999999999935e50 < b

    1. Initial program 90.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 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. accelerator-lowering-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. accelerator-lowering-fma.f6487.2

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

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

    if -2.4e9 < b < 7.79999999999999935e50

    1. Initial program 94.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 b around 0

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

      \[\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 6: 80.3% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \mathsf{fma}\left(a, b, y\right)\\ \mathbf{if}\;b \leq -4 \cdot 10^{+178}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 9.8 \cdot 10^{+58}:\\ \;\;\;\;\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 (<= b -4e+178) t_1 (if (<= b 9.8e+58) (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 (b <= -4e+178) {
		tmp = t_1;
	} else if (b <= 9.8e+58) {
		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 (b <= -4e+178)
		tmp = t_1;
	elseif (b <= 9.8e+58)
		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[b, -4e+178], t$95$1, If[LessEqual[b, 9.8e+58], 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}\;b \leq -4 \cdot 10^{+178}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 9.8 \cdot 10^{+58}:\\
\;\;\;\;\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 < -4.0000000000000002e178 or 9.80000000000000037e58 < b

    1. Initial program 91.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 z around inf

      \[\leadsto \color{blue}{z \cdot \left(y + a \cdot b\right)} \]
    4. Step-by-step derivation
      1. *-lowering-*.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. accelerator-lowering-fma.f6482.8

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

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

    if -4.0000000000000002e178 < b < 9.80000000000000037e58

    1. Initial program 93.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 b around 0

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

      \[\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: 39.5% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;y \leq 1.05 \cdot 10^{-243}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 3.6 \cdot 10^{+80}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.9499999999999999e64 or 3.59999999999999995e80 < y

    1. Initial program 90.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 y around inf

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

        \[\leadsto \color{blue}{z \cdot y} \]
      2. *-lowering-*.f6460.5

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

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

    if -1.9499999999999999e64 < y < 1.05e-243

    1. Initial program 95.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 x around inf

      \[\leadsto \color{blue}{x} \]
    4. Step-by-step derivation
      1. Simplified35.4%

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

      if 1.05e-243 < y < 3.59999999999999995e80

      1. Initial program 94.1%

        \[\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. *-lowering-*.f6437.6

          \[\leadsto \color{blue}{a \cdot t} \]
      5. Simplified37.6%

        \[\leadsto \color{blue}{a \cdot t} \]
    5. Recombined 3 regimes into one program.
    6. Final simplification46.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.95 \cdot 10^{+64}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-243}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{+80}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]
    7. Add Preprocessing

    Alternative 8: 64.3% accurate, 1.2× speedup?

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

      1. Initial program 94.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. accelerator-lowering-fma.f6486.7

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

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

      if -2.2999999999999999e129 < y < 1.75e18

      1. Initial program 92.8%

        \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. +-commutativeN/A

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

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

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot a}, b, \left(x + y \cdot z\right) + t \cdot a\right) \]
        5. associate-+l+N/A

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

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

          \[\leadsto \mathsf{fma}\left(z \cdot a, b, \color{blue}{y \cdot z + \left(t \cdot a + x\right)}\right) \]
        8. accelerator-lowering-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(z \cdot a, b, \color{blue}{\mathsf{fma}\left(y, z, t \cdot a + x\right)}\right) \]
        9. accelerator-lowering-fma.f6493.4

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

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

        \[\leadsto \mathsf{fma}\left(z \cdot a, b, \color{blue}{x}\right) \]
      6. Step-by-step derivation
        1. Simplified71.1%

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

        if 1.75e18 < y

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

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

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

          \[\leadsto \mathsf{fma}\left(a, t, \color{blue}{y \cdot z}\right) \]
        6. Step-by-step derivation
          1. *-lowering-*.f6472.9

            \[\leadsto \mathsf{fma}\left(a, t, \color{blue}{y \cdot z}\right) \]
        7. Simplified72.9%

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

      Alternative 9: 71.1% 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 -2.6 \cdot 10^{-146}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7.4 \cdot 10^{+66}:\\ \;\;\;\;\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 -2.6e-146) t_1 (if (<= z 7.4e+66) (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 <= -2.6e-146) {
      		tmp = t_1;
      	} else if (z <= 7.4e+66) {
      		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 <= -2.6e-146)
      		tmp = t_1;
      	elseif (z <= 7.4e+66)
      		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, -2.6e-146], t$95$1, If[LessEqual[z, 7.4e+66], 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 -2.6 \cdot 10^{-146}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 7.4 \cdot 10^{+66}:\\
      \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -2.59999999999999987e-146 or 7.4000000000000001e66 < z

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

          \[\leadsto \color{blue}{z \cdot \left(y + a \cdot b\right)} \]
        4. Step-by-step derivation
          1. *-lowering-*.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. accelerator-lowering-fma.f6475.3

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

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

        if -2.59999999999999987e-146 < z < 7.4000000000000001e66

        1. Initial program 99.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 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. accelerator-lowering-fma.f6469.0

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

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

      Alternative 10: 73.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 -5.5 \cdot 10^{+51}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{-10}:\\ \;\;\;\;\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 -5.5e+51) t_1 (if (<= a 3.2e-10) (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 <= -5.5e+51) {
      		tmp = t_1;
      	} else if (a <= 3.2e-10) {
      		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 <= -5.5e+51)
      		tmp = t_1;
      	elseif (a <= 3.2e-10)
      		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, -5.5e+51], t$95$1, If[LessEqual[a, 3.2e-10], 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 -5.5 \cdot 10^{+51}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;a \leq 3.2 \cdot 10^{-10}:\\
      \;\;\;\;\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 < -5.5e51 or 3.19999999999999981e-10 < a

        1. Initial program 85.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. *-lowering-*.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. accelerator-lowering-fma.f6475.6

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

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

        if -5.5e51 < a < 3.19999999999999981e-10

        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. accelerator-lowering-fma.f6470.1

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

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

      Alternative 11: 63.5% accurate, 1.6× speedup?

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

        1. Initial program 91.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 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. accelerator-lowering-fma.f6472.2

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

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

        if -19000 < y < 7e31

        1. Initial program 93.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 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. accelerator-lowering-fma.f6458.1

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

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

      Alternative 12: 58.5% accurate, 1.6× speedup?

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

        1. Initial program 89.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 y around inf

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

            \[\leadsto \color{blue}{z \cdot y} \]
          2. *-lowering-*.f6465.4

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

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

        if -5.59999999999999997e94 < y < 9.99999999999999925e125

        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 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. accelerator-lowering-fma.f6455.7

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

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

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

      Alternative 13: 40.2% accurate, 1.7× speedup?

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

        1. Initial program 87.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 t around inf

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

            \[\leadsto \color{blue}{a \cdot t} \]
        5. Simplified45.2%

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

        if -1.4e68 < t < 6e20

        1. Initial program 96.1%

          \[\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 inf

          \[\leadsto \color{blue}{x} \]
        4. Step-by-step derivation
          1. Simplified31.5%

            \[\leadsto \color{blue}{x} \]
        5. Recombined 2 regimes into one program.
        6. Final simplification36.8%

          \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.4 \cdot 10^{+68}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;t \leq 6 \cdot 10^{+20}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \]
        7. Add Preprocessing

        Alternative 14: 25.9% accurate, 30.0× speedup?

        \[\begin{array}{l} \\ x \end{array} \]
        (FPCore (x y z t a b) :precision binary64 x)
        double code(double x, double y, double z, double t, double a, double b) {
        	return x;
        }
        
        real(8) function code(x, y, z, t, a, b)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            real(8), intent (in) :: a
            real(8), intent (in) :: b
            code = x
        end function
        
        public static double code(double x, double y, double z, double t, double a, double b) {
        	return x;
        }
        
        def code(x, y, z, t, a, b):
        	return x
        
        function code(x, y, z, t, a, b)
        	return x
        end
        
        function tmp = code(x, y, z, t, a, b)
        	tmp = x;
        end
        
        code[x_, y_, z_, t_, a_, b_] := x
        
        \begin{array}{l}
        
        \\
        x
        \end{array}
        
        Derivation
        1. Initial program 92.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 x around inf

          \[\leadsto \color{blue}{x} \]
        4. Step-by-step derivation
          1. Simplified24.7%

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

          Developer Target 1: 97.6% 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 2024198 
          (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)))