Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.0% → 96.5%
Time: 3.9s
Alternatives: 11
Speedup: 0.5×

Specification

?
\[\begin{array}{l} \\ \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 92.0% 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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

Alternative 1: 96.5% accurate, 0.5× speedup?

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

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

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


\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 94.7%

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

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

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

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

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

        \[\leadsto \left(b \cdot a + y\right) \cdot z \]
      5. lower-fma.f6494.4

        \[\leadsto \mathsf{fma}\left(b, a, y\right) \cdot z \]
    5. Applied rewrites94.4%

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

Alternative 2: 60.7% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;a \leq -1.85 \cdot 10^{-15}:\\
\;\;\;\;\left(b \cdot z\right) \cdot a\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.54999999999999997e200 or 2.5000000000000001e75 < a < 3.79999999999999988e212

    1. Initial program 81.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 a \cdot t + \color{blue}{x} \]
      2. lower-fma.f6469.7

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

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

    if -1.54999999999999997e200 < a < -1.85000000000000008e-15

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

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

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

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

        \[\leadsto \left(b \cdot z\right) \cdot a \]
    5. Applied rewrites53.5%

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

    if -1.85000000000000008e-15 < a < 2.5000000000000001e75

    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 y \cdot z + \color{blue}{x} \]
      2. *-commutativeN/A

        \[\leadsto z \cdot y + x \]
      3. lower-fma.f6474.3

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

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

    if 3.79999999999999988e212 < a

    1. Initial program 68.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. *-commutativeN/A

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

        \[\leadsto \left(b \cdot z\right) \cdot \color{blue}{a} \]
      3. lower-*.f6462.1

        \[\leadsto \left(b \cdot z\right) \cdot a \]
    5. Applied rewrites62.1%

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

        \[\leadsto \left(b \cdot z\right) \cdot a \]
      2. lift-*.f64N/A

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

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

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

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

        \[\leadsto \left(a \cdot z\right) \cdot \color{blue}{b} \]
      7. lower-*.f6465.6

        \[\leadsto \left(a \cdot z\right) \cdot b \]
    7. Applied rewrites65.6%

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

Alternative 3: 60.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot z\right) \cdot b\\ \mathbf{if}\;a \leq -1.55 \cdot 10^{+200}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \mathbf{elif}\;a \leq -1.85 \cdot 10^{-15}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{+75}:\\ \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{+212}:\\ \;\;\;\;\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 (* (* a z) b)))
   (if (<= a -1.55e+200)
     (fma a t x)
     (if (<= a -1.85e-15)
       t_1
       (if (<= a 2.5e+75) (fma z y x) (if (<= a 3.8e+212) (fma a t x) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (a * z) * b;
	double tmp;
	if (a <= -1.55e+200) {
		tmp = fma(a, t, x);
	} else if (a <= -1.85e-15) {
		tmp = t_1;
	} else if (a <= 2.5e+75) {
		tmp = fma(z, y, x);
	} else if (a <= 3.8e+212) {
		tmp = fma(a, t, x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(a * z) * b)
	tmp = 0.0
	if (a <= -1.55e+200)
		tmp = fma(a, t, x);
	elseif (a <= -1.85e-15)
		tmp = t_1;
	elseif (a <= 2.5e+75)
		tmp = fma(z, y, x);
	elseif (a <= 3.8e+212)
		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[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[a, -1.55e+200], N[(a * t + x), $MachinePrecision], If[LessEqual[a, -1.85e-15], t$95$1, If[LessEqual[a, 2.5e+75], N[(z * y + x), $MachinePrecision], If[LessEqual[a, 3.8e+212], N[(a * t + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.85 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.54999999999999997e200 or 2.5000000000000001e75 < a < 3.79999999999999988e212

    1. Initial program 81.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 a \cdot t + \color{blue}{x} \]
      2. lower-fma.f6469.7

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

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

    if -1.54999999999999997e200 < a < -1.85000000000000008e-15 or 3.79999999999999988e212 < a

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

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

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

        \[\leadsto \left(b \cdot z\right) \cdot \color{blue}{a} \]
      3. lower-*.f6456.7

        \[\leadsto \left(b \cdot z\right) \cdot a \]
    5. Applied rewrites56.7%

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

        \[\leadsto \left(b \cdot z\right) \cdot a \]
      2. lift-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(a \cdot z\right) \cdot b \]
    7. Applied rewrites57.7%

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

    if -1.85000000000000008e-15 < a < 2.5000000000000001e75

    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 y \cdot z + \color{blue}{x} \]
      2. *-commutativeN/A

        \[\leadsto z \cdot y + x \]
      3. lower-fma.f6474.3

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

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

Alternative 4: 86.7% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.9 \cdot 10^{+95} \lor \neg \left(b \leq 8.2 \cdot 10^{+67}\right):\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3.8999999999999997e95 or 8.19999999999999959e67 < b

    1. Initial program 88.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 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 + a \cdot \color{blue}{\left(t + b \cdot z\right)} \]
      2. +-commutativeN/A

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

        \[\leadsto \left(t + b \cdot z\right) \cdot a + x \]
      4. lower-fma.f64N/A

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

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

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

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

    if -3.8999999999999997e95 < b < 8.19999999999999959e67

    1. Initial program 88.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. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, t, z \cdot y + x\right) \]
      11. lower-fma.f6488.8

        \[\leadsto \mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, x\right)\right) \]
    5. Applied rewrites88.8%

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

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

Alternative 5: 82.6% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.8 \cdot 10^{+141}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot z, b, x\right)\\

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

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


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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot z, b, x\right)} \]
        6. lift-*.f6480.9

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

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

      if -9.8000000000000002e141 < b < 4.80000000000000011e134

      1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 4.80000000000000011e134 < b

      1. Initial program 85.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. *-commutativeN/A

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

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

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

          \[\leadsto \left(b \cdot a + y\right) \cdot z \]
        5. lower-fma.f6482.1

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

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

    Alternative 6: 74.5% accurate, 1.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+17} \lor \neg \left(z \leq 1.6 \cdot 10^{-68}\right):\\ \;\;\;\;\mathsf{fma}\left(b, a, y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (if (or (<= z -8.5e+17) (not (<= z 1.6e-68))) (* (fma b a y) z) (fma a t x)))
    double code(double x, double y, double z, double t, double a, double b) {
    	double tmp;
    	if ((z <= -8.5e+17) || !(z <= 1.6e-68)) {
    		tmp = fma(b, a, y) * z;
    	} else {
    		tmp = fma(a, t, x);
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b)
    	tmp = 0.0
    	if ((z <= -8.5e+17) || !(z <= 1.6e-68))
    		tmp = Float64(fma(b, a, y) * z);
    	else
    		tmp = fma(a, t, x);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8.5e+17], N[Not[LessEqual[z, 1.6e-68]], $MachinePrecision]], N[(N[(b * a + y), $MachinePrecision] * z), $MachinePrecision], N[(a * t + x), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -8.5 \cdot 10^{+17} \lor \neg \left(z \leq 1.6 \cdot 10^{-68}\right):\\
    \;\;\;\;\mathsf{fma}\left(b, a, y\right) \cdot z\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -8.5e17 or 1.5999999999999999e-68 < z

      1. Initial program 81.3%

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

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

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

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

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

          \[\leadsto \left(b \cdot a + y\right) \cdot z \]
        5. lower-fma.f6482.5

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

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

      if -8.5e17 < z < 1.5999999999999999e-68

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

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

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

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

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

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

    Alternative 7: 40.1% accurate, 1.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+17}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-218}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-68}:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot y\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (if (<= z -8.5e+17)
       (* z y)
       (if (<= z 7.5e-218) x (if (<= z 1.6e-68) (* a t) (* z y)))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double tmp;
    	if (z <= -8.5e+17) {
    		tmp = z * y;
    	} else if (z <= 7.5e-218) {
    		tmp = x;
    	} else if (z <= 1.6e-68) {
    		tmp = a * t;
    	} else {
    		tmp = z * y;
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, t, a, b)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        real(8) :: tmp
        if (z <= (-8.5d+17)) then
            tmp = z * y
        else if (z <= 7.5d-218) then
            tmp = x
        else if (z <= 1.6d-68) then
            tmp = a * t
        else
            tmp = z * y
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a, double b) {
    	double tmp;
    	if (z <= -8.5e+17) {
    		tmp = z * y;
    	} else if (z <= 7.5e-218) {
    		tmp = x;
    	} else if (z <= 1.6e-68) {
    		tmp = a * t;
    	} else {
    		tmp = z * y;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a, b):
    	tmp = 0
    	if z <= -8.5e+17:
    		tmp = z * y
    	elif z <= 7.5e-218:
    		tmp = x
    	elif z <= 1.6e-68:
    		tmp = a * t
    	else:
    		tmp = z * y
    	return tmp
    
    function code(x, y, z, t, a, b)
    	tmp = 0.0
    	if (z <= -8.5e+17)
    		tmp = Float64(z * y);
    	elseif (z <= 7.5e-218)
    		tmp = x;
    	elseif (z <= 1.6e-68)
    		tmp = Float64(a * t);
    	else
    		tmp = Float64(z * y);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a, b)
    	tmp = 0.0;
    	if (z <= -8.5e+17)
    		tmp = z * y;
    	elseif (z <= 7.5e-218)
    		tmp = x;
    	elseif (z <= 1.6e-68)
    		tmp = a * t;
    	else
    		tmp = z * y;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8.5e+17], N[(z * y), $MachinePrecision], If[LessEqual[z, 7.5e-218], x, If[LessEqual[z, 1.6e-68], N[(a * t), $MachinePrecision], N[(z * y), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -8.5 \cdot 10^{+17}:\\
    \;\;\;\;z \cdot y\\
    
    \mathbf{elif}\;z \leq 7.5 \cdot 10^{-218}:\\
    \;\;\;\;x\\
    
    \mathbf{elif}\;z \leq 1.6 \cdot 10^{-68}:\\
    \;\;\;\;a \cdot t\\
    
    \mathbf{else}:\\
    \;\;\;\;z \cdot y\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -8.5e17 or 1.5999999999999999e-68 < z

      1. Initial program 81.3%

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

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

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

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

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

      if -8.5e17 < z < 7.50000000000000011e-218

      1. Initial program 98.6%

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

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

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

        if 7.50000000000000011e-218 < z < 1.5999999999999999e-68

        1. Initial program 97.0%

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

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

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

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

      Alternative 8: 64.0% accurate, 1.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{-45} \lor \neg \left(z \leq 2.2 \cdot 10^{-69}\right):\\ \;\;\;\;\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 (or (<= z -2.3e-45) (not (<= z 2.2e-69))) (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 ((z <= -2.3e-45) || !(z <= 2.2e-69)) {
      		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 ((z <= -2.3e-45) || !(z <= 2.2e-69))
      		tmp = fma(z, y, x);
      	else
      		tmp = fma(a, t, x);
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.3e-45], N[Not[LessEqual[z, 2.2e-69]], $MachinePrecision]], N[(z * y + x), $MachinePrecision], N[(a * t + x), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -2.3 \cdot 10^{-45} \lor \neg \left(z \leq 2.2 \cdot 10^{-69}\right):\\
      \;\;\;\;\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 z < -2.29999999999999992e-45 or 2.2e-69 < z

        1. Initial program 81.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 y \cdot z + \color{blue}{x} \]
          2. *-commutativeN/A

            \[\leadsto z \cdot y + x \]
          3. lower-fma.f6453.9

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

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

        if -2.29999999999999992e-45 < z < 2.2e-69

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{-45} \lor \neg \left(z \leq 2.2 \cdot 10^{-69}\right):\\ \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 9: 58.7% accurate, 1.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+96} \lor \neg \left(z \leq 1.05 \cdot 10^{-26}\right):\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (if (or (<= z -2.6e+96) (not (<= z 1.05e-26))) (* z y) (fma a t x)))
      double code(double x, double y, double z, double t, double a, double b) {
      	double tmp;
      	if ((z <= -2.6e+96) || !(z <= 1.05e-26)) {
      		tmp = z * y;
      	} else {
      		tmp = fma(a, t, x);
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a, b)
      	tmp = 0.0
      	if ((z <= -2.6e+96) || !(z <= 1.05e-26))
      		tmp = Float64(z * y);
      	else
      		tmp = fma(a, t, x);
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.6e+96], N[Not[LessEqual[z, 1.05e-26]], $MachinePrecision]], N[(z * y), $MachinePrecision], N[(a * t + x), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -2.6 \cdot 10^{+96} \lor \neg \left(z \leq 1.05 \cdot 10^{-26}\right):\\
      \;\;\;\;z \cdot y\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -2.6e96 or 1.05000000000000004e-26 < z

        1. Initial program 77.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 z \cdot \color{blue}{y} \]
          2. lower-*.f6448.8

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

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

        if -2.6e96 < z < 1.05000000000000004e-26

        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
        3. Taylor expanded in z around 0

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

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

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

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

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

      Alternative 10: 39.3% accurate, 1.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.25 \cdot 10^{-48} \lor \neg \left(a \leq 1.18 \cdot 10^{-60}\right):\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (if (or (<= a -2.25e-48) (not (<= a 1.18e-60))) (* a t) x))
      double code(double x, double y, double z, double t, double a, double b) {
      	double tmp;
      	if ((a <= -2.25e-48) || !(a <= 1.18e-60)) {
      		tmp = a * t;
      	} else {
      		tmp = x;
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z, t, a, b)
      use fmin_fmax_functions
          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 <= (-2.25d-48)) .or. (.not. (a <= 1.18d-60))) then
              tmp = a * t
          else
              tmp = x
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a, double b) {
      	double tmp;
      	if ((a <= -2.25e-48) || !(a <= 1.18e-60)) {
      		tmp = a * t;
      	} else {
      		tmp = x;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b):
      	tmp = 0
      	if (a <= -2.25e-48) or not (a <= 1.18e-60):
      		tmp = a * t
      	else:
      		tmp = x
      	return tmp
      
      function code(x, y, z, t, a, b)
      	tmp = 0.0
      	if ((a <= -2.25e-48) || !(a <= 1.18e-60))
      		tmp = Float64(a * t);
      	else
      		tmp = x;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b)
      	tmp = 0.0;
      	if ((a <= -2.25e-48) || ~((a <= 1.18e-60)))
      		tmp = a * t;
      	else
      		tmp = x;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.25e-48], N[Not[LessEqual[a, 1.18e-60]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;a \leq -2.25 \cdot 10^{-48} \lor \neg \left(a \leq 1.18 \cdot 10^{-60}\right):\\
      \;\;\;\;a \cdot t\\
      
      \mathbf{else}:\\
      \;\;\;\;x\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if a < -2.24999999999999994e-48 or 1.17999999999999994e-60 < a

        1. Initial program 81.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. lower-*.f6439.9

            \[\leadsto a \cdot \color{blue}{t} \]
        5. Applied rewrites39.9%

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

        if -2.24999999999999994e-48 < a < 1.17999999999999994e-60

        1. Initial program 98.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. Applied rewrites39.2%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.25 \cdot 10^{-48} \lor \neg \left(a \leq 1.18 \cdot 10^{-60}\right):\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
        7. Add Preprocessing

        Alternative 11: 26.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;
        }
        
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(x, y, z, t, a, b)
        use fmin_fmax_functions
            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 88.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. Applied rewrites23.3%

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

          Developer Target 1: 97.2% 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;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, t, a, b)
          use fmin_fmax_functions
              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 2025079 
          (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)))