Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.3% → 97.4%
Time: 8.2s
Alternatives: 9
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 9 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.3% 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.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, \mathsf{fma}\left(\frac{z}{t}, \mathsf{fma}\left(a, b, y\right), a\right), x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b))))
   (if (<= t_1 INFINITY) t_1 (fma t (fma (/ z t) (fma a b y) a) x))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = fma(t, fma((z / t), fma(a, b, y), a), x);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = fma(t, fma(Float64(z / t), fma(a, b, y), a), x);
	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[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(t * N[(N[(z / t), $MachinePrecision] * N[(a * b + y), $MachinePrecision] + a), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \mathsf{fma}\left(\frac{z}{t}, \mathsf{fma}\left(a, b, y\right), a\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 97.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 88.5% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.5000000000000002e-7

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

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

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

    if -7.5000000000000002e-7 < t < 7.5000000000000004e-150

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

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

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

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

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

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

    if 7.5000000000000004e-150 < t

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 87.0% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(a, \mathsf{fma}\left(b, z, t\right), x\right)\\ \mathbf{if}\;a \leq -2.3 \cdot 10^{-67}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{-35}:\\ \;\;\;\;\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 a (fma b z t) x)))
   (if (<= a -2.3e-67) t_1 (if (<= a 3.8e-35) (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(a, fma(b, z, t), x);
	double tmp;
	if (a <= -2.3e-67) {
		tmp = t_1;
	} else if (a <= 3.8e-35) {
		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(a, fma(b, z, t), x)
	tmp = 0.0
	if (a <= -2.3e-67)
		tmp = t_1;
	elseif (a <= 3.8e-35)
		tmp = fma(a, t, fma(z, y, x));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(b * z + t), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2.3e-67], t$95$1, If[LessEqual[a, 3.8e-35], N[(a * t + N[(z * y + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.3e-67 or 3.8000000000000001e-35 < a

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

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

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

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

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

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

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

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

    if -2.3e-67 < a < 3.8000000000000001e-35

    1. Initial program 99.9%

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

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

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

Alternative 4: 83.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 -4.6 \cdot 10^{+157}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{+76}:\\ \;\;\;\;\mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (fma b z t))))
   (if (<= a -4.6e+157) t_1 (if (<= a 1.5e+76) (fma a t (fma z y x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * fma(b, z, t);
	double tmp;
	if (a <= -4.6e+157) {
		tmp = t_1;
	} else if (a <= 1.5e+76) {
		tmp = fma(a, t, fma(z, y, x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(a * fma(b, z, t))
	tmp = 0.0
	if (a <= -4.6e+157)
		tmp = t_1;
	elseif (a <= 1.5e+76)
		tmp = fma(a, t, fma(z, y, x));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(b * z + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.6e+157], t$95$1, If[LessEqual[a, 1.5e+76], N[(a * t + N[(z * y + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.60000000000000008e157 or 1.4999999999999999e76 < a

    1. Initial program 74.3%

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

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

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

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

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

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

    if -4.60000000000000008e157 < a < 1.4999999999999999e76

    1. Initial program 96.0%

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

      \[\leadsto \color{blue}{x + \left(a \cdot t + y \cdot z\right)} \]
    4. Applied rewrites85.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 5: 74.4% 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 -4 \cdot 10^{-40}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 4.1 \cdot 10^{+20}:\\ \;\;\;\;\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 -4e-40) t_1 (if (<= a 4.1e+20) (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 <= -4e-40) {
		tmp = t_1;
	} else if (a <= 4.1e+20) {
		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 <= -4e-40)
		tmp = t_1;
	elseif (a <= 4.1e+20)
		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, -4e-40], t$95$1, If[LessEqual[a, 4.1e+20], 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 -4 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 4.1 \cdot 10^{+20}:\\
\;\;\;\;\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 < -3.9999999999999997e-40 or 4.1e20 < a

    1. Initial program 80.3%

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

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

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

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

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

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

    if -3.9999999999999997e-40 < a < 4.1e20

    1. Initial program 99.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 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.f6474.7

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

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

Alternative 6: 62.2% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.02 \cdot 10^{-108}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.02000000000000008e-108 or 9.19999999999999953e-73 < a

    1. Initial program 83.3%

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

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

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

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

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

    if -1.02000000000000008e-108 < a < 9.19999999999999953e-73

    1. Initial program 99.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. lower-fma.f6479.9

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

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

Alternative 7: 59.5% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;y \leq 2.25 \cdot 10^{+136}:\\
\;\;\;\;\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 < -1.36000000000000001e163 or 2.25e136 < y

    1. Initial program 85.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 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-*.f6462.5

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

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

    if -1.36000000000000001e163 < y < 2.25e136

    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 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.f6461.6

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

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

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

Alternative 8: 37.9% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;a \leq 2.3 \cdot 10^{-73}:\\
\;\;\;\;y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.02000000000000008e-108 or 2.29999999999999988e-73 < a

    1. Initial program 83.3%

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

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

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

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

    if -1.02000000000000008e-108 < a < 2.29999999999999988e-73

    1. Initial program 99.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 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-*.f6445.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.02 \cdot 10^{-108}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq 2.3 \cdot 10^{-73}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 28.0% 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 89.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 t around inf

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

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

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

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

Developer Target 1: 97.4% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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